-
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: stateless validator add calldata len validator #38
feat: stateless validator add calldata len validator #38
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
==========================================
+ Coverage 63.15% 70.83% +7.67%
==========================================
Files 5 5
Lines 95 120 +25
Branches 95 120 +25
==========================================
+ Hits 60 85 +25
Misses 35 35 ☔ View full report in Codecov by Sentry. |
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 4 files reviewed, all discussions resolved (waiting on @Yael-Starkware)
crates/gateway/src/transaction_validator_test.rs
line 38 at r1 (raw file):
validate_non_zero_l1_gas_fee: true, ..VALIDATOR_CONFIG_FOR_TESTING },
I tried adding the resource bounds config explicitly to each test that deals with it. Do you consider it readable?
Code quote:
#[case::missing_l1_gas_resource_bounds(
TransactionValidatorConfig{
validate_non_zero_l1_gas_fee: true,
..VALIDATOR_CONFIG_FOR_TESTING
},
e5c3156
to
d6853a5
Compare
I tried explicitly adding the resource bounds configuration to each test that deals with it. Do you consider it readable? Code quote: TransactionValidatorConfig{
validate_non_zero_l1_gas_fee: true,
..VALIDATOR_CONFIG_FOR_TESTING
}, |
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 4 files at r1, 1 of 4 files at r2, all commit messages.
Reviewable status: 2 of 6 files reviewed, 4 unresolved discussions (waiting on @ArniStarkware)
crates/gateway/src/stateless_transaction_validator.rs
line 50 at r2 (raw file):
}; fn validate_reousrce_bounds(
resource
Code quote:
reousrce
crates/gateway/src/stateless_transaction_validator.rs
line 50 at r2 (raw file):
}; fn validate_reousrce_bounds(
is it common practice to put a function inside a function? never seen it and it was a bit confusing to me.
crates/gateway/src/stateless_transaction_validator_test.rs
line 18 at r2 (raw file):
}; const VALIDATOR_CONFIG_FOR_TESTING: TransactionValidatorConfig = TransactionValidatorConfig {
VALIDATOR_DEFAULT_CONFIG_FOR_TESTING
Code quote:
VALIDATOR_CONFIG_FOR_TESTING
crates/gateway/src/stateless_transaction_validator_test.rs
line 38 at r2 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
I tried explicitly adding the resource bounds configuration to each test that deals with it. Do you consider it readable?
it is not clear to me why this is the default behaviour? would expect it to be both true or both false.
validate_non_zero_l1_gas_fee: true,
validate_non_zero_l2_gas_fee: false,
I think it would be clearer if the default will be false for both and then you will override it with true when needed.
but maybe there is something I don't understand
crates/gateway/src/stateless_transaction_validator_test.rs
line 87 at r2 (raw file):
), Err(TransactionValidatorError::CalldataTooLong { calldata_length: 2, max_calldata_length: 1 }) )]
add another case checking the good flow with non-empty calldata that does not exceed the maximum length
e1a5f3b
to
e67d927
Compare
d6853a5
to
85b06e2
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 7 files reviewed, 3 unresolved discussions (waiting on @Yael-Starkware)
crates/gateway/src/stateless_transaction_validator.rs
line 50 at r2 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
resource
Done. addressed in #45
crates/gateway/src/stateless_transaction_validator.rs
line 50 at r2 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
is it common practice to put a function inside a function? never seen it and it was a bit confusing to me.
Done.
crates/gateway/src/stateless_transaction_validator_test.rs
line 18 at r2 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
VALIDATOR_DEFAULT_CONFIG_FOR_TESTING
Done. addressed in #45
crates/gateway/src/stateless_transaction_validator_test.rs
line 38 at r2 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
it is not clear to me why this is the default behaviour? would expect it to be both true or both false.
validate_non_zero_l1_gas_fee: true,
validate_non_zero_l2_gas_fee: false,I think it would be clearer if the default will be false for both and then you will override it with true when needed.
but maybe there is something I don't understand
Good point. Addressed in Pre-PR. #45.
crates/gateway/src/stateless_transaction_validator_test.rs
line 87 at r2 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
add another case checking the good flow with non-empty calldata that does not exceed the maximum length
Done.
85b06e2
to
a1dee40
Compare
de47b45
to
10103bb
Compare
a1dee40
to
2cc8517
Compare
10103bb
to
a9a28ee
Compare
2cc8517
to
a8ad36d
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 4 files at r1, 3 of 3 files at r3, all commit messages.
Reviewable status: 4 of 6 files reviewed, 3 unresolved discussions (waiting on @Yael-Starkware)
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 3 of 3 files at r3, all commit messages.
Reviewable status: 4 of 6 files reviewed, all discussions resolved (waiting on @dafnamatsry)
a9a28ee
to
484c7fc
Compare
a8ad36d
to
12ab270
Compare
12ab270
to
16a7af1
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: 2 of 6 files reviewed, all discussions resolved (waiting on @dafnamatsry)
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: 2 of 6 files reviewed, all discussions resolved (waiting on @dafnamatsry)
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 4 files at r2, 2 of 2 files at r4.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @dafnamatsry)
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: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)
This change is