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

Ability to (de)serialize NetworkConfigBuilder #897

Merged
merged 6 commits into from
Jan 18, 2023

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Jan 16, 2023

Closes #873

@leruaa
Copy link
Contributor Author

leruaa commented Jan 16, 2023

Still need to make a bunch of things (De)Serializable. Added some #[serde(skip)] for now.

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2023

Codecov Report

Merging #897 (07105ab) into main (e9792c1) will increase coverage by 0.05%.
The diff coverage is 65.38%.

@@            Coverage Diff             @@
##             main     #897      +/-   ##
==========================================
+ Coverage   73.93%   73.99%   +0.05%     
==========================================
  Files         288      288              
  Lines       30786    30782       -4     
==========================================
+ Hits        22763    22777      +14     
+ Misses       8023     8005      -18     
Flag Coverage Δ
unit-tests 73.99% <65.38%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
bin/reth/src/config.rs 59.61% <0.00%> (ø)
crates/net/network/src/session/config.rs 80.58% <0.00%> (-2.42%) ⬇️
crates/net/network/src/config.rs 59.78% <63.63%> (-1.48%) ⬇️
crates/net/discv4/src/config.rs 56.02% <100.00%> (ø)
crates/net/dns/src/config.rs 100.00% <100.00%> (ø)
crates/net/dns/src/tree.rs 83.13% <100.00%> (ø)
crates/net/nat/src/lib.rs 63.12% <100.00%> (ø)
crates/net/network/src/test_utils/testnet.rs 83.03% <100.00%> (ø)
crates/net/network/src/transactions.rs 22.22% <100.00%> (ø)
crates/primitives/src/forkid.rs 96.25% <100.00%> (ø)
... and 4 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
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

Looks good so far

@leruaa
Copy link
Contributor Author

leruaa commented Jan 17, 2023

Made some progress, some things to notice:

  • I've added skip on ban_list field on Discv4Config because Instant is not serializable
  • executor field is still skipped, and I noticed executor() is neved called on the builder. Do I need to better handle this field?
  • Same thing for block_import, the corresponding method was never called on the builder, So I didn't added the parameter to build() and just create a NetworkConfig with ProofOfStakeBlockImport::default(). Is that ok?

Thanks in advance for your feedbacks

@leruaa leruaa marked this pull request as ready for review January 17, 2023 09:57
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.

ty,

some early pointers.

crates/net/nat/src/lib.rs Outdated Show resolved Hide resolved
crates/net/network/src/session/config.rs Outdated Show resolved Hide resolved
crates/net/network/src/session/config.rs Outdated Show resolved Hide resolved
crates/net/dns/src/tree.rs Outdated Show resolved Hide resolved
@mattsse mattsse added C-enhancement New feature or request A-networking Related to networking in general labels Jan 17, 2023
@gakonst
Copy link
Member

gakonst commented Jan 18, 2023

@leruaa this is looking great -just a bunch of merge conflicts to address

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 115e623 into paradigmxyz:main Jan 18, 2023
@leruaa leruaa deleted the network_config_serializable branch January 21, 2023 22:18
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
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 C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make NetworkConfig serializable
4 participants