feat: add `OperationTracer.tracePrepareTransaction` (#6453)

* feat: add `OperationTracer.tracePrepareTransaction`

Signed-off-by: Franklin Delehelle <franklin.delehelle@odena.eu>
pull/6456/head
delehef 10 months ago committed by GitHub
parent b90d0ed521
commit 928b34d95f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      besu/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java
  3. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetTransactionProcessor.java
  4. 1
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nExecutor.java
  5. 10
      evm/src/main/java/org/hyperledger/besu/evm/tracing/OperationTracer.java

@ -7,6 +7,7 @@
### Deprecations
### Additions and Improvements
- Add `OperationTracer.tracePrepareTransaction`, where the sender account has not yet been altered[#6453](https://github.com/hyperledger/besu/pull/6453)
### Bug fixes
- Fix the way an advertised host configured with `--p2p-host` is treated when communicating with the originator of a PING packet [#6225](https://github.com/hyperledger/besu/pull/6225)

@ -115,6 +115,7 @@ class TraceServiceImplTest {
.getTransactions()
.forEach(
tx -> {
verify(opTracer).tracePrepareTransaction(any(), eq(tx));
verify(opTracer).traceStartTransaction(any(), eq(tx));
verify(opTracer)
.traceEndTransaction(
@ -162,6 +163,7 @@ class TraceServiceImplTest {
.getTransactions()
.forEach(
tx -> {
verify(opTracer).tracePrepareTransaction(any(), eq(tx));
verify(opTracer).traceStartTransaction(any(), eq(tx));
verify(opTracer)
.traceEndTransaction(

@ -293,6 +293,8 @@ public class MainnetTransactionProcessor {
return TransactionProcessingResult.invalid(validationResult);
}
operationTracer.tracePrepareTransaction(worldState, transaction);
final long previousNonce = sender.incrementNonce();
LOG.trace(
"Incremented sender {} nonce ({} -> {})",

@ -271,6 +271,7 @@ public class T8nExecutor {
final TransactionProcessingResult result;
try {
tracer = tracerManager.getManagedTracer(i, transaction.getHash());
tracer.tracePrepareTransaction(worldStateUpdater, transaction);
tracer.traceStartTransaction(worldStateUpdater, transaction);
result =
processor.processTransaction(

@ -68,7 +68,15 @@ public interface OperationTracer {
final MessageFrame frame, final Optional<ExceptionalHaltReason> haltReason) {}
/**
* Trace the start of a transaction.
* Trace the start of a transaction, before sender account alteration but after validation.
*
* @param worldView an immutable view of the execution context
* @param transaction the transaction which will be processed
*/
default void tracePrepareTransaction(final WorldView worldView, final Transaction transaction) {}
/**
* Trace the start of a transaction, before execution but after sender account alteration.
*
* @param worldView an immutable view of the execution context
* @param transaction the transaction which will be processed

Loading…
Cancel
Save