Skip to content
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

Merged
merged 1 commit into from
Jul 11, 2024
Merged

feat: add multi-nonce support #429

merged 1 commit into from
Jul 11, 2024

Conversation

giladchase
Copy link
Collaborator

@giladchase giladchase commented Jul 9, 2024

commit-id:c822f343


This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.28%. Comparing base (7c08d83) to head (31a64e4).

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.
📢 Have feedback on the report? Share it here.

@giladchase giladchase force-pushed the spr/main/c822f343 branch 2 times, most recently from 9269203 to ad95f07 Compare July 10, 2024 07:50
@giladchase giladchase force-pushed the spr/main/ba871431 branch 2 times, most recently from 56e82f9 to 39df99f Compare July 10, 2024 08:53
Copy link
Contributor

@ayeletstarkware ayeletstarkware left a 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

Copy link
Collaborator

@elintul elintul left a 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 =

Copy link
Collaborator Author

@giladchase giladchase left a 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?

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

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. 😬

Copy link
Collaborator

@elintul elintul left a 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)

Copy link
Collaborator

@elintul elintul left a 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)

Copy link
Collaborator

@elintul elintul left a 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)

Copy link
Contributor

@ayeletstarkware ayeletstarkware left a 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

Copy link
Collaborator Author

@giladchase giladchase left a 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?

Copy link
Contributor

@ayeletstarkware ayeletstarkware left a 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

Copy link
Collaborator

@elintul elintul left a 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)

Copy link
Collaborator Author

@giladchase giladchase left a 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?

Copy link
Contributor

@ayeletstarkware ayeletstarkware left a 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
@giladchase giladchase changed the base branch from spr/main/ba871431 to main July 11, 2024 11:40
Copy link
Collaborator Author

@giladchase giladchase left a 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

Copy link
Contributor

@ayeletstarkware ayeletstarkware left a 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

Copy link
Contributor

@ayeletstarkware ayeletstarkware left a 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)

Copy link
Collaborator

@elintul elintul left a 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. 😬

Copy link
Contributor

@ayeletstarkware ayeletstarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @giladchase)

@giladchase giladchase merged commit 9ea9c98 into main Jul 11, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants