Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Validate max gas is greater than zero for strk fee settings #2796
base: master
Are you sure you want to change the base?
Validate max gas is greater than zero for strk fee settings #2796
Changes from 9 commits
e843e47
ea50757
8dce237
72f2fe8
cb3d529
a411a4e
397a8ba
77f4d4d
e5c22d2
969e37b
4788a9b
e23e54e
31168e4
69af0af
7b7337e
2db18e6
41e4cd5
73e085f
7d4bbed
0779442
45cf019
0c80350
0e185b6
a784e69
091e484
9682eab
a7c0acf
2eb48ae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Do these tests refer to the reported issue?
#2697
I suppose that even if max_fee is greater than 0 an error may occur
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.
These ones refer to situation when user explicitly passes 0 to fee args.
The case when max gas or max gas unit price is calculated based on other values, is handled e.g. here.
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.
The most important cases to test here are the ones where values calculated from
--max-fee
are 0. We should add these.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.
Fine, so let's break it down:
max_gas
will always be >= 1 because of previous check formax_fee < max_gas_unit_price
, so it's unreachable for it to be equal to 0There 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.
Why are you using
NonZeroU64::new
in some test cases andFelt::from...
in other cases for the same field? Let's pick a consistent behavior if it's possible.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.
It's because fee-related fields in
FeeArgs
useNonZeroFelt
while inFeeSettings::Strk/Eth
they use eitherNonZeroFelt
,NonZeroU64
orNonZeroU128
(ofc wrappedOption
).