Skip to content

Commit

Permalink
(Node) Reduce ping error loggings (#2295)
Browse files Browse the repository at this point in the history
* fix: reduce ping log level

* fix: update json rpc endpoints

* fix: update based on feedback
  • Loading branch information
nick-bisonai authored Oct 3, 2024
1 parent 4ee6f2d commit 1b15fcd
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
REDIS_HOST: "localhost"
REDIS_PORT: "6379"
ENCRYPT_PASSWORD: "anything"
KAIA_WEBSOCKET_URL: "wss://public-en-cypress.klaytn.net/ws"
KAIA_WEBSOCKET_URL: "wss://public-en.node.kaia.io/ws"
ETH_WEBSOCKET_URL: "wss://ethereum-rpc.publicnode.com"
KAIA_PROVIDER_URL: "https://public-en-kairos.node.kaia.io"
KAIA_REPORTER_PK: ${{ secrets.TEST_DELEGATOR_REPORTER_PK}}
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.1/hardhat.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const config = {
..._baobab,
},
cypress: {
url: 'https://public-en-cypress.klaytn.net',
url: 'https://public-en.node.kaia.io',
...commonConfig,
gasPrice: 250_000_000_000,
},
Expand Down
2 changes: 1 addition & 1 deletion core/test/nonce-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { State } from '../src/reporter/state'

describe('nonce-manager', () => {
const PROVIDER_URL = process.env.GITHUB_ACTIONS
? 'https://public-en-cypress.klaytn.net'
? 'https://public-en.node.kaia.io'
: 'https://public-en-kairos.node.kaia.io'
const redisClient: RedisClientType = createClient({ url: '' })
const ORACLE_ADDRESS = '0x0E4E90de7701B72df6F21343F51C833F7d2d3CFb'
Expand Down
2 changes: 1 addition & 1 deletion core/test/reporter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Reporter', function () {

describe('Filter invalid reporters inside of State', function () {
const PROVIDER_URL = process.env.GITHUB_ACTIONS
? 'https://public-en-cypress.klaytn.net'
? 'https://public-en.node.kaia.io'
: 'https://public-en-kairos.node.kaia.io'
const redisClient: RedisClientType = createClient({ url: '' })

Expand Down
4 changes: 2 additions & 2 deletions inspector/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { HardhatUserConfig } from "hardhat/config";
import "./inspector-task";

import "@nomicfoundation/hardhat-toolbox";
import "hardhat-deploy";
import dotenv from "dotenv";
import "hardhat-deploy";

dotenv.config();

Expand Down Expand Up @@ -45,7 +45,7 @@ const config: HardhatUserConfig = {
gasPrice: 250_000_000_000,
},
cypress: {
url: process.env.PROVIDER || "https://public-en-cypress.klaytn.net",
url: process.env.PROVIDER || "https://public-en.node.kaia.io",
...commonConfig,
gasPrice: 250_000_000_000,
},
Expand Down
2 changes: 1 addition & 1 deletion inspector/scripts/json-rpc-sync-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readonly OUR_KAIROS_JSON_RPC="http://100.93.31.29:8551"
readonly OUR_KAIA_JSON_RPC="http://100.75.43.49:8551"

readonly PUBLIC_KAIROS_JSON_RPC="https://public-en-kairos.node.kaia.io"
readonly PUBLIC_KAIA_JSON_RPC="https://public-en-cypress.klaytn.net"
readonly PUBLIC_KAIA_JSON_RPC="https://public-en.node.kaia.io"

check_klay_sync_baobab() {
our_block_hex=$(get_our_klay_block $OUR_KAIROS_JSON_RPC)
Expand Down
11 changes: 8 additions & 3 deletions node/pkg/checker/ping/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (app *App) Start(ctx context.Context) {
log.Debug().Msg("connecting ICMP Pinger")
err := endpoint.run()
if err != nil {
log.Error().Err(err).Msg("failed to ping endpoint")
log.Warn().Err(err).Msg("failed to ping endpoint")
app.ResultsBuffer <- PingResult{
Address: endpoint.Address,
Success: false,
Expand All @@ -185,14 +185,19 @@ func (app *App) Start(ctx context.Context) {
}

if result.Delay > time.Duration(app.ThresholdFactor*app.RTTAvg[result.Address]) {
log.Error().Any("result", result).Msg("ping failed")
log.
Warn().
Any("result", result).
Float64("delay_ms", float64(result.Delay)/float64(time.Millisecond)).
Float64("threshold_ms", app.ThresholdFactor*app.RTTAvg[result.Address]/float64(time.Millisecond)).
Msg("ping failed")
app.FailCount[result.Address] += 1
} else {
log.Debug().Any("result", result).Msg("ping success")
app.FailCount[result.Address] = 0
}
} else {
log.Error().Any("result", result).Msg("failed to ping endpoint")
log.Warn().Any("result", result).Msg("failed to ping endpoint")
app.FailCount[result.Address] += 1
}

Expand Down

0 comments on commit 1b15fcd

Please sign in to comment.