Skip to content

Commit 7e2b658

Browse files
committed
Move recover authority logic inside submitted lambda
Since submit_eth_call_to_pool() is called from rust thread, blocking on fiber promises is not appropriate and can lead to performance issues. Move recovert_authorities() logic inside lambda executed in fiber pool. Since eth call txn has single authority, parallelization logic inside recover_authorities() only intoduces overhead without benefits. Replace parallelization with single call to recover_authority().
1 parent de74e03 commit 7e2b658

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

category/rpc/eth_call.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <category/execution/ethereum/core/transaction.hpp>
3131
#include <category/execution/ethereum/db/trie_rodb.hpp>
3232
#include <category/execution/ethereum/evmc_host.hpp>
33-
#include <category/execution/ethereum/execute_block.hpp>
3433
#include <category/execution/ethereum/execute_transaction.hpp>
3534
#include <category/execution/ethereum/state2/block_state.hpp>
3635
#include <category/execution/ethereum/state3/state.hpp>
@@ -598,9 +597,6 @@ struct monad_eth_call_executor
598597
return;
599598
}
600599

601-
auto const authorities = recover_authorities({txn}, active_pool.pool);
602-
MONAD_ASSERT(authorities.size() == 1);
603-
604600
active_pool.pool.submit(
605601
eth_call_seq_no,
606602
[this,
@@ -613,7 +609,6 @@ struct monad_eth_call_executor
613609
block_id = block_id,
614610
&db = db_,
615611
sender = sender,
616-
authorities = authorities[0],
617612
result = result,
618613
complete = complete,
619614
user = user,
@@ -640,6 +635,15 @@ struct monad_eth_call_executor
640635
complete(result, user);
641636
return;
642637
}
638+
639+
std::vector<std::optional<Address>> authorities(
640+
orig_txn.authorization_list.size());
641+
for (auto j = 0u; j < orig_txn.authorization_list.size();
642+
++j) {
643+
authorities[j] =
644+
recover_authority(orig_txn.authorization_list[j]);
645+
}
646+
643647
auto transaction = orig_txn;
644648

645649
bool const override_with_low_gas_retry_if_oog =

0 commit comments

Comments
 (0)