From f79115b429e51e1b658e83b8a66d8f7b3f5258da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 14 Jan 2025 08:29:51 +0100 Subject: [PATCH] evm: de-duplicate bailout flag (#2653) --- silkworm/core/execution/processor.cpp | 8 ++++---- silkworm/core/execution/processor.hpp | 2 +- silkworm/rpc/core/evm_executor.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/silkworm/core/execution/processor.cpp b/silkworm/core/execution/processor.cpp index e00a8ee8bd..e0b3cdf989 100644 --- a/silkworm/core/execution/processor.cpp +++ b/silkworm/core/execution/processor.cpp @@ -258,13 +258,13 @@ void ExecutionProcessor::execute_transaction(const Transaction& txn, Receipt& re check_evm1_execution_result(evm1_receipt.state_diff, state_); } -CallResult ExecutionProcessor::call(const Transaction& txn, const std::vector>& tracers, bool bailout, bool refund) noexcept { +CallResult ExecutionProcessor::call(const Transaction& txn, const std::vector>& tracers, bool refund) noexcept { const std::optional sender{txn.sender()}; SILKWORM_ASSERT(sender); SILKWORM_ASSERT(protocol::validate_call_precheck(txn, evm_) == ValidationResult::kOk); - if (!bailout) { + if (!evm().bailout) { SILKWORM_ASSERT(protocol::validate_call_funds(txn, evm_, state_.get_balance(*txn.sender())) == ValidationResult::kOk); } @@ -284,7 +284,7 @@ CallResult ExecutionProcessor::call(const Transaction& txn, const std::vector>& tracers, bool bailout, bool refund) noexcept; + CallResult call(const Transaction& txn, const std::vector>& tracers, bool refund) noexcept; //! \brief Execute the block. //! \remarks Warning: This method does not verify state root; pre-Byzantium receipt root isn't validated either. diff --git a/silkworm/rpc/core/evm_executor.cpp b/silkworm/rpc/core/evm_executor.cpp index 8c9a8989b1..a5b97bd4ec 100644 --- a/silkworm/rpc/core/evm_executor.cpp +++ b/silkworm/rpc/core/evm_executor.cpp @@ -245,7 +245,7 @@ ExecutionResult EVMExecutor::call( return convert_validated_funds(block, txn, evm, owned_funds); } - const auto result = execution_processor_.call(txn, tracers, bailout, refund); + const auto result = execution_processor_.call(txn, tracers, refund); ExecutionResult exec_result{result.status, result.gas_left, result.data};