-
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
Cleanup banking bench #24851
Cleanup banking bench #24851
Conversation
banking-bench/src/main.rs
Outdated
@@ -370,7 +398,7 @@ fn main() { | |||
bank.transaction_count(), | |||
txs_processed | |||
); | |||
assert!(txs_processed < bank.transaction_count()); | |||
//assert!(txs_processed < bank.transaction_count()); |
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 didn't seem safe in the following scenario:
- We create a new bank and add it to poh recorder:
solana/banking-bench/src/main.rs
Lines 418 to 428 in fc4e4b2
bank = bank_forks.working_bank(); insert_time.stop(); // set cost tracker limits to MAX so it will not filter out TXs bank.write_cost_tracker().unwrap().set_limits( std::u64::MAX, std::u64::MAX, std::u64::MAX, ); poh_recorder.lock().unwrap().set_bank(&bank); - Before we can send the transactions for the next iteration, this bank is removed from poh recorder
- We send the transactions for the next iteration, none of them land
check_txs
returns because there's no bank:solana/banking-bench/src/main.rs
Line 57 in fc4e4b2
if poh_recorder.lock().unwrap().bank().is_none() { - No transactions were landed in this bank so
txs_processed == bank.transaction_count()
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 am almost sure I never see this assert fail for described scenario. I mean why would #2 happen?
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 think it can happen if all the work after set_bank()
takes longer than 350ms, things like the blockhash refresh, signature clearing, etc.
Codecov Report
@@ Coverage Diff @@
## master #24851 +/- ##
===========================================
+ Coverage 70.0% 82.0% +11.9%
===========================================
Files 36 596 +560
Lines 2255 165043 +162788
Branches 322 0 -322
===========================================
+ Hits 1580 135439 +133859
- Misses 560 29604 +29044
+ Partials 115 0 -115 |
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.
nice clean up, lgtm! Not sure tho if necessary to disable assert!(txs_processed < bank.transaction_count());
* Cleanup banking bench * Fully remove assert (cherry picked from commit e83efe6) # Conflicts: # banking-bench/src/main.rs
* Cleanup banking bench * Fully remove assert
* Cleanup banking bench * Fully remove assert
Problem
Banking bench has certain portions that are hard to read
Summary of Changes
Refactor and cleanup
Fixes #