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: integrate chain_id and protocol_version in NetworkInfo #1029

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Jan 25, 2023

Closes #980

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looks great overall, only a few nits

@@ -43,17 +47,23 @@ where
Client: BlockProvider + StateProviderFactory + 'static,
{
/// Creates a new, shareable instance.
pub fn new(client: Arc<Client>, pool: Pool) -> Self {
let inner = EthApiInner { client, pool };
pub fn new(client: Arc<Client>, pool: Pool, network: NetworkHandle) -> Self {
Copy link
Collaborator

@mattsse mattsse Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please have a look at #857

we only want traits here and not NetworkHandle

Copy link
Contributor Author

@leruaa leruaa Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to add chain_id() to NetworkInfo or do you want me to create another trait?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep let's add this

Self { inner: Arc::new(inner) }
}

/// Returns the inner `Client`
fn client(&self) -> &Arc<Client> {
&self.inner.client
}

/// Returns the inner `Client`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update docs

@mattsse mattsse added A-rpc Related to the RPC implementation A-networking Related to networking in general labels Jan 25, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #1029 (9f2d320) into main (2ae88b0) will increase coverage by 0.04%.
The diff coverage is 15.00%.

@@            Coverage Diff             @@
##             main    #1029      +/-   ##
==========================================
+ Coverage   73.91%   73.95%   +0.04%     
==========================================
  Files         300      300              
  Lines       32937    32954      +17     
==========================================
+ Hits        24346    24372      +26     
+ Misses       8591     8582       -9     
Flag Coverage Δ
unit-tests 73.95% <15.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
crates/interfaces/src/error.rs 100.00% <ø> (ø)
crates/net/network-api/src/lib.rs 33.33% <ø> (ø)
crates/net/rpc-api/src/eth.rs 0.00% <ø> (ø)
crates/net/rpc/src/eth/api/mod.rs 0.00% <0.00%> (ø)
crates/net/rpc/src/eth/api/server.rs 0.00% <0.00%> (ø)
crates/net/network/src/manager.rs 48.20% <25.00%> (+0.11%) ⬆️
crates/net/network/src/network.rs 56.93% <40.00%> (-0.65%) ⬇️
crates/net/network/src/listener.rs 77.27% <0.00%> (-6.82%) ⬇️
crates/net/eth-wire/src/types/version.rs 77.77% <0.00%> (-2.23%) ⬇️
crates/stages/src/stages/bodies.rs 92.32% <0.00%> (-0.22%) ⬇️
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mattsse mattsse merged commit e493720 into paradigmxyz:main Jan 25, 2023
literallymarvellous pushed a commit to literallymarvellous/reth that referenced this pull request Feb 5, 2023
literallymarvellous pushed a commit to literallymarvellous/reth that referenced this pull request Feb 5, 2023
literallymarvellous pushed a commit to literallymarvellous/reth that referenced this pull request Feb 6, 2023
@leruaa leruaa deleted the add_methods_to_eth_namespace branch July 12, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Related to networking in general A-rpc Related to the RPC implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate chain_id and protocol_version in NetworkInfo
3 participants