-
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
[ExecDriver] Launch execution driver with AuthorityState #6690
Conversation
f7a47a9
to
ca10be0
Compare
// Use owned object certificate for the LimitedPoll test. | ||
// Shared object certificate requires more setup before execution. And if we rely on | ||
// send_consensus() for setup, the certificate will also get executed as output in | ||
// handle_consensus_transaction(), making the LimitedPoll test ineffective. |
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.
Sorry, but the shared object case was added very deliberately in #4579 - I think we need to leave the test as is to prevent a regression.
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.
Reverted the test to use certificate with shared objects. Added a function to run the preparation logic for executing certificates out of consensus, without actual execution.
I am concerned to have AuthorityState to depend on execution_driver. AuthorityState is just a state, while execution_driver is a task. Even if we get rid of the concept of authority_active, execution_driver should still be an independent task that gets spawned independently. |
It seems persisting and scheduling certificates for execution until their inputs are available are preferable to trying to execute certificates and error out if inputs are unavailable, in the majority of places that call I see two potential ways to organize the code here. Support scheduled execution of transactions via
|
Ok indeed. I am convinced. |
Great! I understand that we want to keep |
ce99e29
to
7be4a1a
Compare
7be4a1a
to
4d6205b
Compare
…tion independently
4d6205b
to
3852072
Compare
/// Depending on the type of the VerifiedSequencedConsensusTransaction wrapper, | ||
/// - Verify and initialize the state to execute the certificate. | ||
/// Returns a VerifiedCertificate only if this succeeds. | ||
/// - Or update the state for checkpoint or epoch change protocol. Returns None. |
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.
can you comment that this method is only needed for tests?
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.
nm this is clear enough i suppose
After Gateway deprecation, since we plan to execute certificates with effects in execution driver, there should not be a case where AuthorityState is launched but execution driver is not needed. Keeping execution driver in activate authority no longer brings in benefits. But merging execution driver into AuthorityState has additional values:
Since execution driver requires an Arc<> reference to AuthorityState, AuthorityState::new() is refactored to return
Arc<AuthorityState>
instead. This removes the need for callers to wrap AuthorityState wit Arc themselves.This change is a prerequisite for #6652, which uses TransactionManager for
handle_certificate_with_effects()
by default. Without running execution driver, a number of tests would fail.An alternative approach is to launch ActiveAuthority when execution driver is needed, which is going to be almost all cases for tests and production code. The additional boilerplate seems unnecessary.