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

sdk50mergemain #1507

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4bfe2ba
Setup mergify to backport v0.40.x
alpe Jun 12, 2023
bec6778
Debug simulations in CI (#1446)
pinosu Jun 13, 2023
1ce86ca
Merge pull request #1445 from CosmWasm/mergify_40
alpe Jun 13, 2023
a4548ba
Start system tests (#1410)
alpe Jun 15, 2023
657420b
Edit config to speed up debugging (#1447)
pinosu Jun 19, 2023
5c63f01
Bump github.com/cosmos/cosmos-sdk from 0.47.2 to 0.47.3 in /tests/system
dependabot[bot] Jun 22, 2023
65b5321
Merge pull request #1457 from CosmWasm/dependabot/go_modules/tests/sy…
alpe Jun 23, 2023
e57901f
Bump bufbuild/buf-setup-action from 1.21.0 to 1.22.0
dependabot[bot] Jun 26, 2023
b2214cf
Ensure history position does not conflict
alpe Jun 27, 2023
30f956b
Merge pull request #1461 from CosmWasm/dependabot/github_actions/bufb…
alpe Jun 28, 2023
c376c93
Merge pull request #1462 from CosmWasm/history_position
alpe Jun 29, 2023
448cc64
Bump seq in ibctests for failed messages as well (#1464)
alpe Jun 29, 2023
7644515
Bump bufbuild/buf-setup-action from 1.22.0 to 1.23.0
dependabot[bot] Jun 30, 2023
2496105
Use large resouce class for CI system tests (#1465)
alpe Jun 30, 2023
1d423da
Merge pull request #1474 from CosmWasm/dependabot/github_actions/bufb…
alpe Jun 30, 2023
9b85d8d
Bump bufbuild/buf-setup-action from 1.23.0 to 1.23.1
dependabot[bot] Jul 3, 2023
255ba09
Merge pull request #1477 from CosmWasm/dependabot/github_actions/bufb…
alpe Jul 3, 2023
5c6b2fb
Remove trace param in system tests
alpe Jul 4, 2023
f171a67
Add updates to ibctesting framework for MS (#1472)
alpe Jul 4, 2023
c158b77
Merge pull request #1481 from CosmWasm/system_notrace
alpe Jul 4, 2023
1763477
Remove check for wasm limit size in state sync (#1471)
pinosu Jul 5, 2023
15e4317
Bump CometBFT for security fix
alpe Jul 4, 2023
63f73d3
Gov authorization propagation for sub-messages (#1482)
alpe Jul 6, 2023
0fd9ecd
Deprecate alias.go (#1484)
pinosu Jul 6, 2023
1a5a2d9
Upgrade to wasmvm 1.3.0-rc.0 (#1486)
pinosu Jul 6, 2023
47cdac1
Merge pull request #1479 from CosmWasm/cometbft0372
alpe Jul 6, 2023
41bf225
Remove dependency to wasmd in system tests
alpe Jul 6, 2023
17e14a4
Merge pull request #1489 from CosmWasm/system_dep_cleanup
alpe Jul 6, 2023
3ab22e8
Bump github.com/cosmos/ibc-go/v7 from 7.1.0 to 7.2.0
dependabot[bot] Jul 6, 2023
d2e9ace
Add AllDenomMetadata BankQuery (#1426)
chipshort Jul 6, 2023
db93d7b
Merge pull request #1459 from CosmWasm/dependabot/go_modules/github.c…
alpe Jul 6, 2023
c23ecae
Add Encodings For `MsgFundCommunityPool` from Distribution (#1458)
fragwuerdig Jul 7, 2023
3fef0e2
Bump github.com/prometheus/client_golang from 1.15.0 to 1.16.0
dependabot[bot] Jul 7, 2023
52a7a6a
Merge pull request #1453 from CosmWasm/dependabot/go_modules/github.c…
alpe Jul 7, 2023
9f42774
Bump bufbuild/buf-setup-action from 1.23.1 to 1.24.0
dependabot[bot] Jul 14, 2023
788cdbb
Merge pull request #1502 from CosmWasm/dependabot/github_actions/bufb…
alpe Jul 14, 2023
d7df231
Make system tests extendable for other app binaries
alpe Jul 14, 2023
661fd4b
Merge pull request #1503 from CosmWasm/system_test_reusable
alpe Jul 14, 2023
4e0ad6b
use a more stable ibc-go
faddat Jul 16, 2023
b3607d8
fix some small errors in accordance with what's working in ibc-go and…
faddat Jul 16, 2023
e1d15e7
temporarily disable rosetta
faddat Jul 16, 2023
09f5086
add a few error checks and update some deprecated tendermint calls
faddat Jul 16, 2023
c6f24cb
Merge remote-tracking branch 'upstream/main' into sdk50mergemain
faddat Jul 16, 2023
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
22 changes: 21 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ jobs:
- "profiles/*"
- store_artifacts:
path: /tmp/logs

test-system:
executor: golang
parallelism: 1
resource_class: large
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- restore_cache:
keys:
- go-mod-v1-{{ checksum "go.sum" }}
- run:
name: Build and run system tests
command: make test-system

benchmark:
executor: golang
Expand Down Expand Up @@ -124,7 +139,9 @@ jobs:
- run:
name: Run simulations
command: |
make test-sim-multi-seed-short test-sim-import-export test-sim-deterministic
make test-sim-deterministic test-sim-multi-seed-short test-sim-import-export
- store_artifacts:
path: /tmp

upload-coverage:
executor: golang
Expand Down Expand Up @@ -232,6 +249,9 @@ workflows:
- upload-coverage:
requires:
- test-cover
- test-system:
requires:
- test-cover
- benchmark:
requires:
- test-cover
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.2
uses: actions/checkout@v3.5.3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/proto-buf-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.2
- uses: bufbuild/buf-setup-action@v1.20.0
- uses: actions/checkout@v3.5.3
- uses: bufbuild/buf-setup-action@v1.24.0

# lint checks
- uses: bufbuild/buf-lint-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
queue_rules:
- name: default
conditions:
- "#approved-reviews-by>0"
- '#approved-reviews-by>0'

pull_request_rules:
- name: backport patches to main branch
conditions:
- base=releases/v0.3x
- base=releases/v0.40.x
- label=backport/main
actions:
backport:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ RUN apk add git
WORKDIR /code
COPY . /code/
# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.4/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.2.4/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 682a54082e131eaff9beec80ba3e5908113916fcb8ddf7c668cb2d97cb94c13c
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ce3d892377d2523cf563e01120cb1436f9343f80be952c93f66aa94f5737b661
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0-rc.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0-rc.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep f1d5d58e1699dd63bc81c8ee6950a6092729572ccedebdf122c2bbe838cf74ee
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 829d6063c64feb05b11e39290de0c52402385226e11f8a19a03deca03c996f63

# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ distclean: clean
########################################
### Testing


test: test-unit
test-all: check test-race test-cover
test-all: check test-race test-cover test-system

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./...
Expand All @@ -149,9 +148,12 @@ test-sim-multi-seed-short: runsim
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestFullAppSimulation

test-sim-deterministic: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@echo "Running application deterministic simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 1 1 TestAppStateDeterminism

test-system: install
$(MAKE) -C tests/system/ test

###############################################################################
### Linting ###
###############################################################################
Expand Down Expand Up @@ -201,3 +203,4 @@ proto-check-breaking:
go-mod-cache draw-deps clean build format \
test test-all test-build test-cover test-unit test-race \
test-sim-import-export build-windows-client \
test-system
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ compatibility list:

| wasmd | wasmvm | cosmwasm-vm | cosmwasm-std |
|-------|--------------|-------------|--------------|
| 0.41 | v1.3.0 | | 1.0-1.3 |
| 0.40 | v1.2.3 | | 1.0-1.2 |
| 0.31 | v1.2.0 | | 1.0-1.2 |
| 0.30 | v1.1.0 | | 1.0-1.1 |
Expand Down
30 changes: 15 additions & 15 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ var (

// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to
// produce a list of enabled proposals to pass into wasmd app.
func GetEnabledProposals() []wasm.ProposalType {
func GetEnabledProposals() []wasmtypes.ProposalType {
if EnableSpecificProposals == "" {
if ProposalsEnabled == "true" {
return wasm.EnableAllProposals
return wasmtypes.EnableAllProposals
}
return wasm.DisableAllProposals
return wasmtypes.DisableAllProposals
}
chunks := strings.Split(EnableSpecificProposals, ",")
proposals, err := wasm.ConvertToProposals(chunks)
proposals, err := wasmtypes.ConvertToProposals(chunks)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -248,7 +248,7 @@ type WasmApp struct {
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasm.Keeper
WasmKeeper wasmkeeper.Keeper

ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
Expand All @@ -274,9 +274,9 @@ func NewWasmApp(
db dbm.DB,
traceStore io.Writer,
loadLatest bool,
enabledProposals []wasm.ProposalType,
enabledProposals []wasmtypes.ProposalType,
appOpts servertypes.AppOptions,
wasmOpts []wasm.Option,
wasmOpts []wasmkeeper.Option,
baseAppOptions ...func(*baseapp.BaseApp),
) *WasmApp {
interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
Expand Down Expand Up @@ -389,7 +389,7 @@ func NewWasmApp(
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)
app.CapabilityKeeper.Seal()

// add keepers
Expand Down Expand Up @@ -628,7 +628,7 @@ func NewWasmApp(
// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
availableCapabilities := strings.Join(AllCapabilities(), ",")
app.WasmKeeper = wasm.NewKeeper(
app.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[wasm.StoreKey]),
app.AccountKeeper,
Expand All @@ -651,7 +651,7 @@ func NewWasmApp(

// The gov proposal types can be individually enabled
if len(enabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals))
govRouter.AddRoute(wasmtypes.RouterKey, wasmkeeper.NewWasmProposalHandler(app.WasmKeeper, enabledProposals)) //nolint:staticcheck
}
// Set legacy router for backwards compatibility with gov v1beta1
app.GovKeeper.SetLegacyRouter(govRouter)
Expand Down Expand Up @@ -685,7 +685,7 @@ func NewWasmApp(
// Create static IBC router, add app routes, then set and seal it
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(wasm.ModuleName, wasmStack).
AddRoute(wasmtypes.ModuleName, wasmStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)
app.IBCKeeper.SetRouter(ibcRouter)
Expand Down Expand Up @@ -773,7 +773,7 @@ func NewWasmApp(
ibcexported.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
wasm.ModuleName,
wasmtypes.ModuleName,
)

app.ModuleManager.SetOrderEndBlockers(
Expand All @@ -789,7 +789,7 @@ func NewWasmApp(
ibcexported.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
wasm.ModuleName,
wasmtypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand All @@ -814,7 +814,7 @@ func NewWasmApp(
icatypes.ModuleName,
ibcfeetypes.ModuleName,
// wasm after ibc transfer
wasm.ModuleName,
wasmtypes.ModuleName,
}
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -1177,7 +1177,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(wasm.ModuleName)
paramsKeeper.Subspace(wasmtypes.ModuleName)

return paramsKeeper
}
13 changes: 7 additions & 6 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

var emptyWasmOpts []wasm.Option
var emptyWasmOpts []wasmkeeper.Option

func TestWasmdExport(t *testing.T) {
db := dbm.NewMemDB()
Expand Down Expand Up @@ -68,20 +69,20 @@ func TestGetEnabledProposals(t *testing.T) {
cases := map[string]struct {
proposalsEnabled string
specificEnabled string
expected []wasm.ProposalType
expected []wasmtypes.ProposalType
}{
"all disabled": {
proposalsEnabled: "false",
expected: wasm.DisableAllProposals,
expected: wasmtypes.DisableAllProposals,
},
"all enabled": {
proposalsEnabled: "true",
expected: wasm.EnableAllProposals,
expected: wasmtypes.EnableAllProposals,
},
"some enabled": {
proposalsEnabled: "okay",
specificEnabled: "StoreCode,InstantiateContract",
expected: []wasm.ProposalType{wasm.ProposalTypeStoreCode, wasm.ProposalTypeInstantiateContract},
expected: []wasmtypes.ProposalType{wasmtypes.ProposalTypeStoreCode, wasmtypes.ProposalTypeInstantiateContract},
},
}

Expand Down
20 changes: 11 additions & 9 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"cosmossdk.io/x/feegrant"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/spf13/viper"

"cosmossdk.io/log"
Expand All @@ -29,8 +30,6 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmd/x/wasm"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down Expand Up @@ -120,7 +119,7 @@ func TestAppImportExport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, wasmtypes.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
require.Equal(t, "WasmApp", newApp.Name())

var genesisState GenesisState
Expand All @@ -140,8 +139,10 @@ func TestAppImportExport(t *testing.T) {

ctxA := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()})
ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()})
newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState)
newApp.StoreConsensusParams(ctxB, exported.ConsensusParams)
_, err = newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState)
require.NoError(t, err)
err = newApp.StoreConsensusParams(ctxB, exported.ConsensusParams)
require.NoError(t, err)

t.Log("comparing stores...")
// skip certain prefixes
Expand Down Expand Up @@ -224,13 +225,14 @@ func TestAppSimulationAfterImport(t *testing.T) {
require.NoError(t, os.RemoveAll(newDir))
}()

newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, wasmtypes.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
require.Equal(t, "WasmApp", newApp.Name())

newApp.InitChain(&abci.RequestInitChain{
_, err = newApp.InitChain(&abci.RequestInitChain{
ChainId: SimAppChainID,
AppStateBytes: exported.AppState,
})
require.NoError(t, err)

_, _, err = simulation.SimulateFromSeed(
t,
Expand Down Expand Up @@ -265,7 +267,7 @@ func setupSimulationApp(t *testing.T, msg string) (simtypes.Config, dbm.DB, simt
appOptions[flags.FlagHome] = dir // ensure a unique folder
appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue

app := NewWasmApp(logger, db, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
app := NewWasmApp(logger, db, nil, true, wasmtypes.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID))
require.Equal(t, "WasmApp", app.Name())
return config, db, appOptions, app
}
Expand Down Expand Up @@ -309,7 +311,7 @@ func TestAppStateDeterminism(t *testing.T) {
}

db := dbm.NewMemDB()
app := NewWasmApp(logger, db, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID))
app := NewWasmApp(logger, db, nil, true, wasmtypes.EnableAllProposals, appOptions, emptyWasmOpts, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID))

fmt.Printf(
"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
Expand Down
Loading