-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_l1_provider: add basic flow test Anvil->Scraper->Provider #9902
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
5d2ca8a to
eaa0c73
Compare
7d8c090 to
14b0114
Compare
eaa0c73 to
1fc171a
Compare
ShahakShama
left a 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.
@ShahakShama reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @guy-starkware)
crates/apollo_l1_provider/tests/flow_tests.rs line 39 at r1 (raw file):
// Setup. // Must wait at least 1 second, as timestamps are integer seconds. const COOLDOWN_MILLIS: u64 = 1000;
Change these to be of Duration type instead
crates/apollo_l1_provider/tests/flow_tests.rs line 40 at r1 (raw file):
// Must wait at least 1 second, as timestamps are integer seconds. const COOLDOWN_MILLIS: u64 = 1000; const SMALL_DELAY_MILLIS: u64 = 10;
Rename to WAIT_FOR_L1_MILLIS
(If you accept my comment above, WAIT_FOR_L1_DURATION)
crates/apollo_l1_provider/tests/flow_tests.rs line 96 at r1 (raw file):
let l1_event = events.pop().unwrap(); // Convert the L1 event to an Apollo event, so we can get the L2 hash.
If you take my suggestion to extract to a function from previous PR, add this to that function and have the function return the l2 hash
crates/apollo_l1_provider/tests/flow_tests.rs line 142 at r1 (raw file):
// Set up the L1 scraper and run it as a server. let l1_scraper_config = L1ScraperConfig { polling_interval_seconds: Duration::from_secs(1),
Use the const: Duration::from_millis(COOLDOWN_MILLIS)
crates/apollo_l1_provider/tests/flow_tests.rs line 175 at r1 (raw file):
l1_provider_client.start_block(SessionState::Propose, next_block_height).await.unwrap(); let n_txs = 1; let txs = l1_provider_client.get_txs(n_txs, next_block_height).await.unwrap();
Also test that validate returns true
crates/apollo_l1_provider/tests/flow_tests.rs line 178 at r1 (raw file):
assert!(txs.is_empty()); // Sleep at least two times the cooldown to make sure we are not failing due to fractional
If the reason is fractional seconds, then you should add a second, not multiply by two
De-facto it's the same now, but if someone changes the constant it will break
crates/apollo_l1_provider/tests/flow_tests.rs line 180 at r1 (raw file):
// Sleep at least two times the cooldown to make sure we are not failing due to fractional // seconds. tokio::time::sleep(Duration::from_millis(COOLDOWN_MILLIS * 2)).await;
Use tokio::time::advance and tokio::time::pause instead
guy-starkware
left a 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: all files reviewed, 7 unresolved discussions (waiting on @ShahakShama)
crates/apollo_l1_provider/tests/flow_tests.rs line 39 at r1 (raw file):
Previously, ShahakShama wrote…
Change these to be of Duration type instead
Done.
crates/apollo_l1_provider/tests/flow_tests.rs line 40 at r1 (raw file):
Previously, ShahakShama wrote…
Rename to WAIT_FOR_L1_MILLIS
(If you accept my comment above, WAIT_FOR_L1_DURATION)
Done.
crates/apollo_l1_provider/tests/flow_tests.rs line 96 at r1 (raw file):
Previously, ShahakShama wrote…
If you take my suggestion to extract to a function from previous PR, add this to that function and have the function return the l2 hash
yeah, that's what I'm thinking.
crates/apollo_l1_provider/tests/flow_tests.rs line 142 at r1 (raw file):
Previously, ShahakShama wrote…
Use the const:
Duration::from_millis(COOLDOWN_MILLIS)
Done.
crates/apollo_l1_provider/tests/flow_tests.rs line 175 at r1 (raw file):
Previously, ShahakShama wrote…
Also test that validate returns true
I'll add a calidation attempt after the cooldown as well.
crates/apollo_l1_provider/tests/flow_tests.rs line 178 at r1 (raw file):
Previously, ShahakShama wrote…
If the reason is fractional seconds, then you should add a second, not multiply by two
De-facto it's the same now, but if someone changes the constant it will break
Done.
crates/apollo_l1_provider/tests/flow_tests.rs line 180 at r1 (raw file):
Previously, ShahakShama wrote…
Use tokio::time::advance and tokio::time::pause instead
We use sleep everywhere else in the code. I don't know what the difference is.
14b0114 to
a78c5bc
Compare
1fc171a to
47d17eb
Compare
ShahakShama
left a 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.
@ShahakShama reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/tests/flow_tests.rs line 180 at r1 (raw file):
Previously, guy-starkware wrote…
We use sleep everywhere else in the code. I don't know what the difference is.
Fix this at the end of the stack
a78c5bc to
a820fc0
Compare
47d17eb to
89e8787
Compare
a820fc0 to
db35f21
Compare
89e8787 to
d5a2109
Compare
db35f21 to
ba543a6
Compare
8c98150 to
496e236
Compare
ba543a6 to
3f99e6b
Compare
3f99e6b to
bd42d4e
Compare
496e236 to
11b1728
Compare
guy-starkware
left a 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.
@guy-starkware reviewed 1 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)
11b1728 to
56a4b06
Compare
bd42d4e to
97f5c59
Compare
56a4b06 to
bb88bf0
Compare
Merge activity
|

No description provided.