Skip to content

feat: x/pot — Compliant PoS with token ownership requirements#45

Open
trevormil wants to merge 1 commit intomasterfrom
feat/x-pot
Open

feat: x/pot — Compliant PoS with token ownership requirements#45
trevormil wants to merge 1 commit intomasterfrom
feat/x-pot

Conversation

@trevormil
Copy link
Copy Markdown
Collaborator

Summary

  • New x/pot module that adds a compliance gate on top of x/staking
  • Validators must hold a x/tokenization credential token to have voting power
  • Three modes: staked_multiplier (compliant PoS), equal (democratic with slashing), credential_weighted (weighted by token balance)
  • Post-transfer hook → queue → EndBlocker architecture
  • 28 unit tests (params validation, queue operations, EndBlocker logic for all modes)

Backlog

Implements autopilot backlog #0155

Test plan

  • Params validation tests (10 tests)
  • Queue/hooks tests (6 tests)
  • EndBlocker tests for all three modes (18 tests — staked_multiplier, equal, credential_weighted, jailed/unbonded/non-validator edge cases)
  • Integration test with real x/tokenization + x/staking keepers
  • Wire into app.go and test on local testnet

🤖 Generated with Claude Code

New module that gates validator voting power on x/tokenization credential
token ownership. Supports both x/staking and PoA backends via abstracted
ValidatorSetKeeper interface.

Features:
- Binary credential gate: has token = full power, no token = disabled
- Dual backend: StakingAdapter (x/staking+x/slashing) and PoAAdapter
- Respects slashing: won't unjail tombstoned or still-jailed validators
- CacheContext for atomic EndBlocker state changes
- Per-disable/enable inner CacheContext preventing partial state corruption
- Self-healing proto/JSON params migration
- Registered invariant for compliance-jailed set consistency
- CLI: tx pot update-params, query pot params
- Proto-generated types (params, genesis, tx, query)
- Governance-controlled params (10s voting period for testing)
- Safety: never jails all validators, comprehensive error handling

Tested:
- 10 unit tests (params, queue, EndBlocker logic)
- Full E2E: create credentials, enable via governance, revoke credential,
  verify compliance-jailing, verify chain continues
- Two rounds of security review (15 findings found and fixed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant