From a0072ef53dd31c22b02e34d68adb5df5a5637c71 Mon Sep 17 00:00:00 2001 From: Gabriel Fukushima Date: Tue, 27 Feb 2024 09:32:37 +1000 Subject: [PATCH] remove unnecessary PoS checkpoint methods and variables (#6603) Signed-off-by: Gabriel Fukushima --- .../controller/MergeBesuControllerBuilder.java | 1 - .../besu/consensus/merge/MergeContext.java | 7 ------- .../besu/consensus/merge/PostMergeContext.java | 18 ------------------ .../consensus/merge/TransitionContext.java | 5 ----- 4 files changed, 31 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java index 50abcedbfd2..62bce6ac69b 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java @@ -198,7 +198,6 @@ protected MergeContext createConsensusContext( .getTerminalTotalDifficulty() .map(Difficulty::of) .orElse(Difficulty.ZERO)) - .setCheckpointPostMergeSync(syncConfig.isCheckpointPostMergeEnabled()) .setPostMergeAtGenesis(isPostMergeAtGenesis); blockchain diff --git a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/MergeContext.java b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/MergeContext.java index 9db6a97a0ca..b875a2d7c73 100644 --- a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/MergeContext.java +++ b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/MergeContext.java @@ -185,13 +185,6 @@ default boolean isChainPruningEnabled() { return false; } - /** - * Is checkpoint post merge sync. - * - * @return the boolean - */ - boolean isCheckpointPostMergeSync(); - /** * Is configured for a post-merge from genesis. * diff --git a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/PostMergeContext.java b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/PostMergeContext.java index 08985ed326b..5cf4cc44038 100644 --- a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/PostMergeContext.java +++ b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/PostMergeContext.java @@ -70,7 +70,6 @@ public class PostMergeContext implements MergeContext { private final AtomicReference> terminalPoWBlock = new AtomicReference<>(Optional.empty()); private final BlockValueCalculator blockValueCalculator = new BlockValueCalculator(); - private boolean isCheckpointPostMergeSync; private boolean isPostMergeAtGenesis; // TODO: cleanup - isChainPruningEnabled will not be required after @@ -92,7 +91,6 @@ public class PostMergeContext implements MergeContext { PostMergeContext(final Difficulty difficulty) { this.terminalTotalDifficulty = new AtomicReference<>(difficulty); this.syncState = new AtomicReference<>(); - this.isCheckpointPostMergeSync = false; } /** @@ -314,22 +312,6 @@ public boolean isChainPruningEnabled() { return isChainPruningEnabled; } - /** - * Sets checkpoint post merge sync. - * - * @param isCheckpointPostMergeSync the is checkpoint post merge sync - * @return the checkpoint post merge sync - */ - public PostMergeContext setCheckpointPostMergeSync(final boolean isCheckpointPostMergeSync) { - this.isCheckpointPostMergeSync = isCheckpointPostMergeSync; - return this; - } - - @Override - public boolean isCheckpointPostMergeSync() { - return this.isCheckpointPostMergeSync; - } - @Override public boolean isPostMergeAtGenesis() { return this.isPostMergeAtGenesis; diff --git a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/TransitionContext.java b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/TransitionContext.java index 35e51db563e..71353edd0df 100644 --- a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/TransitionContext.java +++ b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/TransitionContext.java @@ -149,11 +149,6 @@ public Optional retrieveBlockById(final PayloadIdentifier pay return postMergeContext.retrieveBlockById(payloadId); } - @Override - public boolean isCheckpointPostMergeSync() { - return false; - } - @Override public boolean isPostMergeAtGenesis() { return postMergeContext.isPostMergeAtGenesis();