Skip to content

fix(manager): keep fatal VM errors internal - #26

Merged
kp2pml30 merged 1 commit into
v0.3-devfrom
pr/v0.3/fix/fatal-errors
Aug 21, 2026
Merged

fix(manager): keep fatal VM errors internal#26
kp2pml30 merged 1 commit into
v0.3-devfrom
pr/v0.3/fix/fatal-errors

Conversation

@kp2pml30

@kp2pml30 kp2pml30 commented Aug 20, 2026

Copy link
Copy Markdown
Member

Auto-opened executor mirror of genlayerlabs/genvm-manager#27.

Carries the executor-side work for that manager PR. Auto-closed as merged when the manager PR lands (its pr/v0.3/fix/fatal-errors branch is moved onto v0.3-dev).

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of fatal VM errors in top-level executions.
    • Ensured contract-visible results are encoded consistently across leader and validator execution paths.
    • Prevented fatal outcomes from being published as contract results.
    • Improved reporting of malformed nondeterministic outputs and corresponding VM error codes.
  • Tests

    • Added coverage for top-level and nested fatal-result handling, outcome encoding, and invalid leader results.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 615156ea-e43a-49b6-b17c-3fe15b69ffd8

📥 Commits

Reviewing files that changed from the base of the PR and between a54b15b and 55b1336.

⛔ Files ignored due to path filters (1)
  • executor/fuzz/shared/leader-result.rs is excluded by !**/fuzz/**
📒 Files selected for processing (7)
  • executor/src/host/mod.rs
  • executor/src/lib.rs
  • executor/src/rt/supervisor/mod.rs
  • executor/src/rt/vm/mod.rs
  • executor/src/wasi/genlayer_sdk/mod.rs
  • executor/src/wasi/genlayer_sdk/run.rs
  • executor/src/wasi/genlayer_sdk/tests.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The executor introduces contract-visible outcome types, separates publication and validation handling, and preserves fatal VM errors through nested execution. Top-level reporting coalesces fatal results into VmError, while nested execution retains FatalVmError.

Changes

Fatal outcome reporting

Layer / File(s) Summary
Contract outcome representation
executor/src/rt/vm/mod.rs, executor/src/rt/supervisor/mod.rs
ContractOutcome and ContractResultBytes now handle contract-visible encoding. Fatal VM errors cannot convert to contract bytes. Top-level fatal results can be coalesced into VmError.
Leader publication and validation flow
executor/src/wasi/genlayer_sdk/..., executor/src/lib.rs, executor/src/rt/supervisor/mod.rs
Leader and validator paths parse, convert, encode, store, and validate ContractOutcome values. Publication strips VM-error details. Validation preserves the fatal RunOk result.
Top-level fatal-result normalization
executor/src/lib.rs, executor/src/host/mod.rs, executor/src/rt/vm/mod.rs
run_with distinguishes top-level and nested execution. Final results are normalized only at the top-level reporting boundary. Tests verify the resulting codes and decoded error kinds.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 55b13

The change keeps fatal VM errors internal; it is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

Sequence Diagram(s)

sequenceDiagram
  participant Executor
  participant Leader
  participant Supervisor
  participant Validator
  participant Host
  Executor->>Leader: compute nondeterministic result
  Leader->>Executor: convert result to ContractOutcome
  Executor->>Supervisor: store encoded ContractResultBytes
  Supervisor->>Validator: provide leader result bytes
  Validator->>Executor: return validated outcome and RunOk
  Executor->>Host: coalesce fatal result only for top-level execution
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping fatal VM errors internal within the executor.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/v0.3/fix/fatal-errors

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Clippy (1.97.1)

Clippy execution failed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kp2pml30
kp2pml30 merged commit 55b1336 into v0.3-dev Aug 21, 2026
1 check passed
@kp2pml30
kp2pml30 deleted the pr/v0.3/fix/fatal-errors branch August 21, 2026 02:37
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.

1 participant