From 1e5fb574957d7ecba4a1a5508cb163981ea448e5 Mon Sep 17 00:00:00 2001 From: Rohit Ranjan Date: Tue, 6 Aug 2024 17:10:05 +0530 Subject: [PATCH 1/2] fix eth_gasEstimate issue --- src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs b/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs index bc784f520d3..74e5ec28fc2 100644 --- a/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs +++ b/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs @@ -45,7 +45,7 @@ public GasEstimator(ITransactionProcessor transactionProcessor, IReadOnlyStatePr // Calculate and return additional gas required in case of insufficient funds. UInt256 senderBalance = _stateProvider.GetBalance(tx.SenderAddress); - if (tx.Value != UInt256.Zero && tx.Value > senderBalance) + if (tx.Value != UInt256.Zero && tx.Value > senderBalance && tx.SenderAddress != Address.SystemUser) { return gasTracer.CalculateAdditionalGasRequired(tx, releaseSpec); } From b991e266108a0e8c3230c98a4c12d246f81962da Mon Sep 17 00:00:00 2001 From: Rohit Ranjan Date: Wed, 7 Aug 2024 22:06:45 +0530 Subject: [PATCH 2/2] address comments --- src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs b/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs index 74e5ec28fc2..a673ef8b657 100644 --- a/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs +++ b/src/Nethermind/Nethermind.Evm/Tracing/GasEstimator.cs @@ -45,7 +45,7 @@ public GasEstimator(ITransactionProcessor transactionProcessor, IReadOnlyStatePr // Calculate and return additional gas required in case of insufficient funds. UInt256 senderBalance = _stateProvider.GetBalance(tx.SenderAddress); - if (tx.Value != UInt256.Zero && tx.Value > senderBalance && tx.SenderAddress != Address.SystemUser) + if (tx.Value != UInt256.Zero && tx.Value > senderBalance && !tx.IsSystem()) { return gasTracer.CalculateAdditionalGasRequired(tx, releaseSpec); }