Skip to content

Commit

Permalink
Remove isChainPruneEnabled from MergeContext interface (#6672)
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
  • Loading branch information
gfukushima committed Mar 6, 2024
1 parent eeb997f commit 244c814
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,6 @@ public BesuController build() {
validateContext(protocolContext);

if (chainPrunerConfiguration.getChainPruningEnabled()) {
protocolContext
.safeConsensusContext(MergeContext.class)
.ifPresent(mergeContext -> mergeContext.setIsChainPruningEnabled(true));
final ChainDataPruner chainDataPruner = createChainPruner(blockchainStorage);
blockchain.observeBlockAdded(chainDataPruner);
LOG.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,6 @@ void fireNewUnverifiedForkchoiceEvent(
*/
Optional<BlockWithReceipts> retrieveBlockById(final PayloadIdentifier payloadId);

/**
* Sets is chain pruning enabled.
*
* @param isChainPruningEnabled whether chain pruning is enabled
*/
default void setIsChainPruningEnabled(final boolean isChainPruningEnabled) {}

/**
* Is chain pruning enabled.
*
* @return the boolean
*/
default boolean isChainPruningEnabled() {
return false;
}

/**
* Is configured for a post-merge from genesis.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ public class PostMergeContext implements MergeContext {
private final BlockValueCalculator blockValueCalculator = new BlockValueCalculator();
private boolean isPostMergeAtGenesis;

// TODO: cleanup - isChainPruningEnabled will not be required after
// https://github.com/hyperledger/besu/pull/4703 is merged.
private boolean isChainPruningEnabled = false;

/** Instantiates a new Post merge context. */
@VisibleForTesting
PostMergeContext() {
Expand Down Expand Up @@ -302,16 +298,6 @@ private String logBlockProposal(final Block block) {
+ block.getBody().getTransactions().size();
}

@Override
public void setIsChainPruningEnabled(final boolean isChainPruningEnabled) {
this.isChainPruningEnabled = isChainPruningEnabled;
}

@Override
public boolean isChainPruningEnabled() {
return isChainPruningEnabled;
}

@Override
public boolean isPostMergeAtGenesis() {
return this.isPostMergeAtGenesis;
Expand Down

0 comments on commit 244c814

Please sign in to comment.