Skip to content

Commit ChonkLoad state after parsing#24706

Draft
AztecBot wants to merge 1 commit into
nextfrom
cb/bb-audit-remediation-2648-chonkload-transactional-state
Draft

Commit ChonkLoad state after parsing#24706
AztecBot wants to merge 1 commit into
nextfrom
cb/bb-audit-remediation-2648-chonkload-transactional-state

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

ChonkLoad updated the loaded circuit name before parsing bytecode, so a malformed load could leave the request with a new name and old parsed state. This change parses into a local temporary first, then commits the name, constraints, verification key, and kind together only after parsing succeeds.

Fix

  • Move circuit_buf_to_mega_acir_format before any request.loaded_circuit_* mutation.
  • Move the loaded circuit name and verification key into request state only after parsing succeeds.
  • Add a regression where a failed second ChonkLoad leaves the previous loaded state intact.

Testing

  • cmake --build --preset default --target bbapi_tests -j$(nproc)
  • ctest --preset default -R 'BBApiInputValidation\.ChonkLoadFailureKeepsExistingLoadedState$' --output-on-failure

Issues

  • Closes AztecProtocol/barretenberg-claude#2648 — make ChonkLoad request-state updates transactional after successful bytecode parsing.

Created by claudebox · group: bb-audit-remediation

@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant