Skip to content

chore(avm)!: resolve execution TODOs#19501

Merged
fcarreiro merged 3 commits into
merge-train/avmfrom
fc/execution-todos
Jan 12, 2026
Merged

chore(avm)!: resolve execution TODOs#19501
fcarreiro merged 3 commits into
merge-train/avmfrom
fc/execution-todos

Conversation

@fcarreiro

@fcarreiro fcarreiro commented Jan 12, 2026

Copy link
Copy Markdown
Contributor
  1. Improved type conversion in the dispatcher
  2. Exception handling is ok
  3. Input and output handling: sadly required
  4. Checkpoint validation: made it a BB_ASSERT

Note: MemoryTag can be used directly because it's validated during instruction fetching. For EnvironmentVariable, we need to use uint8_t until we do the proper validation.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fcarreiro fcarreiro marked this pull request as ready for review January 12, 2026 14:40

@jeanmon jeanmon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes. I think there is an undefined behavior but not due to your changes.
Could you please check this @fcarreiro ?

// This helper handles operand conversion. In particular it converts enums to their underlying type first.
auto convert_operand = []<typename T>(const Operand& op) -> T {
if constexpr (std::is_enum_v<T>) {
return static_cast<T>(op.to<std::underlying_type_t<T>>());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant!


MemoryValue result;

EnvironmentVariable env_var = static_cast<EnvironmentVariable>(var_enum);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that is undefined behvior. https://stackoverflow.com/questions/33607809/can-an-out-of-range-enum-conversion-produce-a-value-outside-the-underlying-type

Not created by your PR @fcarreiro though but for this case I think we need keep the uint8_t value guarding by env_var <= EnvironmentVariable::MAX.

I think the tag is fine because it should have been filtered earlier in the read_instruction().

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled!

@AztecBot

AztecBot commented Jan 12, 2026

Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 3 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/b181950a1cf307b5�b181950a1cf307b58;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_invalidate_block.parallel.test.ts "committee member invalidates a block if proposer does not come through" (97s) (code: 1) group:e2e-p2p-epoch-flakes (\033fcarreiro\033: handle possible UB)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/83da6c6852626e16�83da6c6852626e168;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_l1_publisher/e2e_l1_publisher.test.ts (96s) (code: 1) (\033fcarreiro\033: handle possible UB)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/b15816c423c39153�b15816c423c391538;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/gossip_network.test.ts (433s) (code: 1) group:e2e-p2p-epoch-flakes (\033fcarreiro\033: handle possible UB)

@fcarreiro fcarreiro requested a review from jeanmon January 12, 2026 16:35

fcarreiro commented Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jan 12, 5:08 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 12, 5:09 PM UTC: @fcarreiro merged this pull request with Graphite.

@fcarreiro fcarreiro merged commit adaa0d1 into merge-train/avm Jan 12, 2026
11 checks passed
@fcarreiro fcarreiro deleted the fc/execution-todos branch January 12, 2026 17:09
@AztecBot AztecBot mentioned this pull request Jan 12, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Jan 12, 2026
BEGIN_COMMIT_OVERRIDE
feat(avm security): add static check for isolated/unused columns
(#19489)
feat(avm): use noop calldata hasher in fast sim (#19495)
chore(avm): rename indirect -> addressing mode (#19491)
chore(avm): small cursor optimizations
chore(avm):! rename indirect -> addressing mode (PIL) (#19493)
fix(avm): constraint when unwinding empty call stack (#19485)
feat(avm): Fuzz debug log and refactor env getter (#19494)
fix!: ecc add predicate completeness bug (#19471)
chore(avm): callstackmetadatacollector clarifications (#19490)
chore: sanity assert in execution for bytecode id (#19486)
fix!: sstore allowed injection of malicious write rows (#19470)
fix!: defensive ghost row constraints in bc_hashing pil (#19481)
fix(avm): fix execution::mov for mac? (#19507)
chore(avm)!: resolve execution TODOs (#19501)
fix!: multiple traces had ghost row injection vulnerabilities (#19480)
fix(avm): defensively copy MemoryValues (#19512)
feat: align TS and BB log levels (#19518)
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.

3 participants