Skip to content

Commit 64dadb9

Browse files
committed
ouroboros-consensus-diffusion integrated with cardano-diffusion
1 parent 0427a5a commit 64dadb9

File tree

36 files changed

+390
-755
lines changed

36 files changed

+390
-755
lines changed

cabal.project

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ repository cardano-haskell-packages
1414
-- update either of these.
1515
index-state:
1616
-- Bump this if you need newer packages from Hackage
17-
, hackage.haskell.org 2025-07-07T23:33:30Z
17+
, hackage.haskell.org 2025-07-14T12:41:02Z
1818
-- Bump this if you need newer packages from CHaP
19-
, cardano-haskell-packages 2025-06-03T13:42:38Z
19+
, cardano-haskell-packages 2025-07-02T14:54:39Z
2020

2121
packages:
2222
ouroboros-consensus
@@ -57,13 +57,8 @@ if impl (ghc >= 9.12)
5757
-- https://github.com/kapralVV/Unique/issues/11
5858
, Unique:hashable
5959

60-
source-repository-package
61-
type: git
62-
location: https://github.com/IntersectMBO/ouroboros-network
63-
tag: 3e8d3b4b8c87ead794876c62d7fe25f32efb5142
64-
--sha256: 08fpkx3iagj83nn413h9a865zjcj3lrf7017a756qd2wg2jg3amq
65-
subdir:
66-
ouroboros-network-api
60+
allow-newer: *:QuickCheck,
61+
allow-newer: quickcheck-lockstep:quickcheck-dynamic
6762

6863
source-repository-package
6964
type: git
@@ -97,3 +92,13 @@ source-repository-package
9792
libs/set-algebra
9893
libs/small-steps
9994
libs/vector-map
95+
96+
-- QuickCheck-2.16 support
97+
source-repository-package
98+
type: git
99+
location: https://github.com/IntersectMBO/plutus
100+
tag: fffd12eb25985eebb84bf5d0cb1e2f6266a36124
101+
--sha256: sha256-FA0aYLjoMT/6DTwOZ+zAar5TNO+cA2716DpsUbIFjPM=
102+
subdir: plutus-core
103+
plutus-tx
104+
plutus-ledger-api

flake.lock

Lines changed: 52 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
inputs.hackage.follows = "hackageNix";
1717
};
1818
hackageNix = {
19-
url = "github:input-output-hk/hackage.nix";
19+
url = "github:input-output-hk/hackage.nix?ref=for-stackage";
2020
flake = false;
2121
};
2222
CHaP = {

nix/haskell.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ let
1414
};
1515
hsPkgs = haskell-nix.cabalProject {
1616
src = ./..;
17+
index-state = "2025-07-14T12:41:02Z";
18+
index-sha256 = "sha256-T95ADIwRyYlG41AHjkxgezWRwfMqg+a1DGlVhACwtC8=";
1719
compiler-nix-name = "ghc967";
1820
flake.variants = {
1921
ghc910 = { compiler-nix-name = lib.mkForce "ghc9102"; };

ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ library
165165
nothunks,
166166
ouroboros-consensus ^>=0.27,
167167
ouroboros-consensus-protocol ^>=0.12,
168-
ouroboros-network-api ^>=0.14,
168+
ouroboros-network-api ^>=0.15,
169169
serialise ^>=0.2,
170170
singletons ^>=3.0,
171171
small-steps,
@@ -498,7 +498,7 @@ test-suite cardano-test
498498
tasty-hunit,
499499
tasty-quickcheck,
500500
temporary,
501-
typed-protocols ^>=0.3,
501+
typed-protocols ^>=1.0,
502502
unstable-byron-testlib,
503503
unstable-cardano-testlib,
504504
unstable-shelley-testlib,
@@ -580,7 +580,7 @@ library unstable-cardano-tools
580580
directory,
581581
dot,
582582
filepath,
583-
fs-api ^>=0.3,
583+
fs-api ^>=0.4,
584584
githash,
585585
microlens,
586586
mtl,
@@ -593,7 +593,7 @@ library unstable-cardano-tools
593593
ouroboros-consensus-protocol:{ouroboros-consensus-protocol, unstable-protocol-testlib} ^>=0.12,
594594
ouroboros-network,
595595
ouroboros-network-api,
596-
ouroboros-network-framework ^>=0.18,
596+
ouroboros-network-framework ^>=0.19,
597597
ouroboros-network-protocols,
598598
resource-registry,
599599
singletons,

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ instance
379379
supportedNodeToNodeVersions _ =
380380
Map.fromList $
381381
[ (NodeToNodeV_14, CardanoNodeToNodeVersion2)
382+
, (NodeToNodeV_15, CardanoNodeToNodeVersion2)
382383
]
383384

384385
supportedNodeToClientVersions _ =
@@ -391,10 +392,7 @@ instance
391392
, (NodeToClientV_21, CardanoNodeToClientVersion17)
392393
]
393394

394-
-- This is not set to NodeToClientV_21 on purpose because that one is just a
395-
-- stub. Once we have a proper ouroboros-network to integrate that comes with
396-
-- said version and we remove the SRP then we can bump this value.
397-
latestReleasedNodeVersion _prx = (Just NodeToNodeV_14, Just NodeToClientV_20)
395+
latestReleasedNodeVersion _prx = (Just NodeToNodeV_15, Just NodeToClientV_21)
398396

399397
{-------------------------------------------------------------------------------
400398
ProtocolInfo

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
@@ -38,6 +38,7 @@ instance SupportedNetworkProtocolVersion (ShelleyBlock proto era) where
3838
supportedNodeToNodeVersions _ =
3939
Map.fromList
4040
[ (NodeToNodeV_14, ShelleyNodeToNodeVersion1)
41+
, (NodeToNodeV_15, ShelleyNodeToNodeVersion1)
4142
]
4243
supportedNodeToClientVersions _ =
4344
Map.fromList

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import Ouroboros.Consensus.Shelley.Ledger.Ledger
2929
instance SL.EraCertState era => LedgerSupportsPeerSelection (ShelleyBlock proto era) where
3030
getPeers ShelleyLedgerState{shelleyLedgerState} =
3131
catMaybes
32-
[ (poolStake,) <$> Map.lookup stakePool poolRelayAccessPoints
32+
[ (poolStake,) <$> Map.lookup stakePool poolLedgerRelayAccessPoints
3333
| (stakePool, poolStake) <- orderByStake poolDistr
3434
]
3535
where
@@ -60,41 +60,41 @@ instance SL.EraCertState era => LedgerSupportsPeerSelection (ShelleyBlock proto
6060
. SL.nesEs
6161
$ shelleyLedgerState
6262

63-
relayToRelayAccessPoint :: SL.StakePoolRelay -> Maybe RelayAccessPoint
64-
relayToRelayAccessPoint (SL.SingleHostAddr (SJust (Port port)) (SJust ipv4) _) =
65-
Just $ RelayAccessAddress (IPv4 ipv4) (fromIntegral port)
66-
relayToRelayAccessPoint
63+
relayToLedgerRelayAccessPoint :: SL.StakePoolRelay -> Maybe LedgerRelayAccessPoint
64+
relayToLedgerRelayAccessPoint (SL.SingleHostAddr (SJust (Port port)) (SJust ipv4) _) =
65+
Just $ LedgerRelayAccessAddress (IPv4 ipv4) (fromIntegral port)
66+
relayToLedgerRelayAccessPoint
6767
( SL.SingleHostAddr
6868
(SJust (Port port))
6969
SNothing
7070
(SJust ipv6)
7171
) =
72-
Just $ RelayAccessAddress (IPv6 ipv6) (fromIntegral port)
73-
relayToRelayAccessPoint (SL.SingleHostName (SJust (Port port)) dnsName) =
74-
Just $ RelayAccessDomain (encodeUtf8 $ dnsToText dnsName) (fromIntegral port)
75-
relayToRelayAccessPoint _ =
72+
Just $ LedgerRelayAccessAddress (IPv6 ipv6) (fromIntegral port)
73+
relayToLedgerRelayAccessPoint (SL.SingleHostName (SJust (Port port)) dnsName) =
74+
Just $ LedgerRelayAccessDomain (encodeUtf8 $ dnsToText dnsName) (fromIntegral port)
75+
relayToLedgerRelayAccessPoint _ =
7676
-- This could be an unsupported relay (SRV records) or an unusable
7777
-- relay such as a relay with an IP address but without a port number.
7878
Nothing
7979

8080
-- \| Note that a stake pool can have multiple registered relays
81-
pparamsRelayAccessPoints ::
82-
(RelayAccessPoint -> StakePoolRelay) ->
81+
pparamsLedgerRelayAccessPoints ::
82+
(LedgerRelayAccessPoint -> StakePoolRelay) ->
8383
SL.PoolParams ->
8484
Maybe (NonEmpty StakePoolRelay)
85-
pparamsRelayAccessPoints injStakePoolRelay =
85+
pparamsLedgerRelayAccessPoints injStakePoolRelay =
8686
NE.nonEmpty
8787
. force
88-
. mapMaybe (fmap injStakePoolRelay . relayToRelayAccessPoint)
88+
. mapMaybe (fmap injStakePoolRelay . relayToLedgerRelayAccessPoint)
8989
. toList
9090
. SL.ppRelays
9191

9292
-- \| Combine the stake pools registered in the future and the current pool
9393
-- parameters, and remove duplicates.
94-
poolRelayAccessPoints ::
94+
poolLedgerRelayAccessPoints ::
9595
Map (SL.KeyHash 'SL.StakePool) (NonEmpty StakePoolRelay)
96-
poolRelayAccessPoints =
96+
poolLedgerRelayAccessPoints =
9797
Map.unionWith
9898
(\futureRelays currentRelays -> NE.nub (futureRelays <> currentRelays))
99-
(Map.mapMaybe (pparamsRelayAccessPoints FutureRelay) futurePoolParams)
100-
(Map.mapMaybe (pparamsRelayAccessPoints CurrentRelay) poolParams)
99+
(Map.mapMaybe (pparamsLedgerRelayAccessPoints FutureRelay) futurePoolParams)
100+
(Map.mapMaybe (pparamsLedgerRelayAccessPoints CurrentRelay) poolParams)

ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Generators.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import Test.Consensus.Byron.Generators ()
5858
import Test.Consensus.Protocol.Serialisation.Generators ()
5959
import Test.Consensus.Shelley.Generators
6060
import Test.Consensus.Shelley.MockCrypto (CanMock)
61-
import Test.QuickCheck
61+
import Test.QuickCheck hiding (Some (..))
6262
import Test.Util.Orphans.Arbitrary ()
6363
import Test.Util.Serialisation.Roundtrip
6464
( Coherent (..)

0 commit comments

Comments
 (0)