-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
simplify transaction list verify code #14783
base: main
Are you sure you want to change the base?
Conversation
⏱️ 11h 44m total CI duration on this PR
🚨 2 jobs on the last run were significantly faster/slower than expected
|
a6413a0
to
b85f4f4
Compare
let num_txns = txn_list_with_proof.transactions.len(); | ||
ensure!(num_txns != 0, "Empty transaction list!"); | ||
let first_version_in_request = txn_list_with_proof | ||
.first_transaction_version | ||
.ok_or_else(|| anyhow!("Non-empty chunk with first_version == None."))?; | ||
let parent_state = self.commit_queue.lock().latest_state(); | ||
ensure!( | ||
first_version_in_request == parent_state.next_version(), | ||
"Unexpected chunk. version in request: {}, current_version: {:?}", | ||
first_version_in_request, | ||
parent_state.current_version, | ||
); |
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 are guaranteed if list.verify()
passes with Some(expected_version)
passed in, specifically, it's guranteed that 1. the list is not empty and 2. the list starts from expected_version
b85f4f4
to
ae6b08f
Compare
Forge is running suite
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
8a098a6
to
88b65de
Compare
88b65de
to
5a3af0e
Compare
eca2910
to
a8b15b2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14783 +/- ##
=======================================
Coverage 59.7% 59.7%
=======================================
Files 853 853
Lines 208283 208300 +17
=======================================
+ Hits 124530 124548 +18
+ Misses 83753 83752 -1 ☔ View full report in Codecov by Sentry. |
a8b15b2
to
73351ba
Compare
73351ba
to
a1ebce8
Compare
a1ebce8
to
be1b350
Compare
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist