Skip to content

cardano-rpc: ReadTip#1259

Open
carbolymer wants to merge 1 commit into
mgalazyn/fix-grpc-bytes-fieldsfrom
mgalazyn/reature/read-tip
Open

cardano-rpc: ReadTip#1259
carbolymer wants to merge 1 commit into
mgalazyn/fix-grpc-bytes-fieldsfrom
mgalazyn/reature/read-tip

Conversation

@carbolymer

@carbolymer carbolymer commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Context

Part of the node kernel access work (ADR-019) and the Kupo/Ogmios replacement effort (#1229): implements the SyncService.ReadTip method (#1218).

ReadTip returns the current chain tip as a fully populated BlockRef: slot, block header hash, block height and the slot timestamp in milliseconds. The handler reads the tip header straight from ChainDB through node kernel access (getTipHeader - no block body fetch), and derives the timestamp from era history the same way FetchBlock does. When the chain is at origin the tip field is left unset; when the node kernel has not initialised yet the call fails with UNAVAILABLE.

Implementation notes:

  • Cardano.Api.Consensus gains getTipHeader, blockHash and blockSlot re-exports.
  • A TraceRpcReadTipSpan trace is emitted around the handler; the node-side rendering and the rpc.request.SyncService.ReadTip prometheus counter land with the E2E test in gRPC: fetchBlock method cardano-node#6579.
  • README coverage table: ReadTip flipped to supported.

Stacked on #1258; only the last commit is new here.

How to trust this PR

The handler is a ChainDB read plus field projection, so there are no unit tests - it needs a live ChainDB. E2E coverage lives in IntersectMBO/cardano-node#6579's Cardano.Testnet.Test.Rpc.FetchBlock: it calls ReadTip over gRPC against a running testnet and asserts the tip's slot and height are bounded below by a CLI query tip snapshot, the hash is 32 bytes, and the timestamp agrees with the slot-derived time within 1s.

Run it with:

TASTY_PATTERN='/RPC FetchBlock/' cabal test cardano-testnet-test

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 Jul 20, 2026
@carbolymer
carbolymer changed the base branch from master to mgalazyn/fix-grpc-bytes-fields July 20, 2026 15:26
@carbolymer
carbolymer force-pushed the mgalazyn/fix-grpc-bytes-fields branch 3 times, most recently from b4ffb7d to 4f93e0b Compare July 21, 2026 15:45
@carbolymer
carbolymer force-pushed the mgalazyn/reature/read-tip branch 2 times, most recently from 9508895 to 0bf4ff4 Compare July 21, 2026 15:47
@carbolymer
carbolymer marked this pull request as ready for review July 21, 2026 15:48
@carbolymer
carbolymer force-pushed the mgalazyn/reature/read-tip branch from 0bf4ff4 to 6a69c74 Compare July 21, 2026 15:49
@carbolymer
carbolymer force-pushed the mgalazyn/reature/read-tip branch from 6a69c74 to 4418b96 Compare July 22, 2026 09:23
@carbolymer
carbolymer force-pushed the mgalazyn/fix-grpc-bytes-fields branch from 4f93e0b to a7ec745 Compare July 22, 2026 09:23
@carbolymer
carbolymer force-pushed the mgalazyn/reature/read-tip branch from 4418b96 to 5ab98a0 Compare July 22, 2026 09:29
@carbolymer
carbolymer force-pushed the mgalazyn/fix-grpc-bytes-fields branch from a7ec745 to 2112d60 Compare July 22, 2026 09:29
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