Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
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
7 changes: 5 additions & 2 deletions eth/vm/forks/frontier/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ def validate_frontier_transaction(state: StateAPI,
if sender_balance < total_cost:
raise ValidationError("Sender account balance cannot afford txn")

if state.get_nonce(transaction.sender) != transaction.nonce:
raise ValidationError("Invalid transaction nonce")
sender_nonce = state.get_nonce(transaction.sender)
if sender_nonce != transaction.nonce:
raise ValidationError(
f"Invalid transaction nonce: Expected {sender_nonce}, but got {transaction.nonce}"
)


def validate_frontier_transaction_against_header(_vm: VirtualMachineAPI,
Expand Down
1 change: 1 addition & 0 deletions newsfragments/1936.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve the error when transaction nonce is invalid: include expected and actual.