-
Notifications
You must be signed in to change notification settings - Fork 28
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): enable l2 gas resource for mempool-test #544
test(mempool): enable l2 gas resource for mempool-test #544
Conversation
b8fa578
to
2e76774
Compare
2e76774
to
1694f23
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.
This PR adds l2_gas_resource to add_tx
macro.
It's essential to enable gap_price_threshold in mempool testing.
Reviewable status: 0 of 4 files reviewed, all discussions resolved
1694f23
to
eb9df81
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 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ayeletstarkware, @giladchase, and @MohammadNassar1)
crates/gateway/src/stateful_transaction_validator_test.rs
line 71 at r1 (raw file):
invoke_tx(CairoVersion::Cairo1), Ok(ValidateInfo{ tx_hash: TransactionHash(felt!(
What happened here? Why is this test fragile?
crates/mempool/src/mempool_test.rs
line 173 at r1 (raw file):
(tip: $tip:expr, tx_hash: $tx_hash:expr, sender_address: $sender_address:expr, tx_nonce: $tx_nonce:expr, account_nonce: $account_nonce:expr) => {{ add_tx_input!(tip: $tip, tx_hash: $tx_hash, sender_address: $sender_address, tx_nonce: $tx_nonce, account_nonce: $account_nonce, resource_bounds: executable_resource_bounds_mapping().into())
Unclear from the name what it returns.
Code quote:
executable_resource_bounds_mapping
crates/mempool_test_utils/src/starknet_api_test_utils.rs
line 28 at r1 (raw file):
PaymasterData, ResourceBounds, ResourceBoundsMapping as ExecutableResourceBoundsMapping,
Why this alias?
Code quote:
ResourceBoundsMapping as ExecutableResourceBoundsMapping,
crates/starknet_api/src/executable_transaction.rs
line 117 at r1 (raw file):
tip: *rpc_tx.tip(), nonce: *rpc_tx.nonce(), resource_bounds: rpc_tx.resource_bounds().clone().into(),
Isn't it the same type?
Why clone
ing and not *
like for tip and nonce?
(Same Q for gateway_test.rs
)
Code quote:
.into()
053ae9a
to
9048645
Compare
eb9df81
to
4286137
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: all files reviewed, 4 unresolved discussions (waiting on @ayeletstarkware, @elintul, and @giladchase)
crates/gateway/src/stateful_transaction_validator_test.rs
line 71 at r1 (raw file):
Previously, elintul (Elin) wrote…
What happened here? Why is this test fragile?
resource bounds was changed -> expected tx hash changed.
crates/mempool/src/mempool_test.rs
line 173 at r1 (raw file):
Previously, elintul (Elin) wrote…
Unclear from the name what it returns.
Changed to test_resource_bounds_mapping
, as it's a resource mapping for testing.
crates/mempool_test_utils/src/starknet_api_test_utils.rs
line 28 at r1 (raw file):
Previously, elintul (Elin) wrote…
Why this alias?
Because there is another ResourceBoundsMapping
, the rpc mapping.
crates/starknet_api/src/executable_transaction.rs
line 117 at r1 (raw file):
Previously, elintul (Elin) wrote…
Isn't it the same type?
Whyclone
ing and not*
like for tip and nonce?
(Same Q forgateway_test.rs
)
Resource bounds doesn't imply Copy, so it cannot deref.
The same answer for gateway_test .rs
code.
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, 2 unresolved discussions (waiting on @ayeletstarkware, @giladchase, and @MohammadNassar1)
crates/gateway/src/stateful_transaction_validator_test.rs
line 71 at r1 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
resource bounds was changed -> expected tx hash changed.
This framework should be refactored.
crates/mempool/src/mempool_test.rs
line 173 at r1 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
Changed to
test_resource_bounds_mapping
, as it's a resource mapping for testing.
But what's its value? Default?
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, 1 unresolved discussion (waiting on @ayeletstarkware, @giladchase, and @MohammadNassar1)
4286137
to
83b0a16
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: complete! all files reviewed, all discussions resolved (waiting on @ayeletstarkware and @giladchase)
This change is