feat(block): track consensus proposer pubkey#178
Open
0xrusowsky wants to merge 5 commits intomainfrom
Open
Conversation
Adds a `consensus_proposer` column to the `blocks` table on both PostgreSQL
(BYTEA, 32-byte CHECK) and ClickHouse (Nullable(String)), populated from the
optional consensus_context.proposer field embedded in the Tempo block header
by TIP-1031. Pre-fork blocks store NULL.
To deserialize the new field, the Block/Transaction type aliases now use
TempoNetwork::BlockResponse from tempo-alloy directly, picking up
TempoHeaderResponse with its consensus context. Header field accesses move
to BlockHeader trait methods since TempoHeader no longer exposes
alloy_consensus::Header fields directly.
Existing rows self-heal from NULL to populated on any later reinsert via
`ON CONFLICT DO UPDATE ... WHERE consensus_proposer IS NULL` so no separate
backfill is required after upgrading past T4. A
`tidx_blocks_consensus_context_total{proposer="present"|"absent"}` counter
gives operators a deploy-day signal that the field is flowing through.
Refs: tempoxyz/tempo TIP-1031
0xrusowsky
commented
Apr 30, 2026
Amp-Thread-ID: https://ampcode.com/threads/T-019dded9-09b3-756a-a669-839a8901a90c Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dded9-09b3-756a-a669-839a8901a90c Co-authored-by: Amp <amp@ampcode.com>
o-az
requested changes
Apr 30, 2026
Member
There was a problem hiding this comment.
Just one note, could you please do the postgres migration via pgroll? if you have mise you can mise install and it'll become available in the env. See https://github.com/tempoxyz/tidx/tree/main/db/pgroll#readme
Mirror db/migrations/20260430_add_blocks_consensus_proposer.sql as a pgroll migration so production deploys via pgroll pick up the new column. Bump expected final pgroll version in compose files and the pgroll README.
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.
Adds a
consensus_proposercolumn to theblockstable, populated from theconsensus_context.proposerfield embedded in the Tempo block header byTIP-1031. Pre-T4 blocks storeNULL.To deserialize the new field, the Block/Transaction type aliases now use TempoNetwork::BlockResponse from tempo-alloy directly, picking up TempoHeaderResponse with its consensus context. Header field accesses move to BlockHeader trait methods since TempoHeader no longer exposes alloy_consensus::Header fields directly.