-
Notifications
You must be signed in to change notification settings - Fork 880
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
ETC "DieHard" support #155
Conversation
4a1742d
to
efe7cbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly minor revisions, focusing on keeping the ETC fork blocks grouped together and in ETC order.
config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java
Outdated
Show resolved
Hide resolved
config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java
Show resolved
Hide resolved
config/src/test-support/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ClassicProtocolSpecs.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ClassicProtocolSpecs.java
Outdated
Show resolved
Hide resolved
final Optional<BigInteger> chainId, | ||
final OptionalInt contractSizeLimit, | ||
final OptionalInt configStackSizeLimit) { | ||
return MainnetProtocolSpecs.tangerineWhistleDefinition(contractSizeLimit, configStackSizeLimit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the defuse fork build off of diehard? Does it not use the SpuriousDragon gas schedule?
configContractSizeLimit.orElse(SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT); | ||
final int stackSizeLimit = configStackSizeLimit.orElse(MessageFrame.DEFAULT_MAX_STACK_SIZE); | ||
|
||
return MainnetProtocolSpecs.tangerineWhistleDefinition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this build off of the defuse fork?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will actually build from the gotham fork which is defined in future commits.
final boolean enableRevertReason) { | ||
final int contractSizeLimit = | ||
configContractSizeLimit.orElse(SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT); | ||
return MainnetProtocolSpecs.constantinopleFixDefinition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this build off of atlantis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is corrected in future commits.
@@ -67,6 +67,17 @@ private MainnetDifficultyCalculators() {} | |||
return periodCount > 1 ? adjustForPeriod(periodCount, difficulty) : difficulty; | |||
}; | |||
|
|||
public static DifficultyCalculator<Void> DIFFICULTY_BOMB_REMOVED = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hot take: could this instead become NO_DIFFICULTY_BOMB
and have HOMESTEAD
wrap it? So this comes first then homestad with the bomb adjustment, making no difficulty the base case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, no difficulty bomb should be the base case, however homestead does have the difficulty bomb and it come before the bomb was removed. I was reluctant to refactor existing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should refactor this one. Even thought it breaks the other pattern of "what was done first and then later adjusted" it results in duplication of the difficulty calculation code. Perhaps as an alternative that calculation code can be pulled out as a method and both calculators can call the same method.
76d8a70
to
9e481da
Compare
9e481da
to
3bda75a
Compare
@@ -114,11 +114,21 @@ private ProtocolScheduleBuilder( | |||
config.getTangerineWhistleBlockNumber(), | |||
MainnetProtocolSpecs.tangerineWhistleDefinition( | |||
config.getContractSizeLimit(), config.getEvmStackSize())); | |||
addProtocolSpec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The classic protocol specs should be grouped together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the regrouping in ProtocolSpec is complete and the DCO and Jenkins build are happy I'll merge this in.
It may be easiest to do a squash merge on top of the git master branch to satisfy the DCO check.
e5151c3
to
1001ef3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProtocolScheduleBuilder
still needs the classic protocol specs grouped together.
6c0b768
to
53eec54
Compare
a048f3a
to
dd1d3b6
Compare
e4f0d83
to
6e31855
Compare
Signed-off-by: Gregory Markou <gregorymarkou@gmail.com>
6e31855
to
25107f4
Compare
Closing because DCO |
PR description
This PR introduces ETC changes for the DieHard fork
Fixed Issue(s)
N/a