Skip to content
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(mempool_node): add NetworkConfig to SequencerNodeConfig #1446

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShahakShama
Copy link
Contributor

No description provided.

@lotem-starkware
Copy link
Contributor

This change is Reviewable

@ShahakShama ShahakShama force-pushed the shahak/add_network_config_to_mempool_node branch from 58c34ca to e06a7a4 Compare October 15, 2024 13:53
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 75.89%. Comparing base (b0cfe82) to head (e06a7a4).
Report is 413 commits behind head on main.

Files with missing lines Patch % Lines
crates/mempool_p2p/src/lib.rs 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1446      +/-   ##
==========================================
+ Coverage   74.18%   75.89%   +1.70%     
==========================================
  Files         359      359              
  Lines       36240    38411    +2171     
  Branches    36240    38411    +2171     
==========================================
+ Hits        26886    29152    +2266     
+ Misses       7220     7045     -175     
- Partials     2134     2214      +80     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a 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 6 files reviewed, 2 unresolved discussions (waiting on @AlonLStarkWare and @ShahakShama)


crates/mempool_p2p/src/lib.rs line 28 at r2 (raw file):

        append_sub_config_name(self.network_config.dump(), "network_config")
    }
}

Consider moving this to a config.rs module.

Code quote:

#[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq, Validate)]
pub struct MempoolP2pConfig {
    #[validate]
    pub network_config: NetworkConfig,
}

impl SerializeConfig for MempoolP2pConfig {
    fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
        append_sub_config_name(self.network_config.dump(), "network_config")
    }
}

crates/mempool_p2p/src/lib.rs line 35 at r2 (raw file):

    version: Option<String>,
    buffer_size: usize,
    topic: Topic,

Recall this function should be invoked by main.rs, which only has MempoolP2pConfig with relevant data towards this module.

I assume you can derive the required version, buffer_size, and topic from the MempoolP2pConfig config.
If so, please do, within this implementation (i.e., I would like the fn args to include only the config and the client).
If not, please let's discuss in person.

Code quote:

    version: Option<String>,
    buffer_size: usize,
    topic: Topic,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants