-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[shared-object] Implement mock sequencer #632
Conversation
This is nice @asonnino |
Absolutely, would you like it in another PR or do I extend this one? |
Tests go in the same PR :) |
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.
A few comments inline, overall:
- How to separate the mocks from our production code.
- How to handle the gap between consensus and processing, where messages may be lost as we start late / crash.
}; | ||
|
||
// Process the certificate to set the locks on the shared objects. | ||
let certificate = &confirmation.certificate; |
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.
Here I was expecting to see logic that processes the certificate then somehow tells the consensus (per cert or in batches) that it may delete the information because it has been processed. Overall, how do we handle lifecycle? When we start the authority or when we stop/crash the authority. How do we ensure that messages that are sequenced are always processed despite these, and then garbage collected from consensus?
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.
The code to process the certificate is located in authority_state
(to keep all dangerous things in the same file). I think GC of consensus depends on the consensus protocol (consensus nodes need to keep the state to allow other slow consensus nodes to sync). I think to handle the crash/stop of the Sui authority with respect to the consensus node we need to implement a similar logic used to interface FastPay with a smart contract. The problem is that the logic depends on the smart contract implementation and consensus protocol. It will also depend on how we approach #633
Added unit tests (but not end-to-end tests to keep the PR small) |
Lets talk about the open question at the sync today, and we can review and merge. |
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.
A few tactical comments.
} | ||
// Log the errors that are the client's fault (not ours). This is | ||
// only for debug purposes: all correct authorities will do the same. | ||
Err(e) => { |
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.
At this point processing a certificate should be infallible no? What kind of errors can the client induce?
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.
The certificate may not be valid (eg. it is not signed by a quorum of authorities)
This PR
Next PR
Questions to address (issues #633)