@@ -629,10 +629,10 @@ func (pool *LegacyPool) validateTxBasics(tx *types.Transaction, local bool) erro
629
629
opts := & txpool.ValidationOptions {
630
630
Config : pool .chainconfig ,
631
631
Accept : 0 |
632
- 1 << types .LegacyTxType |
633
- 1 << types .AccessListTxType |
634
- 1 << types .DynamicFeeTxType |
635
- 1 << types .SetCodeTxType ,
632
+ 1 << types .LegacyTxType |
633
+ 1 << types .AccessListTxType |
634
+ 1 << types .DynamicFeeTxType |
635
+ 1 << types .SetCodeTxType ,
636
636
MaxSize : txMaxSize ,
637
637
MinTip : pool .gasTip .Load (),
638
638
AcceptSponsoredTx : true ,
@@ -702,6 +702,17 @@ func (pool *LegacyPool) validateAuth(tx *types.Transaction) error {
702
702
return ErrInflightTxLimitReached
703
703
}
704
704
}
705
+ // Allow at most one in-flight tx for delegated accounts or those with a
706
+ // pending authorization in case of sponsor tx.
707
+ if tx .Type () == types .SponsoredTxType {
708
+ payer , err := types .Payer (pool .signer , tx )
709
+ if err != nil {
710
+ return err
711
+ }
712
+ if pool .currentState .GetCodeHash (payer ) != types .EmptyCodeHash || len (pool .all .auths [payer ]) != 0 {
713
+ return ErrInflightTxLimitReached
714
+ }
715
+ }
705
716
// Authorities cannot conflict with any pending or queued transactions.
706
717
if auths := tx .SetCodeAuthorities (); len (auths ) > 0 {
707
718
for _ , auth := range auths {
@@ -1740,7 +1751,7 @@ func (pool *LegacyPool) demoteUnexecutables() {
1740
1751
}
1741
1752
}
1742
1753
1743
- // Clear implements txpool.SubPool, removing all tracked txs from the pool
1754
+ // Clear removing all tracked txs from the pool
1744
1755
// and rotating the journal.
1745
1756
func (pool * LegacyPool ) Clear () {
1746
1757
pool .mu .Lock ()
0 commit comments