Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate BlockAwareOperationTracer::traceStartBlock(BlockHeader, BlockBody, [Address]) #8121

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private List<TransactionProcessingResult> trace(
final BlockHeader header = block.getHeader();
final Address miningBeneficiary =
protocolSpec.getMiningBeneficiaryCalculator().calculateBeneficiary(block.getHeader());
tracer.traceStartBlock(block.getHeader(), block.getBody(), miningBeneficiary);
tracer.traceStartBlock(block.getHeader(), miningBeneficiary);

block
.getBody()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.hyperledger.besu.plugin.data.BlockBody;
import org.hyperledger.besu.plugin.data.BlockHeader;
import org.hyperledger.besu.plugin.data.BlockTraceResult;
import org.hyperledger.besu.plugin.data.ProcessableBlockHeader;
import org.hyperledger.besu.plugin.data.TransactionTraceResult;
import org.hyperledger.besu.plugin.services.TraceService;
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat;
Expand Down Expand Up @@ -116,7 +117,7 @@ void shouldRetrieveStateUpdatePostTracingForOneBlock() {

verify(opTracer)
.traceStartBlock(
tracedBlock.getHeader(), tracedBlock.getBody(), tracedBlock.getHeader().getCoinbase());
tracedBlock.getHeader(), tracedBlock.getHeader().getCoinbase());

tracedBlock
.getBody()
Expand Down Expand Up @@ -168,7 +169,6 @@ void shouldRetrieveStateUpdatePostTracingForAllBlocks() {
verify(opTracer)
.traceStartBlock(
tracedBlock.getHeader(),
tracedBlock.getBody(),
tracedBlock.getHeader().getCoinbase());
tracedBlock
.getBody()
Expand Down Expand Up @@ -282,7 +282,7 @@ private static class TxStartEndTracer implements BlockAwareOperationTracer {

private final Set<Transaction> traceStartTxCalled = new HashSet<>();
private final Set<Transaction> traceEndTxCalled = new HashSet<>();
private final Set<Hash> traceStartBlockCalled = new HashSet<>();
private final Set<ProcessableBlockHeader> traceStartBlockCalled = new HashSet<>();
private final Set<Hash> traceEndBlockCalled = new HashSet<>();

@Override
Expand Down Expand Up @@ -319,8 +319,8 @@ public void traceEndTransaction(

@Override
public void traceStartBlock(
final BlockHeader blockHeader, final BlockBody blockBody, final Address miningBeneficiary) {
if (!traceStartBlockCalled.add(blockHeader.getBlockHash())) {
final ProcessableBlockHeader blockHeader, final Address miningBeneficiary) {
if (!traceStartBlockCalled.add(blockHeader)) {
fail("traceStartBlock already called for block " + blockHeader);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public InterruptibleOperationTracer(final BlockAwareOperationTracer delegate) {

@Override
public void traceStartBlock(
final BlockHeader blockHeader, final BlockBody blockBody, final Address miningBeneficiary) {
delegate.traceStartBlock(blockHeader, blockBody, miningBeneficiary);
final BlockHeader blockHeader, final BlockBody blockBody) {
delegate.traceStartBlock(blockHeader, blockBody);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface BlockAwareOperationTracer extends OperationTracer {

/**
* Trace the start of a block. Notice: This method has been marked for removal and will be removed
* in a future version. Avoid using it and use {@link #traceStartBlock(BlockHeader, BlockBody,
* in a future version. Avoid using it and use {@link #traceStartBlock(ProcessableBlockHeader,
* Address)} instead.
*
* @param blockHeader the header of the block which is traced
Expand All @@ -44,24 +44,6 @@ public interface BlockAwareOperationTracer extends OperationTracer {
@Deprecated
default void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {}

/**
* Trace the start of a block.
*
* @param blockHeader the header of the block which is traced
* @param blockBody the body of the block which is traced
* @param miningBeneficiary the address of miner building the block
*/
default void traceStartBlock(
final BlockHeader blockHeader, final BlockBody blockBody, final Address miningBeneficiary) {}

/**
* Trace the end of a block.
*
* @param blockHeader the header of the block which is traced
* @param blockBody the body of the block which is traced
*/
default void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {}

/**
* When building a block this API is called at the start of the process. Notice: This method has
* been marked for removal and will be removed in a future version. Avoid using it and use {@link
Expand All @@ -81,6 +63,14 @@ default void traceStartBlock(final ProcessableBlockHeader processableBlockHeader
default void traceStartBlock(
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {}

/**
* Trace the end of a block.
*
* @param blockHeader the header of the block which is traced
* @param blockBody the body of the block which is traced
*/
default void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {}

@Override
default boolean isExtendedTracing() {
return true;
Expand Down
Loading