fix(drive): strengthen execution proof result validation#4155
fix(drive): strengthen execution proof result validation#4155QuantumExplorer wants to merge 18 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughState-transition proof verification now distinguishes execution evidence from affected-state snapshots, strengthens identity proof binding, adds Drive and WASM affected-state APIs, updates platform-version metadata, and revises integration tests for fail-closed execution checks. ChangesState-transition proof verification
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant WasmClient
participant Drive
participant V0Verifier
participant ProofResult
WasmClient->>Drive: request affected-state proof verification
Drive->>V0Verifier: verify with AllowAffectedState
V0Verifier->>ProofResult: produce height-pinned affected-state result
ProofResult-->>Drive: return root hash and state snapshot
Drive-->>WasmClient: return serialized verification result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Ready for review — 27 ahead in queue (commit 828316c) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v4.1-dev #4155 +/- ##
==========================================
Coverage 87.51% 87.51%
==========================================
Files 2667 2667
Lines 336972 337442 +470
==========================================
+ Hits 294903 295316 +413
- Misses 42069 42126 +57
🚀 New features to boost your workflow:
|
…on-proof-binding # Conflicts: # packages/swift-sdk/build_ios.sh
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/tests-rs-workspace.yml:
- Around line 241-250: Update the cleanup retry loop around rm -rf
target/llvm-cov-target so it breaks only when the removal command succeeds and
target/llvm-cov-target no longer exists. Keep retrying with the existing warning
and delay when either condition fails, while preserving the final warning if the
directory remains after all attempts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 540d3956-d3e2-48f0-9b1d-f30624735b42
📒 Files selected for processing (7)
.github/workflows/kotlin-sdk-build.yml.github/workflows/tests-rs-workspace.ymlpackages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/shield/tests.rspackages/rs-drive-abci/tests/strategy_tests/verify_state_transitions.rspackages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rspackages/rs-unified-sdk-jni/src/tx_decode.rspackages/swift-sdk/build_ios.sh
Resolve the tests-rs-workspace.yml conflict to the base side: the base already carries the coverage-cleanup retry loop and its own timeout tuning, so this PR no longer needs to ship workflow changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ransitions verify_state_transition_was_executed_with_proof keeps failing closed for the transition families whose proof cannot be bound to execution (balance top-ups, credit transfers and withdrawals, address funds movements, shields, no-history token burn/mint/transfer). A new sibling entry point, verify_state_transition_affected_state_with_proof, serves the consumers those errors broke: it behaves identically for execution-verifiable types and, for the receipt-gated families, returns a verified snapshot of the affected state instead — keys derived from the transition, values authenticated as of the proof's block, explicitly documented as height-pinned snapshots rather than execution evidence. The SDK wait path (FromProof for StateTransitionProofResult) now uses the affected-state entry point, restoring the address funds, top-up, withdrawal, credit-transfer and no-history token transfer flows that matched result variants nothing produced anymore. wasm-drive-verify gains the matching verifyStateTransitionAffectedStateWithProof export. Also relax the identity-update disabled-key check from exact equality with the proof block's timestamp to at-or-before it: proofs may be generated at a later block than the one that executed the update, and disabled_at never changes afterwards, so retried or replayed proofs were failing verification spuriously. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Addressed the merge blocker in 828316c (plus a v4.1-dev merge in 962c9ce). The strict verifier keeps this PR's semantics unchanged: The fix adds an explicitly-named sibling entry point, Also relaxed the identity-update disabled-key check from exact equality with the proof block's timestamp to at-or-before it — a proof generated at a later block than the executing one carries the original Validation: drive lib 3,236 tests pass; clippy clean on drive, drive-proof-verifier and wasm-drive-verify (wasm32 target); |
✅ Action performedReview finished.
|
Summary
Compatibility
This is a verifier-side hardening change and does not alter consensus or require a protocol activation. Proved wait calls for unsupported result shapes now return an explicit proof error rather than a stronger success guarantee than the evidence supports.
Validation
cargo test -p drive --lib(3,219 passed)cargo clippy -p drive --lib -- -D warningscargo fmt --all -- --checkgit diff --checkSummary by CodeRabbit