-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add functionality to create all components #265
feat: add functionality to create all components #265
Conversation
be9ba61
to
7f40a03
Compare
4e33568
to
682e7c1
Compare
7f40a03
to
4702767
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## pr/lev-starkware/lev_dev/414d7889 #265 +/- ##
=====================================================================
- Coverage 77.01% 74.00% -3.01%
=====================================================================
Files 28 30 +2
Lines 1379 1435 +56
Branches 1379 1435 +56
=====================================================================
Hits 1062 1062
- Misses 262 318 +56
Partials 55 55 ☔ View full report in Codecov by Sentry. |
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, 3 unresolved discussions (waiting on @lev-starkware)
crates/gateway/src/gateway.rs
line 132 at r2 (raw file):
config: GatewayConfig, rpc_state_reader_config: RpcStateReaderConfig, client: Option<SharedMempoolClient>,
When will this function be invoked with a None value for the client?
If never, please drop the Optional
part, and change the type to Box<dyn MempoolClient
-- we'd like to pass ownership of the client to this struct, not to share an atomic reference with all the other components that need a mempool-client.
Code quote:
Option<SharedMempoolClient>
crates/mempool_node/src/components.rs
line 9 at r2 (raw file):
pub struct Components { pub gateway: Option<Gateway>, pub mempool: Option<Mempool>,
Please don't use pub visibility on fields unless there's an absolute must; that's not the case here imo.
Code quote:
pub gateway: Option<Gateway>,
pub mempool: Option<Mempool>,
crates/mempool_node/src/components.rs
line 23 at r2 (raw file):
if config.components.mempool_component.execute { components.mempool = Some(Mempool::empty()); }
Please create each component as Some
or None
, and then bundle them together in the struct. That is, please do not create the struct with None
values to begin with.
Code quote:
let mut components = Components { gateway: None, mempool: None };
if config.components.gateway_component.execute {
components.gateway = Some(create_gateway(
config.gateway_config.clone(),
config.rpc_state_reader_config.clone(),
clients.mempool_client.clone(),
));
}
if config.components.mempool_component.execute {
components.mempool = Some(Mempool::empty());
}
crates/mempool_node/src/lib.rs
line 3 at r2 (raw file):
pub mod com_clients; pub mod communication; pub mod components;
Next time, please add these with at the relevant pr that introduces the new file.
Code quote:
pub mod com_clients;
pub mod communication;
pub mod components;
682e7c1
to
59e9181
Compare
e27da30
to
8a58f23
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, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware)
crates/mempool_node/src/components.rs
line 23 at r2 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Please create each component as
Some
orNone
, and then bundle them together in the struct. That is, please do not create the struct withNone
values to begin with.
Done.
62bedcd
to
f6bd8aa
Compare
8a58f23
to
eaac21e
Compare
eaac21e
to
d19adbb
Compare
f6bd8aa
to
eebb8aa
Compare
eebb8aa
to
70229b1
Compare
d19adbb
to
1ba1c91
Compare
1ba1c91
to
3d734de
Compare
70229b1
to
3a1782e
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 4 files at r2, 2 of 4 files at r3, all commit messages.
Reviewable status: 3 of 5 files reviewed, 2 unresolved discussions (waiting on @lev-starkware)
crates/mempool_node/src/components.rs
line 14 at r3 (raw file):
pub fn create_components(config: &MempoolNodeConfig, clients: &MempoolNodeClients) -> Components { let gateway_component = if config.components.gateway_component.execute { let mempool_clent =
Typo (missing "i")
Code quote:
mempool_clent
3a1782e
to
758a682
Compare
3d734de
to
5b15998
Compare
commit-id:bb128e01
5b15998
to
609e1fd
Compare
Closing pull request: commit has gone away |
Stack:
This change is