Skip to content

fix(storage): propagate write errors instead of swallowing them in DatabaseCommit#3

Open
wpank wants to merge 1 commit into
Nunchi-trade:mainfrom
wpank:fix/storage-database-commit-error-handling
Open

fix(storage): propagate write errors instead of swallowing them in DatabaseCommit#3
wpank wants to merge 1 commit into
Nunchi-trade:mainfrom
wpank:fix/storage-database-commit-error-handling

Conversation

@wpank
Copy link
Copy Markdown

@wpank wpank commented May 30, 2026

Summary

  • Short-circuit on commit failure: Moved the take_commit_failure() check from after the entire block execution loop to immediately after each per-transaction db.commit() call in revm.rs. This aborts block execution on the first QMDB write failure instead of continuing to execute remaining transactions against potentially inconsistent in-memory state.
  • Enhanced error logging: Added up to 5 affected account addresses to the CRITICAL error log in the DatabaseCommit impl (adapter.rs) for easier diagnosis of write failures.
  • Updated error message: Changed the log message to reflect that the executor now actively short-circuits on commit failure rather than continuing execution.

Problem

The REVM DatabaseCommit::commit() trait returns (), making error propagation impossible through the standard interface. When a per-transaction commit failed (e.g., disk I/O error), remaining transactions in the block continued executing against potentially stale or inconsistent in-memory state. The commit-failure flag was only checked after the entire block had finished, wasting computation and producing invalid receipts.

Test plan

  • cargo check -p kora-executor -p kora-handlers passes
  • cargo clippy -p kora-executor -p kora-handlers --no-deps -- -D warnings passes clean

Closes refcell#22

🤖 Generated with Claude Code

…tabaseCommit

Move the `take_commit_failure()` check from after the entire block
execution loop to immediately after each per-transaction `db.commit()`
call. This short-circuits block execution on the first QMDB write
failure instead of continuing to execute remaining transactions against
potentially inconsistent in-memory state.

Also enhance the error log in the `DatabaseCommit` impl to include up
to 5 affected account addresses for easier diagnosis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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