Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

env:
GO_VERSION: "1.22.11"
GO_VERSION: "1.23.5"
TAR_PATH: /tmp/seda-docker-image.tar
IMAGE_NAME: sedad-e2e

Expand Down
20 changes: 10 additions & 10 deletions app/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
&wasmtypes.MsgExecuteContract{
Expand All @@ -86,13 +86,13 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof2", 20202),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof2"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
},
Expand All @@ -104,7 +104,7 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
&wasmtypes.MsgExecuteContract{
Expand Down Expand Up @@ -133,13 +133,13 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id_2", "commitment", "public_key", "proof", 10101),
Msg: testutil.CommitMsg("dr_id_2", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
},
Expand All @@ -151,7 +151,7 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
&wasmstoragetypes.MsgStoreOracleProgram{
Expand All @@ -162,7 +162,7 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id_2", "commitment", "public_key", "proof", 10101),
Msg: testutil.CommitMsg("dr_id_2", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
},
Expand All @@ -174,7 +174,7 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
&wasmtypes.MsgExecuteContract{
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestCommitRevealDecorator_AnteHandle(t *testing.T) {
&wasmtypes.MsgExecuteContract{
Sender: sender.String(),
Contract: coreContractAddr.String(),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof", 19990),
Msg: testutil.CommitMsg("dr_id", "commitment", "public_key", "proof"),
Funds: sdk.NewCoins(sdk.NewCoin(bondDenom, math.NewIntFromUint64(1))),
},
},
Expand Down
61 changes: 37 additions & 24 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

wasmapp "github.com/CosmWasm/wasmd/app"
wasm "github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
sdkwasm "github.com/CosmWasm/wasmd/x/wasm"
sdkwasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

dbm "github.com/cosmos/cosmos-db"
Expand Down Expand Up @@ -142,6 +142,9 @@ import (
"github.com/sedaprotocol/seda-chain/x/batching"
batchingkeeper "github.com/sedaprotocol/seda-chain/x/batching/keeper"
batchingtypes "github.com/sedaprotocol/seda-chain/x/batching/types"
"github.com/sedaprotocol/seda-chain/x/core"
corekeeper "github.com/sedaprotocol/seda-chain/x/core/keeper"
coretypes "github.com/sedaprotocol/seda-chain/x/core/types"
dataproxy "github.com/sedaprotocol/seda-chain/x/data-proxy"
dataproxykeeper "github.com/sedaprotocol/seda-chain/x/data-proxy/keeper"
dataproxytypes "github.com/sedaprotocol/seda-chain/x/data-proxy/types"
Expand All @@ -151,11 +154,9 @@ import (
"github.com/sedaprotocol/seda-chain/x/slashing"
"github.com/sedaprotocol/seda-chain/x/staking"
stakingkeeper "github.com/sedaprotocol/seda-chain/x/staking/keeper"
"github.com/sedaprotocol/seda-chain/x/tally"
tallykeeper "github.com/sedaprotocol/seda-chain/x/tally/keeper"
tallytypes "github.com/sedaprotocol/seda-chain/x/tally/types"
"github.com/sedaprotocol/seda-chain/x/vesting"
vestingtypes "github.com/sedaprotocol/seda-chain/x/vesting/types"
"github.com/sedaprotocol/seda-chain/x/wasm"
wasmstorage "github.com/sedaprotocol/seda-chain/x/wasm-storage"
wasmstoragekeeper "github.com/sedaprotocol/seda-chain/x/wasm-storage/keeper"
wasmstoragetypes "github.com/sedaprotocol/seda-chain/x/wasm-storage/types"
Expand Down Expand Up @@ -190,7 +191,7 @@ var (
consensus.AppModuleBasic{},
circuit.AppModuleBasic{},
capability.AppModuleBasic{},
wasm.AppModuleBasic{},
sdkwasm.AppModuleBasic{},
ibc.AppModuleBasic{},
ibctm.AppModuleBasic{},
ibcfee.AppModuleBasic{},
Expand All @@ -200,9 +201,9 @@ var (
crisis.AppModuleBasic{},
packetforward.AppModuleBasic{},
wasmstorage.AppModuleBasic{},
tally.AppModuleBasic{},
dataproxy.AppModuleBasic{},
batching.AppModuleBasic{},
core.AppModuleBasic{},
)

// module account permissions
Expand All @@ -218,6 +219,7 @@ var (
icatypes.ModuleName: nil,
wasmtypes.ModuleName: {authtypes.Burner},
dataproxytypes.ModuleName: {authtypes.Burner},
coretypes.ModuleName: {authtypes.Burner},
}
)

Expand Down Expand Up @@ -324,7 +326,7 @@ func NewApp(
capabilitytypes.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
wasmtypes.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey, packetforwardtypes.StoreKey,
crisistypes.StoreKey, wasmstoragetypes.StoreKey, dataproxytypes.StoreKey, pubkeytypes.StoreKey,
batchingtypes.StoreKey, tallytypes.StoreKey,
batchingtypes.StoreKey, coretypes.StoreKey,
)

memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -575,14 +577,14 @@ func NewApp(
app.EvidenceKeeper = *evidenceKeeper

wasmDir := filepath.Join(homePath, "wasm")
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
wasmConfig, err := sdkwasm.ReadWasmConfig(appOpts)
if err != nil {
panic(fmt.Sprintf("error while reading wasm config: %s", err))
}

var wasmOpts []wasmkeeper.Option
var wasmOpts []sdkwasmkeeper.Option

app.WasmKeeper = wasmkeeper.NewKeeper(
sdkWasmKeeper := sdkwasmkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[wasmtypes.StoreKey]),
app.AccountKeeper,
Expand Down Expand Up @@ -632,7 +634,13 @@ func NewApp(
wasmtypes.MaxWasmSize = int(val) // default 819200 (800 * 1024)
}

app.WasmContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(&app.WasmKeeper)
app.WasmKeeper = wasm.NewKeeper(
&sdkWasmKeeper,
app.StakingKeeper,
appCodec,
app.MsgServiceRouter(),
)
app.WasmContractKeeper = sdkwasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper)

app.WasmStorageKeeper = *wasmstoragekeeper.NewKeeper(
appCodec,
Expand All @@ -645,6 +653,8 @@ func NewApp(
app.WasmContractKeeper,
)

app.WasmKeeper.SetWasmStorageKeeper(app.WasmStorageKeeper)

app.PubKeyKeeper = pubkeykeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[pubkeytypes.StoreKey]),
Expand Down Expand Up @@ -674,15 +684,17 @@ func NewApp(
authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
)

app.TallyKeeper = tallykeeper.NewKeeper(
app.CoreKeeper = corekeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[tallytypes.StoreKey]),
runtime.NewKVStoreService(keys[coretypes.StoreKey]),
app.WasmStorageKeeper,
app.BatchingKeeper,
app.DataProxyKeeper,
app.StakingKeeper,
app.BankKeeper,
app.WasmContractKeeper,
app.WasmKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(), // TODO: subject to change
)

// Create evidence router, add batching evidence route, seal it, and set it in the keeper.
Expand Down Expand Up @@ -736,7 +748,7 @@ func NewApp(
/* WASM STACK */
/* =================================================== */
var wasmStack ibcporttypes.IBCModule
wasmStack = wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCFeeKeeper)
wasmStack = sdkwasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, app.IBCFeeKeeper)

/* =================================================== */
Expand Down Expand Up @@ -794,18 +806,18 @@ func NewApp(
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
circuit.NewAppModule(appCodec, app.CircuitKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), nil),
wasm.NewAppModule(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), nil),
ibc.NewAppModule(app.IBCKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
transfer.NewAppModule(app.TransferKeeper),
ica.NewAppModule(&icaControllerKeeper, &app.ICAHostKeeper),
ibctm.AppModule{},
packetforward.NewAppModule(app.PacketForwardKeeper, nil),
wasmstorage.NewAppModule(appCodec, app.WasmStorageKeeper),
tally.NewAppModule(appCodec, app.TallyKeeper),
dataproxy.NewAppModule(appCodec, app.DataProxyKeeper),
pubkey.NewAppModule(appCodec, app.PubKeyKeeper),
batching.NewAppModule(appCodec, app.BatchingKeeper),
core.NewAppModule(appCodec, app.CoreKeeper),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, nil), // always be last to make sure that it checks for all invariants and not only part of them
)

Expand Down Expand Up @@ -861,7 +873,7 @@ func NewApp(
packetforwardtypes.ModuleName,
// custom modules
wasmstoragetypes.ModuleName,
tallytypes.ModuleName,
coretypes.ModuleName,
dataproxytypes.ModuleName,
pubkeytypes.ModuleName,
batchingtypes.ModuleName,
Expand Down Expand Up @@ -894,7 +906,7 @@ func NewApp(
packetforwardtypes.ModuleName,
// custom modules
wasmstoragetypes.ModuleName,
tallytypes.ModuleName,
coretypes.ModuleName,
dataproxytypes.ModuleName,
pubkeytypes.ModuleName,
batchingtypes.ModuleName,
Expand Down Expand Up @@ -934,7 +946,7 @@ func NewApp(
packetforwardtypes.ModuleName,
// custom modules (except pubkey)
wasmstoragetypes.ModuleName,
tallytypes.ModuleName,
coretypes.ModuleName,
dataproxytypes.ModuleName,
batchingtypes.ModuleName,
}
Expand All @@ -950,7 +962,8 @@ func NewApp(
if err != nil {
panic(err)
}
app.setupUpgrades()
// TODO Re-enable upgrades
// app.setupUpgrades()

autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules))
reflectionSvc, err := runtimeservices.NewReflectionService()
Expand Down Expand Up @@ -983,7 +996,7 @@ func NewApp(
},
IBCKeeper: app.IBCKeeper,
WasmConfig: &wasmConfig,
WasmKeeper: &app.WasmKeeper,
WasmKeeper: app.WasmKeeper.Keeper,
TXCounterStoreService: runtime.NewKVStoreService(keys[wasmtypes.StoreKey]),
CircuitKeeper: &app.CircuitKeeper,
},
Expand Down Expand Up @@ -1050,7 +1063,7 @@ func NewApp(

if manager := app.SnapshotManager(); manager != nil {
err = manager.RegisterExtensions(
wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper),
sdkwasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), app.WasmKeeper.Keeper),
)
if err != nil {
panic("failed to register snapshot extension: " + err.Error())
Expand Down
8 changes: 4 additions & 4 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package keepers

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

packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper"
Expand Down Expand Up @@ -29,10 +28,11 @@ import (
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"

batchingkeeper "github.com/sedaprotocol/seda-chain/x/batching/keeper"
corekeeper "github.com/sedaprotocol/seda-chain/x/core/keeper"
dataproxykeeper "github.com/sedaprotocol/seda-chain/x/data-proxy/keeper"
pubkeykeeper "github.com/sedaprotocol/seda-chain/x/pubkey/keeper"
stakingkeeper "github.com/sedaprotocol/seda-chain/x/staking/keeper"
tallykeeper "github.com/sedaprotocol/seda-chain/x/tally/keeper"
"github.com/sedaprotocol/seda-chain/x/wasm"
wasmstoragekeeper "github.com/sedaprotocol/seda-chain/x/wasm-storage/keeper"
)

Expand All @@ -58,7 +58,7 @@ type AppKeepers struct {
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
WasmKeeper *wasm.Keeper
IBCFeeKeeper ibcfeekeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
PacketForwardKeeper *packetforwardkeeper.Keeper
Expand All @@ -75,7 +75,7 @@ type AppKeepers struct {

// SEDA modules keepers
WasmStorageKeeper wasmstoragekeeper.Keeper
TallyKeeper tallykeeper.Keeper
CoreKeeper corekeeper.Keeper
DataProxyKeeper dataproxykeeper.Keeper
PubKeyKeeper *pubkeykeeper.Keeper
BatchingKeeper batchingkeeper.Keeper
Expand Down
2 changes: 1 addition & 1 deletion app/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading