Skip to content

Commit

Permalink
For TimestampSchedule (Shanghai) remove evmBuilder override but leave…
Browse files Browse the repository at this point in the history
… other mods in

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
  • Loading branch information
siladu committed Dec 29, 2022
1 parent e97c134 commit d152fbf
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,26 @@ public static TimestampSchedule createTimestamp(
DEFAULT_CHAIN_ID,
ProtocolSpecAdapters.create(
config.getShanghaiTime().orElse(0),
(specBuilder) ->
MergeProtocolSchedule.applyMergeSpecificModifications(
specBuilder, config.getChainId())),
MergeProtocolSchedule::applyMergeSpecificModificationsForShanghai),
privacyParameters,
isRevertReasonEnabled,
config.isQuorum(),
EvmConfiguration.DEFAULT)
.createTimestampSchedule();
}

// TODO Withdrawals remove this as part of https://github.com/hyperledger/besu/issues/4788
private static ProtocolSpecBuilder applyMergeSpecificModificationsForShanghai(
final ProtocolSpecBuilder specBuilder) {

return specBuilder
.blockProcessorBuilder(MergeBlockProcessor::new)
.blockHeaderValidatorBuilder(MergeProtocolSchedule::getBlockHeaderValidator)
.blockReward(Wei.ZERO)
.difficultyCalculator((a, b, c) -> BigInteger.ZERO)
.skipZeroBlockRewards(true);
}

private static ProtocolSpecBuilder applyMergeSpecificModifications(
final ProtocolSpecBuilder specBuilder, final Optional<BigInteger> chainId) {

Expand Down

0 comments on commit d152fbf

Please sign in to comment.