-
Notifications
You must be signed in to change notification settings - Fork 29
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
refactor(starknet_sequencer_node): get the shared client based on the execution mode #3209
Conversation
2c89809
to
27a1e3a
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.
Can we instead add the execution mode to the Client<Request,Response>
struct, save it on creation, and avoid passing it to the getter function?
Reviewable status: 0 of 3 files reviewed, all discussions resolved
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.
It would create a circular package dependency.
Reviewable status: 0 of 3 files reviewed, all discussions resolved
27a1e3a
to
0008839
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.
Right. So, instead of holding the specific config (which is defined in the node crate), add a boolean / designated struct, derive its value from the config at the ctor, and use it to distinguish which client to return.
The create-with-config-and-later-get-with-config pattern is suboptimal imo:
- Require maintaining the config throughout for this purpose (as well)
- Error prune: might pass one value at ctor and another at getter
Reviewable status: 0 of 3 files reviewed, all discussions resolved
93f927c
to
78da26e
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 1 of 3 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nadin-Starkware)
crates/starknet_sequencer_node/src/clients.rs
line 105 at r3 (raw file):
} else { None }
This should panic
Code quote:
} else {
None
}
crates/starknet_sequencer_node/src/clients.rs
line 113 at r3 (raw file):
} else { None }
This should panic
Code quote:
} else {
None
}
… execution mode commit-id:31764fd4
78da26e
to
c3213fd
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: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)
crates/starknet_sequencer_node/src/clients.rs
line 105 at r3 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
This should
panic
Done.
crates/starknet_sequencer_node/src/clients.rs
line 113 at r3 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
This should
panic
Done.
Stack: