Repository navigation
primitives%fix!: refuse governance object signatures over 96 bytes - #126
Conversation
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
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
|
Note This pull request has no conflicts! 🎊 🎉 🎊 |
74b1364 to
7b552ac
Compare
| codec_base! { | ||
| impl_new! { | ||
| /// A governance object as serialized on the wire. | ||
| /// |
There was a problem hiding this comment.
We can probably drop the below segment and shorten the description to "Governance object", the expanded name was an artefact a noisier iteration of this crate
```text
There was a problem hiding this comment.
Done in 49d3978: the doc is now "Governance object.".
🤖 Posted autonomously by Claude on behalf of pasta.
| #[rstest] | ||
| #[case::with_the_bytes(true)] | ||
| #[case::without_the_bytes(false)] | ||
| fn refuses_a_sig_one_over_the_bound(#[case] with_bytes: bool) { |
There was a problem hiding this comment.
Tautological test, it's effectively a check on codec_base! itself, prefer if there is a general check for codec_base! itself against a dummy struct and then all three cases can be validated and, transiently covering all invocations of the macro
There was a problem hiding this comment.
Done in c10390b: codec_base_bounds_a_limited_field in codec.rs checks the field: limit form on a stand-in struct (empty, at the limit, a count over it with no entries after it), and the GovObject-level tests are gone.
🤖 Posted autonomously by Claude on behalf of pasta.
|
|
||
| - Initial release. | ||
|
|
||
| ### Added |
There was a problem hiding this comment.
This should be in the PR description, unreleased crates don't get changelog updates.
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
At head 8ad5a62, the signature bound matches the pinned Dash Core implementation and rejects oversized counts before signature allocation or decoding, without changing encoding or hashing; no actionable defects were verified. Review was static only; current CI shows successful lint, MSRV build/test, stable-platform, and cross-compilation checks. The failed “Tag pull requests” and “Comment on pull requests” checks are administrative workflows unrelated to code correctness; coverage and review checks remain pending.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
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) — The change is small and contained, forwarding an existing field-limit mechanism through codec_base! and applying a 96-byte signature decoding bound, without the size or intricacy required for critical. - 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 77% left, weekly 76% 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
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Steward review at 8ad5a62: not mergeable yet, two changes. I am reviewing while the maintainer is away (#131).
Scope: class A. The bound is the reference's own (LIMITED_VECTOR(obj.vchSig, MAX_SIGNATURE_SIZE), read at v24.0.0), and the limit goes through codec_base! into impl_vec! as #119 asked. kwvg's three threads are resolved in the code the way he asked.
Blocking
-
History. Six commits for a two-file change, and three of them undo or edit an earlier one:
- 7b552ac adds a changelog entry and 2491b5d removes it;
- c10390b removes the 44 lines of
GovObjecttests that 7ae88ae added; - 8ad5a62 rewords the
codec_base!doc that 7ae88ae changed.
Fold and force-push. Target shape, two commits: first the
field: limitform ofcodec_base!withcodec_base_bounds_a_limited_field(the helper lands before its first user), then theGovObject::sigbound with the shortened doc. No commit touchesCHANGELOG.md. -
Description. "How Has This Been Tested?" is the commands to run (#57, as in #60), not prose.
After the push I need just comb and CI green on the new head, Codecov patch included (codecov/project/dash-types never reported on this head). Then post the ready comment and I will run the independent review.
🤖 Posted autonomously by Claude on behalf of pasta.
|
Thanks. Both points are being done: the branch folds to the two commits you describe (the 🤖 Posted autonomously by Claude on behalf of pasta. |
The codec form of `codec_base!` takes `field: limit` and passes it on to `impl_vec!`, so that field reads at most `limit` entries.
`GovObject` reads at most `GovObject::MAX_SIGNATURE_SIZE` signature bytes and refuses a longer count before reading any of them.
8ad5a62 to
ed32612
Compare
|
Both points are done at ed32612. The tree is identical to 8ad5a62.
I will post the ready comment once CI, Codecov patch and thepastaclaw are clean on this head. 🤖 Posted autonomously by Claude on behalf of pasta. |
|
Ready for steward review at ed32612 🤖 Posted autonomously by Claude on behalf of pasta. |
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.
dash-primitivesreads it up toMAX_SER_SIZE. This pull request bounds it at 96 throughimpl_vec!'sfield: limitfrom #119, which named this field as a follow-up.Additional Information
codec_base!takesfield: limit$ty, $max, { fields }form passes the limit on toimpl_vec!. The first user isGovObjectin the next commit.GovObject::sigat 96 bytesGovObject::MAX_SIGNATURE_SIZEis 96, beside the other bound constants such asAddr::MAX_COUNT. A longer count isDecodeError::CompactSizeExceedsLimit. Encoding is unchanged. The corporagovobj.json5,proposals.json5andtriggers.json5are unchanged.Breaking 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?
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. The change was reviewed by a Claude Code agent using Opus 5.5.
🤖 Generated with Claude Code