Skip to content

fuzz: add proof_decode target for borsh/serde-decoded proofs - #977

Open
citizen-stig wants to merge 1 commit into
thrumdev:masterfrom
citizen-stig:nikolai/fuzz-proof-decode
Open

citizen-stig wants to merge 1 commit into
thrumdev:masterfrom
citizen-stig:nikolai/fuzz-proof-decode

Conversation

@citizen-stig

Copy link
Copy Markdown
Contributor

Untrusted proof bytes are how a stateless verifier receives proofs, but the fuzz build compiled neither decoder. Enable nomt-core's borsh and serde features and add a target that decodes a PathProof, MultiProof or Witness (borsh, or serde via bincode) from raw bytes or from a byte-edited honest encoding, then verifies it as examples/witness_verification does.

Witness reads/writes/paths and multi-proof ops can also be edited before encoding, so verify_update and verify_multi_proof_update see unsorted, duplicated and out-of-scope ops for the first time.

Oracles: decoding never panics and re-encodes to the same bytes; an unedited honest proof verifies and yields the model's updated root; anything a decoded proof confirms, and any root an update returns, matches a reference trie.

On master this finds the decoded TriePosition depth > 256 panic in seconds.

Untrusted proof bytes are how a stateless verifier receives proofs, but the
fuzz build compiled neither decoder. Enable nomt-core's `borsh` and `serde`
features and add a target that decodes a `PathProof`, `MultiProof` or
`Witness` (borsh, or serde via bincode) from raw bytes or from a byte-edited
honest encoding, then verifies it as `examples/witness_verification` does.

Witness reads/writes/paths and multi-proof ops can also be edited before
encoding, so `verify_update` and `verify_multi_proof_update` see unsorted,
duplicated and out-of-scope ops for the first time.

Oracles: decoding never panics and re-encodes to the same bytes; an unedited
honest proof verifies and yields the model's updated root; anything a decoded
proof confirms, and any root an update returns, matches a reference trie.

On master this finds the decoded `TriePosition` depth > 256 panic in seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wb3qFADTLbzKssR5mn8LH
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.

1 participant