-
Notifications
You must be signed in to change notification settings - Fork 23
Support obtaining and resetting the message log #207
Support obtaining and resetting the message log #207
Conversation
It does not seem useful to have the internal lock as a named field since the structure is not exported. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
This change simplifies the code and makes it more efficient. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
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 nitpicking comment, but can't find any critical issues on the changes.
sync.RWMutex | ||
|
||
// Value incremented on each reset | ||
epoch uint64 |
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 field is used to detect Reset()
calls during supplyMessages()
. So naming this more directly like "reset" might be suitable? I think that the word "epoch" can be used to represent the similar concept as "view", so it might be confusing for someone familiar with other consensus protocols.
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 decided to replace it with a channel.
This method will be required to generate ViewChange message. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
This method will allow to replace the content of the log with ViewChange/NewView messages which embed the preceding messages. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
538c814
to
c3ba51d
Compare
Summary of changes:
|
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, thank you.
This pull request extends the message log functionality required to generate
ViewChange
messages.