From 91ff270cd98c999662281570b73b6c082931b771 Mon Sep 17 00:00:00 2001 From: Arpit Temani Date: Thu, 30 Nov 2023 15:35:46 +0530 Subject: [PATCH 1/3] allow unprotected txns --- core/txpool/legacypool/legacypool.go | 16 +++++++++++-- core/txpool/validation.go | 4 +++- core/types/transaction_signing.go | 35 ++++++++++++++++++++++++++++ eth/backend.go | 2 -- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index db4af0ee8d..d37f5ef4bc 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -159,7 +159,8 @@ var DefaultConfig = Config{ AccountQueue: 64, GlobalQueue: 1024, - Lifetime: 3 * time.Hour, + Lifetime: 3 * time.Hour, + AllowUnprotectedTxs: false, } // sanitize checks the provided user configurations and changes anything that's @@ -590,7 +591,8 @@ func (pool *LegacyPool) local() map[common.Address]types.Transactions { // and does not require the pool mutex to be held. func (pool *LegacyPool) validateTxBasics(tx *types.Transaction, local bool) error { opts := &txpool.ValidationOptions{ - Config: pool.chainconfig, + Config: pool.chainconfig, + AllowUnprotectedTxs: pool.config.AllowUnprotectedTxs, Accept: 0 | 1< Date: Sun, 3 Dec 2023 17:14:57 +0530 Subject: [PATCH 2/3] Update core/txpool/validation.go Co-authored-by: Raneet Debnath <35629432+Raneet10@users.noreply.github.com> --- core/txpool/validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/txpool/validation.go b/core/txpool/validation.go index c066474f8f..fd588dcd44 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -93,7 +93,7 @@ func ValidateTransaction(tx *types.Transaction, blobs []kzg4844.Blob, commits [] return core.ErrTipAboveFeeCap } // Make sure the transaction is signed properly - if _, err := types.Sender(signer, tx); err != nil || !opts.AllowUnprotectedTxs { + if _, err := types.Sender(signer, tx); err != nil && !opts.AllowUnprotectedTxs { return ErrInvalidSender } // Ensure the transaction has more gas than the bare minimum needed to cover From 4e3e1de14c2cee4d5f9c7eebeef7c0de7c07b992 Mon Sep 17 00:00:00 2001 From: Arpit Temani Date: Sun, 3 Dec 2023 17:16:37 +0530 Subject: [PATCH 3/3] added log --- eth/backend.go | 1 + 1 file changed, 1 insertion(+) diff --git a/eth/backend.go b/eth/backend.go index 0798ef59e3..5c440aa64b 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -168,6 +168,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil} if eth.APIBackend.allowUnprotectedTxs { + log.Info("------Unprotected transactions allowed-------") config.TxPool.AllowUnprotectedTxs = true }