-
Notifications
You must be signed in to change notification settings - Fork 4.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
Validate account locks on buffering #34229
Validate account locks on buffering #34229
Conversation
5830094
to
78a66d3
Compare
{ | ||
saturating_add_assign!(self.count_metrics.num_dropped_on_validate_locks, 1); | ||
continue; | ||
} |
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.
perhaps move this all the way up to ImmutableDeserializedPacket::new()
or somewhere during packet receiving to drop bad packets before inserting into storage?
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.
This is done before we insert to storage.
We can't do it in ImmutableDeserializedPacket::new
because we haven't resolved look up tables at that point.
This is immediately after we resolve look up tables, which I think is the earliest we can do this.
Potentially, it could/should be done in SanitizedTransaction::try_new
but that's changing the definition of a SanitizedTransaction
. Not sure we want to do 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 got confused by thread-local-MI and central-scheduler code. So this is somewhat parallel to unprocessed_transactino_storage::consume_scan_should_process_packet()
where immmutable_deserialized_packet is sanitized then accounts locks checked, which should be OK then.
Leave SanitizedTransaction
to solana-transaction-types crate :D, there maybe can add a type for "sanitized and account locks validated" type
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 for now
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34229 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 819 819
Lines 219304 219313 +9
=======================================
+ Hits 179700 179721 +21
+ Misses 39604 39592 -12 |
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.
Late to the party but Tao is more familiar with the code so think his review was more critical - thanks for the quick fix!
Problem
Prio-graph has an assumption that account locks are not duplicate - see crash #34221
prio-graph crate should be fixed, but these transactions are not valid and should be dropped as soon as reasonably possible.
Summary of Changes
Fixes #34221