Repository navigation
refactor: update dapi proto file to use either proofs or result - #1148
Merged
Merged
Conversation
added 11 commits
May 23, 2023 16:20
# Conflicts: # packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py # packages/rs-drive-abci/src/query/mod.rs
shuplenkov
marked this pull request as ready for review
June 5, 2023 15:33
shumkov
previously approved these changes
Jun 7, 2023
shumkov
approved these changes
Jun 8, 2023
Closed
7 of 11 tasks
shumkov
added a commit
that referenced
this pull request
Oct 15, 2026
…rifychainlock (PV14) A chain lock that verify_chain_lock_locally v1 leaves to Core (None) went straight to Core's submitchainlock. Dash Core returns its best chain lock height from submitchainlock without checking the signature when that height is at or above the submitted one (rpc/quorums.cpp, v23.1.8), and Drive turns that answer into "Core is synced". So a Byzantine proposer's forged chain lock at an already chain-locked height was accepted by every validator whose Core had a chain lock at or above it. verify_chain_lock_locally v1 now asks Core's verifychainlock whenever the check against the quorums Platform holds cannot decide, on every such path: - false: Some(false), the proposal is rejected and submitchainlock is not called; - true: None, unchanged: submitchainlock still decides whether Core is synced; - RPC error: Err(CoreRpc), which run_block_proposal turns into InvalidChainLock, as it already does for a submitchainlock error there. The check against the held quorums moves unchanged into verify_chain_lock_with_held_quorums, which the local-logic tests call. A false from Core is logged as a warning naming both causes (an invalid signature, or Core missing the block at H - 8); the proposal error is the existing local-rejection one. Both RPCs run the same chainlock::VerifyChainLock. For a genuine chain lock above Core's best they give the same verdict; at or below it, Core's tip is at least H - 8 (Core only keeps a best chain lock it verified), so the signing quorum is selectable and verifychainlock accepts it. A Core more than 8 blocks behind answers false instead of throwing "No quorum found": rejected before and after. So genuine chain locks are rejected in no new case, and forged ones are now rejected by every honest validator instead of depending on each validator's Core. A committed protocol 14 block with a genuine chain lock, which every honest proposer proposes, replays the same way. A block whose forged chain lock v0 accepted through the early return (a Byzantine proposer with rc.1..rc.3 validators holding 2/3) can never be applied by this version; only pre-release protocol 14 networks can hold one. verifychainlock gets the block hash in display order: Drive builds the argument with BlockHash's Display, so the internal-order bug of the pinned rust-dashcore submit_chain_lock (rust-dashcore #1148) does not apply. A test against the mock JSON-RPC Core pins the wire arguments with mainnet chain lock 2555653. Protocol 14 only, in place: v1 is not in any release (5.0.0-rc.1..rc.3 run v0 at protocol 14), testnet and mainnet run protocol 13. No version table changes; item 96 of v14.rs and the V10 table docs describe the Core check. Mixed rc.3/rc.4 validators now also disagree on a forged chain lock in v0's deferred range at a height the validator's Core already has a chain lock for: rc.3 accepts it through the early return, rc.4 rejects it. Only a Byzantine proposer can produce one. Drive now calls verifychainlock on the consensus path: dashmate's drive_consensus RPC whitelist has always allowed it; a deployment without dashmate must allow it too. The strategy tests' mock Core accepts verifychainlock as it accepts submitchainlock; run_chain_lock_update_quorums_not_changing defers a chain lock and needs it. Addresses thepastaclaw's review on #5454. Refs #5438. Test would have caught this: verify_chain_lock with a forged chain lock at 1122 (newly deferred by v1) and 1136 (past the DKG interval end, deferred by v0 too), mock Core best chain lock 1140: ✖ before fix (accepted, Core synced), ✔ after (rejected, submitchainlock not asked). The byte order test fails when the wrapper sends hex::encode(block_hash). The v0/v1 differential test now also runs v1 through the dispatcher against a Core that fails every chain lock: exactly the chain locks the held quorums leave to Core are asked about and rejected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
shumkov
added a commit
that referenced
this pull request
Oct 15, 2026
…rifychainlock (PV14) A chain lock that verify_chain_lock_locally v1 leaves to Core (None) went straight to Core's submitchainlock. Dash Core returns its best chain lock height from submitchainlock without checking the signature when that height is at or above the submitted one (rpc/quorums.cpp, v23.1.8), and Drive turns that answer into "Core is synced". So a Byzantine proposer's forged chain lock at an already chain-locked height was accepted by every validator whose Core had a chain lock at or above it. verify_chain_lock_locally v1 now asks Core's verifychainlock whenever the check against the quorums Platform holds cannot decide, on every such path: - false: Some(false), the proposal is rejected and submitchainlock is not called; - true: None, unchanged: submitchainlock still decides whether Core is synced; - RPC error: Err(CoreRpc), which run_block_proposal turns into InvalidChainLock, as it already does for a submitchainlock error there. The check against the held quorums moves unchanged into verify_chain_lock_with_held_quorums, which the local-logic tests call. A false from Core is logged as a warning naming both causes (an invalid signature, or Core missing the block at H - 8); the proposal error is the existing local-rejection one. Both RPCs run the same chainlock::VerifyChainLock. For a genuine chain lock above Core's best they give the same verdict; at or below it, Core's tip is at least H - 8 (Core only keeps a best chain lock it verified), so the signing quorum is selectable and verifychainlock accepts it. A Core more than 8 blocks behind answers false instead of throwing "No quorum found": rejected before and after. So genuine chain locks are rejected in no new case, and forged ones are now rejected by every honest validator instead of depending on each validator's Core. A committed protocol 14 block with a genuine chain lock, which every honest proposer proposes, replays the same way. A block whose forged chain lock v0 accepted through the early return (a Byzantine proposer with rc.1..rc.3 validators holding 2/3) can never be applied by this version; only pre-release protocol 14 networks can hold one. verifychainlock gets the block hash in display order (BlockHash's Display), as Core parses it; this branch's rust-dashcore pin also sends display order to submitchainlock (rust-dashcore #1148). The wire-level byte order test is on v5.0-dev, whose pin still has the submitchainlock bug; its mock JSON-RPC Core is not on this branch. Protocol 14 only, in place: v1 is not in any release (5.0.0-rc.1..rc.3 run v0 at protocol 14), testnet and mainnet run protocol 13. No version table changes; item 96 of v14.rs and the V10 table docs describe the Core check. Mixed rc.3/rc.4 validators now also disagree on a forged chain lock in v0's deferred range at a height the validator's Core already has a chain lock for: rc.3 accepts it through the early return, rc.4 rejects it. Only a Byzantine proposer can produce one. Drive now calls verifychainlock on the consensus path: dashmate's drive_consensus RPC whitelist has always allowed it; a deployment without dashmate must allow it too. The strategy tests' mock Core accepts verifychainlock as it accepts submitchainlock; run_chain_lock_update_quorums_not_changing defers a chain lock and needs it. Same change as on v5.0-dev (#5459), so the forward merge sees identical edits apart from the BLS API lines. Addresses thepastaclaw's review on #5454. Refs #5438. Test would have caught this: verify_chain_lock with a forged chain lock at 1122 (newly deferred by v1) and 1136 (past the DKG interval end, deferred by v0 too), mock Core best chain lock 1140: ✖ before fix (accepted, Core synced), ✔ after (rejected, submitchainlock not asked). The v0/v1 differential test now also runs v1 through the dispatcher against a Core that fails every chain lock: exactly the chain locks the held quorums leave to Core are asked about and rejected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 19, 2026
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.
Issue being fixed or feature implemented
Update Proto file to use either proofs for direct result, but not both.
What was done?
Changed proto file and all code that uses it
How Has This Been Tested?
With tests
Breaking Changes
No
Checklist:
For repository code-owners and collaborators only