4444#include < category/execution/ethereum/evmc_host.hpp>
4545#include < category/execution/ethereum/execute_block.hpp>
4646#include < category/execution/ethereum/execute_transaction.hpp>
47+ #include < category/execution/ethereum/rlp/decode.hpp>
4748#include < category/execution/ethereum/state2/block_state.hpp>
4849#include < category/execution/ethereum/state3/state.hpp>
4950#include < category/execution/ethereum/trace/call_frame.hpp>
7879#include < cstring>
7980#include < filesystem>
8081#include < format>
81- #include < iostream>
8282#include < memory>
8383#include < optional>
8484#include < span>
@@ -535,10 +535,10 @@ namespace
535535 std::vector<std::unique_ptr<trace::StateTracer>>{};
536536 state_tracers.reserve (calls[block_idx].size ());
537537
538- for (auto tx_idx = 0u ; tx_idx < calls[block_idx]. size (); ++tx_idx ) {
538+ for (Transaction const &tx : calls[block_idx]) {
539539 call_frames.emplace_back ();
540- call_tracers.emplace_back (std::make_unique<CallTracer>(
541- calls[block_idx][tx_idx] , call_frames.back ()));
540+ call_tracers.emplace_back (
541+ std::make_unique<CallTracer>(tx , call_frames.back ()));
542542 state_tracers.emplace_back (
543543 std::make_unique<trace::StateTracer>());
544544 }
@@ -1613,8 +1613,15 @@ struct monad_executor
16131613 complete = complete,
16141614 result = result,
16151615 user = user]() {
1616- // TODO(BSC): fiber group
1617- (void )fiber_group;
1616+ fiber_group->queued_count .fetch_sub (
1617+ 1 , std::memory_order_relaxed);
1618+ fiber_group->executing_count .fetch_add (
1619+ 1 , std::memory_order_relaxed);
1620+ BOOST_SCOPE_EXIT_ALL (&fiber_group)
1621+ {
1622+ fiber_group->executing_count .fetch_sub (
1623+ 1 , std::memory_order_relaxed);
1624+ };
16181625
16191626 auto const res = [&]() -> Result<nlohmann::json> {
16201627 auto authorities = std::vector<
@@ -1658,7 +1665,7 @@ struct monad_executor
16581665 MONAD_ASSERT (false );
16591666 }();
16601667
1661- LazyBlockHash block_hash_buffer{db, block_number};
1668+ LazyBlockHash const block_hash_buffer{db, block_number};
16621669 TrieRODb tdb{db};
16631670
16641671 if (chain_config == CHAIN_CONFIG_ETHEREUM_MAINNET) {
@@ -1938,13 +1945,13 @@ void monad_executor_eth_simulate_submit(
19381945 auto const maybe_senders =
19391946 decode_nested_items<rlp::decode_address, false >(rlp_senders_view);
19401947 MONAD_ASSERT (maybe_senders.has_value ());
1941- auto const senders = maybe_senders.assume_value ();
1948+ auto const & senders = maybe_senders.assume_value ();
19421949
19431950 byte_string_view rlp_calls_view{rlp_calls, rlp_calls_len};
19441951 auto const maybe_txns =
19451952 decode_nested_items<rlp::decode_transaction, true >(rlp_calls_view);
19461953 MONAD_ASSERT (maybe_txns.has_value ());
1947- auto const txns = maybe_txns.assume_value ();
1954+ auto const & txns = maybe_txns.assume_value ();
19481955
19491956 MONAD_ASSERT (senders.size () == txns.size ());
19501957 MONAD_ASSERT (n_state_overrides == txns.size ());
@@ -1963,8 +1970,8 @@ void monad_executor_eth_simulate_submit(
19631970
19641971 executor->submit_eth_simulate_to_pool (
19651972 chain_config,
1966- std::move ( txns) ,
1967- std::move ( senders) ,
1973+ txns,
1974+ senders,
19681975 std::span{state_overrides, n_state_overrides},
19691976 block_header,
19701977 block_number,
0 commit comments