-
Notifications
You must be signed in to change notification settings - Fork 21
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
refactor(blockifier): replace WORD_WIDTH w FELT_WIDTH in contract_class #1967
refactor(blockifier): replace WORD_WIDTH w FELT_WIDTH in contract_class #1967
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @avivg-starkware and the rest of your teammates on Graphite |
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
cb06e92
to
de3c5c0
Compare
Artifacts upload triggered. View details here |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1967 +/- ##
===========================================
+ Coverage 40.10% 75.67% +35.56%
===========================================
Files 26 103 +77
Lines 1895 13827 +11932
Branches 1895 13827 +11932
===========================================
+ Hits 760 10463 +9703
- Misses 1100 2909 +1809
- Partials 35 455 +420 ☔ View full report in Codecov by Sentry. |
de3c5c0
to
170a607
Compare
Artifacts upload triggered. View details 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.
Reviewed 2 of 3 files at r1.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @avivg-starkware and @Yoni-Starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 5 at r1 (raw file):
pub const GAS_PER_MEMORY_ZERO_BYTE: usize = 4; pub const GAS_PER_MEMORY_BYTE: usize = 16; pub const GAS_PER_MEMORY_WORD: usize = GAS_PER_MEMORY_BYTE * WORD_WIDTH;
- Be consistent.
- Imports come before everything.
Suggestion:
pub const GAS_PER_MEMORY_ZERO_BYTE: usize = 4;
pub const GAS_PER_MEMORY_BYTE: usize = 16;
pub const GAS_PER_MEMORY_WORD: usize = GAS_PER_MEMORY_BYTE * starknet_api::core::WORD_WIDTH;
170a607
to
4632773
Compare
Artifacts upload triggered. View details 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.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @Yoni-Starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 5 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
- Be consistent.
- Imports come before everything.
1- by consistent, you're referring to the use of "starknet_api::core::WORD_WIDTH" in the other files?
(that is used without 'use' but rather explicitly? )
if so, I did so in this file as well. Otherwise, I'm sorry not sure i understand.
2- I see, I thought comments are excluded.
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 3 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @avivg-starkware and @Yoni-Starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 5 at r1 (raw file):
Previously, avivg-starkware wrote…
1- by consistent, you're referring to the use of "starknet_api::core::WORD_WIDTH" in the other files?
(that is used without 'use' but rather explicitly? )if so, I did so in this file as well. Otherwise, I'm sorry not sure i understand.
2- I see, I thought comments are excluded.
- Yes - this is what I meant.
a discussion (no related file):
I apologize - because this is contradictory to my latest comment. Please import the const in each file using: starknet_api::core::WORD_WIDTH
.
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 (commit messages unreviewed), 1 unresolved discussion (waiting on @avivg-starkware and @Yoni-Starkware)
a discussion (no related file):
Previously, ArniStarkware (Arnon Hod) wrote…
I apologize - because this is contradictory to my latest comment. Please import the const in each file using:
starknet_api::core::WORD_WIDTH
.
use
starknet_api::core::WORD_WIDTH;
4632773
to
595fcf0
Compare
Artifacts upload triggered. View details 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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @Yoni-Starkware)
a discussion (no related file):
Previously, ArniStarkware (Arnon Hod) wrote…
use
starknet_api::core::WORD_WIDTH;
all good, Done :)
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: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
595fcf0
to
0bd4c0d
Compare
Artifacts upload triggered. View details here |
0bd4c0d
to
e759d81
Compare
Artifacts upload triggered. View details 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.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-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.
Blocking
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @avivg-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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avivg-starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 1 at r4 (raw file):
use starknet_api::core::WORD_WIDTH;
Remove this const, and instead define FELT_WIDTH = 32
in contract_class.rs
WORD_WIDTH
is the size of a word in ethereum.
In code_size
, we approximate the code size by adding the max size of each element, which is felt, which is accidentally 32. Felt width could have been different.
Code quote:
use starknet_api::core::WORD_WIDTH;
30842e9
to
7c22e27
Compare
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details 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.
Reviewable status: 3 of 5 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @Yoni-Starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 1 at r4 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Remove this const, and instead define
FELT_WIDTH = 32
incontract_class.rs
WORD_WIDTH
is the size of a word in ethereum.
Incode_size
, we approximate the code size by adding the max size of each element, which is felt, which is accidentally 32. Felt width could have been different.
Done (please tell me if I missed something) .
are the comments clear enough?
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 r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avivg-starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 1 at r4 (raw file):
Previously, avivg-starkware wrote…
Done (please tell me if I missed something) .
are the comments clear enough?
Move starknet_api::core::WORD_WIDTH
back to this file.
Please rename the commit and PR message
Artifacts upload triggered. View details here |
d8064e7
to
bdf6489
Compare
Artifacts upload triggered. View details 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.
Reviewable status: 2 of 5 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @Yoni-Starkware)
crates/blockifier/src/fee/eth_gas_constants.rs
line 1 at r4 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Move
starknet_api::core::WORD_WIDTH
back to this file.Please rename the commit and PR message
Done.
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
bdf6489
to
2aa0c56
Compare
Artifacts upload triggered. View details 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.
Reviewed 3 of 3 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)
Benchmark movements: |
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 @Yoni-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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-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 1 of 2 files at r5, 3 of 3 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @avivg-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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @avivg-starkware)
No description provided.