refactor(spv): isolate btcd script classification - #4165
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe deposit sweep parser now classifies transaction inputs through ChangesSPV script classification
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 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 |
|
CI note: I reran the non-required client-integration-test after its initial failure. The rerun failed for the same shared external-infrastructure reason as PR #4167: all 30 failures are fulcrum_tcp cases receiving |
Resolve conflicts by final behavior, preserving the candidate's OOB hardening and the no-cap / exact-target SPV semantics while taking main's threshold-network#4039 work-accumulation model, threshold-network#4165 script-type isolation, threshold-network#4172 sweep fee floor, and the threshold-network#3998 v1-random-beacon extraction. SPV conflict resolution: - pkg/maintainer/spv/spv.go: keep candidate side (no 144-header cap, header cache, exact decoded-target DIFF1 comparison + zero-target guard). Removed the `const maxProofHeaders = 144` that the 3-way merge silently re-added from main (merge-base lacked it, so the candidate's iteration-1 removal was invisible to the merge). - pkg/maintainer/spv/deposit_sweep.go: combine candidate's bounds-checked OutputAt accessor with main's bitcoin.GetScriptType classification (threshold-network#4165). - pkg/maintainer/spv/spv_test.go: keep candidate's superset of cases (non-DIFF1 rounding, zero-target, 145- and 201-header long-run cases); drop main's removed "minimum difficulty run exceeds header bound" cap test. Accepted main's deletion of the extracted v1 random beacon and dead Ropsten infra. NOTE: this drops two candidate-only v1 hardenings that main moved out of this repo — require(entryCreatedSuccess) in KeepRandomBeaconOperator.sol and the registry-approval modifier in KeepRandomBeaconServiceImplV1.sol. If those are in security scope they must be ported to the keep-core-v1 repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Resolve conflicts by final behavior, preserving the candidate's OOB hardening and the no-cap / exact-target SPV semantics while taking main's threshold-network#4039 work-accumulation model, threshold-network#4165 script-type isolation, threshold-network#4172 sweep fee floor, and the threshold-network#3998 v1-random-beacon extraction. SPV conflict resolution: - pkg/maintainer/spv/spv.go: keep candidate side (no 144-header cap, header cache, exact decoded-target DIFF1 comparison + zero-target guard). Removed the `const maxProofHeaders = 144` that the 3-way merge silently re-added from main (merge-base lacked it, so the candidate's iteration-1 removal was invisible to the merge). - pkg/maintainer/spv/deposit_sweep.go: combine candidate's bounds-checked OutputAt accessor with main's bitcoin.GetScriptType classification (threshold-network#4165). - pkg/maintainer/spv/spv_test.go: keep candidate's superset of cases (non-DIFF1 rounding, zero-target, 145- and 201-header long-run cases); drop main's removed "minimum difficulty run exceeds header bound" cap test. Accepted main's deletion of the extracted v1 random beacon and dead Ropsten infra. NOTE: this drops two candidate-only v1 hardenings that main moved out of this repo — require(entryCreatedSuccess) in KeepRandomBeaconOperator.sol and the registry-approval modifier in KeepRandomBeaconServiceImplV1.sol. If those are in security scope they must be ported to the keep-core-v1 repo.
Resolve conflicts by final behavior, preserving the candidate's OOB hardening and the no-cap / exact-target SPV semantics while taking main's threshold-network#4039 work-accumulation model, threshold-network#4165 script-type isolation, threshold-network#4172 sweep fee floor, and the threshold-network#3998 v1-random-beacon extraction. SPV conflict resolution: - pkg/maintainer/spv/spv.go: keep candidate side (no 144-header cap, header cache, exact decoded-target DIFF1 comparison + zero-target guard). Removed the `const maxProofHeaders = 144` that the 3-way merge silently re-added from main (merge-base lacked it, so the candidate's iteration-1 removal was invisible to the merge). - pkg/maintainer/spv/deposit_sweep.go: combine candidate's bounds-checked OutputAt accessor with main's bitcoin.GetScriptType classification (threshold-network#4165). - pkg/maintainer/spv/spv_test.go: keep candidate's superset of cases (non-DIFF1 rounding, zero-target, 145- and 201-header long-run cases); drop main's removed "minimum difficulty run exceeds header bound" cap test. Accepted main's deletion of the extracted v1 random beacon and dead Ropsten infra. NOTE: this drops two candidate-only v1 hardenings that main moved out of this repo — require(entryCreatedSuccess) in KeepRandomBeaconOperator.sol and the registry-approval modifier in KeepRandomBeaconServiceImplV1.sol. If those are in security scope they must be ported to the keep-core-v1 repo.
Summary
Testing
Fixes #3677
Summary by CodeRabbit