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

[TODOs] sdk-v0.50 app.go #1844

Merged
merged 52 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
939fcbf
app.go account keeper
nullpointer0x00 Feb 20, 2024
4fdb14c
add bank keeper
nullpointer0x00 Feb 20, 2024
2e1a010
add staking, mint, distr, slashing, crisis, feegrant keepers
nullpointer0x00 Feb 20, 2024
790c0c3
refactor staking keeper property
nullpointer0x00 Feb 20, 2024
7d02b05
add authz keeper
nullpointer0x00 Feb 20, 2024
2268240
add app modules
nullpointer0x00 Feb 20, 2024
2c1bdc2
fix broken test compile
nullpointer0x00 Feb 21, 2024
750a7d4
Add gov keeper
nullpointer0x00 Feb 21, 2024
a38581b
refactor gov keeper init to reflect cosmos pattern
nullpointer0x00 Feb 21, 2024
7304796
use provenance cosmos-sdk fork, add msg service router
nullpointer0x00 Feb 22, 2024
b3e7bc3
TODO comment, update msg_service_router_test
nullpointer0x00 Feb 23, 2024
6c6afa2
fix another test
nullpointer0x00 Feb 23, 2024
0c9bcfb
add register hybrid handler logic
nullpointer0x00 Feb 23, 2024
f61d6cd
todo async-icq
nullpointer0x00 Feb 28, 2024
bbc1fb6
update third party protos
nullpointer0x00 Feb 29, 2024
a08daf9
update proto-update-deps to use new proofs location
nullpointer0x00 Feb 29, 2024
c184abf
remove redundant delete
nullpointer0x00 Feb 29, 2024
6d4478b
fix ibc version
nullpointer0x00 Mar 1, 2024
2142210
update protos for library location updates
nullpointer0x00 Mar 1, 2024
4f3a200
ica-host app.go todos
nullpointer0x00 Mar 1, 2024
3ad9bba
ibc-host app.go todo
nullpointer0x00 Mar 4, 2024
c59e54e
few more ibc-host app.go todo
nullpointer0x00 Mar 4, 2024
4828238
Add new cosmos-sdk tag for msg based fee support, add fee handler, ad…
nullpointer0x00 Mar 4, 2024
2aa86de
add todo for issue that is blocking furture development
nullpointer0x00 Mar 5, 2024
3869d18
finish evidence todo
nullpointer0x00 Mar 5, 2024
f6b5756
rename todo to line up with other proto todos
nullpointer0x00 Mar 5, 2024
ae114c5
Update protobuf and point async-icq to our own version. Still need to…
Taztingo Mar 7, 2024
dedb215
Add pulsar in case we need it.
Taztingo Mar 11, 2024
9787ffc
Add pulsar script.
Taztingo Mar 11, 2024
623f2a6
Remove pulsar until we need it.
Taztingo Mar 11, 2024
695188f
Add swagger.
Taztingo Mar 11, 2024
61cd5f4
Update swagger.
Taztingo Mar 11, 2024
99a0052
Remove doc since it isn't needed.
Taztingo Mar 12, 2024
40f04b5
Improve comment documentation in go.mod
Taztingo Mar 12, 2024
89bb201
Update statik.go
Taztingo Mar 12, 2024
fd3c517
First changes towards any generation.
Taztingo Mar 12, 2024
f5e036f
Remove make proto-gen-any.
Taztingo Mar 12, 2024
e0d67de
Remove temporary work that was used for proto-gen-any.
Taztingo Mar 12, 2024
cb611a0
Update phony to remove any.
Taztingo Mar 12, 2024
8552a24
Remove todo since protos are registering now.
Taztingo Mar 12, 2024
a0baad8
Fix prefix address for tests.
Taztingo Mar 12, 2024
544aa11
Add WasmKeeper so tests can run.
Taztingo Mar 13, 2024
1fe4f6b
Fix some wasm sim. Still need to resolve message router issues, and m…
Taztingo Mar 13, 2024
77bfe99
Fix more wasm deprecations. Add ConsensusParamsKeeper.
Taztingo Mar 13, 2024
1af599a
Fix prefixes.
Taztingo Mar 13, 2024
8f8f059
Fix validator address for tests.
Taztingo Mar 13, 2024
d613390
Add keys for crisis module.
Taztingo Mar 13, 2024
1deb0ed
Add fix for ibc legacy param store.
Taztingo Mar 14, 2024
d4b61c7
remove use of deprecated authtypes AccountI and use sdk types AccountI
nullpointer0x00 Mar 14, 2024
79b1db8
use protocompat.Handler instead of re-writing func sig
nullpointer0x00 Mar 14, 2024
e63e0d3
remove proofs.proto customization that isn't needed
nullpointer0x00 Mar 14, 2024
6fed1b7
Merge branch 'main-v0.50' into nullpointer0x00-cosmos-sdk-v50-todos
nullpointer0x00 Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ linters-settings:
- github.com/cosmos/ibc-apps/modules/async-icq/v6/types
- github.com/cosmos/ibc-apps/modules/async-icq/v6/keeper

- github.com/gogo/protobuf
- github.com/cosmos/gogoproto

- github.com/google/uuid

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ build, in which case we can fall back on `go mod tidy`.

## Protobuf

We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use in Cosmos-SDK.
We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/cosmos/protobuf) to generate code for use in Cosmos-SDK.

For determinstic behavior around Protobuf tooling, everything is containerized using Docker. Make sure to have Docker installed on your machine, or head to [Docker's website](https://docs.docker.com/get-docker/) to install it.

Expand Down
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ proto-all: proto-update-deps proto-format proto-lint proto-check-breaking proto-
proto-checks: proto-update-deps proto-lint proto-check-breaking proto-check-breaking-third-party
proto-regen: proto-format proto-gen update-swagger-docs

containerProtoVer=v0.2
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoVer=0.14.0
containerProtoImage=ghcr.io/cosmos/proto-builder:$(containerProtoVer)
containerProtoGen=prov-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=prov-proto-gen-swagger-$(containerProtoVer)
containerProtoFmt=prov-proto-fmt-$(containerProtoVer)
Expand All @@ -487,12 +487,6 @@ proto-gen:
mv .go.mod.bak go.mod
go mod tidy

# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
@echo "Generating Protobuf Any"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh
go mod tidy

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then \
Expand Down Expand Up @@ -537,7 +531,7 @@ proto-update-deps:
@echo "Updating Protobuf files"
sh ./scripts/proto-update-deps.sh

.PHONY: proto-all proto-checks proto-regen proto-gen proto-format proto-gen-any proto-lint proto-check-breaking proto-check-breaking-third-party proto-update-deps proto-update-check
.PHONY: proto-all proto-checks proto-regen proto-gen proto-format proto-lint proto-check-breaking proto-check-breaking-third-party proto-update-deps proto-update-check


##############################
Expand Down
462 changes: 235 additions & 227 deletions app/app.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func MakeEncodingConfig() params.EncodingConfig {
encodingConfig := params.MakeTestEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)

ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs
return servertypes.ExportedApp{}, err
}

validators, err := staking.WriteValidators(ctx, &app.StakingKeeper)
validators, err := staking.WriteValidators(ctx, app.StakingKeeper)
return servertypes.ExportedApp{
AppState: appState,
Validators: validators,
Expand Down
21 changes: 10 additions & 11 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
storetypes "cosmossdk.io/store/types"
evidencetypes "cosmossdk.io/x/evidence/types"

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

Expand Down Expand Up @@ -107,16 +107,15 @@ func appStateWithICQ(appState json.RawMessage, cdc codec.JSONCodec) json.RawMess
if err != nil {
panic(fmt.Sprintf("error unmarshalling appstate: %v", err))
}
// TODO[1760]: async-icq
// icqGenJSON, icqGenFound := rawState[icqtypes.ModuleName]
// if !icqGenFound || len(icqGenJSON) == 0 {
// icqGenState := icqtypes.DefaultGenesis()
// rawState[icqtypes.ModuleName] = cdc.MustMarshalJSON(icqGenState)
// appState, err = json.Marshal(rawState)
// if err != nil {
// panic(fmt.Sprintf("error marshalling appstate: %v", err))
// }
// }
icqGenJSON, icqGenFound := rawState[icqtypes.ModuleName]
if !icqGenFound || len(icqGenJSON) == 0 {
icqGenState := icqtypes.DefaultGenesis()
rawState[icqtypes.ModuleName] = cdc.MustMarshalJSON(icqGenState)
appState, err = json.Marshal(rawState)
if err != nil {
panic(fmt.Sprintf("error marshalling appstate: %v", err))
}
}
return appState
}

Expand Down
2 changes: 1 addition & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func genesisStateWithValSet(t *testing.T,
MinSelfDelegation: sdkmath.ZeroInt(),
}
validators = append(validators, validator)
delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), val.Address.String(), sdkmath.LegacyOneDec()))
delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), sdkmath.LegacyOneDec()))
}

// set validators and delegations
Expand Down
8 changes: 4 additions & 4 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"

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

"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -125,7 +125,7 @@ var upgrades = map[string]appUpgrade{

return vm, nil
},
Added: []string{ /* icqtypes.ModuleName, // TODO[1760]: async-icq */ oracletypes.ModuleName, ibchookstypes.StoreKey, hold.ModuleName, exchange.ModuleName},
Added: []string{icqtypes.ModuleName, oracletypes.ModuleName, ibchookstypes.StoreKey, hold.ModuleName, exchange.ModuleName},
},
"saffron-rc2": { // upgrade for v1.17.0-rc2
Handler: func(ctx sdk.Context, app *App, vm module.VersionMap) (module.VersionMap, error) {
Expand Down Expand Up @@ -175,7 +175,7 @@ var upgrades = map[string]appUpgrade{

return vm, nil
},
Added: []string{ /* icqtypes.ModuleName, // TODO[1760]: async-icq */ oracletypes.ModuleName, ibchookstypes.StoreKey, hold.ModuleName, exchange.ModuleName},
Added: []string{icqtypes.ModuleName, oracletypes.ModuleName, ibchookstypes.StoreKey, hold.ModuleName, exchange.ModuleName},
},
"tourmaline-rc1": { // upgrade for v1.18.0-rc1
Added: []string{ibcratelimit.ModuleName},
Expand Down Expand Up @@ -450,7 +450,7 @@ func setAccountDataNameRecord(ctx sdk.Context, accountK attributetypes.AccountKe
// TODO: Remove with the saffron handlers.
func setupICQ(ctx sdk.Context, app *App) {
ctx.Logger().Info("Updating ICQ params")
// app.ICQKeeper.SetParams(ctx, icqtypes.NewParams(true, []string{"/provenance.oracle.v1.Query/Oracle"})) // TODO[1760]: async-icq
app.ICQKeeper.SetParams(ctx, icqtypes.NewParams(true, []string{"/provenance.oracle.v1.Query/Oracle"}))
ctx.Logger().Info("Done updating ICQ params")
}

Expand Down
13 changes: 13 additions & 0 deletions buf.gen.proto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: v1

plugins:

- name: gocosmos
out: .
opt:
- plugins=interfacetype+grpc

- name: grpc-gateway
out: .
opt:
- logtostderr=true
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading
Loading