Skip to content
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

QBFT migration: Create migrating mining coordinator #3097

Merged
merged 15 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tidy up TODOs (move them to PR discussion)
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
  • Loading branch information
siladu committed Nov 23, 2021
commit 1727b8f7291603a5736a2faddc3e7630b29310a8
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public Optional<ValidatorVote> extractVoteFromHeader(final BlockHeader header) {

@Override
public Collection<Address> validatorsInBlock(final BlockHeader header) {
final BftExtraData bftExtraData =
bftExtraDataCodec.decode(header); // TODO SLD fails when starting with ibft 1
final BftExtraData bftExtraData = bftExtraDataCodec.decode(header);
return bftExtraData.getValidators();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import com.google.common.annotations.VisibleForTesting;

// TODO SLD if using this with <MiningCoordinator>, should I rename this to ForksSchedule?
public class BftForksSchedule<C> {
siladu marked this conversation as resolved.
Show resolved Hide resolved

private final NavigableSet<ForkSpec<C>> forks =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public BftMiningCoordinator(
public void start() {
if (state.compareAndSet(State.IDLE, State.RUNNING)) {
bftExecutors.start();
blockAddedObserverId = blockchain.observeBlockAdded(this); // TODO SLD duplicate block event
blockAddedObserverId = blockchain.observeBlockAdded(this);
eventHandler.start();
bftExecutors.executeBftProcessor(bftProcessor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public void onBlockAdded(final BlockAddedEvent event) {
miningCoordinatorSchedule.getFork(currentBlock + 1).getValue();
if (activeMiningCoordinator != nextMiningCoordinator) {
LOG.debug(
siladu marked this conversation as resolved.
Show resolved Hide resolved
"Switching mining coordinator after block {} from {} to {}",
"Switching mining coordinator at block {} from {} to {}",
currentBlock,
activeMiningCoordinator.getClass().getName(),
nextMiningCoordinator.getClass().getTypeName());
activeMiningCoordinator.getClass().getSimpleName(),
nextMiningCoordinator.getClass().getSimpleName());
activeMiningCoordinator.stop();
nextMiningCoordinator.start();
activeMiningCoordinator = nextMiningCoordinator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* subscribers.unsubscribe(this::onSomeEvent);</code>
* </pre>
*
* <p>Since the two separate <code>this:onSomeEvent</code> are not equal, the subscriber wouldn't be
* <p>Since the two separate <code>this::onSomeEvent</code> are not equal, the subscriber wouldn't be
* removed. This bug is avoided by assigning each subscriber a unique ID and using that to
* unsubscribe.
*
Expand Down