Skip to content

Commit

Permalink
Fix tracing for block 1
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacolvin0 committed Sep 20, 2022
1 parent e97c1a4 commit 8ce0d72
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/arb-avm-cpp/data_storage/src/arbcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3045,11 +3045,13 @@ ArbCore::getExecutionCursorAtEndOfBlock(const uint256_t& block_number,
std::unique_ptr<ExecutionCursor> execution_cursor;
{
ReadSnapshotTransaction tx(data_storage);
auto gas_used_result = getGasAtBlock(tx, block_number);
if (!gas_used_result.status.ok()) {
return gas_used_result.status;
if (block_number > 0) {
auto gas_used_result = getGasAtBlock(tx, block_number);
if (!gas_used_result.status.ok()) {
return gas_used_result.status;
}
gas_target = gas_used_result.data;
}
gas_target = gas_used_result.data;

auto closest_checkpoint = findCloserExecutionCursor(
tx, std::nullopt, gas_target, allow_slow_lookup);
Expand Down

0 comments on commit 8ce0d72

Please sign in to comment.