-
Notifications
You must be signed in to change notification settings - Fork 26
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(starknet_integration_tests): test commit blocks by running multiple heights #2242
Conversation
0f64454
to
37b3117
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2242 +/- ##
===========================================
+ Coverage 40.10% 77.60% +37.49%
===========================================
Files 26 389 +363
Lines 1895 41184 +39289
Branches 1895 41184 +39289
===========================================
+ Hits 760 31961 +31201
- Misses 1100 6962 +5862
- Partials 35 2261 +2226 ☔ 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.
Nice PR! One semantic comment.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dan-starkware and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 37 at r1 (raw file):
let first_height = INITIAL_HEIGHT.unchecked_next(); let last_height = first_height.unchecked_next();
First
and initial
mean the same, but they are different here, so it's a bit confusing. WDYT of this?
Also, the last height is only used for the iterator, so it is better to initialize it as it will be used.
Another option is const END_HEIGHT: BlockNumber = BlockNumber(3);
Or you could implement for BlockNumber fn iter_up(usize)
.
Any of these is fine IMO.
Suggestion:
const START_HEIGHT: BlockNumber = BASE_HEIGHT.unchecked_next();
const END_HEIGHT: BlockNumber = START_HEIGHT.unchecked_next().unchecked_next();
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, 3 unresolved discussions (waiting on @dan-starkware and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 38 at r1 (raw file):
let first_height = INITIAL_HEIGHT.unchecked_next(); let last_height = first_height.unchecked_next(); let expected_content_ids = [
Suggestion:
expected_block_hashes
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 43 at r1 (raw file):
), Felt::from_hex_unchecked( "0x7e2c0e448bea6bbf00962017d8addd56c6146d5beb5a273b2e02f5fb862d20f",
Did you make sure the txs are successful in the second block also? It must be checked manually once in order for us to "trust" this block hash.
Code quote:
"0x7e2c0e448bea6bbf00962017d8addd56c6146d5beb5a273b2e02f5fb862d20f"
37b3117
to
e72dca5
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 3 files reviewed, 3 unresolved discussions (waiting on @alonh5 and @dan-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 37 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
First
andinitial
mean the same, but they are different here, so it's a bit confusing. WDYT of this?
Also, the last height is only used for the iterator, so it is better to initialize it as it will be used.Another option is
const END_HEIGHT: BlockNumber = BlockNumber(3);
Or you could implement for BlockNumberfn iter_up(usize)
.Any of these is fine IMO.
Changed the variables, WDYT?
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 43 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Did you make sure the txs are successful in the second block also? It must be checked manually once in order for us to "trust" this block hash.
I didn't.
What do you regard as a sufficient check? I need to calc the StateDiff
imposed by the test txs, and calculate its StateDiffCommitment
.
I think it is not in the scope of the e2e test to validate these calculations.
Perhaps it doesn't need to check the ContentId
at all, just the tx hashes.
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 38 at r1 (raw file):
let first_height = INITIAL_HEIGHT.unchecked_next(); let last_height = first_height.unchecked_next(); let expected_content_ids = [
I don't know why they convert to BlockHash
in the consensus, that's a mistake IMO.
ContentId
is the correct term.
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 @dan-starkware and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 37 at r1 (raw file):
Previously, yair-starkware (Yair) wrote…
Changed the variables, WDYT?
Looks good.
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 43 at r1 (raw file):
Previously, yair-starkware (Yair) wrote…
I didn't.
What do you regard as a sufficient check? I need to calc theStateDiff
imposed by the test txs, and calculate itsStateDiffCommitment
.
I think it is not in the scope of the e2e test to validate these calculations.
Perhaps it doesn't need to check theContentId
at all, just the tx hashes.
I meant just to check in the logs that the 3 txs in the iteration go into that second block.
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 50 at r2 (raw file):
for (height, expected_content_id) in next_height.iter_up_to(LAST_HEIGHT.unchecked_next()).zip(expected_content_ids.iter()) {
Check out zip_eq
from iter_tools. I think you should use it here (and in general).
Suggestion:
for (height, expected_content_id) in
next_height.iter_up_to(LAST_HEIGHT).zip(expected_content_ids.iter())
{
e72dca5
to
359f306
Compare
b0a0af4
to
d273db9
Compare
359f306
to
472ef75
Compare
d273db9
to
8fb2748
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 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dan-starkware and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 43 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
I meant just to check in the logs that the 3 txs in the iteration go into that second block.
in the second* iteration
8fb2748
to
47f1b64
Compare
472ef75
to
f72d8a7
Compare
f72d8a7
to
4b74eea
Compare
47f1b64
to
26bda9b
Compare
f007b11
to
c1acb38
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: 0 of 5 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @dan-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 43 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
I meant just to check in the logs that the 3 txs in the iteration go into that second block.
Oh yes I checked this
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 50 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Check out
zip_eq
from iter_tools. I think you should use it here (and in general).
Done.
Benchmark movements: |
c1acb38
to
927d3ac
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 r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)
927d3ac
to
135e9f1
Compare
135e9f1
to
8135e3d
Compare
Benchmark movements: |
8135e3d
to
344eaed
Compare
344eaed
to
a54e72d
Compare
a54e72d
to
8404158
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 2 of 5 files at r4, 3 of 3 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dan-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 r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)
No description provided.