Node Kernel Access#1222
Draft
carbolymer wants to merge 13 commits into
Draft
Conversation
fe6c243 to
153dece
Compare
aa0403a to
e294c78
Compare
5532ba5 to
05c7bbb
Compare
790ad5b to
ff55f0b
Compare
7ac67c0 to
f028edc
Compare
f028edc to
bc14885
Compare
b0dbce2 to
0d12995
Compare
…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
2281836 to
3b8151f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.changes/