-
Notifications
You must be signed in to change notification settings - Fork 266
Make skip messages 'portable' such that they can be gossipped #895
Conversation
6bdbda6
to
2d5a09e
Compare
ToSend = fixup_msgs(ToSend1 ++ ToSend2), | ||
%% we retain the skip votes here because we may not succeed and we want the | ||
%% algorithm to converge more quickly in that case | ||
{(state_reset(HBBFT2, S0))#state{skip_votes = S0#state.skip_votes}, |
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 we use the skip votes we got in this skip message here?
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.
Or do we even still need to do this? the skip was confirmed at this point?
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 don't think we need to retain votes if we have echoable votes, no
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.
so set skip_votes to empty here?
@@ -297,6 +297,40 @@ handle_message(<<BinMsgIn/binary>>, Index, #state{hbbft = HBBFT, skip_votes = Sk | |||
{ok, {proposed_skip, ProposedRound, IndexRound}} -> | |||
Skips1 = Skips#{Index => {ProposedRound, IndexRound}}, | |||
{S0#state{skip_votes = Skips1}, []}; | |||
{ok, {skip, Round, Sigs}} when Round > CurRound -> |
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.
Round > CurRound is correct, right? we can never skip backwards?
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.
we can skip backwards, we just can't skip onto the existing round, or we won't make any progress.
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.
When would we skip backwards?
@@ -804,6 +844,9 @@ bin_to_msg(<<Bin/binary>>) -> | |||
{error, truncated} | |||
end. | |||
|
|||
sign_skip({proposed_skip, ProposedRound, MyRound}, #state{swarm_keys={_Key, SigFun}}) -> | |||
{proposed_skip, ProposedRound, MyRound, SigFun(t2b({proposed_skip, ProposedRound}))}. |
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.
We only sign over the proposed round, not myround, is that ok?
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 that this will allow some minor adversarial behavior but I am not sure if we care? If you're not being honest about your round and want the group to stop, you don't plan on executing anyway?
%% we retain the skip votes here because we may not succeed and we want the | ||
%% algorithm to converge more quickly in that case | ||
{(state_reset(HBBFT2, S0))#state{skip_votes = S0#state.skip_votes}, | ||
[ new_epoch | ToSend]}; |
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 we send the skip message to all the nodes who did not sign the skip here?
2d5a09e
to
b96b2d9
Compare
b96b2d9
to
fb6746f
Compare
No description provided.