Skip to content

Eject db-synthesizer - #2087

Closed
jasagredo wants to merge 8 commits into
f-f/prepare-11.1from
js/eject-db-synth
Closed

Eject db-synthesizer#2087
jasagredo wants to merge 8 commits into
f-f/prepare-11.1from
js/eject-db-synth

Conversation

@jasagredo

Copy link
Copy Markdown
Contributor

We keep all the funcionality but as we don't want to replicate cardano-api code, we delete the executable here and create it again downstream.

@jasagredo
jasagredo force-pushed the js/eject-db-synth branch from fb0ab29 to b5ae3f4 Compare June 23, 2026 12:25
Wire the shared cardano-config package into the build so the tools can
migrate off their locally-implemented config parsers. The local path is
a development pin and must become a source-repository-package / CHaP
release before this lands.
Replace db-analyser's locally-implemented CardanoConfig JSON parser with
the shared cardano-config package. The genesis file paths, byron network
magic, genesis hashes and hard-fork triggers are now read from
cardano-config's NodeConfigurationFromFile, with small boundary
conversions for the hash/network-magic representations. db-immutaliser
reuses this path via CardanoBlockArgs, so it migrates too.

No behavioural change: the tools-test integration test (synthesise ->
immutalise -> analyse) still passes with matching block counts.
Replace db-synthesizer's locally-implemented config parser with the
shared cardano-config package. 'initialize' now parses the node config
with cardano-config and adapts it into the Node*ProtocolConfiguration
records that mkConsensusProtocolCardano consumes: byron-era settings,
genesis file paths (including Dijkstra via the testing config's
experimental genesis) and the hard-fork triggers.

Removes the local parser entirely: the NodeConfigStub type, the
FromJSON/AdjustFilePaths orphan instances (Orphans.hs) and the
confConfigStub field. Forging credentials still come from the tool's own
CLI NodeCredentials; the byron software version is hard-coded, mirroring
the node, since cardano-config does not model it.

tools-test still passes (synthesise -> immutalise -> analyse).
…utable

Reshape 'synthesize' to accept the (ProtocolInfo, block-forgers) pair
produced by 'protocolInfoCardano', plus the forge options, epoch size and
ChainDB directory directly. Constructing the protocol from a node
configuration is now the caller's responsibility, so 'synthesize' no
longer touches CardanoProtocolParams or the configuration filesystem.

Also remove the standalone db-synthesizer executable (app + CLI parser +
cabal stanza); it will be provided downstream. The tools-test integration
test now builds the protocol itself (initialize + protocolInfoCardano)
and still exercises the full synthesise -> immutalise -> analyse pipeline.

No behavioural change; tools-test still passes.
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.
@jasagredo
jasagredo force-pushed the js/eject-db-synth branch from b5ae3f4 to 2c45ddd Compare June 23, 2026 12:54
@f-f
f-f force-pushed the f-f/prepare-11.1 branch 2 times, most recently from e530c74 to e37ba20 Compare July 2, 2026 14:54
@f-f
f-f force-pushed the f-f/prepare-11.1 branch 3 times, most recently from 8e146c0 to e468a93 Compare July 20, 2026 14:22
@jasagredo

Copy link
Copy Markdown
Contributor Author

Superseded by #2141

@jasagredo jasagredo closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants