-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add multi-nonce support #429
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
==========================================
+ Coverage 82.89% 83.28% +0.38%
==========================================
Files 37 37
Lines 1719 1723 +4
Branches 1719 1723 +4
==========================================
+ Hits 1425 1435 +10
+ Misses 217 211 -6
Partials 77 77 ☔ View full report in Codecov by Sentry. |
9269203
to
ad95f07
Compare
6b28204
to
106bcf6
Compare
ad95f07
to
8a8cc3b
Compare
56e82f9
to
39df99f
Compare
8a8cc3b
to
205665e
Compare
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.
Reviewed 1 of 2 files at r2, all commit messages.
Reviewable status: 1 of 2 files reviewed, 3 unresolved discussions (waiting on @elintul and @giladchase)
crates/mempool/src/mempool.rs
line 120 at r2 (raw file):
} fn is_queuable(tx_reference: TransactionReference, account: Account) -> bool {
why not name it something that is nonce-related?
Code quote:
is_queuable
crates/mempool/src/mempool_test.rs
line 23 at r2 (raw file):
/// Creates a valid input for mempool's `add_tx` with optional default values. /// Usage:
Add the new usage here
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
MempoolInput { tx, account } }}; // Pattern for four arguments.
I think those lines are confusing
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @giladchase)
crates/mempool/src/mempool.rs
line 120 at r2 (raw file):
} fn is_queuable(tx_reference: TransactionReference, account: Account) -> bool {
WDYT of a short method of TranasctionReference
?
Suggestion:
is_eligible_for_sequencing
crates/mempool/src/mempool_test.rs
line 146 at r2 (raw file):
add_tx_input!(tx_hash: 2, sender_address: "0x1", tx_nonce: 0_u8,account_nonce: 0_u8); let input_address_0_nonce_1 =
Suggestion:
add_tx_input!(tx_hash: 1, sender_address: "0x0", tx_nonce: 0_u8, account_nonce: 0_u8);
let input_address_1 =
add_tx_input!(tx_hash: 2, sender_address: "0x1", tx_nonce: 0_u8,account_nonce: 0_u8);
let input_address_0_nonce_1 =
205665e
to
d7004cb
Compare
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.
Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @ayeletstarkware and @elintul)
crates/mempool/src/mempool.rs
line 120 at r2 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
why not name it something that is nonce-related?
Cause it's an implementation detail --- if we decide too add anything to the queueability check, we'll have to change the function name? this is too fragile.
Also, is_queueable communicates the behavior, if it were something-with-nonce, the reader will have to translate it themselves into "this is a queuability check? because according to it they decide to insert or not", so might as well do that for them.
if they want to know the queueability internals they can step-in, but they might not, so no need to force it on them.
crates/mempool/src/mempool.rs
line 120 at r2 (raw file):
Previously, elintul (Elin) wrote…
WDYT of a short method of
TranasctionReference
?
That means TransactionReference will have to be aware of Account? is that legit?
crates/mempool/src/mempool_test.rs
line 23 at r2 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
Add the new usage here
Done.
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
I think those lines are confusing
which lines?
d7004cb
to
befc8b0
Compare
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.
Reviewed 1 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ayeletstarkware and @giladchase)
crates/mempool/src/mempool.rs
line 120 at r2 (raw file):
Previously, giladchase wrote…
That means TransactionReference will have to be aware of Account? is that legit?
Not sure, maybe later. 😬
befc8b0
to
db25574
Compare
a5823b1
to
ad134f4
Compare
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.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ayeletstarkware and @giladchase)
ad134f4
to
da4a07d
Compare
db25574
to
06e107a
Compare
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.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ayeletstarkware and @giladchase)
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware)
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.
Reviewed all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @giladchase)
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, giladchase wrote…
which lines?
"Pattern for x arguments."
crates/mempool/src/mempool_test.rs
line 47 at r6 (raw file):
/// Usage: /// 1. add_tx_input!(tip: 1, tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3) /// 1. add_tx_input!(tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3)
fix the counting
Code quote:
1
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware and @elintul)
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
"Pattern for x arguments."
@elintul asked for them 😬
Do you have a suggestion for something else?
I'd rather have some documentation over none, since macros are hard to read.
crates/mempool/src/mempool_test.rs
line 47 at r6 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
fix the counting
Just to be sure, you think it'd be more readable than keeping the numbering form the other cases?
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @elintul and @giladchase)
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, giladchase wrote…
@elintul asked for them 😬
Do you have a suggestion for something else?
I'd rather have some documentation over none, since macros are hard to read.
maybe "Pattern for tx_hash, sender_address... etc"?
crates/mempool/src/mempool_test.rs
line 47 at r6 (raw file):
Previously, giladchase wrote…
Just to be sure, you think it'd be more readable than keeping the numbering form the other cases?
fix to 1,2,3,4 instead of 1,1,2,3
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware and @giladchase)
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware)
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
maybe "Pattern for tx_hash, sender_address... etc"?
That's what i originally put there, but elin preferred the x arguments
, can you talk to her about it plz so you can reach an agreement?
crates/mempool/src/mempool_test.rs
line 47 at r6 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
fix to 1,2,3,4 instead of 1,1,2,3
I don't follow 🤔 where is there a 1,1,2,3?
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @giladchase)
crates/mempool/src/mempool_test.rs
line 47 at r6 (raw file):
Previously, giladchase wrote…
I don't follow 🤔 where is there a 1,1,2,3?
/// 1. add_tx_input!(tip: 1, tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3)
/// 1. add_tx_input!(tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3)
commit-id:c822f343
06e107a
to
31a64e4
Compare
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.
Reviewable status: 1 of 2 files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware and @elintul)
crates/mempool/src/mempool_test.rs
line 47 at r6 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
/// 1. add_tx_input!(tip: 1, tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3)
/// 1. add_tx_input!(tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3)
🤦 oh tnx
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.
Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @giladchase)
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, giladchase wrote…
That's what i originally put there, but elin preferred the
x arguments
, can you talk to her about it plz so you can reach an agreement?
sure
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.
Reviewed 1 of 2 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @giladchase)
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.
Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ayeletstarkware and @giladchase)
crates/mempool/src/mempool_test.rs
line 42 at r2 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
sure
Let's not block on this though. 😬
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @giladchase)
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @giladchase)
commit-id:c822f343
This change is