mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Fix issue with different state depending on input order.
This commit fixes the issue where the submission of a transaction with an authority which already has a pending transaction would fail. While submitting the authorization first and the transaction second would work. This is unexpected because when using gap nonces, the behavior could still be correct according to the limitations introduced for the EIP -27702.
This commit is contained in:
parent
9fe8e2bab8
commit
00a4aa7f69
1 changed files with 13 additions and 2 deletions
|
|
@ -633,10 +633,21 @@ func (pool *LegacyPool) validateAuth(tx *types.Transaction) error {
|
|||
return ErrInflightTxLimitReached
|
||||
}
|
||||
}
|
||||
// Authorities cannot conflict with any pending or queued transactions.
|
||||
// For symmetry, Allow at most one in-flight tx for any authority with a pending
|
||||
// transaction
|
||||
if auths := tx.SetCodeAuthorities(); len(auths) > 0 {
|
||||
for _, auth := range auths {
|
||||
if pool.pending[auth] != nil || pool.queue[auth] != nil {
|
||||
var count int
|
||||
pending := pool.pending[auth]
|
||||
|
||||
if pending != nil {
|
||||
count += pending.Len()
|
||||
}
|
||||
queue := pool.queue[auth]
|
||||
if queue != nil {
|
||||
count += queue.Len()
|
||||
}
|
||||
if count > 1 {
|
||||
return ErrAuthorityReserved
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue