Skip to content

Commit

Permalink
pass EvmWorldStateUpdater to tracer at end of transaction
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
  • Loading branch information
lu-pinto committed Nov 8, 2024
1 parent 640d3ba commit de7871d
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ public TransactionProcessingResult processTransaction(
accessListGas,
codeDelegationGas);

final WorldUpdater worldUpdater = evmWorldUpdater.updater();
operationTracer.traceStartTransaction(evmWorldUpdater, transaction);

final ImmutableMap.Builder<String, Object> contextVariablesBuilder =
ImmutableMap.<String, Object>builder()
.put(KEY_IS_PERSISTING_PRIVATE_STATE, isPersistingPrivateState)
Expand All @@ -397,8 +398,7 @@ public TransactionProcessingResult processTransaction(
contextVariablesBuilder.put(KEY_PRIVATE_METADATA_UPDATER, privateMetadataUpdater);
}

operationTracer.traceStartTransaction(worldUpdater, transaction);

final WorldUpdater worldUpdater = evmWorldUpdater.updater();
final MessageFrame.Builder commonMessageFrameBuilder =
MessageFrame.builder()
.maxStackSize(maxStackSize)
Expand Down Expand Up @@ -531,13 +531,14 @@ public TransactionProcessingResult processTransaction(
final Wei coinbaseWeiDelta =
coinbaseCalculator.price(usedGas, transactionGasPrice, blockHeader.getBaseFee());

operationTracer.traceBeforeRewardTransaction(worldUpdater, transaction, coinbaseWeiDelta);
operationTracer.traceBeforeRewardTransaction(evmWorldUpdater.updater(), transaction, coinbaseWeiDelta);

final var coinbase = evmWorldUpdater.getOrCreate(miningBeneficiary);
coinbase.incrementBalance(coinbaseWeiDelta);

operationTracer.traceEndTransaction(
worldUpdater,
evmWorldUpdater.updater(),

transaction,
initialFrame.getState() == MessageFrame.State.COMPLETED_SUCCESS,
initialFrame.getOutputData(),
Expand Down

0 comments on commit de7871d

Please sign in to comment.