#127 SDK hardening#128
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the token split payment protocol by replacing the plain sparse Merkle tree with a radix sparse Merkle sum tree (RSMST) to support value-conserving split allocations, introducing classes like SplitAllocationProof, SplitManifest, and VerificationContext. It also hardens JsonRpcHttpTransport with response size limits and improves CBOR/JSON deserialization. The code review identifies several critical issues: a potential compilation or runtime crash in InclusionProofVerificationRule due to accessing lockScript on ITransaction where it is undefined; a high-severity Denial of Service (infinite loop/OOM) vulnerability in Token.verify when processing circular provenance chains; unhandled exceptions in SplitMintJustificationVerifier.verify that should be caught defensively; a resource leak in JsonRpcHttpTransport when response limits are exceeded without canceling the reader; and missing SHA-256 validation checks in SplitAllocationProof and SplitManifest.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
MastaP
left a comment
There was a problem hiding this comment.
Automated review — correctness & hardening pass
Reviewed the full diff (104 files) with a multi-angle finder + adversarial-verification pass. This is mostly solid defensive work; the notes below are the items worth acting on, left as inline comments and ordered by severity:
- Verification gap (highest priority) — the split burn-transfer guard became dead code, letting a genesis mint stand in for the required certified burn.
- Three JSON-RPC transport response-validation regressions (spec-compliant
id:null/error:nullshapes and null-body statuses now throw the wrong error). TokenSaltwire validation weakened from exact-32 to min-16 with no upper bound.AggregatorClientconstructor now throws on inputs that previously worked.- Two maintainability/perf items in the split path (duplicated consensus-critical commitment formulas; redundant TokenId re-derivation; O(n²) proofs copy).
The CBOR-reader rewrite, BFT certificate parsing, and radixsum tree math verified clean for correctness. Details inline.
No description provided.