Skip to content

Conversation

@hawkadrian
Copy link
Contributor

Description

Fixes nonce validation error in debug_executionWitness when used with pruned nodes.

Problem

The debug_executionWitness RPC method was failing with "nonce too high" error when used on pruned nodes. This occurred because the method was not applying pre-execution changes to properly set up the state before block execution.

Solution

Added missing apply_pre_execution_changes call in debug_execution_witness_for_block method, following the same pattern used by other debug methods like debug_trace_transaction.

Fixes #19244

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klkvr I believe we can close this because this isnt right

Comment on lines 658 to 660
// Apply pre-execution changes to ensure correct state setup, especially for pruned
// nodes
this.eth_api().apply_pre_execution_changes(&block, &mut db, &evm_env)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this is correct because the actual

block_executor.execute_with_state_closure

call already takes care of that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this is correct because the actual

block_executor.execute_with_state_closure

call already takes care of that

I've removed the redundant call as you suggested.

Just to confirm - does execute_block handle EIP-4788 system calls as well? The RPC apply_pre_execution_changes specifically handles the 4788 system call for beacon root updates. If the issue persists, should we investigate elsewhere?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes execute handles the entire block STF including pre+post system calls,

this is like an issue with pruned state, worth opening an issue of this, but we dont need to fix anything here

@mattsse mattsse closed this Nov 1, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

EVM reported invalid transaction with debug_executionWitness

2 participants