From 7af9e9d496c67e5eede9f0bf8d7943c478e93c87 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 14 May 2025 06:24:55 +0000 Subject: [PATCH] Add evidence module (#71) Part of https://www.notion.so/Add-evidence-module-for-double-signing-slashing-1f2a6b22d472805b8609e2122c5b0328 Reviewed-on: https://git.vdb.to/cerc-io/laconicd/pulls/71 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- app/app.go | 4 ++++ app/app.yaml | 7 +++++-- go.mod | 1 + go.sum | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 08d39552..8669716c 100644 --- a/app/app.go +++ b/app/app.go @@ -12,6 +12,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" + evidencekeeper "cosmossdk.io/x/evidence/keeper" auctionkeeper "git.vdb.to/cerc-io/laconicd/x/auction/keeper" bondkeeper "git.vdb.to/cerc-io/laconicd/x/bond/keeper" @@ -44,6 +45,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" _ "cosmossdk.io/api/cosmos/tx/config/v1" // import for side-effects + _ "cosmossdk.io/x/evidence" // import for side-effects _ "git.vdb.to/cerc-io/laconicd/x/auction/module" // import for side-effects _ "git.vdb.to/cerc-io/laconicd/x/bond/module" // import for side-effects _ "git.vdb.to/cerc-io/laconicd/x/onboarding/module" // import for side-effects @@ -89,6 +91,7 @@ type LaconicApp struct { GovKeeper *govkeeper.Keeper CrisisKeeper *crisiskeeper.Keeper ConsensusParamsKeeper consensuskeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper // laconic keepers AuctionKeeper *auctionkeeper.Keeper // (Use * as per ProvideModule implementation) @@ -162,6 +165,7 @@ func NewLaconicApp( &app.GovKeeper, &app.CrisisKeeper, &app.ConsensusParamsKeeper, + &app.EvidenceKeeper, &app.AuctionKeeper, &app.BondKeeper, &app.RegistryKeeper, diff --git a/app/app.yaml b/app/app.yaml index 75fae7f0..78b27298 100644 --- a/app/app.yaml +++ b/app/app.yaml @@ -6,11 +6,11 @@ modules: # During begin block slashing happens after distr.BeginBlocker so that # there is nothing left over in the validator fee pool, so as to keep the CanWithdrawInvariant invariant. # NOTE: staking module is required if HistoricalEntries param > 0 - begin_blockers: [distribution, slashing, staking] + begin_blockers: [distribution, slashing, evidence, staking] end_blockers: [crisis, gov, staking, auction, registry] # NOTE: The genutils module must occur after staking so that pools are properly initialized with tokens from genesis accounts. # NOTE: The genutils module must also occur after auth so that it can access the params from auth. - init_genesis: [auth, bank, distribution, staking, slashing, gov, crisis, genutil, auction, bond, registry, onboarding] + init_genesis: [auth, bank, distribution, staking, slashing, gov, crisis, genutil, evidence, auction, bond, registry, onboarding] override_store_keys: - module_name: auth kv_store_key: acc @@ -62,6 +62,9 @@ modules: - name: crisis config: "@type": cosmos.crisis.module.v1.Module + - name: evidence + config: + "@type": cosmos.evidence.module.v1.Module - name: bond config: "@type": cerc.bond.module.v1.Module diff --git a/go.mod b/go.mod index 37664171..d1c5352d 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1 cosmossdk.io/tools/confix v0.1.0 + cosmossdk.io/x/evidence v0.1.1 github.com/99designs/gqlgen v0.17.22 github.com/cometbft/cometbft v0.38.12 github.com/cosmos/cosmos-db v1.0.2 diff --git a/go.sum b/go.sum index f21bdf80..a572e5a6 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,8 @@ cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/tools/confix v0.1.0 h1:2OOZTtQsDT5e7P3FM5xqM0bPfluAxZlAwxqaDmYBE+E= cosmossdk.io/tools/confix v0.1.0/go.mod h1:TdXKVYs4gEayav5wM+JHT+kTU2J7fozFNqoVaN+8CdY= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=