Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Cleanup the exports of sc-network #4983

Merged
merged 4 commits into from
Feb 19, 2020

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Feb 19, 2020

Before we stabilize stuff, I thought I'd clean up a bit the API of sc-network.
This PR doesn't do anything except move code around between modules.

Most notably, everything that is only needed during the initialization process (for example the TransactionPool trait) has been moved into the config module.

I also moved everything related to NetworkState to a separate module.

A couple things have been #[doc(hidden)]'ed rather than removed:

  • The ProtocolConfig struct contains only two fields and is used in sc-network-test only.
  • The message module and its content are supposed to be implementation details and really aren't supposed to be exposed. Right now we create and destroy ConsensusGossip structs in sc-network-gossip, and we use the BlockData network message as the format to store blocks in when exporting/importing blocks in the CLI.

This PR is expected to go in pair with #4665, which will finish the clean-up.

@tomaka tomaka added the A0-please_review Pull request needs code review. label Feb 19, 2020
@tomaka
Copy link
Contributor Author

tomaka commented Feb 19, 2020

There are a couple of methods that really aren't greatly designed (for example add_reserved_peer taking a String), so that's a best-effort PR.

Copy link
Contributor

@gnunicorn gnunicorn left a comment

Choose a reason for hiding this comment

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

LGTM

@gnunicorn gnunicorn merged commit 0fb8e84 into paritytech:master Feb 19, 2020
@tomaka tomaka deleted the sc-network-api-cleanup branch February 19, 2020 16:08
General-Beck pushed a commit to General-Beck/substrate that referenced this pull request Feb 20, 2020
* Cleanup the exports of sc-network

* Fix RPC tests

* Revert moving the NetworkStateInfo trait

* Fix GrandPa tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants