From 00a4aa7f69e7b175fb93a83d5f0d0896088f98fa Mon Sep 17 00:00:00 2001 From: Luis Ayuso Date: Mon, 10 Mar 2025 12:29:52 +0100 Subject: [PATCH] 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. --- core/txpool/legacypool/legacypool.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 1cc6856663..eb86bc4bda 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -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 } }