-
Notifications
You must be signed in to change notification settings - Fork 23
Implement ViewChange message type #204
Implement ViewChange message type #204
Conversation
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 left one minor comment, but I can't find any critical issue on suggested changes, thank you.
// whereas any valid view-change certificate is | ||
// equivalent to any other valid one. Moreover, | ||
// messages in the message log and view-change | ||
// certificate are authenticated on their own. |
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.
Maybe I miss something, but It seems to me unclear why we don't have to include message log into signed data. I think that each message has a signature, but the order of messages in the log is not signed, so could a malicious replica intentionally reorder the log and disturb the replay after view change?
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.
Messages in the message log are required to be sequential in the counter value assigned by USIG. So any reordering, omission, or duplication of messages in the log will be detected when validating integrity of the ViewChange message.
I will add this explanation to the comment.
This commit defines abstract interface for VIEW-CHANGE message type. Since the checkpoint feature is to be considered later, the interface omits a method to get the latest stable checkpoint, for simplicity. Besides that, ViewChange message is augmented with a quorum of ReqViewChange messages, dubbed "view-change certificate", for the following reason. Whenever a replica decides to terminate the current view and start the view change operation, it must make sure that other correct replicas will eventually do the same. Otherwise some other correct replica might stay in the old view for arbitrary long time, and the replica that started view change would stop making any progress waiting for other correct replicas. A replica terminates the current view and generates its ViewChange message once it has collected a quorum of valid ReqViewChange messages from different replicas referring to the subsequent view number. Thus, a simple way to ensure liveness would be to justify the ViewChange message with a quorum of ReqViewChange messages. This quorum will ensure view change is also triggered in any correct replica that processes the ViewChange message. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
WrapMessage function wraps a Protobuf structure of any message type into a generic Message structure. It borrows from marshalMessage function from messages/protobuf package. The new function will help to convert messages from API into Protobuf representation. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
MessageFromAPI function will help to convert any message from its API representation into a Protobuf structure of the corresponding type. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
This function will help to convert any message from Protobuf into API representation. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
The new function will help to convert any message from its API representation into a Protobuf structure of the corresponding type. If the message was created by this package, the Protobuf structure is taken directly from the underlying message structure, falling back into creating a new Protobuf structure otherwise. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
5d0f23f
to
b5ffd9a
Compare
Summary of changes: adjusted comment in |
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.
Looks good to me.
@nhoriguchi Thanks for reviewing it |
This pull request introduces and implements
ViewChange
message type.ViewChange
message will be generated when handlingReqViewChange
messages (#177).