Skip to content

feat(rs)!: ICS with RS only POC experiment #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: v5.2.0-fork
Choose a base branch
from

Conversation

n2p5
Copy link
Collaborator

@n2p5 n2p5 commented Aug 1, 2025

Description

This is a WIP experiment of:

  • forking ICS v5.2.0
  • upgrading to cosmos SDK v0.50.13
  • stripping out PSS code so that we only rely on RS

Context: AtomOne is currently in the process of upgrading CosmosSDK to v0.50.13 atomone-hub/atomone#141

We aim to be compatible with this change so that we can complement IBC compatibility efforts with the gno.land project and be able to provide ICS support when the time comes.

WIP

I'm currently taking a chainsaw to a knife fight with this, pulling out all the PSS stuff as we explore a simplified and patched Replicated Security flow. We aim to maintain unit testing as we explore here, and so far, that is what we have achieved. I'll update my findings as we go.

Active Experiment: Remove all Partial Set Security (PSS) features to create pure Replicated Security for AtomOne

Key Changes Breakdown

1. Core PSS Removal (~11,000 lines removed)

9 files completely deleted (~3,700 lines):

  • x/ccv/provider/keeper/partial_set_security.go (320 lines)
  • x/ccv/provider/keeper/partial_set_security_test.go (684 lines)
  • tests/e2e/steps_partial_set_security.go (2,441 lines)
  • 3 MBT model files (331 lines)
  • 3 documentation files

Additional removals:

  • ~925 PSS-specific function calls removed from existing files
  • 420+ lines removed from keeper.go (29 PSS functions)

2. Protobuf Changes (~6,000 lines - mostly generated)

Proto definitions modified (actual changes ~300 lines):

  • tx.proto: Removed MsgOptIn, MsgOptOut, MsgSetConsumerCommissionRate
  • query.proto: Removed PSS-specific queries
  • provider.proto: Cleaned up deprecated fields
  • shared_consumer.proto: Removed soft_opt_out_threshold

Generated .pb.go files (automated, can skip review):

  • tx.pb.go: -2,020 lines
  • query.pb.go: -1,709 lines
  • provider.pb.go: -573 lines

3. Dependency Updates (~1,100 lines)

  • go.mod: AtomOne SDK v0.50.13 integration (132 changes)
  • go.sum: Dependency updates (989 changes)

Review Priority Guide

Priority 1: Core Logic Changes (Must Review)

Focus on the business logic changes in these files:

x/ccv/provider/keeper/validator_set_update.go (+14 lines)

  • REMOVED all opt-in/TopN filtering logic
  • SIMPLIFIED ComputeNextValidators() to return all bonded validators

x/ccv/provider/keeper/relay.go (review diff)

  • REMOVED TopN and opt-in logic from QueueVSCPackets
  • ENSURED All bonded validators now participate automatically

x/ccv/provider/keeper/keeper.go (review removals)

  • REMOVED PSS functions
  • REMOVED State storage keys

x/ccv/provider/keeper/proposal.go (review cleanup)

  • REMOVED PSS cleanup from StopConsumerChain

Priority 2: Protocol Definitions (Quick Review)

Review the intent, not the generated code:

  • Proto files (proto/interchain_security/ccv/provider/v1/*.proto)
    • VERIFY message removals are complete
    • CHECK for any remaining PSS references

Priority 3: Test Updates (Spot Check)

  • Integration tests updated for pure RS
  • PSS-specific tests removed
  • Verify test coverage remains adequate

🔍 What to Look For

Verify Complete Removal

These searches should return no results:

grep -r "OptIn\|OptOut\|TopN\|PowerShaping\|ConsumerCommission" x/ccv/provider/
grep -r "Allowlist\|Denylist\|ValidatorsPowerCap" x/ccv/provider/
grep -r "soft_opt_out" x/ccv/

Confirm Replicated Security Behavior

  • All bonded validators must validate all consumer chains
  • No partial validator sets
  • No commission rate customization per consumer

Known Issues

  • Integration tests fail due to CometBFT version mismatch (not related to PSS removal)
  • This is expected and will be addressed separately

Quick Review Path

  1. Start with: validator_set_update.go and relay.go for core changes
  2. Then check: Proto files for completeness
  3. Skip: All .pb.go files (generated)
  4. Skip: go.mod/go.sum (dependency management)
  5. Spot check: A few test files for correctness

Acceptance Criteria

  • No PSS references remain in provider module
  • All validators must validate all consumer chains
  • Tests pass with new RS-only behavior

Summary: This PR successfully removes ~12,000 lines of PSS code while maintaining a clean, working Replicated Security implementation. The actual logic changes are minimal and focused, making this a surgical removal rather than a refactor.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if the change is state-machine breaking
  • Confirmed this PR does not introduce changes requiring state migrations, OR migration code has been added to consumer and/or provider modules
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry to CHANGELOG.md
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed
  • If this PR is library API breaking, bump the go.mod version string of the repo, and follow through on a new major release

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! the type prefix if the change is state-machine breaking
  • confirmed this PR does not introduce changes requiring state migrations, OR confirmed migration code has been added to consumer and/or provider modules
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

@n2p5 n2p5 changed the title feat: upgrade to AtomOne SDK v0.50.13 and fix Go 1.24.5 compatibility DRAFT: ICS with RS only POC experiment Aug 1, 2025
@n2p5 n2p5 changed the title DRAFT: ICS with RS only POC experiment feat(rs)!: ICS with RS only POC experiment Aug 1, 2025
@n2p5 n2p5 force-pushed the atomone-replicated-security-poc branch from b0ab4bd to 354f839 Compare August 6, 2025 18:11
@n2p5 n2p5 force-pushed the atomone-replicated-security-poc branch from 354f839 to 0d95b37 Compare August 6, 2025 18:19
@n2p5
Copy link
Collaborator Author

n2p5 commented Aug 14, 2025

Discoveries:

  • AtomOne Cosmos SDK 0.50.13 upgrades from IBC from v7 -> v10
  • cosmos ICS v5.2 is on IBC v8 and doesn't upgrade to IBC v10 until v7

This has been interesting and somewhat of a rabbit hole I've been going down, but I think I'll have some POC worthy code soon (maybe I am too optimistic here).

@n2p5
Copy link
Collaborator Author

n2p5 commented Aug 15, 2025

I've merged the work of the IBC v10 experiment into this POC branch for simplicity, putting this link here for traceability and so that it is easy to diff this major change to this experiment. #3

n2p5 and others added 4 commits August 20, 2025 11:18
feat: update core deps and remove x/crisis
feat: apply pr 2098 (provider-side removal of vscmatured packet) to our ics module
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