-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_l1_provider: add reset_bootstrapper function #10513
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: add reset_bootstrapper function #10513
Conversation
c4630be to
ee5e32e
Compare
046f9f1 to
b8af5b7
Compare
ee5e32e to
453d1c4
Compare
444039c to
c4cdcd7
Compare
453d1c4 to
3de885e
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 1 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
self.state = ProviderState::Pending; self.reset_bootstrapper();
This is so next time you try to bootstrap you start from a reset bootstrapped? Is it not better to reset once the state moves to bootstrapping?
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 1 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
This is so next time you try to bootstrap you start from a reset bootstrapped? Is it not better to reset once the state moves to bootstrapping?
It would make life a little bit harder for testing, since you'd be initializing the test with some particular bootstrapper, and then have to somehow skip the part where you reset it just before starting bootstrapping.
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 1 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
Previously, guy-starkware wrote…
It would make life a little bit harder for testing, since you'd be initializing the test with some particular bootstrapper, and then have to somehow skip the part where you reset it just before starting bootstrapping.
Can we add a test that would test this flow at least?
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 1 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Can we add a test that would test this flow at least?
Wait what am I talking about, wrong PR...
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 1 files reviewed, 1 unresolved discussion (waiting on @guy-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Wait what am I talking about, wrong PR...
Doesn't reset_bootstrapper return the bootstrapper to a state where it can begin bootstrapping (identical to the initial bootstrapper) Why would you need to avoid resetting it in tests?
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 1 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Doesn't
reset_bootstrapperreturn the bootstrapper to a state where it can begin bootstrapping (identical to the initial bootstrapper) Why would you need to avoid resetting it in tests?
Yeah, I guess if we are going to override the bootstrapper state in the test we can also circumvent the "reset" part, too.
3de885e to
b665780
Compare
c4cdcd7 to
91f02de
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 1 files reviewed, 1 unresolved discussion (waiting on @sirandreww-starkware)
crates/apollo_l1_provider/src/l1_provider.rs line 447 at r1 (raw file):
Previously, guy-starkware wrote…
Yeah, I guess if we are going to override the bootstrapper state in the test we can also circumvent the "reset" part, too.
I had to change only one test to skip the "normal" way we trigger bootstrapping, but that's not too bad.
b665780 to
7f1375e
Compare
91f02de to
2721dcf
Compare
7f1375e to
cdec096
Compare
2721dcf to
9305b6d
Compare
cdec096 to
caf686a
Compare
9305b6d to
31cfc70
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 2 files reviewed, 2 unresolved discussions (waiting on @guy-starkware and @ShahakShama)
crates/apollo_l1_provider/src/l1_provider.rs line 335 at r2 (raw file):
self.reset_bootstrapper(); self.state = ProviderState::Bootstrap; self.bootstrapper.start_l2_sync(self.current_height, target_height);
make this a function
Code quote:
self.state = ProviderState::Bootstrap;
self.bootstrapper.start_l2_sync(self.current_height, target_height);crates/apollo_l1_provider/src/l1_provider_tests.rs line 379 at r2 (raw file):
l1_provider.initialize(STARTUP_HEIGHT, vec![]).await.expect("l1 provider initialize failed"); l1_provider.state = ProviderState::Bootstrap; l1_provider.bootstrapper.start_l2_sync(STARTUP_HEIGHT, TARGET_HEIGHT);
call that function here
Code quote:
l1_provider.state = ProviderState::Bootstrap;
l1_provider.bootstrapper.start_l2_sync(STARTUP_HEIGHT, TARGET_HEIGHT);
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 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @guy-starkware)
caf686a to
c0cf695
Compare
31cfc70 to
4eddf74
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 2 of 4 files at r3, 2 of 2 files at r4, all commit messages.
@guy-starkware dismissed @sirandreww-starkware from 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @guy-starkware)

No description provided.