Conversation
|
7bb70c0 to
c1f726f
Compare
consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftRound.java
Outdated
Show resolved
Hide resolved
...us/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftRoundFactory.java
Outdated
Show resolved
Hide resolved
...ft/src/main/java/org/hyperledger/besu/consensus/ibft/validation/MessageValidatorFactory.java
Outdated
Show resolved
Hide resolved
0ba4bda to
3e4e682
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
3e4e682 to
7cd7178
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
f73e9e0 to
8195395
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
8195395 to
e08527b
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
7766e1a to
8665212
Compare
…age validator creation Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
8665212 to
41ab356
Compare
Signed-off-by: Matt Whitehead <matthew1001@gmail.com>
10fe48f to
b9caf13
Compare
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
| * @return the protocol spec for that block number and timestamp | ||
| */ | ||
| public ProtocolSpec getByBlockNumber(final long number) { | ||
| public ProtocolSpec getByBlockNumberAndTimestamp(final long number, final long timestamp) { |
There was a problem hiding this comment.
I think this getting a protocol spec by either the block number or timestamp. Better name would be getByBlockNumberOrTimestamp
There was a problem hiding this comment.
Done - updated to getByBlockNumberOrTimestamp
| LOG.trace("Importing block with extraData={}", extraData); | ||
| final BlockImporter blockImporter = | ||
| ((BftProtocolSchedule) protocolSchedule) | ||
| .getByBlockNumberAndTimestamp( |
There was a problem hiding this comment.
I think this could just use protocolSchedule.getByBlockHeader(blockToImport.getHeader()) instead. It will look up protocol schedules by both block timestamps and block numbers.
|
|
||
| final BlockValidator blockValidator = | ||
| ((BftProtocolSchedule) protocolSchedule) | ||
| .getByBlockNumberAndTimestamp( |
There was a problem hiding this comment.
Similar to the IbftRound I think you could use the existing protocolSchedule.getByBlockHeader method here instead
| } | ||
| LOG.trace("Importing proposed block with extraData={}", extraData); | ||
| final BlockImporter blockImporter = | ||
| ((BftProtocolSchedule) protocolSchedule) |
There was a problem hiding this comment.
Same in the IbftRound think we get away with using the protocolSchedule.getByBlockHeader method here
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
|
Thanks for the latest comments @jframe. I think the latest commits resolve them - let me know what you think. |
Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
...nsus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/validation/MessageValidator.java
Outdated
Show resolved
Hide resolved
consensus/qbft/src/integration-test/resources/genesis_validator_contract_shanghai.json
Outdated
Show resolved
Hide resolved
...t/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidator.java
Outdated
Show resolved
Hide resolved
...sus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidator.java
Show resolved
Hide resolved
...rc/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidator.java
Show resolved
Hide resolved
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
| checkState( | ||
| protocolSchedule instanceof BftProtocolSchedule, | ||
| "Wrong class type for protocol schedule, requires BftProtocolSchedule"); |
There was a problem hiding this comment.
nit: don't need this check anymore
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
PR description
Implement shanghai support for QBFT and IBFT chains.
Main areas of change:
QbftRound/IbftRound, since the next block number was known ahead of time. With number-based milestones such aslondonthis is fine, but with timestamp-based milestones the type of EVM to use for a new round needs to be based on the time that the block is being created. As such, in many places aprotocolScheduleis now passed down the stack instead of ablockValidatoror ablockImporterto allow these to be created using theprotocolSchedulewhen the timestamp is known.BftProtocolSchedulewas only designed to allow a protocol spec to be requested by block number, so a new methodgetByBlockNumberAndTimestampthat takes both the block number and timestamp has replacedgetByBlockNumber, and determines the fork spec based on whichever milestone is most recent.I don't think any docs changes are required since we don't currently make any mention of
shanghaiin the docs today.Fixed Issue(s)
Fixes #5446