Skip to content

Auto-mining failures are swallowed, allowing submission success without required mining pass #56

Description

@roninjin10

Summary

In auto mining mode, submission handlers ignore all errors from the mining pass and still return a tx hash success response.

Why this matters

Contract semantics define auto mode as an immediate mining pass on accepted executable submission, and runtime failures should map to runtime rejection (no result hash). Swallowing mining errors can report success even when the auto-mining step failed.

Contract anchors

  • docs/specs/json-rpc-contract.md:877-880
    • auto mode trigger is accepted submission and effect is immediate single-block mining pass.
  • docs/specs/json-rpc-contract.md:607-610
    • runtime rejection returns error (no tx hash result).

Evidence

Both submission paths suppress mining errors:

  • src/rpc/handlers/tx_submission.zig:118-120
  • src/rpc/handlers/tx_submission.zig:447-449
if (rt.mining_mode == .auto) {
    automine(allocator, rt, indexes) catch {};
}
return .{ .value = .{ .bytes = tx_hash } };

automine is fallible (allocation/state/block-seal/index writes):

  • src/rpc/handlers/tx_submission.zig:466-619

Errors from these paths are currently dropped and cannot surface to RPC callers.

Suggested scope

  1. Do not suppress automine errors in submission handlers.
  2. Distinguish validation errors (-32602) from runtime mining failures (-32603) at handler boundary.
  3. Add regression coverage where a forced mining failure in auto mode returns runtime error and does not return a success hash.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions