chore(riscv-guest): Error codes and their coverage - #3786
Open
Filter94 wants to merge 2 commits into
Open
Conversation
Deterministic exit-code taxonomy for the l2-execution guest: guest_errors.zig defines 7 stable category codes; the guest entry logs the error name via zkvm_log then exits with the mapped category code instead of a blanket exit(1).
…lockNumber (pr3-v2) Missed when reconstructing this branch: PR3's §6.5 deadline constraint wording fix. Both implementations already enforce ftx.deadlineBlockNumber >= handlingBlockNumber; the spec text previously described a weaker range-start check.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the L2 execution guest’s failure handling to use deterministic, category-stable exit codes (instead of a single generic failure code), and aligns the rollup spec’s forced-transaction deadline wording with block-level handling.
Changes:
- Introduces a standalone
guest_errorsmodule that maps Zig errors to a fixed exit-code taxonomy. - Updates the RISC-V guest entrypoint to log the failing error name and exit with
guest_errors.exitCode(err)on failure. - Adds unit tests that pin representative exit-code values and enforce that every
linea_errorsmember maps to a non-unknown category. - Clarifies the forced-transaction deadline constraint in
rollup_spec/Readme.mdto be relative to the handling block.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
rollup_spec/Readme.md |
Clarifies forced-transaction deadline semantics in the spec text. |
riscv-guests/l2-execution/src/guest_errors.zig |
Adds deterministic, category-stable exit codes and a mapping from errors to codes. |
riscv-guests/l2-execution/src/evm_execution_guest.zig |
Uses the new exit-code mapping and logs error names before terminating on failure. |
riscv-guests/l2-execution/test/evm_execution_guest_test.zig |
Adds tests to pin exit-code values and ensure full coverage of listed Linea-layer errors. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+25
to
+29
| /// A node needed to resolve an MPT proof path was missing from the witness pool (a proof of ABSENCE | ||
| /// resolves to `null`/`0` instead, never here), at whichever layer surfaces the read: a direct | ||
| /// Linea-layer MPT read, the witness header chain, or the EVM's witness-backed database during | ||
| /// delegated per-block execution. | ||
| pub const CODE_WITNESS_RESOLUTION: ExitCode = 7; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements issue(s) #
Checklist
PR.