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

Removal of NonP2P Network Components #5007

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Removal of NonP2P Network Components #5007

wants to merge 19 commits into from

Conversation

coot
Copy link
Contributor

@coot coot commented Nov 4, 2024

Description

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

@coot coot requested a review from a team as a code owner November 4, 2024 11:07
@coot coot marked this pull request as draft November 4, 2024 11:10
@coot coot force-pushed the coot/drop-non-p2p branch from b964eba to b0d5f13 Compare November 4, 2024 11:55
@coot coot marked this pull request as ready for review November 4, 2024 12:44
@coot coot force-pushed the coot/drop-non-p2p branch from b0d5f13 to e6a376d Compare November 4, 2024 12:48
@coot coot added the diffusion Issues / PRs related to diffusion layer label Nov 4, 2024
@coot coot self-assigned this Nov 4, 2024
@coot coot force-pushed the coot/drop-non-p2p branch 3 times, most recently from 61518a8 to 8cad967 Compare December 19, 2024 06:04
@coot coot force-pushed the coot/drop-non-p2p branch from 8cad967 to 9ed2049 Compare January 3, 2025 08:08
@coot coot added PI-9 Issues / PRs related to PI-9 technical debt labels Jan 24, 2025
@coot coot changed the title Removed NonP2P code Removed NonP2P Network Stack Jan 27, 2025
@coot coot changed the title Removed NonP2P Network Stack Removed NonP2P Network Components Jan 27, 2025
@coot coot changed the title Removed NonP2P Network Components Removal of NonP2P Network Components Jan 27, 2025
bolt12 and others added 10 commits February 11, 2025 14:56
(See CHANGELOG for more details)

- Extract Cardano-specific components into separate modules to resolve cyclic dependency issues:
  - `ConsensusModePeerTargets` and `PeerSelectionTargets` were refactored to avoid circular dependencies.

- Introduce extension points in Diffusion data structures:
  - Split P2P functionality into `P2PCardano` (for Cardano Node specifics) and a more general `P2P` module.
  - Added `Minimal/Node.hs` as a placeholder for a minimal Node diffusion instantiation example.

- Refactor Peer Selection:
  - Removed redundant `PeerSelectionActionsArgs`.
  - Reorganized `DNSActions` and `LedgerPeersArgs`.
  - Improved API for `PeerSelectionActions`.

- Rename `Cardano.Node` to `Cardano.Network`.

- Generalize and refactor the following components:
  - `ConsensusModePeerTargets`.
  - `PeerSelection{Views, Counters}` to allow extensibility for third-party users.
  - `PublicRootPeers`.

- Enhance the Outbound Governor:
  - Generalize `MinimalP2P` for diffusion initialization.
  - Update `ArgumentsExtra` with new parameters for a more flexible diffusion setup.
  - Refactor `PeerSelection.Governor.Monitor` to separate Cardano-specific monitoring actions and support third-party custom actions.

- Ensure the `Diffusion` module is fully polymorphic:
  - Removed `CardanoP2P` dependencies.
  - Updated the test suite to align with the new structure.

- Miscellaneous updates:
  - Update CHaP and fix build issues.
  - Remove `daBlockFetchMode`.
  - Address review feedback.
  - Fix churn timeout tests and increase `shortDelay` to stabilize tests.
  - Recover `sigusr1` signal handler.
  - Make addresses polymorphic.
  - Refactor `extraDebugState` and introduce `P2PDecisionType`.
  - Refactor `requestPublicRootPeers` type.
They are passed as a closure, no need to leak them outside of `Cardano`
(or any other 3rd party integration).
Instead of specifying `extraAPI ~ ()` for non-p2p, we can make it
polymorphic.  This way both p2p & non-p2 `Application` type is using the
same type variables, and the wrapper type can be removed.  This is more
in-line with removal of non-p2p code base.
Also adhere to the convention: first `extraFlags`, then `extraPeers`
We can pass `PeerSelectionInterfaces` to `updateWithState` function to
get access to `readUseLedgerPeers`.
@coot coot force-pushed the coot/drop-non-p2p branch from 9ed2049 to 5cb5043 Compare February 12, 2025 06:09
@coot coot requested a review from a team as a code owner February 12, 2025 06:09
@coot coot force-pushed the coot/drop-non-p2p branch from 5cb5043 to 3a5d6b9 Compare February 12, 2025 11:48
coot and others added 3 commits February 12, 2025 13:22
Also edit export lists so that we need fewer imports.
@coot coot force-pushed the coot/drop-non-p2p branch 2 times, most recently from 9188bf0 to 1ec5fae Compare February 13, 2025 10:20
coot added 6 commits February 13, 2025 14:42
* `Ouroboros.Network.Subscription` removed;
* `Ouroboros.Network.ErrorPolicy` removed;
* APIs removed from `Ouroboros.Network.Socket`:
  * `NetworkMutableState` & friends,
  * `withServerNode` and `withServerNode'`,
  * `NetworkServerTracers`,
  * `fromSnocket`,
  * `beginConnection`
* `Ouroboros.Network.Server.Socket` replaced with a simpler server
  implementation in `Test.Ouroboros.Network.Server`.

All tests & demos of `ouroboros-network-framework` update.
* Updated to compile with changes in the previous commit.
* APIs removed from `Ouroboros.Network.{NodeToClient,NodeToNode}` modules:
  * NetworkServerTracers
  * NetworkMutableState APIs
  * withServer
  * ErrorPolicies
  * WithAddr
  * SuspendDecision
* APIs removed from `Ouroboros.Network.NodeToNode` module:
  * IPSubscriptionTarget
  * NetworkIPSubscription
  * NetworkSubscriptionTracers
  * SubscriptionParams
  * DnsSubscriptionTarget
  * DnsSubscriptioinParams
  * NetworkDNSSubscriptionTracers
  * dnsSubscriptionWorker
@coot coot force-pushed the coot/drop-non-p2p branch from 1ec5fae to 877e397 Compare February 13, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diffusion Issues / PRs related to diffusion layer PI-9 Issues / PRs related to PI-9 technical debt
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants