docs+test(settlement): pin idle-flush-secs' max-interval settlement semantics#642
Merged
Conversation
…s setting Rename the settlement runtime's `idle-flush-secs` knob to `settle-interval-secs` to match what it actually does: a batch settles when it reaches `batch-size` blocks or when this many seconds have elapsed since its first pending block — whichever comes first. The old name (and its doc comment, "settle after this many seconds without a new block") suggested an inactivity timer, but the deadline was never reset by blocks arriving mid-window, so it has always been a max-interval cadence: even a single block produced in the window settles once the interval elapses. The old `idle-flush-secs` key still parses via a serde alias, so existing chain configs keep working. New paused-clock tests drive the worker's run loop end to end and pin the guarantee: a lone pending block settles once the interval elapses, and blocks arriving mid-window do not push the deadline back. Co-Authored-By: Claude Fable 5 <[email protected]>
Codec benchmark diff vs
|
| Benchmark | Baseline (ns) | Current (ns) | Δ |
|---|---|---|---|
CompiledClass(fixture)/compress |
2638010 | 2675257 | +1.41% |
CompiledClass(fixture)/decompress |
2803968 | 2806309 | +0.08% |
ExecutionCheckpoint/compress |
30 | 30 | +0.00% |
ExecutionCheckpoint/decompress |
23 | 24 | +4.35% |
PruningCheckpoint/compress |
30 | 30 | +0.00% |
PruningCheckpoint/decompress |
23 | 23 | +0.00% |
VersionedHeader/compress |
642 | 641 | -0.16% |
VersionedHeader/decompress |
822 | 842 | +2.43% |
StoredBlockBodyIndices/compress |
73 | 74 | +1.37% |
StoredBlockBodyIndices/decompress |
36 | 36 | +0.00% |
StorageEntry/compress |
138 | 136 | -1.45% |
StorageEntry/decompress |
140 | 140 | +0.00% |
ContractNonceChange/compress |
138 | 140 | +1.45% |
ContractNonceChange/decompress |
233 | 235 | +0.86% |
ContractClassChange/compress |
180 | 180 | +0.00% |
ContractClassChange/decompress |
274 | 262 | -4.38% |
ContractStorageEntry/compress |
150 | 148 | -1.33% |
ContractStorageEntry/decompress |
309 | 328 | +6.15% |
GenericContractInfo/compress |
133 | 136 | +2.26% |
GenericContractInfo/decompress |
102 | 102 | +0.00% |
Felt/compress |
70 | 71 | +1.43% |
Felt/decompress |
55 | 55 | +0.00% |
BlockHash/compress |
70 | 71 | +1.43% |
BlockHash/decompress |
54 | 58 | +7.41% |
TxHash/compress |
70 | 71 | +1.43% |
TxHash/decompress |
53 | 56 | +5.66% |
ClassHash/compress |
70 | 71 | +1.43% |
ClassHash/decompress |
56 | 56 | +0.00% |
CompiledClassHash/compress |
70 | 71 | +1.43% |
CompiledClassHash/decompress |
54 | 55 | +1.85% |
BlockNumber/compress |
33 | 33 | +0.00% |
BlockNumber/decompress |
23 | 23 | +0.00% |
TxNumber/compress |
32 | 33 | +3.13% |
TxNumber/decompress |
23 | 23 | +0.00% |
FinalityStatus/compress |
1 | 1 | +0.00% |
FinalityStatus/decompress |
11 | 11 | +0.00% |
TypedTransactionExecutionInfo/compress |
16393 | 18460 | +12.61% |
TypedTransactionExecutionInfo/decompress |
3655 | 3550 | -2.87% |
VersionedContractClass/compress |
375 | 376 | +0.27% |
VersionedContractClass/decompress |
809 | 800 | -1.11% |
MigratedCompiledClassHash/compress |
139 | 139 | +0.00% |
MigratedCompiledClassHash/decompress |
140 | 138 | -1.43% |
ContractInfoChangeList/compress |
1418 | 1411 | -0.49% |
ContractInfoChangeList/decompress |
2084 | 2126 | +2.02% |
BlockChangeList/compress |
618 | 633 | +2.43% |
BlockChangeList/decompress |
850 | 848 | -0.24% |
ReceiptEnvelope/compress |
30933 | 31529 | +1.93% |
ReceiptEnvelope/decompress |
5992 | 6134 | +2.37% |
TrieDatabaseValue/compress |
171 | 175 | +2.34% |
TrieDatabaseValue/decompress |
211 | 211 | +0.00% |
TrieHistoryEntry/compress |
297 | 326 | +9.76% |
TrieHistoryEntry/decompress |
238 | 240 | +0.84% |
|
Keep the existing `idle-flush-secs` / `idle_flush_interval` names. The doc comments still get the fix — the knob is a max time between settlements while blocks are pending (the deadline is not reset by mid-window blocks), not an inactivity timer — and the new paused-clock run-loop tests that pin that behavior stay. Co-Authored-By: Claude Fable 5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #642 +/- ##
==========================================
- Coverage 73.32% 68.28% -5.05%
==========================================
Files 209 335 +126
Lines 23132 47059 +23927
==========================================
+ Hits 16961 32133 +15172
- Misses 6171 14926 +8755 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
idle-flush-secsalready provides time-based settlement, but its docs described it as an inactivity timer ("settle a partial batch after this many seconds without a new block"). The implementation never resets the deadline when blocks arrive mid-window, so it is actually a max interval between settlements: a batch settles when it reachesbatch-sizeblocks or whenidle-flush-secshave elapsed since its first pending block — whichever comes first — meaning even a single block produced in the window settles on time. This PR corrects the docs to state that contract and adds run-loop tests that pin it. No behavior change; the config key keeps its name.Changes
chain-spec/settlement: corrected doc comments onSettlementRuntime.idle_flush_secsandSettlementConfig.idle_flush_interval, plus stale in-loop comments in the settlement worker.Worker::runend to end: a lone pending block settles once the interval elapses, and blocks arriving mid-window don't push the deadline back (settlement happens ~interval after the window opens, not after the last block). Addskatana-dbas a dev-dependency to advance the chain head via direct table writes.docs/tee-deployment.md: config snippet comments updated to the accurate semantics.🤖 Generated with Claude Code