feat(api): slots.da_block_height + BlockResponse.da_block_height (consumes chain v0.2.3's receipt.da_block_height)#63
Merged
Conversation
…sumes chain v0.2.3's receipt.da_block_height)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Indexer-side companion to chain v0.2.3 (ligate-io/ligate-chain#355). Extracts the new
receipt.da_block_heightfield from each slot's first batch and surfaces it as a top-level field onBlockResponse, powering the explorer's "View on Celenium" deep-link.What
migrations/20260518000002_slots_da_block_height.sql:ALTER TABLE slots ADD COLUMN da_block_height BIGINT. Nullable.extract_slot_proposer→extract_slot_first_batch_facts. Same single first-batch fetch now pulls bothreceipt.da_address(the existingproposer) andreceipt.da_block_height(the new field). Returns a tinySlotFirstBatchFactsstruct.db::upsert_slotgains ada_block_height: Option<i64>parameter. Same COALESCE-preserve semantics asproposer— a re-poll that can't reach batches won't blank a known height.BlockResponse.da_block_height: Option<u64>— surfaces the column to API consumers.#[serde(skip_serializing_if = "Option::is_none")]so legacy null rows omit the field rather than emit"da_block_height": null.SlotRow+SlotTupleextended with the new column; all 3SELECT … FROM slotssites updated to include it.Backward compatibility
da_block_height = NULLuntil an optional one-shot backfill walks them. The explorer treatsnullas "no Celenium link to render" — graceful degrade.Verification
cargo check --workspaceclean Rust-side (the local build fails on the risc0-sys Metal kernel script — macOS-only issue, same as every other api PR this week; Linux CI validates).curl https://rpc.ligate.io/v1/ledger/batches/44857 | jq .receipt.da_block_height→11403025(verified live during the v0.2.3 swap).After merge
ligate-api→ runs the migration → indexer starts populating the column on new slots.da_block_heightis present.