Skip to content

fix(mmr): enforce exact int types and strict schema validation in InclusionProof/ConsistencyProof.from_dict (#160) - #165

Open
drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-mmr-proofs-160
Open

drk-ram wants to merge 1 commit into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-mmr-proofs-160

Conversation

@drk-ram

@drk-ram drk-ram commented Oct 25, 2026

Copy link
Copy Markdown

Closes #160

Summary

  • Require exact int (type(value) is int) in peaks, inclusion_proof, consistency_proof, verify_inclusion, and verify_consistency so booleans and IntEnum values are rejected.
  • Strictly validate InclusionProof.from_dict and ConsistencyProof.from_dict (requiring exact field sets, v == 1, matching kind, exact non-negative integers, and list of 64-char lowercase hex strings for witness and old_peaks) and convert any decoding KeyError/TypeError/ValueError into InvalidArgumentError.
  • Add subTest-isolated unit tests in tests/test_mmr_core.py.

Validation

  • pytest tests/test_mmr_core.py tests/test_mmr_checkpoint_adversarial.py -q — passed (19 passed, 19 subtests passed)

…lusionProof/ConsistencyProof.from_dict (agentrust-io#160)

Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
@drk-ram
drk-ram force-pushed the drk-ram-fix-mmr-proofs-160 branch from ab6fa7f to 84a68b5 Compare October 29, 2026 17:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(trace_verify/_mmr): enforce exact int types across MMR functions and harden InclusionProof/ConsistencyProof.from_dict

1 participant