Repository navigation
primitives%fix!: refuse governance object signatures over 96 bytes - #126
PastaPastaPasta wants to merge 2 commits into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Verified the complete diff at 74b1364 and found no actionable defects. The signature limit matches the pinned Dash Core implementation and is enforced before signature allocation or byte reads, while encoding, field order, construction, and hashing remain unchanged. Validation was static only; the supplied CI snapshot and current checks show successful applicable build, test, lint, and coverage checks, with none failing or pending.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, contained decoding-bound fix with focused boundary tests and a straightforward macro passthrough, not a large or intricate change despite touching peer-facing deserialization. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 44% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort medium); agentphase2-reviewer
|
Warning This pull request may have conflicts, please coordinate with the authors of these pull requests. Potential conflicts |
`codec_base!` takes `field: limit` in its codec form. `GovObject` reads at most `GovObject::MAX_SIGNATURE_SIZE` signature bytes and refuses a longer count before reading any of them.
74b1364 to
7b552ac
Compare
Motivation
The reference implementation v24.0.0 reads a governance object's signature as a vector of at most 96 bytes, and refuses a longer length before reading the bytes (dashpay/dash#7831).
dash-primitivesreads it up toMAX_SER_SIZE. This pull request bounds it at 96, usingimpl_vec!'sfield: limitfrom #119. #119 named this field as a follow-up.Additional Information
GovObject::sigat 96 bytesGovObject::MAX_SIGNATURE_SIZEis 96.GovObjectdeclares itself withimpl_new!and takes its codec fromcodec_base!'s$ty, $max, { fields }form, which now passes afield: limitthrough toimpl_vec!. The signature count is checked before any signature byte is read, and a longer count isDecodeError::CompactSizeExceedsLimit. The other fields,dataincluded, read as before. Encoding is unchanged.govobj.json5,proposals.json5andtriggers.json5, unchangedBreaking Changes
GovObjectrefuses a signature longer than 96 bytes when decoding, which it read before.dash-p2p-core'sgovobjmessage, which carries aGovObject, refuses it too.How Has This Been Tested?
decodes_a_sig_up_to_the_bounddecodes an empty signature and one of 96 bytes.refuses_a_sig_one_over_the_boundrefuses 97, with and without the signature bytes after the count.govobj.json5,proposals.json5andtriggers.json5still decodes and encodes to the same bytes.Checklist
comments and concerns without said assistance. I assume authorship of the code submitted.
Agent disclosure
Code, commit messages and this description were generated with Claude Code using Claude Opus 5.5, running autonomously as an agent on behalf of the author.
🤖 Generated with Claude Code