Skip to content

Commit 11a3582

Browse files
docs(dashmate): correct state sync retries=0 semantics to unlimited
Tenderdash's SyncAny only returns errNoSnapshots (the block sync fallback trigger) when retries > 0, so retries=0 repeats snapshot discovery indefinitely rather than disabling retries - Tenderdash's own sample config comment is wrong about this. Describe 0 as retry-indefinitely in the schema, rendered template, docs, and test. Also annotate the grpc-concurrency block: Tenderdash drops the concurrency map for the routed transport (NewRoutedClientWithAddr passes address and transport only), so the entries, including the pre-existing check_tx one, are declarative until that propagates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 428052c commit 11a3582

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

packages/dashmate/docs/config/tenderdash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ State sync bootstraps a fresh node from a recent state snapshot fetched from pee
8787
| Option | Description | Default | Example |
8888
|--------|-------------|---------|---------|
8989
| `platform.drive.tenderdash.stateSync.enabled` | Bootstrap a fresh node from a snapshot | `true` | `false` |
90-
| `platform.drive.tenderdash.stateSync.retries` | Retries before falling back to block sync, `0` disables retries | `3` | `5` |
90+
| `platform.drive.tenderdash.stateSync.retries` | Retries before falling back to block sync, `0` retries indefinitely (never falls back) | `3` | `5` |
9191
| `platform.drive.tenderdash.stateSync.chunkRequestTimeout` | Timeout before re-requesting a snapshot chunk, at least `5s` | `15s` | `30s` |
9292
| `platform.drive.tenderdash.stateSync.fetchersCount` | Concurrent chunk fetchers, 1 to 64 | `4` | `8` |
9393

packages/dashmate/src/config/configJsonSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ export default {
13771377
type: 'integer',
13781378
minimum: 0,
13791379
description: 'How many times to retry state sync before falling back to block sync.'
1380-
+ ' 0 disables retries',
1380+
+ ' 0 means retry indefinitely and never fall back',
13811381
},
13821382
chunkRequestTimeout: {
13831383
description: 'Timeout before re-requesting a snapshot chunk. Tenderdash requires at least 5s',

packages/dashmate/templates/platform/drive/tenderdash/config.toml.dot

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ grpc-concurrency = [
9999
{ "check_tx" = {{= it.platform.drive.tenderdash.mempool.maxConcurrentCheckTx }} },
100100
# Snapshot serving: discovery is one request per peer, chunk downloads run
101101
# several concurrent fetchers per syncing peer.
102+
#
103+
# NOTE: Tenderdash currently applies grpc-concurrency only to a direct
104+
# `transport = "grpc"` client; the routed transport used here drops the map
105+
# when it builds the nested per-method clients (NewRoutedClientWithAddr
106+
# passes address and transport only), so these limits — including the
107+
# pre-existing check_tx one — are declarative until Tenderdash propagates
108+
# them to routed clients.
102109
{ "list_snapshots" = 10 },
103110
{ "load_snapshot_chunk" = 100 },
104111
]
@@ -439,8 +446,9 @@ rpc-servers = ""
439446
discovery-time = "15s"
440447

441448
# The number of times to retry state sync. When retries are exhausted, the node falls back
442-
# to block sync. Set to 0 to disable retries. In the pessimistic case it takes at least
443-
# discovery-time * retries before falling back.
449+
# to block sync. 0 means retry indefinitely: the node keeps repeating snapshot discovery
450+
# and never falls back. In the pessimistic case it takes at least discovery-time * retries
451+
# before falling back.
444452
retries = {{= it.platform.drive.tenderdash.stateSync.retries }}
445453

446454
# Temporary directory for state sync snapshot chunks, defaults to os.TempDir().

packages/dashmate/test/unit/config/stateSyncOptions.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ describe('state sync options', () => {
4646
config = getBaseConfig();
4747
});
4848

49-
it('should accept retries of 0 (disable retries) but not negative', () => {
49+
// Tenderdash treats 0 as an unlimited retry count: SyncAny only returns
50+
// errNoSnapshots (the block sync fallback trigger) when retries > 0.
51+
it('should accept retries of 0 (retry indefinitely) but not negative', () => {
5052
config.set('platform.drive.tenderdash.stateSync.retries', 0);
5153

5254
expect(() => config.set('platform.drive.tenderdash.stateSync.retries', -1))

0 commit comments

Comments
 (0)