Skip to content

Conversation

n2p5
Copy link
Collaborator

@n2p5 n2p5 commented Sep 22, 2025

Restore TopN Functionality for AtomOne

What this PR does

Brings back TopN functionality from v5.2.0 after we stripped out all the PSS stuff. This gives us:

  • TopN=100 for replicated security (all validators must validate)
  • TopN=0 for opt-in chains (validators choose to validate)
  • TopN queries so you can see chain configuration

What we intentionally left out

We're NOT including these PSS features because of the subset problem concerns:

  • ValidatorsPowerCap
  • ValidatorSetCap
  • Allowlist
  • Denylist
  • ConsumerCommissionRate
  • MinStake

These add complexity and have fundamental issues that need more thought.

Key changes

Protos

  • Added top_N and min_power_in_top_N to Chain query message
  • TopN field in consumer addition proposals
  • Basic TopN fields only, no PSS extras

Core logic

  • partial_set_security.go - restored just the TopN computation parts
  • grpc_query.go - GetConsumerChain returns TopN info
  • Auto opt-in for validators meeting power thresholds on TopN chains

For AtomOne

  • Use TopN=100 for production chains (replicated security)
  • TopN=0 for test/opt-in chains
  • No config needed for excluded PSS features

@n2p5 n2p5 changed the base branch from v5.2.0-fork to atomone-replicated-security-poc September 22, 2025 20:26
@n2p5 n2p5 changed the base branch from atomone-replicated-security-poc to v5.2.0-fork September 22, 2025 20:27
@n2p5 n2p5 changed the base branch from v5.2.0-fork to atomone-replicated-security-poc September 23, 2025 23:04
repeated interchain_security.ccv.v1.ConsumerPacketData list = 1
[ (gogoproto.nullable) = false ];
}
syntax = "proto3";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this invalid duplicate got here (I haven't looked on git blame yet) but proto was erroring out and I deleted to fix.

@n2p5 n2p5 marked this pull request as ready for review September 23, 2025 23:14
Copy link

@masonmcbride masonmcbride left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it looks like you added the minimum infrastructure necessary to get TopN in there. And the pr is very modular and clean.


return !iterator.Valid()
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍 and I'm assuming you didn't change anything in them just brought them back.

@n2p5 n2p5 merged commit e614a55 into atomone-replicated-security-poc Sep 25, 2025
14 checks passed
@n2p5 n2p5 mentioned this pull request Sep 25, 2025
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants