-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
8a3ea71
to
74fcb8a
Compare
12b7c7d
to
c3351e0
Compare
a8f850c
to
46409d2
Compare
|
||
// TODO(tmm): This needs to be reworked to not always be "add" | ||
// TODO(tmm): The Vote type probably shouldn't know about serialisation values, should bein the | ||
// extra data content. |
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 seems like a fairly important TODO.
.map(p -> Optional.of(new Vote(p.getKey(), IbftVoteType.ADD))) | ||
.orElse(Optional.empty()); | ||
|
||
List<Address> validators = new ArrayList<>(voteTally.getCurrentValidators()); |
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.
nit: final.
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.
done.
// TODO(tmm): This needs to be reworked to not always be "add" | ||
// TODO(tmm): The Vote type probably shouldn't know about serialisation values, should bein the | ||
// extra data content. | ||
Optional<Vote> vote = |
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.
nit: final
|
||
List<Address> validators = new ArrayList<>(voteTally.getCurrentValidators()); | ||
|
||
IbftExtraData extraData = |
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.
nit: final
46409d2
to
5aa4eb5
Compare
@@ -68,4 +68,14 @@ public BlockHeaderBuilder insertVoteToHeaderBuilder( | |||
final IbftExtraData ibftExtraData = IbftExtraData.decode(header.getExtraData()); | |||
return ibftExtraData.getValidators(); | |||
} | |||
|
|||
public static Optional<Vote> toVote(final Optional<ValidatorVote> input) { | |||
Optional<Vote> headerVote = Optional.empty(); |
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.
nit: headerVote
appears to be unused.
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.
done.
return extraData.encode(); | ||
} | ||
|
||
// TODO(tmm): Copied from CliqueMinerExecutor |
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.
It would be good to avoid scattering TODO items around the codebase. Either fix it now, log a ticket or decide it's ok to live with.
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.
Deal - broken out to a helper function.
|
||
@Override | ||
public boolean isRunning() { | ||
return false; |
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 seems potentially misleading. I would have expected it to either always be running (but might be just waiting for it's turn to create a block) or to return true
only when this node was a validator (which seems excessive). If it's false
I would expect it to never create blocks.
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.
Updated to 'true' for now, but need to revisit how this class fits with the IbftController as new capabilities are added.
5aa4eb5
to
b8c676b
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.
LGTM.
IBFT requires various aspects of the mining infrastructure in order to create a proposed block. This includes specifically the BlockCreator and MiningCoordinating, the mining executor is not required at this stage, nor is the miner.
92c8855
to
697694f
Compare
This builds up PR #168, and creates classes around the creation of IBFT blocks, ensuring data from the JSON RPC (vanity data) is included.