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

Proposal 29 implementation #480

Merged
merged 37 commits into from Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c3b91a8
Implementation of proposal 29
zmanian Oct 7, 2020
1a05be1
Update to latest sdk master (IBC reorg)
jackzampolin Oct 5, 2020
0bf56ff
Update to latest SDK master
jackzampolin Oct 6, 2020
597e078
Update to latest sdk master
jackzampolin Oct 7, 2020
df38701
Update gaia to support the new IBC related governance proposal and ot…
zmanian Oct 10, 2020
9a84b4f
fix build
tac0turtle Sep 15, 2020
05fdf68
Add vesting client logic (#470)
alexanderbez Sep 15, 2020
51bd1a3
Merge PR $472: add state_sync & blockpruning support
tac0turtle Sep 15, 2020
94ea223
Fix test image issue
jackzampolin Sep 15, 2020
198aae9
Update gaia to support the new IBC related governance proposal and ot…
zmanian Oct 10, 2020
374f27b
Fix for missing import
zmanian Oct 10, 2020
66a03d2
Integrate the migrate command
zmanian Oct 10, 2020
3dcf640
Merge branch 'jack/gaiav3.0' into zaki/prop29
zmanian Oct 12, 2020
bf7ce17
Fix argument position
zmanian Oct 19, 2020
e2bb29d
Merge branch 'zaki/prop29' of github.com:iqlusioninc/gaia into zaki/p…
zmanian Oct 19, 2020
b50c68a
Change target version
zmanian Oct 19, 2020
c69402d
Version fix
zmanian Oct 19, 2020
a79b164
Upgade to rc0
zmanian Oct 19, 2020
c4b57b0
Add migrations for the tendermint parameters
zmanian Oct 20, 2020
cf93769
Switch max_num to an integer
zmanian Oct 20, 2020
276bd7a
Update the migration function to do two migrations
zmanian Oct 20, 2020
7e5d3bf
Fix minor error
zmanian Oct 20, 2020
71c8d18
Do three migrations
zmanian Oct 20, 2020
bd6cd52
Add disabling IBC send and recieve
zmanian Oct 20, 2020
e492c33
disable IBC transfers
zmanian Oct 20, 2020
0978263
Update to rc1
zmanian Oct 20, 2020
d15ae8c
Remove the amino encoding config
zmanian Oct 20, 2020
c4b7af3
Fix for vesting serialization and prop29 accounting
zmanian Oct 21, 2020
bb8d68f
Fix some more arithmetic
zmanian Oct 21, 2020
465138e
add a public key replacement option for testnets
zmanian Oct 23, 2020
10d245d
Improvement to key replacement
zmanian Oct 23, 2020
2cdd25b
Validate passes
zmanian Oct 23, 2020
a3f647f
Remove GRPC registry
zmanian Oct 23, 2020
a0f4961
Enable opting out prop29 in a flag. Very helpful for testnets
zmanian Oct 23, 2020
29ca557
Handle slashing state in pub key replacement
zmanian Oct 23, 2020
52dbc53
Only initialize capabilities during load latest
zmanian Oct 24, 2020
e1aafef
Update golang ci version
zmanian Oct 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: golangci/golangci-lint-action@master
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.27
version: v1.28.3
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: "env.GIT_DIFF != ''"
47 changes: 22 additions & 25 deletions app/app.go
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/rakyll/statik/fs"

abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"
Expand All @@ -21,7 +22,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
Expand Down Expand Up @@ -82,6 +82,7 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

gaiaappparams "github.com/cosmos/gaia/app/params"

// This is for the swagger file for legacy support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
)
Expand Down Expand Up @@ -113,6 +114,7 @@ var (
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
)

// module account permissions
Expand All @@ -139,7 +141,7 @@ var _ App = (*GaiaApp)(nil)
// capabilities aren't needed for testing.
type GaiaApp struct {
*baseapp.BaseApp
cdc *codec.LegacyAmino
legacyAmino *codec.LegacyAmino
appCodec codec.Marshaler
interfaceRegistry types.InterfaceRegistry

Expand Down Expand Up @@ -194,14 +196,13 @@ func NewGaiaApp(
) *GaiaApp {

appCodec := encodingConfig.Marshaler
cdc := encodingConfig.Amino
legacyAmino := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry

bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
bApp.SetAppVersion(version.Version)
bApp.GRPCQueryRouter().SetInterfaceRegistry(interfaceRegistry)
bApp.GRPCQueryRouter().RegisterSimulateService(bApp.Simulate, interfaceRegistry)
bApp.SetInterfaceRegistry(interfaceRegistry)

keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
Expand All @@ -214,7 +215,7 @@ func NewGaiaApp(

app := &GaiaApp{
BaseApp: bApp,
cdc: cdc,
legacyAmino: legacyAmino,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
invCheckPeriod: invCheckPeriod,
Expand All @@ -223,8 +224,7 @@ func NewGaiaApp(
memKeys: memKeys,
}

app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])

app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])
// set the BaseApp's parameter store
bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable()))

Expand Down Expand Up @@ -350,10 +350,6 @@ func NewGaiaApp(

app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
app.mm.RegisterQueryServices(app.GRPCQueryRouter())

// add test gRPC service for testing gRPC queries in isolation
testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{})

// create the simulation manager and define the order of the modules for deterministic simulations
//
Expand Down Expand Up @@ -396,18 +392,17 @@ func NewGaiaApp(
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
}
}

// Initialize and seal the capability keeper so all persistent capabilities
// are loaded in-memory and prevent any further modules from creating scoped
// sub-keepers.
// This must be done during creation of baseapp rather than in InitChain so
// that in-memory capabilities get regenerated on app restart
// Note that since this reads from the store, we can only perform it when
// `loadLatest` is set to true.
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
app.CapabilityKeeper.InitializeAndSeal(ctx)

// Initialize and seal the capability keeper so all persistent capabilities
// are loaded in-memory and prevent any further modules from creating scoped
// sub-keepers.
// This must be done during creation of baseapp rather than in InitChain so
// that in-memory capabilities get regenerated on app restart
// Note that since this reads from the store, we can only perform it when
// `loadLatest` is set to true.
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
app.CapabilityKeeper.InitializeAndSeal(ctx)
}
app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper

Expand Down Expand Up @@ -438,7 +433,9 @@ func (app *GaiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.R
// InitChainer application update at chain initialization
func (app *GaiaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState GenesisState
app.cdc.MustUnmarshalJSON(req.AppStateBytes, &genesisState)
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

Expand Down Expand Up @@ -473,7 +470,7 @@ func (app *GaiaApp) BlockedAddrs() map[string]bool {
// NOTE: This is solely to be used for testing purposes as it may be desirable
// for modules to register their own custom testing types.
func (app *GaiaApp) LegacyAmino() *codec.LegacyAmino {
return app.cdc
return app.legacyAmino
}

// AppCodec returns Gaia's app codec.
Expand Down
10 changes: 3 additions & 7 deletions app/export.go
Expand Up @@ -10,7 +10,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/exported"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

Expand Down Expand Up @@ -72,11 +71,8 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
/* Handle fee distribution state. */

// withdraw all validator commission
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val exported.ValidatorI) (stop bool) {
_, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator())
if err != nil {
panic(err)
}
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
_, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator())
return false
})

Expand Down Expand Up @@ -106,7 +102,7 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
ctx = ctx.WithBlockHeight(0)

// reinitialize all validators
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val exported.ValidatorI) (stop bool) {
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
// donate any unwithdrawn outstanding reward fraction tokens to the community pool
scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator())
feePool := app.DistrKeeper.GetFeePool(ctx)
Expand Down
23 changes: 0 additions & 23 deletions app/params/amino.go

This file was deleted.

2 changes: 0 additions & 2 deletions app/params/proto.go
@@ -1,5 +1,3 @@
// +build !test_amino

package params

import (
Expand Down