-
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
Do not re-sequence replayed transactions #1947
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.
A few nits, but this looks great!
sui_types/src/error.rs
Outdated
ConsensusNarwhalSerializationError(String), | ||
#[error("Only shared object transactions need to be sequenced")] | ||
OnlySharedObjectTransactionNeedSequencing, |
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.
NotASharedObjectTransaction
maybe?
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.
good idea
sui_core/src/authority_server.rs
Outdated
let ConsensusTransaction::UserTransaction(certificate) = &transaction; | ||
let info = match self | ||
.state | ||
.try_skip_consensus(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.
You own the transaction, consider having try_skip_consensus
take ownership of it.
See C-CALLER-CONTROL.
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.
thanks!
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.
Actually this is a good read (should have done it earlier): https://rust-lang.github.io/api-guidelines/about.html
The authority currently sequences every shared-object transaction it sees. This is fine, but we can skip consensus in the following cases: