Skip to content

chore(riscv-guest): Error codes and their coverage - #3786

Open
Filter94 wants to merge 2 commits into
test/l2-exec-guest-coverage-pr2-v2from
test/l2-exec-guest-coverage-pr3-v2
Open

chore(riscv-guest): Error codes and their coverage#3786
Filter94 wants to merge 2 commits into
test/l2-exec-guest-coverage-pr2-v2from
test/l2-exec-guest-coverage-pr3-v2

Conversation

@Filter94

Copy link
Copy Markdown
Contributor

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this
    PR.
  • I have informed the team of any breaking changes if there are any.

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.
Copilot AI lite review requested due to automatic review settings August 13, 2026 09:37
@Filter94 Filter94 changed the title Test/l2 exec guest coverage pr3 v2 chore(riscv-guest): Error codes and their coverage Aug 13, 2026

Copilot AI 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.

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_errors module 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_errors member maps to a non-unknown category.
  • Clarifies the forced-transaction deadline constraint in rollup_spec/Readme.md to 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;
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