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

test(mempool): add commit block test invalid argument #491

Closed

Conversation

MohammadNassar1
Copy link
Contributor

@MohammadNassar1 MohammadNassar1 commented Jul 16, 2024

This change is Reviewable

@MohammadNassar1 MohammadNassar1 requested a review from elintul July 16, 2024 14:20
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.21%. Comparing base (93de0bd) to head (32dfad7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #491   +/-   ##
=======================================
  Coverage   81.21%   81.21%           
=======================================
  Files          42       42           
  Lines        1826     1826           
  Branches     1826     1826           
=======================================
  Hits         1483     1483           
  Misses        269      269           
  Partials       74       74           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MohammadNassar1 MohammadNassar1 force-pushed the mohammad/commit-block-test/invalid_argument branch from c49c443 to da55752 Compare July 22, 2024 11:49
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 r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MohammadNassar1)


crates/mempool/src/mempool_test.rs line 365 at r2 (raw file):

    assert_eq!(txs, &[input_address_0_nonce_0.tx]);
}

How can we reduce transaction cloning to once per test?


crates/mempool/src/mempool_test.rs line 388 at r2 (raw file):

    let invalid_commit_state =
        HashMap::from([(contract_address!("0x0"), AccountState { nonce: Nonce(felt!(3_u16)) })]);

Why is this invalid? Maybe the transaction was rejected/not inserted into the block due to space?

Code quote:

    let invalid_commit_state =
        HashMap::from([(contract_address!("0x0"), AccountState { nonce: Nonce(felt!(3_u16)) })]);

@MohammadNassar1 MohammadNassar1 force-pushed the mohammad/commit-block-test/invalid_argument branch from da55752 to 32dfad7 Compare July 24, 2024 08:21
Copy link
Contributor Author

@MohammadNassar1 MohammadNassar1 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 1 files reviewed, 2 unresolved discussions (waiting on @elintul)


crates/mempool/src/mempool_test.rs line 388 at r2 (raw file):

Previously, elintul (Elin) wrote…

Why is this invalid? Maybe the transaction was rejected/not inserted into the block due to space?

Note that in the block state, the nonce was decreased, which is illegal.

Copy link
Contributor Author

@MohammadNassar1 MohammadNassar1 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 1 files reviewed, 2 unresolved discussions (waiting on @elintul)


crates/mempool/src/mempool_test.rs line 365 at r2 (raw file):

Previously, elintul (Elin) wrote…

How can we reduce transaction cloning to once per test?

Done.

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 r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MohammadNassar1)


crates/mempool/src/mempool_test.rs line 388 at r2 (raw file):

Previously, MohammadNassar1 (mohammad-starkware) wrote…

Note that in the block state, the nonce was decreased, which is illegal.

I see, then what's our behavior in this case?

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.

3 participants