Skip to content

Fix/subnet topology#166

Closed
mananuf wants to merge 4 commits intodevnet3from
fix/subnet-topology
Closed

Fix/subnet topology#166
mananuf wants to merge 4 commits intodevnet3from
fix/subnet-topology

Conversation

@mananuf
Copy link
Copy Markdown
Collaborator

@mananuf mananuf commented Mar 26, 2026

Closes #165

This PR implements a comprehensive suite of node-level capabilities that brings gean to full 100% compliance with tracking the latest devnet3 specifications, specifically the Subnet Network Topology feature defined in leanSpec PR #486 (Gean Issue #165).

1. Subnet Network Topology (Issue #165)

Follows leanSpec PR #482 requirements to move attestation filtering to the network subscription layer, optimizing fork-choice store performance and establishing correct P2P mesh health for non-aggregators.

  • CLI Support: Adds --import-subnet-ids configuration flag and removes the hardcoded attestation-committee-count=1 enforcement.
  • P2P Layer: Replaces single attestation pubsub topic with multi-subnet topic subscriptions per validator_id % committee_count, plus explicit import IDs and aggregator fallback.
  • Store Optimizations: Removes isAggregator checks from the forkchoice layer since gossip signature ingest is now securely filtered at the P2P edge.
  • Routing: PublishAttestation now routes signatures accurately to their spec-assigned computational subnet topics.

Testing Performed

  • Local Devnet: Validated on 3-node local cluster. Attestations are successfully routing to correct partitioned topics.
  • Network Mesh: Verified non-aggregators are participating in subnet topic meshes for health without writing to local stores.
  • Finalization: Confirmed continuous state transitions and parent walk block backfilling.
  • Test Suite: All unit, race, and linter checks pass.

mananuf added 4 commits March 26, 2026 08:07
- Add --import-subnet-ids CLI flag (comma-separated, e.g. '0,1,2')
- Remove hardcoded attestation-committee-count == 1 enforcement
- Add ImportSubnetIDs and AttestationCommitteeCount to node.Config
- Change Topics.SubnetAttestation to SubnetAttestations map[uint64]*pubsub.Topic
- JoinTopics accepts []uint64 subnet list instead of single subnetID
- SubscribeTopics spawns a goroutine per subnet attestation topic
- Add GetSubnetTopic helper for subnet-based topic lookup
…storage

- Store gossip signatures unconditionally in ProcessAttestation,
  ProcessSubnetAttestation, and ProcessBlock
- Subnet filtering is now handled at the P2P subscription layer,
  so only relevant attestations reach the store
- Compute deduplicated subnet IDs from import subnets + validator-derived
  subnets (validatorID %% committeeCount), with aggregator fallback to
  subnet 0
- Wire AttestationCommitteeCount into ValidatorDuties
- Route attestation publish to correct subnet topic per validator
- Update validator_test.go for multi-topic Topics struct
@devylongs devylongs closed this Apr 2, 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.

2 participants