Conversation
All four previously flagged issues remain resolved. Latest commit (ac6236f) stabilizes CI timing in the audit+everlight test harness by adding a generous scaled timeout to
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
There was a problem hiding this comment.
Pull request overview
This PR (“Everlight”) integrates an Everlight rewards pool into x/supernode (new params, state, queries, and end-block distribution plumbing), adds a new STORAGE_FULL SuperNode state, and wires fee-share routing from x/action into the Everlight pool, alongside devnet/docs/tooling updates.
Changes:
- Add Everlight reward distribution configuration to supernode params + new gRPC queries for pool state and SN eligibility.
- Introduce Everlight pool state tracking (last distribution height, total distributed, per-validator distribution state) and integrate distribution execution into
x/supernodeend blocker. - Route a configurable share of action registration fees into the Everlight pool module account; add supporting devnet and documentation artifacts.
Reviewed changes
Copilot reviewed 153 out of 157 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| x/supernode/v1/types/params.go | Adds Everlight params defaults + validation hooks. |
| x/supernode/v1/types/keys.go | Adds Everlight store keys + per-validator dist key helper. |
| x/supernode/v1/types/expected_keepers.go | Extends keeper interfaces for Everlight accounting/state. |
| x/supernode/v1/types/everlight_state.go | Adds per-validator distribution state struct. |
| x/supernode/v1/types/events.go | Adds new events/attributes for storage + distribution. |
| x/supernode/v1/module/genesis.go | Persists/export last distribution height in genesis. |
| x/supernode/v1/module/depinject.go | Wires AccountKeeper into supernode keeper constructor. |
| x/supernode/v1/module/autocli.go | Adds AutoCLI query commands for Everlight state/eligibility. |
| x/supernode/v1/mocks/queryserver_mock.go | Updates query mocks for new Everlight RPCs. |
| x/supernode/v1/mocks/expected_keepers_mock.go | Updates keeper mocks for new Everlight methods. |
| x/supernode/v1/keeper/supernode_by_account_internal_test.go | Fixes keeper setup signature (AccountKeeper arg). |
| x/supernode/v1/keeper/state.go | Adds Everlight KV state helpers + EMA/growth utilities. |
| x/supernode/v1/keeper/query_get_top_super_nodes_for_block.go | Excludes STORAGE_FULL by default unless requested. |
| x/supernode/v1/keeper/query_get_reward_eligibility.go | Implements SN eligibility query with smoothing/cap logic. |
| x/supernode/v1/keeper/query_get_pool_state.go | Implements pool state query (balance/height/totals). |
| x/supernode/v1/keeper/params.go | Exposes GetRegistrationFeeShareBps for fee routing. |
| x/supernode/v1/keeper/msg_update_params.go | Merges nested Everlight params for UpdateParams. |
| x/supernode/v1/keeper/msg_server_report_supernode_metrics.go | Splits storage-only compliance into STORAGE_FULL. |
| x/supernode/v1/keeper/msg_server_report_supernode_metrics_test.go | Adds tests for STORAGE_FULL transitions/recovery. |
| x/supernode/v1/keeper/msg_server_register_supernode_test.go | Fixes keeper setup signature (AccountKeeper arg). |
| x/supernode/v1/keeper/module_account_test.go | Adds tests around Everlight module account behavior. |
| x/supernode/v1/keeper/metrics_validation.go | Introduces ComplianceResult + STORAGE_FULL detection. |
| x/supernode/v1/keeper/metrics_state.go | Adds state transition helpers/events for STORAGE_FULL. |
| x/supernode/v1/keeper/metrics_staleness.go | Includes STORAGE_FULL nodes in staleness enforcement. |
| x/supernode/v1/keeper/keeper.go | Adds AccountKeeper dependency to keeper struct/ctor. |
| x/supernode/v1/keeper/fee_routing_test.go | Adds unit tests for fee-share config + math. |
| x/supernode/v1/keeper/abci.go | Triggers Everlight distribution logic in EndBlocker. |
| x/audit/v1/types/evidence_metadata.pb.go | Comment tweak in generated evidence metadata. |
| x/audit/v1/keeper/msg_submit_evidence.go | Marks cascade client failure evidence as reserved. |
| x/audit/v1/keeper/evidence_test.go | Updates tests to reflect reserved evidence type behavior. |
| x/action/v1/types/expected_keepers.go | Adds bank module-to-module send + fee-share keeper interface. |
| x/action/v1/module/depinject.go | Injects supernode keeper as reward distribution keeper. |
| x/action/v1/keeper/keeper.go | Adds RewardDistributionKeeper to action keeper wiring. |
| x/action/v1/keeper/action.go | Routes fee share from action module into Everlight pool. |
| testutil/keeper/supernode.go | Fixes keeper setup signature (AccountKeeper arg). |
| testutil/keeper/action.go | Implements module-to-module send in test bank keeper; passes new dep. |
| tests/integration/supernode/keeper_test.go | Wires AuthKeeper into supernode keeper for integration tests. |
| proto/lumera/supernode/v1/supernode_state.proto | Adds SUPERNODE_STATE_STORAGE_FULL enum value. |
| proto/lumera/supernode/v1/query.proto | Adds PoolState and SNEligibility query RPCs/messages. |
| proto/lumera/supernode/v1/params.proto | Adds RewardDistribution + Everlight-related params fields. |
| proto/lumera/supernode/v1/metrics.proto | Adds cascade_kademlia_db_bytes metric. |
| proto/lumera/supernode/v1/genesis.proto | Adds last_distribution_height to genesis state. |
| Makefile.devnet | Adds Everlight devnet test target + no-hermes devnet target. |
| Makefile | Adds vulncheck tooling/target (govulncheck). |
| go.sum | Updates dependency checksum entries (cometbft bump). |
| go.mod | Updates Go directive + bumps cometbft dependency. |
| docs/plans/lep5-incremental-requirements.md | Adds LEP-5 incremental plan doc. |
| docs/human-playbook.md | Adds BRIDGE human playbook doc. |
| docs/gates-evals/S10-S15-gate-report.md | Adds Everlight gate report artifact. |
| docs/decisions.md | Adds ADR-style decisions log. |
| devnet/scripts/configure.sh | Copies config/validators to fixed filenames for start scripts. |
| devnet/default-config/devnet-genesis.json | Adds Everlight params + last_distribution_height to devnet genesis. |
| devnet/config/config-no-hermes.json | Adds a devnet config variant disabling hermes. |
| CLAUDE.md | Adds BRIDGE methodology guidance for Claude workflow. |
| AGENTS.md | Adds BRIDGE methodology guidance for agent workflows. |
| .gitignore | Ignores .roo/ directory. |
| .codex/config.toml | Adds Codex project config (BRIDGE profile). |
| .claude/specialists/testing-qa.md | Adds testing specialist guidance. |
| .claude/specialists/security-auth.md | Adds security/auth specialist guidance. |
| .claude/specialists/frontend-ui.md | Adds frontend specialist guidance. |
| .claude/specialists/devops-infra.md | Adds devops/infra specialist guidance. |
| .claude/specialists/database.md | Adds database specialist guidance. |
| .claude/specialists/catalog.md | Adds specialist catalog. |
| .claude/specialists/api-design.md | Adds API design specialist guidance. |
| .claude/skills/bridge-slice-plan/SKILL.md | Adds slice planning skill doc. |
| .claude/skills/bridge-session-management/SKILL.md | Adds session management skill doc. |
| .claude/skills/bridge-gate-audit/SKILL.md | Adds gate audit skill doc. |
| .claude/skills/bridge-feedback-process/SKILL.md | Adds feedback triage skill doc. |
| .claude/skills/bridge-eval-generate/SKILL.md | Adds evaluation pack skill doc. |
| .claude/skills/bridge-context-sync/SKILL.md | Adds context sync skill doc. |
| .claude/settings.json | Adds Claude tool permissions + hooks configuration. |
| .claude/rules/security.md | Adds security rules doc. |
| .claude/rules/methodology.md | Adds BRIDGE methodology rules doc. |
| .claude/hooks/session-start.sh | Adds startup hook to check BRIDGE context. |
| .claude/hooks/README.md | Documents Claude hooks. |
| .claude/hooks/post-edit-lint.sh | Adds post-edit lint hook. |
| .claude/hooks/auto-approve-cd-git.sh | Adds auto-approval for safe git commands. |
| .claude/commands/bridge-start.md | Adds bridge-start command doc. |
| .claude/commands/bridge-scope.md | Adds bridge-scope command doc. |
| .claude/commands/bridge-resume.md | Adds bridge-resume command doc. |
| .claude/commands/bridge-requirements-only.md | Adds requirements-only command doc. |
| .claude/commands/bridge-project-brief.md | Adds project-brief command doc. |
| .claude/commands/bridge-gate.md | Adds bridge-gate command doc. |
| .claude/commands/bridge-feedback.md | Adds bridge-feedback command doc. |
| .claude/commands/bridge-feature.md | Adds bridge-feature command doc. |
| .claude/commands/bridge-eval.md | Adds bridge-eval command doc. |
| .claude/commands/bridge-end.md | Adds bridge-end command doc. |
| .claude/commands/bridge-context-update.md | Adds bridge-context-update command doc. |
| .claude/commands/bridge-context-create.md | Adds bridge-context-create command doc. |
| .claude/commands/bridge-brainstorm.md | Adds bridge-brainstorm command doc. |
| .claude/commands/bridge-advisor.md | Adds bridge-advisor command doc. |
| .claude/agents/bridge-evaluator.md | Adds evaluator agent definition. |
| .claude/agents/bridge-debugger.md | Adds debugger agent definition. |
| .claude/agents/bridge-coder.md | Adds coder agent definition. |
| .claude/agents/bridge-auditor.md | Adds auditor agent definition. |
| .claude/agents/bridge-architect.md | Adds architect agent definition. |
| .bridgeinclude | Adds BRIDGE include metadata. |
| .agents/specialists/testing-qa.md | Adds agents specialist mirror (testing). |
| .agents/specialists/security-auth.md | Adds agents specialist mirror (security). |
| .agents/specialists/frontend-ui.md | Adds agents specialist mirror (frontend). |
| .agents/specialists/devops-infra.md | Adds agents specialist mirror (devops). |
| .agents/specialists/database.md | Adds agents specialist mirror (database). |
| .agents/specialists/catalog.md | Adds agents specialist mirror (catalog). |
| .agents/specialists/api-design.md | Adds agents specialist mirror (api-design). |
| .agents/skills/bridge-start/SKILL.md | Adds agents skill mirror (bridge-start). |
| .agents/skills/bridge-scope/SKILL.md | Adds agents skill mirror (bridge-scope). |
| .agents/skills/bridge-resume/SKILL.md | Adds agents skill mirror (bridge-resume). |
| .agents/skills/bridge-requirements-only/SKILL.md | Adds agents skill mirror (requirements-only). |
| .agents/skills/bridge-project-brief/SKILL.md | Adds agents skill mirror (project-brief). |
| .agents/skills/bridge-gate/SKILL.md | Adds agents skill mirror (bridge-gate). |
| .agents/skills/bridge-feedback/SKILL.md | Adds agents skill mirror (bridge-feedback). |
| .agents/skills/bridge-feature/SKILL.md | Adds agents skill mirror (bridge-feature). |
| .agents/skills/bridge-eval/SKILL.md | Adds agents skill mirror (bridge-eval). |
| .agents/skills/bridge-end/SKILL.md | Adds agents skill mirror (bridge-end). |
| .agents/skills/bridge-context-update/SKILL.md | Adds agents skill mirror (context-update). |
| .agents/skills/bridge-context-create/SKILL.md | Adds agents skill mirror (context-create). |
| .agents/skills/bridge-brainstorm/SKILL.md | Adds agents skill mirror (brainstorm). |
| .agents/skills/bridge-advisor/SKILL.md | Adds agents skill mirror (advisor). |
| .agents/procedures/bridge-slice-plan.md | Adds slice planning procedure. |
| .agents/procedures/bridge-session-management.md | Adds session management procedure. |
| .agents/procedures/bridge-gate-audit.md | Adds gate audit procedure. |
| .agents/procedures/bridge-feedback-process.md | Adds feedback triage procedure. |
| .agents/procedures/bridge-eval-generate.md | Adds evaluation generation procedure. |
| .agents/procedures/bridge-context-sync.md | Adds context sync procedure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…`max_storage_usage_percent` for `STORAGE_FULL` transitions, refine reward distribution params, and update documentation accordingly.
…ribution, edge cases, and Everlight eligibility; introduce Go version bump and CLI enhancements.
…eterministic timing
… keeper pointer assertion
…fix devnet test assertions Three surgical changes on top of the Everlight PR: 1) x/supernode/v1/keeper/distribution.go PR #113 introduced 'import lumera/config' in the distribution keeper so it could reference config.ChainDenom when building payout coins. That package's init() calls sdk.GetConfig().Seal() at package-init time. Any Go consumer of x/supernode/v1/keeper (notably the supernode repo, which pulls in this package transitively via sdk/action -> cascadekit) therefore ended up with a pre-sealed SDK config, causing its own keyring.InitSDKConfig() to panic with 'Config is sealed' at startup. Replace the cross-package dependency with a package-local constant 'everlightDenom = "ulume"' used in all three payout accounting sites. Add a unit test (TestEverlightDenomMatchesConfig in distribution_test.go) that asserts everlightDenom == config.ChainDenom so the two never drift. The test file already imported lumera/config for other fixtures, so adding the assertion does not introduce a new import and does not expose the seal to non-test consumers. 2) devnet/tests/everlight/everlight_test.sh — S7.2 The governance proposal test hard-coded a 1_000_000_000 ulume deposit which is not guaranteed to be satisfiable by the funded test account on all devnet genesis profiles, producing spurious 'tx code=5 (insufficient funds)' failures. Query gov params for the configured min_deposit in DENOM and use that amount, with a conservative fallback if the query shape is unexpected. 3) devnet/tests/everlight/everlight_test.sh — S8.1c Under PR #113 the flat 'get-metrics' query surface was removed in favour of the per-SN 'sn-eligibility' response which carries cascade_kademlia_db_bytes (the value that drives Everlight payouts). The S8.1c assertion still hit the deprecated surface and failed with NotFound. Prefer 'sn-eligibility'; fall back to the legacy 'get-metrics' seeding path only if the new surface does not expose the field. Verified: go build ./... OK, go test ./x/supernode/... OK, bash -n on script OK.
RCA — three system tests failed intermittently on CI (the exact same
commit SHA passed on one trigger and failed on another, confirming
flakiness rather than a real regression):
- TestAuditRecovery_PostponedBecomesActiveWithSelfAndPeerOpen_NoHostThresholds
audit_recovery_enforcement_test.go:91 → RequireTxSuccess(tx2e2)
got 'tx committed: false' — the 3rd back-to-back tx in an epoch
window missed the 3-block commit wait in cli.awaitTxCommitted.
- TestAuditSubmitReportAndQuery
audit_submit_and_query_test.go:47 'Timeout - block 21 not reached
within 14s' — awaitAtLeastHeight delegated to sut.AwaitBlockHeight
without an explicit timeout, so the default (delta+3)*blockTime
of 14s was insufficient under CI load.
- TestEverlightSystem_AuditDrivesStorageFullState
everlight_system_test.go:83 'Timeout - block 31 not reached within
11s' — same root cause as TestAuditSubmitReportAndQuery.
Fixes (only the test harness is touched; no protocol or state-machine
code changes):
1) tests/systemtests/cli.go
Extend the tx-commit wait window in LumeradCli.awaitTxCommitted from
3 blocks to 5. This adds ~2s of additional tolerance for the 'third
tx in a burst' case without changing behaviour for the common path.
(The loop still short-circuits as soon as the tx is observed in a
block, so passing tests do not get slower.)
2) tests/systemtests/audit_test_helpers_test.go
awaitAtLeastHeight now computes its own generous AwaitBlockHeight
timeout: (delta + 15) * blockTime, floor 30s. With blockTime=1s this
guarantees at least 30s of slack even on the tightest call sites,
instead of the tight (delta+3)*blockTime default.
Local verification (exact CI commands):
- ignite chain build --build.tags ledger -y -t linux:amd64 (go 1.25.9)
- (cd tests/systemtests && go test -tags=system_test -timeout 20m -v .)
→ 15/15 PASS in 662.897s (all 3 previously-flaky tests included).
- go test ./x/... → all packages pass.
- go test -tags=integration ./tests/integration/... → all packages pass.
Risk: zero behaviour change to production code. The extended waits only
delay failure on genuinely broken tests by a few seconds.
Integrates two master commits into the evm feature branch: - 7ca770a Everlight (#113): new v1.12.0 upgrade handler, supernode storage-full / storage-recovered / reward-distribution events, reward attribute keys. Coexists with evm's v1.20.0 upgrade (both registered). - 1de7dda fix(cli) (#115): float64 marshal fix for audit/supernode CLI. Conflicts resolved: - upgrades registry / tests: both v1.12.0 (Everlight) and v1.20.0 (EVM) handlers registered side-by-side. - supernode event type list + reward attribute keys: union of both sides. - Makefile / Makefile.devnet / gitignore / CI workflows: union of both sides' additions; determinism.yml keeps evm's 500ulume fees for the EVM feemarket minimum and drops the now-unused submit_evidence_tx helper. - release.yml: kept evm's shared build.yml refactor. - go.mod / tests/systemtests/go.mod: reconciled via go mod tidy (Go 1.26.2, cosmos-sdk v0.53.6, gjson v1.18.0, grpc v1.80.0). - devnet/default-config/devnet-genesis.json: kept master's additional audit params (min_cpu/mem/disk_free_percent, sc_challengers_per_epoch). - devnet/scripts/configure.sh: kept master's deterministic config.json / validators.json rename on copy. - docs/static/openapi.yml: kept master's spec (will be regenerated by make openrpc). - audit_test_helpers_test.go: kept master's more robust timeout floor. - Everlight distribution/eligibility tests: renamed lcfg.{Account,Validator}AddressPrefix to their evm-branch Bech32-prefixed equivalents (Bech32AccountAddressPrefix / Bech32ValidatorAddressPrefix). - Unused-linter errors on master's storage-full helpers (markStorageFull / recoverFromStorageFull / lastNonDegradedState) suppressed with //nolint:unused pending the follow-up audit enforcement wiring. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
This PR delivers Cascade Everlight Phase 1 on-chain by embedding payout logic into
x/supernode(no new module yet), wiring funding from registration fees, and introducing observability/query surfaces for payout state.At a high level, this implements:
STORAGE_FULLsupport in payout eligibility,Product Goal (Why Everlight)
Everlight aligns rewards with measurable storage contribution (
cascade_kademlia_db_bytes) while preserving deterministic protocol behavior and auditability.Goals:
STORAGE_FULLnodes to remain payout-eligible when appropriate.Engineering Design (How it works)
1) Reward pool and cadence
payment_period_blocks.2) Eligibility gates
A supernode must pass all key gates:
ACTIVEorSTORAGE_FULL),3) Weight computation
Per supernode:
4) Payout execution
5) State source split
host_report.cascade_kademlia_db_bytes).STORAGE_FULLtransition is enforced via audit report path in this rollout.New/Updated Query Surfaces
pool-stateReturns pool balance, last distribution height, total distributed, eligible count.
sn-eligibility <validator>Returns eligibility boolean, reason, bytes view, smoothed weight.
payout-history <validator>(new)Returns payout entries (height, amount, bytes/weights, recipient metadata).
Everlight Params (defaults / behavior)
payment_period_blocks100800registration_fee_share_bps200(2%)min_cascade_bytes_for_payment1073741824(1 GiB)new_sn_ramp_up_periods4measurement_smoothing_periods4usage_growth_cap_bps_per_period1000(10%)Related supernode gates used by payout path include:
metrics_freshness_max_blocks(default5000)max_storage_usage_percent(default90)Upgrade Handler (
v1.12.0)Upgrade behavior:
Notes:
Tests Added / Extended
ACTIVE -> STORAGE_FULL -> ACTIVE, payout + history checksdevnet/tests/everlight/everlight_test.shscenarios for bootstrap, governance, storage-full transitions, payout preconditions, anti-gaming checksRequired Supernode-side Changes
Supernode reporting must provide (via epoch host report):
disk_usage_percentcascade_kademlia_db_bytesOperationally important:
pool-state,sn-eligibility,payout-history) should be integrated into supernode observability workflows.Release Checklist