-
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
Multi-process shared-objects execution #2059
Conversation
CC @mystenmark to coordinate with #1953 |
@@ -35,7 +35,7 @@ pub struct ValidatorConfig { | |||
network_address: Multiaddr, | |||
metrics_address: Multiaddr, | |||
|
|||
consensus_config: ConsensuseConfig, | |||
pub consensus_config: ConsensuseConfig, |
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.
these don't need to be made pub as there are accessors implemented below for that
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 need to modify them to not use the default values (it was one of the reasons why our tests are so slow)
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.
Ideally we need a constructor for narwhal configs, but I figured this could be made in a separate PR (the config structure is pretty complex)
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.
Got it. Yeah this is something that we can fix later (enabling configuration generation with a base template)
A bit of context on how this work. Upon receiving a shared-object certificate, the Sui authority first calls
try_skip_consensus
to see if locks already exist and it can directly re-attempt execution (without going through consensus). If it can't, it sends the transaction through consensus. After sequencing, consensus callsasign_shared_locks
to assign shared locks to every shared-object in the certificate. Note that there is only one task runningasign_shared_locks
(this is safety-critical). Finally, the certificate returns to the Sui authority who callsexecute_shared_transaction
to attempt execution. Note that the order of the checks in the functions below are important to avoid race-conditions. Further, the shared-objects logic assumes that every shared-object transaction updates at least one owned-transaction (the gas object); this avoids a number of race conditions upon committing the transaction effects to storage.