Skip to content

Commit f869ab3

Browse files
evanorticlaudegreptile-apps[bot]swift1337
authored
Adaptive sync doc (#256)
* fix: add missing sdk/next/build/ directory The sdk/next/ directory was created as a copy of sdk/v0.53/ but the build/ subdirectory was not included, causing broken internal links in the learn/ pages. Copy build/ from v0.53, rewrite internal links to /sdk/next/, add noindex: true to all pages, and update .gitignore to allow sdk/next/build/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update docs.json * Create adaptive-sync.mdx * Update cometbft/next/docs/experimental/adaptive-sync.mdx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix * improve * move AdaptiveSync to BlockSync page --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Dmitry S <11892559+swift1337@users.noreply.github.com>
1 parent 13524ed commit f869ab3

1 file changed

Lines changed: 75 additions & 2 deletions

File tree

cometbft/next/docs/core/block-sync.mdx

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,78 @@ other than v0 have been deprecated in favor of the simplest and most well-unders
4545
version = "v0"
4646
```
4747

48-
If we're lagging sufficiently, we should go back to block syncing, but
49-
this is an [open issue](https://github.com/tendermint/tendermint/issues/129).
48+
## AdaptiveSync
49+
50+
<Warning>
51+
This is an experimental feature.
52+
It has been tested under a range of network conditions and perturbations, but you should validate it
53+
for your specific workload before enabling it on a production mainnet chain.
54+
</Warning>
55+
56+
AdaptiveSync allows a node to run blocksync and consensus at the same time.
57+
58+
In the default flow, a node starts in blocksync, catches up, then switches to consensus.
59+
Under sustained load (for example, busy RPC nodes), a node can remain behind and struggle to catch up.
60+
With short block times, this can hurt network liveness.
61+
62+
With `adaptive_sync` enabled, consensus still works normally, but it can also ingest already available
63+
blocks from blocksync. This acts as a fallback path when a node is behind, allowing it to recover
64+
more quickly during traffic spikes and continue progressing with the network.
65+
66+
AdaptiveSync does not change consensus safety or finality rules. It changes catch-up behavior, not block validity rules.
67+
68+
### Scope and compatibility
69+
70+
- AdaptiveSync is intended for nodes that can temporarily lag, especially RPC-heavy or high-throughput deployments.
71+
- It is experimental; enable it gradually and validate in your own network conditions before broad rollout.
72+
- If you run mixed node roles (validators, sentries, RPC nodes), test each role separately.
73+
74+
### How it works
75+
76+
1. The node continues running consensus as usual.
77+
2. If the node is behind, blocks obtained by blocksync can be handed to consensus ingestion.
78+
3. If a candidate block is already included by consensus, it is skipped.
79+
4. If not already included, it is ingested and applied through normal validation paths.
80+
5. The node converges faster during transient load spikes while preserving normal consensus behavior.
81+
82+
### When to use it
83+
84+
Enable `adaptive_sync` if your nodes can temporarily fall behind and need better recovery behavior:
85+
86+
- **High-throughput or bursty traffic** where load spikes can delay vote processing.
87+
- **Short block times** where slow catch-up can impact liveness sooner.
88+
- **RPC-heavy nodes** that may lag during periods of high request volume.
89+
90+
If your network is stable and nodes consistently keep up, the default mode may already be sufficient.
91+
92+
**Notes**:
93+
94+
- Running this fallback path may slightly increase CPU and I/O during catch-up windows
95+
- Constant blocksync message processing may increase network traffic.
96+
- Gains are most visible during temporary overload.
97+
98+
### Configuration
99+
100+
AdaptiveSync is disabled by default.
101+
To enable it, set `adaptive_sync = true` in the `[blocksync]` section of `config.toml`:
102+
103+
```toml
104+
[blocksync]
105+
version = "v0"
106+
adaptive_sync = true
107+
```
108+
109+
### Metrics
110+
111+
```text
112+
# counter: blocksync block was already included by consensus --> skip
113+
cometbft_blocksync_already_included_blocks
114+
115+
# counter: blocksync block was ingested by consensus --> ingest
116+
cometbft_blocksync_ingested_blocks
117+
118+
# histogram: duration of ingesting a non-skipped block
119+
cometbft_blocksync_ingested_block_duration_bucket
120+
cometbft_blocksync_ingested_block_duration_count
121+
cometbft_blocksync_ingested_block_duration_sum
122+
```

0 commit comments

Comments
 (0)