-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Bugfix: MultiIterator batch priority guard #33454
Bugfix: MultiIterator batch priority guard #33454
Conversation
I have a branch off of this which makes the |
Codecov Report
@@ Coverage Diff @@
## master #33454 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 799 799
Lines 217344 217367 +23
=========================================
+ Hits 178169 178181 +12
- Misses 39175 39186 +11 |
🤔 You mean "Tx3 has |
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.
lgtm
@@ -2048,6 +2055,109 @@ mod tests { | |||
Blockstore::destroy(ledger_path.path()).unwrap(); | |||
} | |||
|
|||
#[test] | |||
fn test_consume_buffered_packets_batch_priority_guard() { |
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 test case makes sense to me.
Yeah, thanks for pointing that out. I meant Tx2 has higher priority 😄 |
!message | ||
/// Returns true if all account locks were available and false otherwise. | ||
#[allow(dead_code)] | ||
pub fn check_locks(&self, message: &SanitizedMessage) -> bool { |
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.
unused here, but I still need to check w/o adding for the central scheduler.
@@ -16,66 +13,42 @@ pub struct ReadWriteAccountSet { | |||
} | |||
|
|||
impl ReadWriteAccountSet { | |||
/// Check static account locks for a transaction message. | |||
pub fn check_static_account_locks(&self, message: &VersionedMessage) -> bool { |
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.
checking static locks is not necessary anymore w/ priority-guarding the batch
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.
lgtm
Problem
Shortcoming with the current multi-iterator decision function.
Allows non-conflicting txs to take higher-priority locks.
Tx1
andTx2
conflict so they cannot be in a batch togetherTx2
andTx3
conflict so they cannot be in a batch togetherTx1
andTx3
do not conflict, so they could be in a batch togetherTx3
to execute beforeTx2
though, sinceTx2
has higher-priority.Summary of Changes
Later
.Fixes #