Skip to content
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

Add the quarantine module. #1926

Merged
merged 29 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1a34ce8
[1902]: Copy the quarantine protos and code from our SDK fork.
SpicyLemon Apr 10, 2024
0b6cc38
[1902]: Update the go_package of the quarantine protos.
SpicyLemon Apr 10, 2024
f04cc5c
[1902]: Fix all the imports of quarantine stuff that are in the quara…
SpicyLemon Apr 10, 2024
1fa95a8
[1902]: Remove imports of the sdk's simapp and fix a few low-hanging-…
SpicyLemon Apr 10, 2024
ecc8c32
[1902]: Clean up the codec.
SpicyLemon Apr 10, 2024
f9e453a
[1902]: Make the module satisfy the AppModule interface, and clean up…
SpicyLemon Apr 10, 2024
afe4293
[1902]: Get rid of all the old tendermint imports as well as the bank…
SpicyLemon Apr 10, 2024
cb357b0
[1902]: Update the expected keepers.
SpicyLemon Apr 10, 2024
b1639c3
[1902]: Switch the send restriction to use a context.Context.
SpicyLemon Apr 10, 2024
2e61eca
[1902]: Fix the KVStore and prefix imports. Fix use of sdk.NewInt. Fi…
SpicyLemon Apr 10, 2024
a534292
[1902]: Use the provenance AssertErrorContents instead of the one in …
SpicyLemon Apr 10, 2024
833c3f8
[1902]: Knock out the rest of the quarantine TODOs.
SpicyLemon Apr 10, 2024
c82add1
[1902]: Clean up a couple possible lint complaints.
SpicyLemon Apr 10, 2024
c246f80
[1902]: Format+lint the protos and regenerate stuff from them.
SpicyLemon Apr 10, 2024
b22dad9
Merge branch 'main' into dwedul/1902-quarantine
SpicyLemon Apr 10, 2024
b7749a2
Merge branch 'main' into dwedul/1902-quarantine
SpicyLemon Apr 11, 2024
9372213
[1902]: Copy in an updated swagger_third_party.yaml.
SpicyLemon Apr 11, 2024
6e0c750
[1902]: Update swagger.
SpicyLemon Apr 11, 2024
820928c
Merge branch 'main' into dwedul/1902-quarantine
SpicyLemon Apr 11, 2024
042d6be
[1902]: Update the simulation operations to properly report the modul…
SpicyLemon Apr 11, 2024
0ce6380
[1902]: Fix the client CLI tests.
SpicyLemon Apr 11, 2024
3fb971f
[1902]: Cut the quarantine and sanction cli test runtimes in half.
SpicyLemon Apr 12, 2024
3057f80
[1902]: Update the block waiters to include the first lookup as part …
SpicyLemon Apr 12, 2024
e148678
[1902]: Fix some unit tests that started failing because the SDK twea…
SpicyLemon Apr 12, 2024
e0e485d
[1902]: Remove the norace build tags from the quarantine and sanction…
SpicyLemon Apr 12, 2024
baf21b9
[1902]: Make the quarantine module account unsanctionable, and restor…
SpicyLemon Apr 12, 2024
b75d1af
[1902]: Add changelog entry.
SpicyLemon Apr 12, 2024
63fd040
[1902]: Update the spec docs.
SpicyLemon Apr 12, 2024
8bd078e
Merge branch 'main' into dwedul/1902-quarantine
SpicyLemon Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
* Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).

### Improvements

Expand Down
64 changes: 31 additions & 33 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ import (
icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper"
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"

// "github.com/cosmos/cosmos-sdk/x/quarantine" // TODO[1760]: quarantine
// quarantinekeeper "github.com/cosmos/cosmos-sdk/x/quarantine/keeper" // TODO[1760]: quarantine
// quarantinemodule "github.com/cosmos/cosmos-sdk/x/quarantine/module" // TODO[1760]: quarantine

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -175,7 +171,9 @@ import (
oraclekeeper "github.com/provenance-io/provenance/x/oracle/keeper"
oraclemodule "github.com/provenance-io/provenance/x/oracle/module"
oracletypes "github.com/provenance-io/provenance/x/oracle/types"

"github.com/provenance-io/provenance/x/quarantine"
quarantinekeeper "github.com/provenance-io/provenance/x/quarantine/keeper"
quarantinemodule "github.com/provenance-io/provenance/x/quarantine/module"
"github.com/provenance-io/provenance/x/sanction"
sanctionkeeper "github.com/provenance-io/provenance/x/sanction/keeper"
sanctionmodule "github.com/provenance-io/provenance/x/sanction/module"
Expand Down Expand Up @@ -249,23 +247,23 @@ type App struct {
memKeys map[string]*storetypes.MemoryStoreKey

// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
GroupKeeper groupkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
MsgFeesKeeper msgfeeskeeper.Keeper
// QuarantineKeeper quarantinekeeper.Keeper // TODO[1760]: quarantine
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
GroupKeeper groupkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
MsgFeesKeeper msgfeeskeeper.Keeper
QuarantineKeeper quarantinekeeper.Keeper
SanctionKeeper sanctionkeeper.Keeper
TriggerKeeper triggerkeeper.Keeper
OracleKeeper oraclekeeper.Keeper
Expand Down Expand Up @@ -377,7 +375,7 @@ func New(
nametypes.StoreKey,
msgfeestypes.StoreKey,
wasmtypes.StoreKey,
// quarantine.StoreKey, // TODO[1760]: quarantine
quarantine.StoreKey,
sanction.StoreKey,
triggertypes.StoreKey,
oracletypes.StoreKey,
Expand Down Expand Up @@ -562,8 +560,8 @@ func New(
)

markerReqAttrBypassAddrs := []sdk.AccAddress{
authtypes.NewModuleAddress(authtypes.FeeCollectorName), // Allow collecting fees in restricted coins.
// authtypes.NewModuleAddress(quarantine.ModuleName), // Allow quarantine to hold onto restricted coins. // TODO[1760]: quarantine
authtypes.NewModuleAddress(authtypes.FeeCollectorName), // Allow collecting fees in restricted coins.
authtypes.NewModuleAddress(quarantine.ModuleName), // Allow quarantine to hold onto restricted coins.
authtypes.NewModuleAddress(govtypes.ModuleName), // Allow restricted coins in deposits.
authtypes.NewModuleAddress(distrtypes.ModuleName), // Allow fee denoms to be restricted coins.
authtypes.NewModuleAddress(stakingtypes.BondedPoolName), // Allow bond denom to be a restricted coin.
Expand Down Expand Up @@ -691,7 +689,7 @@ func New(
for mName := range maccPerms {
unsanctionableAddrs = append(unsanctionableAddrs, authtypes.NewModuleAddress(mName))
}
// unsanctionableAddrs = append(unsanctionableAddrs, authtypes.NewModuleAddress(quarantine.ModuleName)) // TODO[1760]: quarantine
unsanctionableAddrs = append(unsanctionableAddrs, authtypes.NewModuleAddress(quarantine.ModuleName))
app.SanctionKeeper = sanctionkeeper.NewKeeper(appCodec, keys[sanction.StoreKey],
app.BankKeeper, &app.GovKeeper,
govAuthority, unsanctionableAddrs)
Expand Down Expand Up @@ -737,7 +735,7 @@ func New(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

// app.QuarantineKeeper = quarantinekeeper.NewKeeper(appCodec, keys[quarantine.StoreKey], app.BankKeeper, authtypes.NewModuleAddress(quarantine.ModuleName)) // TODO[1760]: quarantine
app.QuarantineKeeper = quarantinekeeper.NewKeeper(appCodec, keys[quarantine.StoreKey], app.BankKeeper, authtypes.NewModuleAddress(quarantine.ModuleName))

/**** Module Options ****/

Expand Down Expand Up @@ -766,7 +764,7 @@ func New(
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
// quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), // TODO[1760]: quarantine
quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
sanctionmodule.NewAppModule(appCodec, app.SanctionKeeper, app.AccountKeeper, app.BankKeeper, app.GovKeeper, app.interfaceRegistry),

// PROVENANCE
Expand Down Expand Up @@ -851,7 +849,7 @@ func New(
icqtypes.ModuleName,
nametypes.ModuleName,
vestingtypes.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,
hold.ModuleName,
exchange.ModuleName,
Expand Down Expand Up @@ -892,7 +890,7 @@ func New(
markertypes.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,
hold.ModuleName,
exchange.ModuleName,
Expand Down Expand Up @@ -920,7 +918,7 @@ func New(
authz.ModuleName,
group.ModuleName,
feegrant.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,

nametypes.ModuleName,
Expand Down Expand Up @@ -967,7 +965,7 @@ func New(
ibctransfertypes.ModuleName,
upgradetypes.ModuleName,
vestingtypes.ModuleName,
// quarantine.ModuleName, // TODO[1760]: quarantine
quarantine.ModuleName,
sanction.ModuleName,
hold.ModuleName,
exchange.ModuleName,
Expand Down Expand Up @@ -1009,7 +1007,7 @@ func New(
evidence.NewAppModule(app.EvidenceKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
// quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), // TODO[1760]: quarantine
quarantinemodule.NewAppModule(appCodec, app.QuarantineKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
sanctionmodule.NewAppModule(appCodec, app.SanctionKeeper, app.AccountKeeper, app.BankKeeper, app.GovKeeper, app.interfaceRegistry),

metadata.NewAppModule(appCodec, app.MetadataKeeper, app.AccountKeeper),
Expand Down
4 changes: 2 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
evidencetypes "cosmossdk.io/x/evidence/types"

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types"
// "github.com/cosmos/cosmos-sdk/x/quarantine" // TODO[1760]: quarantine

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -56,6 +55,7 @@ import (
metadatatypes "github.com/provenance-io/provenance/x/metadata/types"
msgfeetype "github.com/provenance-io/provenance/x/msgfees/types"
nametypes "github.com/provenance-io/provenance/x/name/types"
"github.com/provenance-io/provenance/x/quarantine"
"github.com/provenance-io/provenance/x/sanction"
triggertypes "github.com/provenance-io/provenance/x/trigger/types"
)
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestAppImportExport(t *testing.T) {
{app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}},
{app.keys[capabilitytypes.StoreKey], newApp.keys[capabilitytypes.StoreKey], [][]byte{}},
{app.keys[authzkeeper.StoreKey], newApp.keys[authzkeeper.StoreKey], [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}},
// {app.keys[quarantine.StoreKey], newApp.keys[quarantine.StoreKey], [][]byte{}}, // TODO[1760]: quarantine
{app.keys[quarantine.StoreKey], newApp.keys[quarantine.StoreKey], [][]byte{}},
{app.keys[sanction.StoreKey], newApp.keys[sanction.StoreKey], [][]byte{}},

{app.keys[markertypes.StoreKey], newApp.keys[markertypes.StoreKey], [][]byte{}},
Expand Down
7 changes: 7 additions & 0 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@
"url": "./tmp-swagger-gen/cosmos/sanction/v1beta1/tx.swagger.json"
},

{
"url": "./tmp-swagger-gen/cosmos/quarantine/v1beta1/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/cosmos/quarantine/v1beta1/tx.swagger.json"
},

{
"url": "./tmp-swagger-gen/provenance/trigger/v1/query.swagger.json"
},
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading
Loading