-
Notifications
You must be signed in to change notification settings - Fork 52
feat(starknet_integration_tests): refactor e2e flow test #4787
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Graphite Automations"Yair - Auto-assign" took an action on this PR • (03/10/25)1 assignee was added to this PR based on Yair's automation. |
9951e7d
to
525642b
Compare
cb2f624
to
b29b947
Compare
525642b
to
9c8f12c
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 r2, all commit messages.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @Yael-Starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 100 at r2 (raw file):
tokio::time::timeout(TEST_SENARIO_TIMOUT, async { for tx in expected_batched_tx_hashes {
In the many_txs_scenario
we need to check that only the expected txs were batched.
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, 2 unresolved discussions (waiting on @alonh5 and @ArniStarkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 100 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
In the
many_txs_scenario
we need to check that only the expected txs were batched.
what stops the test from producing another block with the remaining txs?
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 109 at r2 (raw file):
} tokio::time::sleep(Duration::from_millis(2000)).await; }
Suggestion:
while !expected_batched_tx_hashes.is_empty() {
let batched_txs =
mock_running_system.aggregated_txs.lock().await.get_all_txs_so_far();
expected_batched_tx_hashes.retain(|tx| !batched_txs.contains(tx));
tokio::time::sleep(Duration::from_millis(2000)).await;
}
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 @alonh5, @ArniStarkware, and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 59 at r2 (raw file):
configure_tracing().await; const TEST_SENARIO_TIMOUT: std::time::Duration = std::time::Duration::from_secs(50);
Suggestion:
TEST_SCENARIO_TIMOUT
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 @alonh5, @ArniStarkware, and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 109 at r2 (raw file):
} tokio::time::sleep(Duration::from_millis(2000)).await; }
Suggestion:
loop {
println!(
"Waiting for txs {} to be included in a block.",
expected_batched_tx_hashes
);
let batched_txs =
mock_running_system.aggregated_txs.lock().await.get_all_txs_so_far();
expected_batched_tx_hashes.retain(|tx| !batched_txs.contains(tx));
if expected_batched_tx_hashes.is_empty() {
break;
}
tokio::time::sleep(Duration::from_millis(2000)).await;
}
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 109 at r2 (raw file):
} tokio::time::sleep(Duration::from_millis(2000)).await; }
retracting this one and suggesting a refined version in the next comment.
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 @ArniStarkware, @Yael-Starkware, and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 100 at r2 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
what stops the test from producing another block with the remaining txs?
Nothing, we should test that at some point only the expected txs where batched. Or can you think of another way to verify the block was closed on size and not time?
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 @alonh5, @ArniStarkware, and @Yael-Starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 100 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Nothing, we should test that at some point only the expected txs where batched. Or can you think of another way to verify the block was closed on size and not time?
How does this verify that it was closed on size and not on time?
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 109 at r2 (raw file):
} tokio::time::sleep(Duration::from_millis(2000)).await; }
Why is one better than the other?
b29b947
to
cf7afc2
Compare
9c8f12c
to
9e532a7
Compare
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: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @ArniStarkware, @Yael-Starkware, and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 100 at r2 (raw file):
Previously, yair-starkware (Yair) wrote…
How does this verify that it was closed on size and not on time?
Actually nothing, you're right. Maybe we should just decrease the max gas amount even more and send a lot of txs.
Also maybe we should add a metric for batches closed on time/size for the dashboard, and then we could use it here. (in a different PR). WDYT?
cf7afc2
to
0b924a0
Compare
9e532a7
to
30c8f25
Compare
1edddd9
to
cce21a7
Compare
ae41407
to
f14a08c
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, 4 unresolved discussions (waiting on @alonh5, @ArniStarkware, and @Yael-Starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 108 at r4 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
This is cool that this way you can print which txs we're still waiting for. Can you use a new
remaining_expected_batched_tx_hashes
variable so in the end you can also assert the other direction:expected_batched_tx_hashes == batched_txs
It's a problem in the too_many_txs test because the additional txs get to the accumulated txs too.
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 162 at r4 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
This can be removed now.
Done.
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 163 at r4 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Also these aren't blocks anymore.
Done.
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 160 at r6 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
There is no longer a need to split it into two test cases. (other than the fact that closing a block on size must have more than 15 txs).
This test case can be squashed into the first test case.Non-blocking, as this may be complicated.
Can't because limiting the block_max_capacity_sierra_gas
for the too_many_txs is causing the l1handler tx to fail in the batcher
2f87781
to
89f9261
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 3 of 5 files at r7, 2 of 3 files at r8, 1 of 1 files at r9, 1 of 1 files at r10, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @Yael-Starkware, and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 108 at r4 (raw file):
Previously, yair-starkware (Yair) wrote…
It's a problem in the too_many_txs test because the additional txs get to the accumulated txs too.
Like we said we aren't checking those 12 tx are in one block anyways here right?
You can decrease even more the gas amount and send more txs just to be sure the block will close on size, then you can add this assertion.
In a separate PR can we check the logs we're getting a block full log?
89f9261
to
3cac284
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: all files reviewed, 1 unresolved discussion (waiting on @Yael-Starkware and @yair-starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 160 at r6 (raw file):
Previously, yair-starkware (Yair) wrote…
Can't because limiting the
block_max_capacity_sierra_gas
for the too_many_txs is causing the l1handler tx to fail in the batcher
Can you increase the number of Txs be more than 15?
Also not sure - because that case the block might be closed on time before it is closed on size.
But, as I said - out of scope.
3cac284
to
7324887
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 5 files reviewed, 1 unresolved discussion (waiting on @alonh5 and @Yael-Starkware)
crates/starknet_integration_tests/tests/end_to_end_flow_test.rs
line 108 at r4 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Like we said we aren't checking those 12 tx are in one block anyways here right?
You can decrease even more the gas amount and send more txs just to be sure the block will close on size, then you can add this assertion.
In a separate PR can we check the logs we're getting a block full log?
Added a todo and will try it in a separate PR
Previously, yair-starkware (Yair) wrote…
Added the check of the other direction |
7324887
to
3d2f9f7
Compare
3d2f9f7
to
4b27ecd
Compare
Check success on aggregated txs instead of per height
4b27ecd
to
56359b8
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 r11, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)
Check success on aggregated txs instead of per height