Skip to content

feat(types): split validators pubkey into dual-key Validator#206

Open
dimka90 wants to merge 1 commit intodevnet-4from
feat/dual-key-types-v2
Open

feat(types): split validators pubkey into dual-key Validator#206
dimka90 wants to merge 1 commit intodevnet-4from
feat/dual-key-types-v2

Conversation

@dimka90
Copy link
Copy Markdown
Collaborator

@dimka90 dimka90 commented Apr 11, 2026

Summary
This PR

  • Split Validator.Pubkey into AttestationPubkey + ProposalPubkey (SSZ 60→112 bytes) for devnet-4 dual-key support. Both keys populated from same genesis key; Phase 2 will parse
    separate keys.
  • Add MaxAttestationsData = 16 constant (PR #536).
  • drainPendingBlocks before each tick — mirrors zeam's processPendingBlocks() to prevent Go select race between block arrival and tick processing.
  • GossipSignatures dedup in InsertWithHandle — prevents duplicate entries when same attestation arrives from multiple gossip paths.
  • PruneStaleSigs — bounds gossip signature growth on non-aggregator nodes (10-slot window).
  • Makefile: don't delete *_encoding.go on make clean.

Changes

Types

  • types/validator.go: Pubkey → AttestationPubkey + ProposalPubkey
  • types/validator_encoding.go: SSZ encoding updated (60→112 bytes)
  • types/state_encoding.go: Validator size references updated
  • types/constants.go: Added MaxAttestationsData = 16

Node

  • node/tick.go: Added drainPendingBlocks() — processes queued blocks before each tick to ensure head is current before attestation production
  • node/store_gossip.go: Added dedup in InsertWithHandle, added PruneStaleSigs method
  • node/store_block.go, node/store_aggregate.go, node/block.go, node/verify.go: .Pubkey → .AttestationPubkey

Genesis

  • genesis/config.go: Populates both keys from same genesis key

Build

  • Makefile: Removed rm -f types/*_encoding.go from clean target

Test plan

  • All unit tests pass
  • 3-node gean-only devnet: justification/finalization advancing steadily (justified within 5 slots of head)
  • Verified main branch baseline still works
  • Each improvement tested individually — no regressions

…dening

Split Validator.Pubkey into AttestationPubkey + ProposalPubkey (SSZ 60→112
bytes) for devnet-4 dual-key support. Both keys populated from the same
genesis key; Phase 2 will parse separate keys.

Add MaxAttestationsData=16 constant (PR #536).

Improvements:
- drainPendingBlocks before each tick, matching zeam's
  processPendingBlocks() pattern to prevent Go select race conditions
- GossipSignatures dedup in InsertWithHandle to prevent duplicate entries
- PruneStaleSigs to bound gossip signature growth on non-aggregator nodes
- Makefile: don't delete *_encoding.go on make clean (sszgen not installed)
@dimka90 dimka90 changed the title feat(types): devnet-4 phase 1 — dual-key Validator feat(types): split validators pubkey into dual-key Validator Apr 11, 2026
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.

reafactor: container typets, dual-key Validator, remove proposer attestation

1 participant