-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_l1_provider: check for uninitialized instead of bootstrapping+sync started #10512
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
apollo_l1_provider: check for uninitialized instead of bootstrapping+sync started #10512
Conversation
fb641ce to
f3f2c47
Compare
c4630be to
ee5e32e
Compare
f3f2c47 to
5363593
Compare
453d1c4 to
3de885e
Compare
5363593 to
8a1a721
Compare
sirandreww-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: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/test_utils.rs line 104 at r1 (raw file):
tx_manager: content.tx_manager_content.map(Into::into).unwrap_or_default(), // The real Provider starts as Uninitialized by default, but for testing purposes we // start it as Pending.
Should we do this? can't we follow a similar flow to make it pending?
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: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/test_utils.rs line 104 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Should we do this? can't we follow a similar flow to make it pending?
There are three options:
- Make it Pending by default, which is what most tests expect (those that aren't about initialization). Requires least changes in existing tests.
- Make it Uninitialized by default, then add
with_stateto all the tests that need it to already be in Pending. - Make it Uninitialized and add code to make it bootstrap to get into Pending mode (the "more realistic flow"). That would add some complexity to most of the tests.
Looking at these three options, I prefer (1). But I'm open to other ideas or if you have some other reasons we should pick (2) or (3).
sirandreww-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: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/test_utils.rs line 104 at r1 (raw file):
Previously, guy-starkware wrote…
There are three options:
- Make it Pending by default, which is what most tests expect (those that aren't about initialization). Requires least changes in existing tests.
- Make it Uninitialized by default, then add
with_stateto all the tests that need it to already be in Pending.- Make it Uninitialized and add code to make it bootstrap to get into Pending mode (the "more realistic flow"). That would add some complexity to most of the tests.
Looking at these three options, I prefer (1). But I'm open to other ideas or if you have some other reasons we should pick (2) or (3).
Can we add a test for 3 and assert that the object is identical to the object used by most of the other test?
That way we can be sure that we're testing a state that we would actually get in production
3de885e to
b665780
Compare
8a1a721 to
a3efc8e
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.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/test_utils.rs line 104 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Can we add a test for 3 and assert that the object is identical to the object used by most of the other test?
That way we can be sure that we're testing a state that we would actually get in production
It is actually really hard to get the provider to be identical to one that has undergone the full process of bootstrapping.
I'll try to do something like that in a different PR but it needs more thought.
a3efc8e to
b29880f
Compare
b665780 to
7f1375e
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.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/test_utils.rs line 104 at r1 (raw file):
Previously, guy-starkware wrote…
It is actually really hard to get the provider to be identical to one that has undergone the full process of bootstrapping.
I'll try to do something like that in a different PR but it needs more thought.
Ok, so for the trivial case of having no txs and no need for bootstrapping (e.g., we get initialized directly into the correct block height) then the test is very easy to write. I added it in this PR.
7f1375e to
cdec096
Compare
b29880f to
4ed08e0
Compare
4ed08e0 to
a7908f8
Compare
cdec096 to
caf686a
Compare
sirandreww-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: 0 of 4 files reviewed, all discussions resolved (waiting on @ShahakShama)
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 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)
caf686a to
c0cf695
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 4 files at r1, 3 of 3 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)

No description provided.