Skip to content

DO NOT MERGE: MK synthetic re-addition - #2088

Draft
jasagredo wants to merge 42 commits into
js/utxo-hd-4from
js/utxo-hd-4-skin
Draft

DO NOT MERGE: MK synthetic re-addition#2088
jasagredo wants to merge 42 commits into
js/utxo-hd-4from
js/utxo-hd-4-skin

Conversation

@jasagredo

Copy link
Copy Markdown
Contributor

Description

Please include a meaningful description of the PR and link the relevant issues
this PR might resolve.

Also note that:

  • New code should be properly tested (even if it does not add new features).
  • The fix for a regression should include a test that reproduces said regression.

WARNING

To update your feature branch if it's stale, please rebase it manually on top of main. Don't update your feature branch by merging main into it. Your pull request will not pass CI if you do.

@jasagredo
jasagredo force-pushed the js/utxo-hd-4-skin branch 2 times, most recently from 513d346 to d05eaee Compare June 22, 2026 13:45
@jasagredo
jasagredo force-pushed the js/utxo-hd-4 branch 2 times, most recently from 6861cb2 to 96c3086 Compare June 26, 2026 13:38
@jasagredo
jasagredo force-pushed the js/utxo-hd-4-skin branch from d05eaee to a090135 Compare June 26, 2026 14:05

@dnadales dnadales left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all seems like a syntactic change indeed 👍 (with no semantic changes)

jasagredo added 22 commits July 3, 2026 17:36
…ry in Basics

WIP (red, expected): re-adds the mk parameter to the LedgerState data family and
restores main's kind vocabulary (MapKind/StateKind/LedgerStateKind), the skin
newtypes (LedgerTables/EmptyMK/KeysMK/ValuesMK/DiffMK), the HasLedgerTables class
and forget/emptyLedgerTables, re-kinds LedgerCfg to StateKind, and gives
decodeValues an EmptyMK hint. The IsLedger/GetTip/ApplyBlock 'l' cascade and the
lib-wide instance/signature sweep are the continuation (see mk-skin-plan.md).
Scope reduced to the five production libs; testlibs/test-suites left red.
Re-kind IsLedger to StateKind (concrete-mk superclasses, since main's quantified
forall mk. EqMK mk => ... form needs type families in quantified constraints,
which GHC forbids under the single-arg skin); GetTip to LedgerStateKind with
getTip :: l mk -> Point l; applyChainTick(LedgerResult) re-dressed to
l blk EmptyMK -> (Ticked l blk DiffMK) matching main; enable QuantifiedConstraints.
Errors have moved downstream to Ledger/Abstract (ApplyBlock). Still WIP-red.
Keep the branch's genuine apply restructuring visible (explicit Values, (state,
Diff) tuples, forward) — that is redesign, not packaging, and should show in the
review diff. Only annotate the state positions with EmptyMK so the state mk-
vocabulary cancels against main; bodies unchanged. Revert applyChainTick to the
branch's (Ticked l blk EmptyMK, Diff blk) tuple (consistent with the apply
bodies) rather than main's bundled Ticked l blk DiffMK. Errors now fan out to the
sibling Ledger/* signature sweep.
CommonProtocolParams/SupportsPeerSelection/SupportsPeras (poly mk reads),
Inspect (mk1/mk2 before/after), SupportsMempool (tableless ticked state ->
EmptyMK).
…st, InFutureCheck, BlockchainTime, State/Types, HeaderValidation

mk-annotate state signatures (poly mk reads; EmptyMK tableless states; the
TranslateLedgerState field's x->EmptyMK / y->EmptyMK+Diff). Add EmptyMK to
InFutureCheck's explicit Abstract import.
…Extended (ExtLedgerState mk)

ExtLedgerState regains its mk param (data type + Ticked instance + deriving +
apply helper + disk codecs); CrossEraForecaster's state arg -> state x EmptyMK;
SupportsProtocol ticked/state -> EmptyMK. This unblocks the Storage/Node
consumers (the new build frontier).
Forker/ReadOnlyForker re-kinded to StateKind (Ap too); forker state fields ->
EmptyMK; Snapshots states -> EmptyMK (+ EmptyMK import). Export StateKind from
Basics. ProtocolInfo genesis state + HeaderStateHistory -> EmptyMK. Revert
applyHelper's spurious mk. Fix plan terminology (main -> prepare-11.1, the actual
review base).
…teKind, states -> EmptyMK) — LedgerDB subsystem complete
… Dual data instances

ChainDB consumer states -> EmptyMK; Ledger/Query QFNoTables state -> EmptyMK;
Dual LedgerState/Ticked data instances threaded (main sub-state -> mk, aux ->
EmptyMK + separate Values a). Dual apply bodies + HFC SingleEraBlock/combinator
are the next (involved) frontier. WIP-red.
jasagredo added 20 commits July 3, 2026 17:37
…ate.hs type-level

HFC LedgerState gets a PHANTOM mk; telescope functor restored to
Flip LedgerState EmptyMK (Data.SOP.Functors). Basics green. State.hs type sigs
done; its bodies still need the unFlip/Flip wrapping sweep (mirror prepare-11.1's
Flip usage but at fixed EmptyMK). WIP-red.
…ed instance + FlipTickedLedgerState + GetTip/forecast/functor types

State.hs telescope bodies done (unFlip/Flip on Current/Product destructure). Ledger.hs:
restored FlipTickedLedgerState newtype, Ticked HFC instance (phantom mk, telescope
FlipTickedLedgerState EmptyMK), GetTip unwraps, AnnForecast/inspect/ledgerInfo functor
types. Remaining: ~22 Ledger.hs apply/forward BODY sites need unFlip/getFlipTickedLedgerState
wrapping (the telescope hmap/zip seams) + 3 consumers. WIP-red.
…mer sweep underway

Ledger.hs apply/forward/forecast/inspect bodies threaded (unFlip/getFlipTickedLedgerState
at telescope seams). HFC PeerSelection/CommonProtocolParams/InitStorage + Mempool arState
done. Remaining: HFC consumer sweep (Query x7, Mempool bodies, Degenerate/Embed/Serialisation/
Node/Forging) — same unFlip + EmptyMK-import pattern — plus Mempool/Impl/Common, ChainSync,
then diffusion/lsm/cardano libs. WIP-red.
…ool type-level + distribExtLedgerState

CommonProtocolParams accessor result kept poly-mk (phantom), telescope arg EmptyMK.
HFC Mempool ticked states -> EmptyMK. Query distribution/Situated functors ->
Flip ExtLedgerState/LedgerState EmptyMK; distribExtLedgerState body threaded.
Remaining: Query bodies (go/Situated), + Degenerate/Embed/Serialisation/Node/Forging,
Mempool/Impl/Common, ChainSync; then diffusion/lsm/cardano. WIP-red.
…tyMK

- GSM: getCurrentLedger results m/STM (LedgerState blk) -> EmptyMK
- NodeKernel: getPeersFromCurrentLedger callback -> EmptyMK; afterSlotNo poly mk
- Node: openChainDB initial-ledger pair -> (ExtLedgerState blk EmptyMK, Values blk)
Port lib:lsm to the mk-skin. The handle accessors (read,
takeHandleSnapshot) take the pure ledger state at EmptyMK, matching
e6fad06's signatures. Also restore the EmptyMK in the streaming
Yield/Sink type aliases in LedgerDB.API, which the lsm backend's
LedgerTablesHandle-based YieldArgs requires (l :: StateKind); the
in-memory backend never threads a handle through Yield/Sink, so the
omission only surfaced here.
… state (consensus+diffusion+lsm green; cardano in progress)
…/serialisation mk-skin (WIP base)

protocol lib confirmed green (no source changes needed).
Re-dress Byron (phantom mk) and Shelley (shelleyLedgerTables field + Ticked) to
prepare-11.1 mk vocabulary. Cardano lib files (Block/CanHardFork/Node) and the
remaining Shelley modules still to do.
…a-translation wrapping at EmptyMK; shelleyLedgerTables fields
… init (EmptyMK ExtLedgerState; Flip telescope in genesis-funds injection)
@jasagredo
jasagredo force-pushed the js/utxo-hd-4-skin branch from a090135 to ed57506 Compare July 3, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants