-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix(common): v3 transaction hash calculation #1210
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1210 +/- ##
==========================================
+ Coverage 71.05% 74.16% +3.10%
==========================================
Files 83 78 -5
Lines 7947 7560 -387
Branches 7947 7560 -387
==========================================
- Hits 5647 5607 -40
+ Misses 1390 1066 -324
+ Partials 910 887 -23
... and 22 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
1326dca
to
81181f0
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 4 of 4 files at r1.
Reviewable status: all files reviewed (commit messages unreviewed), 4 unresolved discussions (waiting on @yoavGrs)
crates/papyrus_common/src/transaction_hash.rs
line 228 at r1 (raw file):
.chain(&l1_resource) .chain(&l2_resource) .get_poseidon_hash())
Add comment why is this poseidon (with maybe reference to starknet docs)
crates/papyrus_common/src/transaction_hash.rs
line 231 at r1 (raw file):
} // Concat of: [0 | resource_name (56 bit) | max_amount (64 bit) | max_price_per_unit (128 bit)].
Same as below
crates/papyrus_common/src/transaction_hash.rs
line 244 at r1 (raw file):
} // Concat of [0...0 (192 bit) | nonce_mode (32 bit) | fee_mode (32 bit)].
You're already describing the concat in the expression. Consider instead
Receives nonce_mode and fee_mode and returns [0...0 ...
crates/papyrus_common/src/transaction_hash_test.rs
line 47 at r1 (raw file):
// The details were taken from Starknet Goerli. You can found the transactions by hash in: // https://alpha4.starknet.io/feeder_gateway/get_transaction?transactionHash=<transaction_hash> // The V3 transaction hashes generated by internal simulations.
generated -> are generated
d1a5dae
to
3e002e0
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 4 files reviewed, 3 unresolved discussions (waiting on @ShahakShama)
crates/papyrus_common/src/transaction_hash.rs
line 228 at r1 (raw file):
Previously, ShahakShama wrote…
Add comment why is this poseidon (with maybe reference to starknet docs)
- A node doesn't design the hash.
- It is not in the docs yet.
crates/papyrus_common/src/transaction_hash.rs
line 231 at r1 (raw file):
Previously, ShahakShama wrote…
Same as below
Same as below.
crates/papyrus_common/src/transaction_hash_test.rs
line 47 at r1 (raw file):
Previously, ShahakShama wrote…
generated -> are generated
were generated?
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.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @yoavGrs)
crates/papyrus_common/src/transaction_hash.rs
line 231 at r1 (raw file):
Previously, yoavGrs wrote…
Same as below.
you did not do the same fix as below
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), all discussions resolved (waiting on @yoavGrs)
crates/papyrus_common/src/transaction_hash.rs
line 231 at r1 (raw file):
Previously, ShahakShama wrote…
you did not do the same fix as below
Done.
(I did the same as above :( )
3e002e0
to
c9b0674
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 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)
c9b0674
to
cd3b1ce
Compare
cd3b1ce
to
ee5b29e
Compare
ee5b29e
to
a12b43a
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 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information
This change is