Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion internal/ethapi/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const (
errCodeClientLimitExceeded = -38026
errCodeInternalError = -32603
errCodeInvalidParams = -32602
errCodeReverted = -32000
errCodeVMError = -32015
)

Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
if errors.Is(result.Err, vm.ErrExecutionReverted) {
// If the result contains a revert reason, try to unpack it.
revertErr := newRevertError(result.Revert())
callRes.Error = &callError{Message: revertErr.Error(), Code: errCodeReverted, Data: revertErr.ErrorData().(string)}
callRes.Error = &callError{Message: revertErr.Error(), Code: revertErr.ErrorCode(), Data: revertErr.ErrorData().(string)}
Comment on lines 220 to +223
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The revert path now returns Code: revertErr.ErrorCode() (3). There isn’t currently a regression test covering the eth_simulateV1 response’s per-call error code for reverts, so this behavior could easily drift again. Consider adding a unit/integration test that executes a simulated call which reverts and asserts calls[i].error.code == 3 (and that error.data matches the revert hex payload).

Copilot uses AI. Check for mistakes.
} else {
callRes.Error = &callError{Message: result.Err.Error(), Code: errCodeVMError}
}
Expand Down
Loading