> loading_
# ── Exploring TIP-1031: Consensus Context in Block Headers ──────────────
# Walkthrough based on PR #3254 — adapt paths to your local Tempo client checkout.
# 1. Pull the latest Tempo source that includes TIP-1031
# git fetch origin main && git checkout main && git pull
# 2. Locate the updated block header struct.
# The consensus context is a new field appended to the canonical header.
# Look for the type definition — typically in a core/types or protocol/types package.
# grep -rn 'ConsensusContext' core/types/block.go
# You should see something like:
# type Header struct {
# ParentHash common.Hash
# ...
# ConsensusContext ConsensusContext // <-- NEW: TIP-1031
# }
# 3. Inspect the ConsensusContext type itself.
# This struct encapsulates the consensus-layer metadata now committed to in each header.
# grep -A 20 'type ConsensusContext struct' core/types/consensus_context.go
# Expected fields (illustrative — check the actual definition):
# type ConsensusContext struct {
# ValidatorSetHash common.Hash // commitment to the active validator set
# Round uint64 // consensus round that produced this block
# ExtraData []byte // protocol-defined auxiliary context
# }
# 4. Verify that header hashing now includes the consensus context.
# The canonical hash function must serialize ConsensusContext into the preimage.
# grep -n 'ConsensusContext' core/types/block.go | grep -i 'hash\|rlp\|encode'
# 5. Run the unit tests that cover the new header format to confirm correctness.
# go test ./core/types/... -run TestHeaderConsensusContext -v
# 6. If you maintain an off-chain indexer or custom RPC middleware,
# update your header deserialization to include the new field.
# For example, in a JS/TS ethers-style decoder:
#
# import { decodeTempoHeader } from '@tempo/sdk';
# const header = decodeTempoHeader(rawRlp);
# console.log(header.consensusContext.validatorSetHash);
# console.log(header.consensusContext.round);
#
# Failing to update deserialization will cause hash mismatches
# and RLP decode errors once the network activates TIP-1031.
# 7. For validator / node operators: watch the release notes for the
# activation height. Before that height, ensure you are running a
# client version that includes PR #3254.
# tempo version # should report a build that includes TIP-1031 support