Skip to content

docs: avm docs#19603

Merged
dbanks12 merged 3 commits into
merge-train/avmfrom
db/avm-docs
Jan 16, 2026
Merged

docs: avm docs#19603
dbanks12 merged 3 commits into
merge-train/avmfrom
db/avm-docs

Conversation

@dbanks12

@dbanks12 dbanks12 commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

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

@dbanks12 dbanks12 marked this pull request as ready for review January 14, 2026 21:18
@dbanks12 dbanks12 requested a review from fcarreiro January 14, 2026 21:18
@AztecBot

AztecBot commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator

Flakey Tests

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

\033FLAKED\033 (8;;http://ci.aztec-labs.com/3a0fa7f2e643b2a8�3a0fa7f2e643b2a88;;�): yarn-project/end-to-end/scripts/run_test.sh web3signer src/composed/web3signer/e2e_multi_validator_node_key_store.test.ts (36s) (code: 1) (\033dbanks12\033: align calldata/returndata docs with cpp/pil realities)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/89d2f0f7c51b4754�89d2f0f7c51b47548;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_invalidate_block.parallel.test.ts "proposer invalidates multiple blocks" (602s) (code: 124) group:e2e-p2p-epoch-flakes (\033dbanks12\033: align calldata/returndata docs with cpp/pil realities)

@fcarreiro fcarreiro 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.

This is REALLY REALLY good! I think you should merge it.

You can still pass it around and people can comment. Someone else can take over and make the changes.

@@ -0,0 +1,79 @@
# Aztec Virtual Machine (AVM)

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.

I feel this is a bit too defensive. It's like "I'm telling you why a VM and not circuits", while it could be "hello! this is the AVM, by the way, no circuits because of XX". By now I think L2s with VMs are quite standard and understood.

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.

Left this as-is for now, but we can rethink. Honestly I pasted verbatim from the technical whitepaper. I personally think this content is useful somewhere, but maybe it doesn't need to be multiple paragraphs in the intro.

Comment thread yarn-project/simulator/docs/avm/enqueued-calls.md
Comment thread yarn-project/simulator/docs/avm/enqueued-calls.md Outdated
Comment thread yarn-project/simulator/docs/avm/enqueued-calls.md Outdated
Comment thread yarn-project/simulator/docs/avm/memory.md Outdated
Comment thread yarn-project/simulator/docs/avm/execution-lifecycle.md Outdated
Comment thread yarn-project/simulator/docs/avm/execution-lifecycle.md Outdated
Comment thread yarn-project/simulator/docs/avm/calldata-returndata.md Outdated
- `argsOffset` — Memory offset where arguments start
- `argsSize` — Number of field elements to pass

The callee receives this memory region as its calldata.

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.

The types are reinterpreted as FIELDS.... are they? (now I dont remember)

- `retOffset` — Memory offset where return data starts
- `retSize` — Number of field elements to return

On `REVERT`, the same parameters specify revert data.

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.

Maybe a note here (or in the ISA, or both) that this only SETS the params, but does not try to access or copy the returndata. in particular this means that setting this to some OOB memory location access will not fail here, but on the caller (which, thinking about it, is actually quite bad from a programming/defensive PoV...)

@dbanks12 dbanks12 Jan 15, 2026

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.

Oof honestly I don't think I realized that. That's a bummer. Ideally the fact that returndata really lives in child's memory should be a circuit/cpp implementation detail. IMO both TS and C++ implementations aren't great. maybe they should really both just pad with 0s for memory OOB like they do if you copy a size larger than the calldata/returndata.

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.

This means we need to officially define calldata/returndata as living in the parent's/child's memory in the docs 😢

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.

And if it would be an out-of-bounds access, but it is also a read past the end of calldata/returndata size, it's NOT an OOB error.....

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.

I'm documenting it as the C++ and PIL implement it. I updated the opcode pages and calldata-returndata.md

@dbanks12

Copy link
Copy Markdown
Contributor Author

we really need to revisit terms like revert vs rollback, revert vs error, exception / exceptional, halt,.... We need to define these terms and then have claude change the docs to use them consistently. My proposal:

  1. Revert just means the opcode
  2. Use rollback to mean ... rollback of state
  3. Error causes rollback, so does revert
  4. Return opcode, Revert opcode and Error all "halt" execution of the current context
  5. Error or revert of a top-level context during setup causes a "Fatal error" (?). Same with error during non-revertible insertions.

@dbanks12 dbanks12 merged commit 1ffa9c3 into merge-train/avm Jan 16, 2026
9 checks passed
@dbanks12 dbanks12 deleted the db/avm-docs branch January 16, 2026 00:04
@AztecBot AztecBot mentioned this pull request Jan 16, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Jan 17, 2026
BEGIN_COMMIT_OVERRIDE
feat(avm): contract instance mutation (#19499)
fix(avm): Fix note hash exists fuzzing (#19616)
fix(avm): Build trace on coverage prover runs (#19627)
chore(avm): Use PC alias type consistently (#19625)
feat(avm): mutate global gas fees and timestamp (#19500)
docs: avm docs (#19603)
fix(avm): Increase chances of fuzzer finding limits (#19656)
fix(avm)!: de-risk memory injection attacks (#19620)
fix(avm): Fix TS ECC add infinity handling (#19657)
fix(avm): Fix jumpif in fuzzer (#19655)
feat(avm): protocol contractg mutations (#19586)
chore(avm): analyze fuzzer corpus distribution (#19614)
feat(avm): fuzzer treats enqueued call size as coverage (#19615)
refactor(avm): Refactor calldata copy and return data copy fuzzing
(#19666)
feat(avm): boundary values for mutations (#19617)
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