Skip to content

Commit c29424b

Browse files
committed
timeout increase
1 parent 68cdf8e commit c29424b

9 files changed

Lines changed: 34 additions & 4 deletions

File tree

collector/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ L1_RPC_URL=http://127.0.0.1:8545
2121
# L1_SLASH_LOG_START_BLOCK=25533241
2222
# Used only when no exact start block is configured.
2323
L1_SLASH_LOG_LOOKBACK_BLOCKS=50000
24+
# Archive calls for a chunk containing slash executions can take longer.
25+
L1_SLASH_LOG_PROVIDER_TIMEOUT_MS=30000
2426

2527
# Enable Telegram only when both values are set.
2628
TELEGRAM_BOT_TOKEN=

collector/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ past them.
4040
Sentinel indexing is committee-scoped and epoch-gated. Unknown coverage gaps
4141
start a new generation and cannot extend an inactivity streak.
4242

43+
Slash-log chunks are limited to 1,000 blocks. The default provider timeout is
44+
30 seconds because chunks containing executions require exact archive state
45+
reconstruction; `L1_SLASH_LOG_PROVIDER_TIMEOUT_MS` may raise it to 45 seconds.
46+
4347
## Case API
4448

4549
The only API is `/api/v3`:

collector/deploy/slashmon-backend-testing.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ L1_RPC_URL=http://127.0.0.1:8545
3232
# L1_SLASH_LOG_START_BLOCK=25533241
3333
# Used only when no exact start block is configured.
3434
L1_SLASH_LOG_LOOKBACK_BLOCKS=50000
35+
# Archive calls for a chunk containing slash executions can take longer.
36+
L1_SLASH_LOG_PROVIDER_TIMEOUT_MS=30000
3537

3638
# Use testing-only notification credentials. In particular, Telegram long
3739
# polling cannot be shared with production. Leave these empty if not needed.

collector/deploy/slashmon-backend.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ L1_RPC_URL=http://127.0.0.1:8545
2929
# L1_SLASH_LOG_START_BLOCK=25533241
3030
# Used only when no exact start block is configured.
3131
L1_SLASH_LOG_LOOKBACK_BLOCKS=50000
32+
# Archive calls for a chunk containing slash executions can take longer.
33+
L1_SLASH_LOG_PROVIDER_TIMEOUT_MS=30000
3234

3335
# Optional notification channels.
3436
TELEGRAM_BOT_TOKEN=

collector/src/config.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { createECDH } from 'node:crypto';
44
const DEFAULT_ADMIN_POLL_INTERVAL_MS = 15_000;
55
const DEFAULT_SENTINEL_POLL_INTERVAL_MS = 60_000;
66
const DEFAULT_L1_POLL_INTERVAL_MS = 30_000;
7+
const DEFAULT_L1_SLASH_LOG_PROVIDER_TIMEOUT_MS = 30_000;
8+
const L1_SLASH_LOG_MAX_RUN_MS = 60_000;
79
const DEFAULT_DATABASE_PATH = './data/slashmon.sqlite';
810
const NETWORK_DEFAULTS = {
911
mainnet: {
@@ -117,8 +119,14 @@ export function loadConfig(env = process.env, cwd = process.cwd()) {
117119
l1SlashLogOverlapBlocks: 12,
118120
l1SlashLogReorgRewindBlocks: 512,
119121
l1SlashLogMaxChunksPerPoll: 25,
120-
l1SlashLogMaxRunMs: 20_000,
121-
l1SlashLogProviderTimeoutMs: 5_000,
122+
l1SlashLogMaxRunMs: L1_SLASH_LOG_MAX_RUN_MS,
123+
l1SlashLogProviderTimeoutMs: readInteger(
124+
env,
125+
'L1_SLASH_LOG_PROVIDER_TIMEOUT_MS',
126+
DEFAULT_L1_SLASH_LOG_PROVIDER_TIMEOUT_MS,
127+
5_000,
128+
45_000,
129+
),
122130

123131
bindHost: readString(env.BACKEND_BIND_HOST, '127.0.0.1'),
124132
port: readInteger(env, 'BACKEND_PORT', 8_790, 1, 65_535),

collector/src/l1-collector.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class L1Collector {
88
pollIntervalMs,
99
maxBackoffMs,
1010
maxSlashLogChunksPerPoll = 25,
11-
maxSlashLogRunMs = 20_000,
11+
maxSlashLogRunMs = 60_000,
1212
logger,
1313
now = Date.now,
1414
}) {

collector/src/l1-scanner.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class L1Scanner {
3636
slashLogChunkSize = 1_000,
3737
slashLogOverlapBlocks = 12,
3838
slashLogReorgRewindBlocks = 128,
39-
slashLogProviderTimeoutMs = 5_000,
39+
slashLogProviderTimeoutMs = 30_000,
4040
clientFactory,
4141
now = Date.now,
4242
}) {

collector/test/config.test.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ test('loadConfig provides a complete local configuration', () => {
2323
assert.equal(config.l1SlashLogStartBlock, undefined);
2424
assert.equal(config.l1SlashLogLookbackBlocks, 50_000);
2525
assert.equal(config.l1SlashLogChunkSize, 1_000);
26+
assert.equal(config.l1SlashLogProviderTimeoutMs, 30_000);
27+
assert.equal(config.l1SlashLogMaxRunMs, 60_000);
2628
assert.equal(config.sentinelPollIntervalMs, 60_000);
2729
assert.equal(config.sentinelLookbackEpochs, 3);
2830
assert.equal(config.sentinelEpochEndBufferSlots, 2);
@@ -90,6 +92,10 @@ test('operator-facing URLs and process settings are validated', () => {
9092
() => loadConfig({ L1_SLASH_LOG_START_BLOCK: '-1' }),
9193
/between 0 and 1000000000/,
9294
);
95+
assert.throws(
96+
() => loadConfig({ L1_SLASH_LOG_PROVIDER_TIMEOUT_MS: '45001' }),
97+
/between 5000 and 45000/,
98+
);
9399
assert.throws(() => loadConfig({ BACKEND_TRUST_PROXY: 'yes' }), /must be true or false/);
94100
assert.throws(() => loadConfig({ BACKEND_LOG_LEVEL: 'trace' }), /debug, info, warn, or error/);
95101

@@ -99,6 +105,7 @@ test('operator-facing URLs and process settings are validated', () => {
99105
L1_RPC_URL: 'https://rpc-one.example/path',
100106
L1_SLASH_LOG_START_BLOCK: '25533241',
101107
L1_SLASH_LOG_LOOKBACK_BLOCKS: '75000',
108+
L1_SLASH_LOG_PROVIDER_TIMEOUT_MS: '40000',
102109
BACKEND_DATABASE_PATH: '../state/slashmon.sqlite',
103110
BACKEND_PORT: '9000',
104111
BACKEND_TRUST_PROXY: 'true',
@@ -111,6 +118,7 @@ test('operator-facing URLs and process settings are validated', () => {
111118
assert.deepEqual(config.l1RpcUrls, ['https://rpc-one.example/path']);
112119
assert.equal(config.l1SlashLogStartBlock, 25_533_241);
113120
assert.equal(config.l1SlashLogLookbackBlocks, 75_000);
121+
assert.equal(config.l1SlashLogProviderTimeoutMs, 40_000);
114122
assert.equal(config.databasePath, '/srv/state/slashmon.sqlite');
115123
assert.equal(config.port, 9000);
116124
assert.equal(config.trustLoopbackProxy, true);

docs/runbook.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ database whose durable log cursor was created with a different start, and
3232
historical observations do not send notifications. Leave it unset to use
3333
`L1_SLASH_LOG_LOOKBACK_BLOCKS` for a head-relative initial backfill instead.
3434
Log requests remain fixed at 1,000 blocks to support RPCs with that maximum.
35+
Each provider gets 30 seconds for a chunk, and each backfill pass yields after
36+
60 seconds so a fresh L1 snapshot runs regularly. For a slower archive node,
37+
raise `L1_SLASH_LOG_PROVIDER_TIMEOUT_MS` up to `45000`; keep it below the
38+
60-second pass budget.
3539

3640
To expand an existing production or testing database, add the setting to that
3741
service's `/etc/slashmon-backend*.env` and deploy with `--upgrade`. Do not reset

0 commit comments

Comments
 (0)