Skip to content

Node Kernel Access#1222

Draft
carbolymer wants to merge 13 commits into
mgalazyn/feature/fetchBlock-tx-bodiesfrom
mgalazyn/feature/node-kernel-access
Draft

Node Kernel Access#1222
carbolymer wants to merge 13 commits into
mgalazyn/feature/fetchBlock-tx-bodiesfrom
mgalazyn/feature/node-kernel-access

Conversation

@carbolymer

Copy link
Copy Markdown
Contributor

Context

Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

@carbolymer carbolymer self-assigned this May 25, 2026
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch 7 times, most recently from fe6c243 to 153dece Compare June 1, 2026 14:38
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch 11 times, most recently from aa0403a to e294c78 Compare June 3, 2026 14:56
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch from 5532ba5 to 05c7bbb Compare July 3, 2026 15:57
Comment thread cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Sync.hs Fixed
Comment thread cardano-rpc/src/Cardano/Rpc/Server/NodeKernelAccess.hs Fixed
Comment thread cardano-rpc/src/Cardano/Rpc/Server/NodeKernelAccess/Type.hs Fixed
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch 9 times, most recently from 790ad5b to ff55f0b Compare July 7, 2026 15:27
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch 7 times, most recently from 7ac67c0 to f028edc Compare July 9, 2026 13:55
@carbolymer carbolymer changed the base branch from master to mgalazyn/feature/fetchBlock-tx-bodies July 9, 2026 13:55
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch from f028edc to bc14885 Compare July 10, 2026 09:03
@carbolymer carbolymer force-pushed the mgalazyn/feature/fetchBlock-tx-bodies branch from b0dbce2 to 0d12995 Compare July 10, 2026 09:04
carbolymer and others added 13 commits July 11, 2026 01:34
…block-add-timestamp

cardano-rpc: Add timestamp to fetchBlock
The Rational to RationalNumber conversion used fromIntegral into the
int32 numerator and uint32 denominator, which wraps modulo 2^32: a pool
margin of 1 % 2^33 emitted denominator 0. The conversion now returns
the best representable approximation via a continued-fraction walk when
either component exceeds its field, and converts exactly otherwise.
The comment claiming the conversion clips was wrong and is gone.
Handler boundary types, the Inject orphans and nested fields of Proto
messages all expect Proto values, so wrapping throughout eliminates the
getProto and Proto shims at every seam. The predicate matchers now take
Proto-wrapped patterns and scriptWitnessIndexToRedeemerPurpose returns a
Proto-wrapped enum, since grapesy rewraps enum fields too.
…pers

txOutToUtxoRpcTxOutput now takes an explicit ShelleyBasedEra witness
instead of IsEra, so it can convert outputs of blocks from any
Shelley-based era rather than only the current one. Export
txoRefUtxoRpcToTxIn and add exactAddressPredicate so RPC clients and
tests build requests from library code instead of duplicating it.
fetchBlock now yields the block in era context via fromConsensusBlock
instead of just the block number, so handlers can inspect the block
content. The Sync proto wrapper re-exports the whole generated
Cardano_Fields module (hiding the four lenses that clash with
Sync_Fields), giving FetchBlock consumers access to all cardano
message field lenses.
Move the conversions between cardano-api types and their UTxO RPC
protobuf counterparts from the monolithic UtxoRpc.Type module into
dedicated submodules: BigInt, ChainPoint, PlutusData,
ProtocolParameters, Script, TxEval and TxOutput.

UtxoRpc.Type becomes an umbrella module which re-exports the same
names it exported before, so the import surface is unchanged and
existing importers keep compiling without modification.
Map fetched block transactions onto the UTxO RPC Tx message, covering
all 14 proto fields: inputs, outputs, reference inputs, certificates,
withdrawals, mint, witnesses, collateral, fee, validity, successful,
auxiliary data, hash and governance proposals.

- Convert at ledger level for every Shelley-based era, with era-gated
  fields (reference inputs, mint, collateral, proposals) empty where
  the era predates them
- Wire spending, withdrawal and certificate redeemers to their entries
  by script witness index; successful reflects the phase-2 IsValid flag
- Add Type.Certificate mapping all 19 certificate variants
  (Dijkstra-safe via concrete-era dispatch) and Type.Governance
  mapping all 7 governance actions including partial parameter updates
- Convert Byron transactions directly from the Byron ledger types
  (cardano-api's Tx has no Byron constructor); Byron fees are implicit
  and stay unset; epoch boundary blocks yield no transactions
- Re-export byronBlockRaw from Cardano.Api.Consensus
- Add property tests: per-field projections against generated
  transactions, wire-level encode/decode totality across eras,
  injected-redeemer wiring, a forged-annotation guard pinning Byron
  transaction ids to the on-chain bytes, and a golden test over a
  mainnet Byron block and epoch boundary block
@carbolymer carbolymer force-pushed the mgalazyn/feature/node-kernel-access branch from 2281836 to 3b8151f Compare July 11, 2026 01:43
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