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

IBC Alpha Updates #288

Merged
merged 154 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
0fa78b3
IBC v1.0.0
fedekunze Oct 29, 2019
4e83c88
add demo readme
jackzampolin Oct 29, 2019
9f1a281
update ibc-demo.md
mossid Oct 29, 2019
fffa6e3
fix readme to match current state
jackzampolin Oct 30, 2019
fb4006a
WIP connection handshake
jackzampolin Oct 30, 2019
7b2589c
Merge PR #174: IBC demo fixes
cwgoes Nov 5, 2019
a6284dd
Fix branch in demo readme
jackzampolin Nov 7, 2019
12b1a35
Fix branch in script
jackzampolin Nov 7, 2019
bffcfe2
Apply suggestions from code review
fedekunze Nov 12, 2019
459f8e6
Init ibc-alpha
jackzampolin Nov 12, 2019
3176266
Update sdk version to incorporate codec changes
jackzampolin Nov 12, 2019
e04e0ad
Upstream codec changes
jackzampolin Nov 12, 2019
9eb8739
Add --node flag to transfer commands
jackzampolin Nov 12, 2019
6b448b6
Remove extra --from flag
jackzampolin Nov 12, 2019
eea30e9
update to latest IBC alpha
fedekunze Dec 4, 2019
d1c6354
fix app.evidenceKeeper params
fedekunze Dec 4, 2019
ee7e913
pull branch
fedekunze Dec 4, 2019
1560791
merge downstream changes
fedekunze Dec 4, 2019
58e138d
point to 'misc-ibc-issues' SDK branch
fedekunze Dec 4, 2019
7c58e78
merge upstream changes
fedekunze Dec 11, 2019
f255b1c
fix build
fedekunze Dec 11, 2019
fe8ba40
merge changes from master
fedekunze Dec 11, 2019
30c422e
target to ibc-alpha
fedekunze Dec 11, 2019
aadce15
SDK changes
fedekunze Dec 11, 2019
2fb4437
Update gaia to latest ibc-alpha
jackzampolin Jan 15, 2020
0df1a1b
IBC v1.0.0
fedekunze Oct 29, 2019
05cf4d6
add demo readme
jackzampolin Oct 29, 2019
dd98604
update ibc-demo.md
mossid Oct 29, 2019
860823b
fix readme to match current state
jackzampolin Oct 30, 2019
c4d259e
WIP connection handshake
jackzampolin Oct 30, 2019
89626ce
Merge PR #174: IBC demo fixes
cwgoes Nov 5, 2019
13073de
Fix branch in demo readme
jackzampolin Nov 7, 2019
bcc1b9f
Fix branch in script
jackzampolin Nov 7, 2019
8191f5a
Apply suggestions from code review
fedekunze Nov 12, 2019
de0d617
Init ibc-alpha
jackzampolin Nov 12, 2019
0d2df9a
Update sdk version to incorporate codec changes
jackzampolin Nov 12, 2019
5dbd038
Upstream codec changes
jackzampolin Nov 12, 2019
8244efa
Add --node flag to transfer commands
jackzampolin Nov 12, 2019
4379fe6
Remove extra --from flag
jackzampolin Nov 12, 2019
fd3c9f5
fix app.evidenceKeeper params
fedekunze Dec 4, 2019
ca1936c
point to 'misc-ibc-issues' SDK branch
fedekunze Dec 4, 2019
6c4c424
fix build
fedekunze Dec 11, 2019
fa906e0
target to ibc-alpha
fedekunze Dec 11, 2019
6d4a578
Update gaia to latest ibc-alpha
jackzampolin Jan 15, 2020
70718c6
Update to latest sdk:ibc-alpha and rebase onto master
jackzampolin Jan 15, 2020
8089b8e
Merge in ibc-alpha remote
jackzampolin Jan 15, 2020
8b6f142
Fix broken tests
jackzampolin Jan 15, 2020
65b1ca3
update to v0.38.0 sdk
jackzampolin Jan 17, 2020
0120424
Update to latest master, bank changes
jackzampolin Jan 31, 2020
d1fc045
Update to latest SDK ibc-alpha
jackzampolin Feb 11, 2020
86a5498
update: gaia to master of the sdk
tac0turtle Feb 13, 2020
c0fcc3e
bump to master
tac0turtle Feb 14, 2020
558464b
Proto updates
alexanderbez Feb 18, 2020
d1fd70d
Update makefiles
alexanderbez Feb 18, 2020
fd84de7
Merge branch 'master' into marko/update_sdk_master
alexanderbez Feb 18, 2020
7fb25dd
Fix codecs in cli tests
jackzampolin Feb 18, 2020
320bb9e
Update CLI tests
alexanderbez Feb 19, 2020
bbf3220
Merge remote-tracking branch 'refs/remotes/origin/marko/update_sdk_ma…
alexanderbez Feb 19, 2020
df06841
Merge branch 'marko/update_sdk_master' into ibc-alpha
jackzampolin Feb 19, 2020
a3d7ac8
WIP fix deps
jackzampolin Feb 19, 2020
af5eb52
Pin to IBC-alpha
jackzampolin Feb 19, 2020
7034eb1
Updates to build, failing tests
jackzampolin Feb 19, 2020
5d4695d
Update to latest ibc-alpha
jackzampolin Feb 19, 2020
de9d881
Merge branch 'master' into ibc-alpha
jackzampolin Feb 20, 2020
6fb63a0
Push
jackzampolin Feb 20, 2020
e525286
Update to latest ibc-alpha
jackzampolin Feb 20, 2020
4561912
Update upstream SDK version to latest ibc-alpha
cwgoes Feb 21, 2020
1fbcd5e
Update to latest ibc-alpha
jackzampolin Feb 21, 2020
4901e6a
Push go.sum changes
jackzampolin Feb 21, 2020
78bb32c
enable historical info tracking
AdityaSripal Feb 24, 2020
69d5a56
Update to latest ibc-alpha
jackzampolin Feb 24, 2020
18e2a65
Merge branch 'master' into ibc-alpha
jackzampolin Feb 26, 2020
293e96f
Push latest ibc-alpha version
jackzampolin Feb 26, 2020
d89d397
Fix build, flags issue still present
jackzampolin Feb 26, 2020
b07085d
Working build
jackzampolin Feb 26, 2020
139f570
Update to latest ibc-alpha and fix merge conflicts
jackzampolin Mar 7, 2020
692a11e
Fix lint issue
jackzampolin Mar 7, 2020
96135ce
Update to latest sdk@ibc-alpha
jackzampolin Mar 9, 2020
3702395
Update TM and SDK versions
jackzampolin Mar 9, 2020
d20df0b
Change historical header numsaved to 1000 and update to latest ibc-alpha
jackzampolin Mar 9, 2020
a2f1fb2
Update upstream SDK version
cwgoes Mar 10, 2020
0418fc2
Merge PR #318: Hook up 20-Transfer module to Gaia
AdityaSripal Mar 12, 2020
6978f84
Update upstream SDK version
cwgoes Mar 13, 2020
8329dfd
Fix commit
cwgoes Mar 16, 2020
8984c58
bump sdk dependency
AdityaSripal Mar 17, 2020
fe439e5
Update sdk version
jackzampolin Mar 18, 2020
dc453b3
update to [email protected]
jackzampolin Mar 23, 2020
cb7eba8
Update to latest cosmos-sdk
jackzampolin Mar 23, 2020
028db94
Push ibc-alpha @jackzampolin: update sdk version
jackzampolin Mar 24, 2020
a9aa9ea
Push ibc-alpha @jackzampolin: update sdk version
jackzampolin Mar 24, 2020
276e9b7
Push ibc-alpha @jackzampolin: fix go version in dockerfile
jackzampolin Mar 24, 2020
7a90bc0
Merge PR #336: Add testing dockerfile for relayer
jackzampolin Mar 28, 2020
be7b6cc
Push ibc-alpha @jackzampolin: ensure that tags are indexed
jackzampolin Mar 30, 2020
c07a8b0
Push ibc-alpha @jackzampolin: update to latest sdk@ibc-alpha
jackzampolin Apr 2, 2020
f933fac
Push ibc-alpha @jackzampolin: update sdk to latest ibc-alpha
jackzampolin Apr 3, 2020
ccfb0a7
Push ibc-alpha @jackzampolin: update sdk version
jackzampolin Apr 6, 2020
193d5dc
Add capability keeper to gaia
jackzampolin Apr 7, 2020
7627236
Merge branch 'master' into ibc-alpha
jackzampolin Apr 7, 2020
3b770ee
Push ibc-alpha @jackzampolin: clean up go.sum
jackzampolin Apr 7, 2020
bca9418
Push ibc-alpha @jackzampolin: fix test failures
jackzampolin Apr 7, 2020
b4e9e8b
Push ibc-alpha @jackzampolin: begin incorporating the port routing ch…
jackzampolin Apr 8, 2020
a3b9ac0
Push ibc-alpha @jackzampolin: begin incorporating the port routing ch…
jackzampolin Apr 8, 2020
9630783
Merge PR #349: Update to lastest SDK
AdityaSripal Apr 9, 2020
af0e6f5
Push ibc-alpha @jackzampolin: fix go.sum
jackzampolin Apr 9, 2020
9465218
Push ibc-alpha @jackzampolin: fix test failure due to key refactor
jackzampolin Apr 9, 2020
57cdd32
Merge branch 'master' into ibc-alpha
jackzampolin Apr 9, 2020
c0e2855
Passing cli tests?"
jackzampolin Apr 10, 2020
1b862a0
Push ibc-alpha @jackzampolin: Update to latest SDK master
jackzampolin Apr 10, 2020
062de45
Remove unnecessary import
jackzampolin Apr 10, 2020
bb94d7f
Passing multisig test
jackzampolin Apr 10, 2020
9fb2a15
Update go.mod
Apr 13, 2020
b6c85a2
Update lcd_test/helpers.go
Apr 13, 2020
5b25c13
Update lcd_test/helpers.go
Apr 13, 2020
d6d0508
Apply suggestions from code review
Apr 13, 2020
e3b3d87
Update app/app.go
Apr 14, 2020
5ca64b1
Apply suggestions from code review
fedekunze Apr 14, 2020
adb6d40
revert changes as suggested by @fedekunze
Apr 14, 2020
a488423
run go mod tidy
Apr 14, 2020
1ff1a01
attempt to fix test-sim-multi-seed-short simulation
Apr 14, 2020
ae229d3
Revert "attempt to fix test-sim-multi-seed-short simulation"
Apr 14, 2020
f248f60
Push ibc-alpha @jackzampolin: address pr comments and clean up old ib…
jackzampolin Apr 14, 2020
55bb1d5
Merge branch 'master' into ibc-alpha
Apr 14, 2020
fbbfa08
remove unnecessary replace statement
Apr 14, 2020
8dd54b8
Push ibc-alpha @jackzampolin: update to latest cosmos-sdk master and …
jackzampolin Apr 17, 2020
b740cb3
Push ibc-alpha @jackzampolin: update to latest SDK
jackzampolin Apr 17, 2020
8072344
Push ibc-alpha @jackzampolin: fix test builds
jackzampolin Apr 17, 2020
09050a7
Push ibc-alpha @jackzampolin: fix packet send issue
jackzampolin Apr 17, 2020
9a09e54
Push ibc-alpha @jackzampolin: update sdk to fix encoding issue on acks
jackzampolin Apr 19, 2020
37a5361
Push ibc-alpha @jackzampolin: update for supply removal and packet ac…
jackzampolin Apr 20, 2020
1672d1f
Push ibc-alpha @jackzampolin: update to latest sdk master
jackzampolin Apr 20, 2020
81ce8de
Fix test failures
jackzampolin Apr 21, 2020
c5f1ad7
Push ibc-alpha @jackzampolin: fix gaia supply tests
jackzampolin Apr 21, 2020
7b4bf73
Push ibc-alpha @jackzampolin: fix lcd test failures
jackzampolin Apr 21, 2020
24c9274
WIP debugging
jackzampolin Apr 21, 2020
1bf3211
Push ibc-alpha @jackzampolin: update to include capability fixes
jackzampolin Apr 22, 2020
49d42ac
Push ibc-alpha @jackzampolin: fix test build issue
jackzampolin Apr 22, 2020
540ac82
Merge branch 'master' of github.com:cosmos/gaia into ibc-alpha
fedekunze Apr 22, 2020
a387068
add HistoricalInfoKey to skipped prefixes
fedekunze Apr 22, 2020
d5be36e
fix diff with SDK's Simapp
fedekunze Apr 22, 2020
ba25f1d
typo
fedekunze Apr 22, 2020
320f6c8
update sim_test.go
fedekunze Apr 22, 2020
d3ed122
Bump sdk version
alexanderbez Apr 22, 2020
ed5b702
update replay.go and helpers.go
fedekunze Apr 22, 2020
0ddbbcc
remove default param override
fedekunze Apr 22, 2020
ecee2e5
Update Dockerfile
Apr 22, 2020
3744828
Push ibc-alpha @jackzampolin: update to sdk master
jackzampolin Apr 23, 2020
04bf0e3
Merge branch 'ibc-alpha' of github.com:cosmos/gaia into ibc-alpha
jackzampolin Apr 23, 2020
4e9bc7e
Push ibc-alpha @jackzampolin: address PR comments
jackzampolin Apr 23, 2020
74963e4
simplify makefile's docker target, remove remote push
Apr 23, 2020
9acabe0
update .PHONY
Apr 23, 2020
b544866
Reduce diff size
Apr 23, 2020
039aa5d
Push ibc-alpha @jackzampolin: re-add docker push to Makefile
jackzampolin Apr 23, 2020
44ab9f7
Push ibc-alpha @jackzampolin: incorporate historical entries change f…
jackzampolin Apr 23, 2020
d26d6ed
Address PR comment
jackzampolin Apr 23, 2020
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# > docker build -t gaia .
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad init
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad start
FROM golang:alpine AS build-env
FROM golang:1.14-alpine AS build-env
alessio marked this conversation as resolved.
Show resolved Hide resolved

# Set up dependencies
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
TEST_DOCKER_REPO=jackzampolin/gaiatest

export GO111MODULE = on

Expand Down Expand Up @@ -91,8 +92,8 @@ else
endif

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/gaiad
go install -mod=readonly $(BUILD_FLAGS) ./cmd/gaiacli
jackzampolin marked this conversation as resolved.
Show resolved Hide resolved
go install $(BUILD_FLAGS) ./cmd/gaiad
go install $(BUILD_FLAGS) ./cmd/gaiacli

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
Expand Down Expand Up @@ -160,6 +161,14 @@ test-build: build
benchmark:
@go test -mod=readonly -bench=. ./...

test-docker:
alessio marked this conversation as resolved.
Show resolved Hide resolved
@docker build -f contrib/Dockerfile.test -t ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) .
@docker tag ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO}:$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
@docker tag ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD) ${TEST_DOCKER_REPO}:latest
@docker push ${TEST_DOCKER_REPO}:$(shell git rev-parse --short HEAD)
@docker push ${TEST_DOCKER_REPO}:$(shell git rev-parse --abbrev-ref HEAD | sed 's#/#_#g')
@docker push ${TEST_DOCKER_REPO}:latest


###############################################################################
### Linting ###
Expand Down
84 changes: 60 additions & 24 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/capability"
"github.com/cosmos/cosmos-sdk/x/crisis"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/evidence"
"github.com/cosmos/cosmos-sdk/x/genutil"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/cosmos-sdk/x/ibc"
transfer "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
paramsproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/supply"
Expand Down Expand Up @@ -58,18 +62,22 @@ var (
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
supply.AppModuleBasic{},
ibc.AppModuleBasic{},
alessio marked this conversation as resolved.
Show resolved Hide resolved
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
ibc.AppModuleBasic{},
transfer.AppModuleBasic{},
)

// module account permissions
maccPerms = map[string][]string{
auth.FeeCollectorName: nil,
distr.ModuleName: nil,
mint.ModuleName: {supply.Minter},
staking.BondedPoolName: {supply.Burner, supply.Staking},
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
auth.FeeCollectorName: nil,
distr.ModuleName: nil,
mint.ModuleName: {supply.Minter},
staking.BondedPoolName: {supply.Burner, supply.Staking},
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
transfer.GetModuleAccountName(): {supply.Minter, supply.Burner},
}
)

Expand All @@ -91,18 +99,21 @@ type GaiaApp struct {
subspaces map[string]params.Subspace

// keepers
accountKeeper auth.AccountKeeper
bankKeeper bank.Keeper
supplyKeeper supply.Keeper
stakingKeeper staking.Keeper
slashingKeeper slashing.Keeper
mintKeeper mint.Keeper
distrKeeper distr.Keeper
govKeeper gov.Keeper
crisisKeeper crisis.Keeper
paramsKeeper params.Keeper
upgradeKeeper upgrade.Keeper
evidenceKeeper evidence.Keeper
accountKeeper auth.AccountKeeper
bankKeeper bank.Keeper
supplyKeeper supply.Keeper
stakingKeeper staking.Keeper
capabilityKeeper *capability.Keeper
slashingKeeper slashing.Keeper
mintKeeper mint.Keeper
distrKeeper distr.Keeper
govKeeper gov.Keeper
crisisKeeper crisis.Keeper
paramsKeeper params.Keeper
upgradeKeeper upgrade.Keeper
evidenceKeeper evidence.Keeper
ibcKeeper ibc.Keeper
transferKeeper transfer.Keeper

// the module manager
mm *module.Manager
Expand All @@ -128,7 +139,8 @@ func NewGaiaApp(
keys := sdk.NewKVStoreKeys(
bam.MainStoreKey, auth.StoreKey, bank.StoreKey, staking.StoreKey,
supply.StoreKey, mint.StoreKey, distr.StoreKey, slashing.StoreKey,
gov.StoreKey, params.StoreKey, evidence.StoreKey, upgrade.StoreKey,
gov.StoreKey, params.StoreKey, ibc.StoreKey, transfer.StoreKey,
evidence.StoreKey, upgrade.StoreKey,
)
tKeys := sdk.NewTransientStoreKeys(staking.TStoreKey, params.TStoreKey)

Expand All @@ -153,6 +165,11 @@ func NewGaiaApp(
app.subspaces[crisis.ModuleName] = app.paramsKeeper.Subspace(crisis.DefaultParamspace)
app.subspaces[evidence.ModuleName] = app.paramsKeeper.Subspace(evidence.DefaultParamspace)

// add capability keeper and ScopeToModule for ibc module
app.capabilityKeeper = capability.NewKeeper(appCodec, keys[capability.StoreKey])
scopedIBCKeeper := app.capabilityKeeper.ScopeToModule(ibc.ModuleName)
scopedTransferKeeper := app.capabilityKeeper.ScopeToModule(transfer.ModuleName)

// add keepers
app.accountKeeper = auth.NewAccountKeeper(
appCodec, keys[auth.StoreKey], app.subspaces[auth.ModuleName], auth.ProtoBaseAccount,
Expand All @@ -174,9 +191,12 @@ func NewGaiaApp(
appCodec, keys[distr.StoreKey], app.subspaces[distr.ModuleName], app.bankKeeper, &stakingKeeper,
app.supplyKeeper, auth.FeeCollectorName, app.ModuleAccountAddrs(),
)
app.mintKeeper = mint.NewKeeper(appCodec, keys[mint.StoreKey], app.subspaces[mint.ModuleName], &stakingKeeper, app.supplyKeeper, auth.FeeCollectorName)
app.distrKeeper = distr.NewKeeper(appCodec, keys[distr.StoreKey], app.subspaces[distr.ModuleName], app.bankKeeper, &stakingKeeper, app.supplyKeeper, auth.FeeCollectorName, app.ModuleAccountAddrs())
fedekunze marked this conversation as resolved.
Show resolved Hide resolved
app.slashingKeeper = slashing.NewKeeper(
appCodec, keys[slashing.StoreKey], &stakingKeeper, app.subspaces[slashing.ModuleName],
)

alessio marked this conversation as resolved.
Show resolved Hide resolved
app.crisisKeeper = crisis.NewKeeper(
app.subspaces[crisis.ModuleName], invCheckPeriod, app.supplyKeeper, auth.FeeCollectorName,
)
Expand All @@ -196,7 +216,7 @@ func NewGaiaApp(
// register the proposal types
govRouter := gov.NewRouter()
govRouter.AddRoute(gov.RouterKey, gov.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)).
AddRoute(paramsproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)).
AddRoute(distr.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)).
AddRoute(upgrade.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper))
app.govKeeper = gov.NewKeeper(
Expand All @@ -210,6 +230,13 @@ func NewGaiaApp(
staking.NewMultiStakingHooks(app.distrKeeper.Hooks(), app.slashingKeeper.Hooks()),
)

app.ibcKeeper = ibc.NewKeeper(app.cdc, keys[ibc.StoreKey], stakingKeeper, scopedIBCKeeper)

app.transferKeeper = transfer.NewKeeper(
app.cdc, keys[transfer.StoreKey],
app.ibcKeeper.ChannelKeeper, app.bankKeeper, app.supplyKeeper, scopedTransferKeeper,
)

// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
app.mm = module.NewManager(
Expand All @@ -225,12 +252,14 @@ func NewGaiaApp(
staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.bankKeeper, app.supplyKeeper),
upgrade.NewAppModule(app.upgradeKeeper),
evidence.NewAppModule(app.evidenceKeeper),
ibc.NewAppModule(app.ibcKeeper),
transfer.NewAppModule(app.transferKeeper),
)
// 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.

app.mm.SetOrderBeginBlockers(upgrade.ModuleName, mint.ModuleName, distr.ModuleName, slashing.ModuleName)
app.mm.SetOrderBeginBlockers(upgrade.ModuleName, mint.ModuleName, distr.ModuleName, slashing.ModuleName, staking.ModuleName)
app.mm.SetOrderEndBlockers(crisis.ModuleName, gov.ModuleName, staking.ModuleName)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -268,7 +297,7 @@ func NewGaiaApp(
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
app.SetAnteHandler(auth.NewAnteHandler(app.accountKeeper, app.supplyKeeper, auth.DefaultSigVerificationGasConsumer))
app.SetAnteHandler(ante.NewAnteHandler(app.accountKeeper, app.supplyKeeper, app.ibcKeeper, ante.DefaultSigVerificationGasConsumer))
app.SetEndBlocker(app.EndBlocker)

if loadLatest {
Expand Down Expand Up @@ -299,7 +328,14 @@ func (app *GaiaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci
var genesisState simapp.GenesisState
app.cdc.MustUnmarshalJSON(req.AppStateBytes, &genesisState)

return app.mm.InitGenesis(ctx, app.cdc, genesisState)
res := app.mm.InitGenesis(ctx, app.cdc, genesisState)

// Set Historical infos in InitChain to ignore genesis params
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
stakingParams := staking.DefaultParams()
stakingParams.HistoricalEntries = 1000
app.stakingKeeper.SetParams(ctx, stakingParams)
jackzampolin marked this conversation as resolved.
Show resolved Hide resolved

return res
}

// LoadHeight loads a particular height
Expand Down
4 changes: 2 additions & 2 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailWhiteList []st
app.stakingKeeper.IterateValidators(ctx, func(_ int64, val staking.ValidatorI) (stop bool) {

// donate any unwithdrawn outstanding reward fraction tokens to the community pool
scraps := app.distrKeeper.GetValidatorOutstandingRewards(ctx, val.GetOperator())
scraps := app.distrKeeper.GetValidatorOutstandingRewards(ctx, val.GetOperator()).Rewards
feePool := app.distrKeeper.GetFeePool(ctx)
feePool.CommunityPool = feePool.CommunityPool.Add(scraps.Rewards...)
feePool.CommunityPool = feePool.CommunityPool.Add(scraps...)
app.distrKeeper.SetFeePool(ctx, feePool)

app.distrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator())
Expand Down
24 changes: 8 additions & 16 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,13 @@ func TestFullAppSimulation(t *testing.T) {
app := NewGaiaApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, "", fauxMerkleModeOpt)
require.Equal(t, appName, app.Name())

// run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
alessio marked this conversation as resolved.
Show resolved Hide resolved
t, os.Stdout, app.BaseApp, simapp.AppStateFn(app.Codec(), app.SimulationManager()),
// Run randomized simulation
_, _, simErr := simulation.SimulateFromSeed(
t, os.Stdout, app.BaseApp, simapp.AppStateFn(app.Codec(), app.sm),
simapp.SimulationOperations(app, app.Codec(), config),
app.ModuleAccountAddrs(), config,
)

// export state and simParams before the simulation error is checked
err = simapp.CheckExportSimulation(app, config, simParams)
require.NoError(t, err)
require.NoError(t, simErr)

if config.Commit {
Expand All @@ -98,15 +95,12 @@ func TestAppImportExport(t *testing.T) {
require.Equal(t, appName, app.Name())

// Run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
t, os.Stdout, app.BaseApp, simapp.AppStateFn(app.Codec(), app.SimulationManager()),
_, _, simErr := simulation.SimulateFromSeed(
t, os.Stdout, app.BaseApp, simapp.AppStateFn(app.Codec(), app.sm),
simapp.SimulationOperations(app, app.Codec(), config),
app.ModuleAccountAddrs(), config,
)

// export state and simParams before the simulation error is checked
err = simapp.CheckExportSimulation(app, config, simParams)
require.NoError(t, err)
require.NoError(t, simErr)

if config.Commit {
Expand Down Expand Up @@ -184,15 +178,13 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.Equal(t, appName, app.Name())

// Run randomized simulation
stopEarly, simParams, simErr := simulation.SimulateFromSeed(
t, os.Stdout, app.BaseApp, simapp.AppStateFn(app.Codec(), app.SimulationManager()),
// Run randomized simulation
stopEarly, _, simErr := simulation.SimulateFromSeed(
t, os.Stdout, app.BaseApp, simapp.AppStateFn(app.Codec(), app.sm),
simapp.SimulationOperations(app, app.Codec(), config),
app.ModuleAccountAddrs(), config,
)

// export state and simParams before the simulation error is checked
err = simapp.CheckExportSimulation(app, config, simParams)
require.NoError(t, err)
require.NoError(t, simErr)

if config.Commit {
Expand Down
Loading