Skip to content

fix(pxe): validate a BoundedVec against its storage array on deserialization - #25035

Merged
nventuro merged 1 commit into
merge-train/fairiesfrom
nv/bvec-serde-fix
Jul 29, 2026
Merged

fix(pxe): validate a BoundedVec against its storage array on deserialization#25035
nventuro merged 1 commit into
merge-train/fairiesfrom
nv/bvec-serde-fix

Conversation

@nventuro

Copy link
Copy Markdown
Contributor

This just catches a misconstructred oracle call.

…ization

The bounded-vec deserializer computed the storage array's capacity and then
ignored it, trusting the length scalar instead. Two malformed inputs got
through: a length past the capacity ran the element loop until the reader ran
dry, reporting "Not enough fields to be consumed" from several frames down
after Array.from had already reserved a slot per claimed element; and a storage
array that was not a whole number of elements silently produced a vec with a
fractional maxLength.

Both now throw naming the values that disagree. Serialization already enforced
the length bound, so this restores the symmetry.
@nventuro
nventuro requested a review from nchamo July 28, 2026 21:11
@nventuro
nventuro merged commit e316ccd into merge-train/fairies Jul 29, 2026
12 checks passed
@nventuro
nventuro deleted the nv/bvec-serde-fix branch July 29, 2026 19:57
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request Aug 5, 2026
BEGIN_COMMIT_OVERRIDE
fix(pxe): validate a BoundedVec against its storage array on
deserialization (AztecProtocol#25035)
chore: add disclaimers on poc contracts (AztecProtocol#24975)
chore: begin nr constant cleanup (AztecProtocol#25014)
fix(txe): authorize sync_state utility calls in inlined contexts
(AztecProtocol#25034)
refactor(stdlib): a function's return type is a single optional AbiType
(AztecProtocol#25066)
feat(pxe): hash-pinned node read cache (AztecProtocol#24969)
feat(noir-projects): publish compiled protocol artifacts to npm (AztecProtocol#25075)
fix(ci): trim GitHub commit API response in upload_benchmarks to avoid
E2BIG on large merge commits (AztecProtocol#25077)
END_COMMIT_OVERRIDE
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.

2 participants