Skip to content

feat: wire x/evidence into the provider app and tidy both app wirings - #73

Open
giunatale wants to merge 1 commit into
giunatale/feat/offline-detectionfrom
giunatale/feat/provider-evidence-and-app-wiring
Open

feat: wire x/evidence into the provider app and tidy both app wirings#73
giunatale wants to merge 1 commit into
giunatale/feat/offline-detectionfrom
giunatale/feat/provider-evidence-and-app-wiring

Conversation

@giunatale

@giunatale giunatale commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

The reference provider app never wired x/evidence, so a provider-native
double-sign (CometBFT duplicate-vote evidence) was silently unpunished — the
mock app must be faithful to what a real embedding chain needs, or localnet and
e2e exercise a security model that doesn't exist.

What

  • Wire x/evidence into the provider app: keeper, store key, module, and the
    begin-blocker that consumes CometBFT duplicate-vote evidence and routes it to
    slashing — slash, jail, tombstone.
  • Add a full-app ABCI test that submits real DUPLICATE_VOTE evidence through
    FinalizeBlock and asserts the validator is slashed, jailed, and tombstoned
    (and that it was not before the wiring).
  • App-wiring hygiene, both apps: remove the dead gov keeper and its unused
    setter; add the IBC redundant-relay ante decorator on the provider; de-dup
    the consumer's params module registration; strip gentx/collect-gentxs from
    the consumer daemon (a consumer's validator set comes from the provider, not
    gentxs); remove test-only protobuf services from production binaries; delete
    an example upgrade handler; check the SetModuleVersionMap error; capture
    previously swallowed zero-height export errors; command-root cosmetics.
  • Register amino-json for both modules' messages so Ledger and legacy signing
    work.
  • Consumer query polish: proper gRPC status errors and nil-request guards on
    the provider-info and staking queries.

Note for embedding chains: any real provider chain must wire x/evidence the
same way, or provider-native equivocation goes unpunished (also stated in the
security-model documentation).

The app/ module is now actually covered by CI

app/ is a separate Go module, and both make test and make lint only walked
the root module — go list ./... does not cross module boundaries. So every test
in the app module, starting with the one added here, had never run in CI, and the
module's code had never been linted. Both targets now cover it (as does
vulncheck), and the 16 findings that surfaced the first time the app module was
linted are fixed on their merits rather than annotated away: the two
appendAssign hits were growing a shared package-level slice and now clone it,
the unparam hits had genuinely dead parameters removed (a consumer chain wires
no staking, so there is nothing to jail), and the two malformed nolint
directives were reformatted. No new suppressions.

Testing

The new full-app evidence test plus build, lint, and the full unit suite,
all green.

@giunatale

Copy link
Copy Markdown
Contributor Author

Branched from giunatale/feat/offline-detection (#63).
Opened against that branch so only this PR's commit shows; will retarget to main after #63 lands and this rebases.

- wire x/evidence (keeper, store key, module, begin-blocker) into the
  provider app so CometBFT duplicate-vote evidence is slashed, jailed,
  and tombstoned; add a full-app test that asserts that path end to end
- app-wiring hygiene: drop the dead gov keeper and unused SetGovKeeper,
  add RedundantRelayDecorator to the provider ante, de-dup the consumer
  params module, strip gentx/collect-gentxs from the consumer daemon,
  remove the testpb wiring and the example vaas-v1-to-v2 upgrade handler,
  check the SetModuleVersionMap error, capture the zero-height export
  errors, and clean up the command-root cosmetics
- register amino-json for the provider and consumer module messages so
  Ledger and legacy signing work
- return proper gRPC errors (status.Error, nil-request guards) from the
  consumer provider-info and staking queries
- extend the make test target to the app module: app/ is its own Go
  module, so the root go list ./... never reached it and every app test
  (starting with the one added here) was silently skipped by CI
- extend make lint the same way, plus lint-fix and vulncheck, and give
  rundep an absolute modfile path so devdeps still resolves from inside
  app/; golangci-lint had never walked the app module, which was hiding
  16 issues
- fix all 16: gci import order in 9 files, the two
  append(authtx.DefaultSignModes, ...) calls that grew a package-level
  slice shared with every other caller, the unused jailAllowedAddrs
  parameter on the consumer prepForZeroHeightGenesis (a consumer wires no
  staking module, so it has nothing to jail), the always-nil error
  returned by enrichAutoCliOpts on both command roots, and two nolint
  directives written with a leading space
@giunatale
giunatale force-pushed the giunatale/feat/provider-evidence-and-app-wiring branch from 3538422 to 9683cd3 Compare July 31, 2026 18:41
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