Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Node) Reduce ping error loggings #2295

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
nick-bisonai marked this conversation as resolved.
Show resolved Hide resolved

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",
nick-bisonai marked this conversation as resolved.
Show resolved Hide resolved
...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
Loading