Clique block period transition#6596
Conversation
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
|
…locks Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
...ensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueProtocolSchedule.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
…locks Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
…locks Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
fab-10
left a comment
There was a problem hiding this comment.
looks good, just would avoid having the mutable config class, and minor stuffs
config/src/main/java/org/hyperledger/besu/config/JsonCliqueConfigOptions.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockScheduler.java
Outdated
Show resolved
Hide resolved
...reation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/DefaultBlockScheduler.java
Outdated
Show resolved
Hide resolved
| final MutableCliqueConfigOptions cliqueConfigOptions = | ||
| new MutableCliqueConfigOptions(lastSpec.getValue()); | ||
|
|
||
| fork.getBlockPeriodSeconds().ifPresent(cliqueConfigOptions::setBlockPeriodSeconds); | ||
|
|
||
| return cliqueConfigOptions; |
There was a problem hiding this comment.
From what I see, there should not be a need for this mutable object, since if you use immutables annotation for CliqueConfigOptions then you can do something like this
var next = ImmutableCliqueConfigOptions.builder().from(lastSpec.getValue());
fork.getBlockPeriodSeconds().ifPresent(next::blockPeriodSeconds);
return next.build();
and avoid having mutable objects around, since the conf should newer change once it is created.
There was a problem hiding this comment.
This Mutable*ConfigOptions approach is pretty ingrained in the transition functionality used throughout the codebase, ie for BFT too. Can spike this out unless @jframe already knows there would be an issue with this?
There was a problem hiding this comment.
Should be fine to change it using a builder. It's only mutable for building the CliqueConfigOptions from the transitions.
There was a problem hiding this comment.
done this for Clique, but not BFT
There was a problem hiding this comment.
fine, the other part could be done later
…locks Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
…locks Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Add BFT-style transitions to Clique, modelled with ForksSchedule<CliqueConfigOptions> Add ability to transition the blockperiodseconds config. --------- Signed-off-by: Jason Frame <jason.frame@consensys.net> Signed-off-by: Simon Dudley <simon.dudley@consensys.net> Co-authored-by: Jason Frame <jason.frame@consensys.net>
Add BFT-style transitions to Clique, modelled with
ForksSchedule<CliqueConfigOptions>CliqueMiningAcceptanceTest heavily inspired by BftBlockRewardPaymentAcceptanceTest
Preparatory story to #6290 - a
createemptyblockstransition will be added in the next PR.Create genesis config transitions: