Repository navigation
fix(platform): repeat a failed wait lookup and settle the open review items of the before/after block proofs - #6240
Merged
QuantumExplorer merged 3 commits intoNov 24, 2026
Conversation
…s result A wait read every failure of Tenderdash's `tx` lookup as "in no block yet" and went on to wait for the transaction's event. When the lookup failed for another reason (a transport error, a timeout, an index read that failed) and the transaction was in a block already, that event had come before the wait subscribed, so the wait ran into its timeout for an executed transition. Only Tenderdash's own answer that its index does not hold the hash now counts as "in no block yet". After any other failure the wait keeps listening for the event and repeats the lookup, 500 ms later at first and then at doubling intervals up to 8 s, until Tenderdash answers one: with the transaction, which ends the wait, or that it holds no such hash, after which only the event can. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…e-before-block verifiers `verify_state_transition_result_around_block`, `verify_state_before_block` and `verify_state_transition_proof_outcome` took `provider` after `platform_version`. All three are new with the before/after block proofs, so they follow the rule that `platform_version` closes a parameter list. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…dget do - A release of a lease Drive does not hold is remembered as one that came before its registration, also when the lease was released already or has expired. The docs called a repeated release a no-op; they now say what it costs, and a test pins it. - The registry and the per-block proving budgets are the node's, shared by every caller: a registration names only a hash, so a client can use them up with transitions others sent. The module docs now say so, and that a wait left out answers with a proof of current state. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
QuantumExplorer
merged commit Nov 24, 2026
c1f838c
into
claude/state-transition-proof-b318cb
8 of 10 checks passed
QuantumExplorer
deleted the
fix/state-transition-proof-review-followups
branch
November 24, 2026 16:35
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.
Basic explanation
This follows up #6038 (the proofs of the state before and after a state transition's block) and is stacked on its branch. A code review of #6038 left four findings open after the fixes already pushed there. This PR handles them:
providerafterplatform_version. Reordered.Issue being fixed or feature implemented
1. A failed transaction lookup was read as "not in a block yet"
waitForStateTransitionResultsubscribes to the transaction's event and then asks Tenderdash'stxwhether the transaction is in a block already. It treated every failure of that lookup as "no", and waited for the event.Before:
txcall fails with a transport error, a timeout, ortx (…) not found, err: database unavailable.state_transition_wait_timeout(120 s under dashmate) the client gets a timeout for an executed transition.After:
tx (<HASH>) not found, err: %!w(<nil>)) counts as "not in a block yet". This is the same checkgetRecentStateTransitionStatusalready uses (is_missing_from_index), not a second copy of it.A wait whose first lookup is answered behaves exactly as before and makes no extra call. This problem predates #6038; it is fixed here because #6038 reworked the same function.
2.
platform_versionis the last parameterverify_state_transition_result_around_block,verify_state_before_blockandverify_state_transition_proof_outcomedeclaredplatform_version, provider. They now declareprovider, platform_version.3. Releasing a lease twice
Drive keeps nothing of a lease it no longer holds, so a release that finds no registration looks the same whether it came before its registration, a second time, or after the lease expired. All three are remembered as "a release that came first" (up to 1,024 of them, for 64 blocks), and a later registration with that lease is refused. The docs on
unregister,RegistrationLeaseand the Drive proto said a repeated release changes nothing. They now say what happens and that a caller releases a lease once, which is what rs-dapi does.Telling the cases apart would mean remembering every lease Drive has seen, for a case rs-dapi never produces, so the behaviour stays and the docs match it.
4. The proving budget is shared
A registration names a hash, and nothing ties it to whoever sent the transition. A client can register transitions other people sent, and those count against the node's 1,024 registrations and against a block's 64 decodes and 32 proofs like any other. A client whose transition is left out gets no pair, and its wait answers with the ordinary proof of current state.
No code change:
StateTransitionenum order, and type-based twins of two versioned Drive predicates.The module docs and the docs of
MAX_DECODED_STATE_TRANSITIONS_PER_BLOCKnow state the limit.What was done?
rs-dapi:wait_for_state_transition_result_impltells a missing hash apart from a failed lookup and repeats a failed one while it waits (TX_LOOKUP_RETRY_DELAY,TX_LOOKUP_MAX_RETRY_DELAY).is_missing_from_indexis nowpub(super)so the wait can use it.rs-dapitests: the Tenderdash stand-in answers lookups from a script (missing, failed, found) in Tenderdash's real wording and counts them. Three new tests.rs-drive-proof-verifier: parameter order of the three functions and their callers.rs-drive-abci,dapi-grpc: doc corrections for the lease release and the shared budget, and one test that pins the repeated release.Public interface changes
drive_proof_verifier::verify_state_transition_result_around_block(request, response, provider, platform_version): the last two parameters swapped. The function is new in feat(platform): prove the state before and after the block of a state transition #6038 and has no caller outside this repository's tests.drive.protochanges a comment only.waitForStateTransitionResultanswers the same things as before. The only visible difference is that a wait whose first lookup failed can now answer with a transaction that was already in a block, and makes repeatedtxcalls to Tenderdash until one is answered.How Has This Been Tested?
cargo test -p rs-dapi --lib wait_for_state_transition_result: 34 passed, with the newshould_answer_with_a_transaction_a_repeated_lookup_finds_after_a_failed_oneshould_stop_repeating_the_lookup_once_tenderdash_says_it_holds_no_such_hashshould_still_answer_with_the_event_while_the_lookup_keeps_failingcargo test -p rs-dapi --lib get_recent_state_transition_status: 11 passed.cargo test -p drive-abci --lib state_transition_execution_proofs: 31 passed, with the newshould_remember_a_repeated_release_as_one_that_came_before_its_registration.cargo test -p drive-abci --test state_before_block: 7 passed.cargo test -p drive-proof-verifier --lib state_before_block: 5 passed.cargo clippy -p rs-dapi -p drive-proof-verifier -p drive-abci --all-targets --all-features --locked -- --no-deps -D warnings: clean.Not run: the full workspace suites and a live network.
Breaking Changes
None. The reordered verifier function has not been released.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code