Skip to content

Commit 8920055

Browse files
committed
move db finalize and update_verified_block out of process_ethereum_block
1 parent 84a8aca commit 8920055

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/monad/runloop_ethereum.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@ Result<BlockHeader> process_ethereum_block(
171171
BOOST_OUTCOME_TRY(
172172
chain.validate_output_header(block.header, output_header));
173173

174-
// Commit prologue: database finalization, computation of the Ethereum
175-
// block hash to append to the circular hash buffer
176-
db.finalize(block.header.number, block_id);
177-
db.update_verified_block(block.header.number);
178-
179174
// Emit the block metrics log line
180175
[[maybe_unused]] auto const block_time =
181176
std::chrono::duration_cast<std::chrono::microseconds>(
@@ -260,6 +255,10 @@ Result<std::pair<uint64_t, uint64_t>> runloop_ethereum(
260255
MONAD_ABORT_PRINTF("unhandled rev switch case: %d", rev);
261256
}());
262257

258+
// Commit prologue: database finalization, computation of the Ethereum
259+
// block hash to append to the circular hash buffer
260+
db.finalize(block.header.number, block_id);
261+
db.update_verified_block(block.header.number);
263262
bytes32_t const eth_block_hash =
264263
to_bytes(keccak256(rlp::encode_block_header(output_header)));
265264
block_hash_buffer.set(block.header.number, eth_block_hash);

0 commit comments

Comments
 (0)