core: fix nonce overflow validation logic

This commit is contained in:
Alex Pikme 2025-10-09 11:05:37 +02:00 committed by GitHub
parent 695c1445ab
commit 2079bf8fa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -319,7 +319,7 @@ func (st *stateTransition) preCheck() error {
} else if stNonce > msgNonce { } else if stNonce > msgNonce {
return fmt.Errorf("%w: address %v, tx: %d state: %d", ErrNonceTooLow, return fmt.Errorf("%w: address %v, tx: %d state: %d", ErrNonceTooLow,
msg.From.Hex(), msgNonce, stNonce) msg.From.Hex(), msgNonce, stNonce)
} else if stNonce+1 < stNonce { } else if stNonce == math.MaxUint64 {
return fmt.Errorf("%w: address %v, nonce: %d", ErrNonceMax, return fmt.Errorf("%w: address %v, nonce: %d", ErrNonceMax,
msg.From.Hex(), stNonce) msg.From.Hex(), stNonce)
} }