Skip to content

Commit 2c45ddd

Browse files
committed
db-synthesizer: eject Layer 2 (config/credential machinery) downstream
With the config parsing now handled by cardano-config and synthesize taking a ready-made ProtocolInfo, db-synthesizer no longer needs the vendored node/api machinery in-repo. Remove it entirely: - 'initialize' and its adapters (the genesis/credential reading and protocol assembly) leave; they belong downstream, built on cardano-api. - Delete the vendored Cardano.Api.*, Cardano.Node.Protocol.* and Cardano.Node.Types modules (no remaining consumers), and prune the now-unused build-depends (base16-bytestring, cardano-crypto, transformers-except). - Trim DBSynthesizer.Types to the node/api-free option types. The tools-test integration test becomes synthesis-only: it builds a forging-capable protocol via the testlib (new mkSimpleTestProtocolInfoForging, which also returns the block forgers and genesis) instead of a node configuration file, and forges within the testlib's KES validity window. The config-driven synthesise -> immutalise -> analyse pipeline (and the executable) move downstream. Drop the now-unused config fixtures. All tool executables, cardano-test and tools-test still build and pass.
1 parent 65e1c06 commit 2c45ddd

27 files changed

Lines changed: 90 additions & 4648 deletions

File tree

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module Test.Consensus.Cardano.ProtocolInfo
1717

1818
-- * ProtocolInfo elaboration
1919
, mkSimpleTestProtocolInfo
20+
, mkSimpleTestProtocolInfoForging
2021
, mkTestProtocolInfo
2122
, protocolVersionZero
2223
) where
@@ -184,15 +185,49 @@ mkSimpleTestProtocolInfo ::
184185
CardanoHardForkTriggers ->
185186
IO (ProtocolInfo (CardanoBlock c))
186187
mkSimpleTestProtocolInfo
188+
decentralizationParam
189+
securityParam
190+
byronSlotLenghtInSeconds
191+
shelleySlotLengthInSeconds
192+
protocolVersion
193+
hardForkTriggers =
194+
(\(protocolInfo, _, _) -> protocolInfo)
195+
<$> mkSimpleTestProtocolInfoForging
196+
decentralizationParam
197+
securityParam
198+
byronSlotLenghtInSeconds
199+
shelleySlotLengthInSeconds
200+
protocolVersion
201+
hardForkTriggers
202+
203+
-- | Like 'mkSimpleTestProtocolInfo', but additionally returns the block
204+
-- forgers and the Shelley genesis. Callers that forge (eg db-synthesizer)
205+
-- need the forgers, and the genesis for its epoch length.
206+
mkSimpleTestProtocolInfoForging ::
207+
forall c.
208+
(CardanoHardForkConstraints c, AgentCrypto c) =>
209+
-- | Network decentralization parameter.
210+
Shelley.DecentralizationParam ->
211+
SecurityParam ->
212+
ByronSlotLengthInSeconds ->
213+
ShelleySlotLengthInSeconds ->
214+
SL.ProtVer ->
215+
CardanoHardForkTriggers ->
216+
IO
217+
( ProtocolInfo (CardanoBlock c)
218+
, Tracer.Tracer IO KESAgentClientTrace -> IO [MkBlockForging IO (CardanoBlock c)]
219+
, ShelleyGenesis
220+
)
221+
mkSimpleTestProtocolInfoForging
187222
decentralizationParam
188223
securityParam
189224
byronSlotLenghtInSeconds
190225
shelleySlotLengthInSeconds
191226
protocolVersion
192227
hardForkTriggers = do
193228
fs <- SomeHasFS <$> Sim.simHasFS' MockFS.empty
194-
fst
195-
<$> mkTestProtocolInfo @IO
229+
(protocolInfo, blockForging) <-
230+
mkTestProtocolInfo @IO
196231
fs
197232
(CoreNodeId 0, coreNodeShelley)
198233
shelleyGenesis
@@ -203,6 +238,7 @@ mkSimpleTestProtocolInfo
203238
(Just $ PBftSignatureThreshold 1)
204239
protocolVersion
205240
hardForkTriggers
241+
pure (protocolInfo, blockForging, shelleyGenesis)
206242
where
207243
aByronProtocolVersion =
208244
CC.Update.ProtocolVersion 0 0 0

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Api/Any.hs

Lines changed: 0 additions & 164 deletions
This file was deleted.

ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Api/Key.hs

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)