Skip to content

Commit 9172e9e

Browse files
tbagrel1agustinmista
authored andcommitted
[Peras 4] Add ObjectDiffusion and PerasCert diffusion (instance of ObjectDiffusion) (#1679)
This pull request introduces support for the ObjectDiffusion mini-protocol, required for Peras (for certificates and votes diffusion). It also plugs the PerasCertDiffusion (instance of ObjectDiffusion) mini-protocol in the networking layer. This PR depends on an updated version of `ouroboros-network`, see IntersectMBO/ouroboros-network#5202 and https://github.com/IntersectMBO/ouroboros-network/tree/peras-staging/pr-5202-v2 --- - Added modules `Ouroboros.Consensus.MiniProtocol.ObjectDiffusion{.Inbound,.Outbound}` with implementations of the ObjectDiffusion protocol (quite similar/inspired from TX-submission, except that client = inbound, server = outbound) - Added module `Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.API` defining `ObjectPool{Reader,Writer}` interfaces, through which ObjectDiffusion accesses/stores the objects to send/that have been received. - Added modules `Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.PerasCert` and `Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.PerasCert` containing definitions specific to `PerasCert` diffusion through the ObjectDiffusion mini-protocol - Modifies `Ouroboros.Consensus.Node.Serialisation` to add CBOR serialisation (`SerialiseNodeToNode`) for `Point blk`, `Tip blk`, and `PerasCert blk` - Modifies `Ouroboros.Consensus{.Node,.Node.Tracer,.Network.NodeToNode}` to wire-in PerasCertDiffusion similarly to other mini-protocols (e.g. TX-submission) --- - Added module `Test.Consensus.MiniProtocol.ObjectDiffusion.Smoke` with smoke test for the general ObjectDiffusion mini-protocol (using mock objects) - Added module `Test.Consensus.MiniProtocol.ObjectDiffusion.PerasCert.Smoke` with smoke test specific to `PerasCert` diffusion through ObjectDiffusion - Updates `Test.ThreadNet.Network` in `unstable-diffusion-testlib` accordingly to the changes made in `Ouroboros.Consensus.Network.NodeToNode` --- **Network Protocol Version Updates:** - Depends on `ouroboros-network` rev https://github.com/IntersectMBO/ouroboros-network/tree/peras-staging/pr-5202-v2 through source-repository-package directive - Added support in `ouroboros-consensus` for `NodeToNodeV_16`
2 parents fe2513c + 4188b8f commit 9172e9e

File tree

22 files changed

+1781
-45
lines changed

22 files changed

+1781
-45
lines changed

cabal.project

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,19 @@ source-repository-package
8080
eras/byron/ledger/impl
8181
eras/byron/crypto
8282

83-
-- Backported version of https://github.com/IntersectMBO/ouroboros-network/pull/5161
83+
allow-newer:
84+
-- https://github.com/phadej/vec/issues/121
85+
, ral:QuickCheck
86+
, fin:QuickCheck
87+
, bin:QuickCheck
88+
89+
-- Using https://github.com/IntersectMBO/ouroboros-network/tree/peras-staging/pr-5202-v2
8490
source-repository-package
8591
type: git
8692
location: https://github.com/IntersectMBO/ouroboros-network
87-
tag: 1385b53cefb81e79553b6b0252537455833ea9c4
88-
--sha256: sha256-zZ7WsMfRs1fG16bmvI5vIh4fhQ8RGyEvYGLSWlrxpg0=
93+
tag: 0db8669b67982cba755e80bf2e413527def41244
94+
--sha256: sha256-vEO721Xab0RTVKFQFKal5VCV5y+OUzELo8+7Z8TETJQ=
8995
subdir:
96+
ouroboros-network-protocols
9097
ouroboros-network-api
9198
ouroboros-network
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
<!--
9+
### Patch
10+
11+
- A bullet item for the Patch category.
12+
13+
-->
14+
<!--
15+
### Non-Breaking
16+
17+
- A bullet item for the Non-Breaking category.
18+
19+
-->
20+
21+
### Breaking
22+
23+
- Added support for `NodeToNodeV_16`

ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ instance
430430
Map.fromList $
431431
[ (NodeToNodeV_14, CardanoNodeToNodeVersion2)
432432
, (NodeToNodeV_15, CardanoNodeToNodeVersion2)
433+
, (NodeToNodeV_16, CardanoNodeToNodeVersion2)
433434
]
434435

435436
supportedNodeToClientVersions _ =

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ instance SupportedNetworkProtocolVersion (ShelleyBlock proto era) where
4848
Map.fromList
4949
[ (NodeToNodeV_14, ShelleyNodeToNodeVersion1)
5050
, (NodeToNodeV_15, ShelleyNodeToNodeVersion1)
51+
, (NodeToNodeV_16, ShelleyNodeToNodeVersion1)
5152
]
5253
supportedNodeToClientVersions _ =
5354
Map.fromList
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
<!--
9+
### Patch
10+
11+
- A bullet item for the Patch category.
12+
13+
-->
14+
<!--
15+
### Non-Breaking
16+
17+
- A bullet item for the Non-Breaking category.
18+
19+
-->
20+
21+
### Breaking
22+
23+
- Modify `Ouroboros.Consensus{.Node,.Node.Tracer,.Network.NodeToNode}` to wire-in PerasCertDiffusion similarly to other mini-protocols (e.g. TX-submission)
24+
25+
### Non-Breaking
26+
27+
- Update `Test.ThreadNet.Network` in `unstable-diffusion-testlib` accordingly to the changes made in `Ouroboros.Consensus.Network.NodeToNode`

0 commit comments

Comments
 (0)