diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 37d5886..776dafb 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -168,7 +168,15 @@ type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `signer` | [string](#string) | | signer is the address who submits the message. | -| `init_msg` | [bytes](#bytes) | | init_msg is the instantiation message for the Babylon contract. | +| `network` | [string](#string) | | network is the Bitcoin network to connect to (e.g. "regtest", "testnet", "mainnet") | +| `babylon_tag` | [string](#string) | | babylon_tag is a unique identifier for this Babylon instance | +| `btc_confirmation_depth` | [uint32](#uint32) | | btc_confirmation_depth is the number of confirmations required for Bitcoin transactions | +| `checkpoint_finalization_timeout` | [uint32](#uint32) | | checkpoint_finalization_timeout is the timeout in blocks for checkpoint finalization | +| `notify_cosmos_zone` | [bool](#bool) | | notify_cosmos_zone indicates whether to notify the Cosmos zone of events | +| `btc_staking_msg` | [bytes](#bytes) | | btc_staking_msg is the initialization message for the BTC staking contract | +| `btc_finality_msg` | [bytes](#bytes) | | btc_finality_msg is the initialization message for the BTC finality contract | +| `consumer_name` | [string](#string) | | consumer_name is the name of this consumer chain | +| `consumer_description` | [string](#string) | | consumer_description is a description of this consumer chain | diff --git a/proto/babylonlabs/babylon/v1beta1/tx.proto b/proto/babylonlabs/babylon/v1beta1/tx.proto index 77fe22f..a6cc386 100644 --- a/proto/babylonlabs/babylon/v1beta1/tx.proto +++ b/proto/babylonlabs/babylon/v1beta1/tx.proto @@ -57,8 +57,29 @@ message MsgInstantiateBabylonContracts { // signer is the address who submits the message. string signer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // init_msg is the instantiation message for the Babylon contract. - bytes init_msg = 2; + + // network is the Bitcoin network to connect to (e.g. "regtest", "testnet", + // "mainnet") + string network = 2; + // babylon_tag is a unique identifier for this Babylon instance + string babylon_tag = 3; + // btc_confirmation_depth is the number of confirmations required for Bitcoin + // transactions + uint32 btc_confirmation_depth = 4; + // checkpoint_finalization_timeout is the timeout in blocks for checkpoint + // finalization + uint32 checkpoint_finalization_timeout = 5; + // notify_cosmos_zone indicates whether to notify the Cosmos zone of events + bool notify_cosmos_zone = 6; + // btc_staking_msg is the initialization message for the BTC staking contract + bytes btc_staking_msg = 7; + // btc_finality_msg is the initialization message for the BTC finality + // contract + bytes btc_finality_msg = 8; + // consumer_name is the name of this consumer chain + string consumer_name = 9; + // consumer_description is a description of this consumer chain + string consumer_description = 10; } // MsgInstantiateBabylonContractsResponse is the Msg/InstantiateBabylonContracts diff --git a/x/babylon/keeper/keeper_test.go b/x/babylon/keeper/keeper_test.go index e69bd37..52ea498 100644 --- a/x/babylon/keeper/keeper_test.go +++ b/x/babylon/keeper/keeper_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + "fmt" + "os" "testing" "time" @@ -8,10 +10,13 @@ import ( "cosmossdk.io/store" storemetrics "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/evidence" evidencetypes "cosmossdk.io/x/evidence/types" "cosmossdk.io/x/feegrant" + "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/CosmWasm/wasmd/x/wasm/ioutils" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -30,10 +35,13 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + "github.com/cosmos/cosmos-sdk/x/distribution" distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -41,17 +49,21 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/params" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/ibc-go/modules/capability" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" "github.com/stretchr/testify/require" @@ -70,11 +82,20 @@ type encodingConfig struct { var moduleBasics = module.NewBasicManager( auth.AppModuleBasic{}, bank.AppModuleBasic{}, + capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, + distribution.AppModuleBasic{}, gov.NewAppModuleBasic([]govclient.ProposalHandler{ paramsclient.ProposalHandler, }), + params.AppModuleBasic{}, + crisis.AppModuleBasic{}, + slashing.AppModuleBasic{}, + ibc.AppModuleBasic{}, + upgrade.AppModuleBasic{}, + evidence.AppModuleBasic{}, + vesting.AppModuleBasic{}, ) func makeEncodingConfig(_ testing.TB) encodingConfig { @@ -86,6 +107,9 @@ func makeEncodingConfig(_ testing.TB) encodingConfig { moduleBasics.RegisterLegacyAminoCodec(amino) moduleBasics.RegisterInterfaces(interfaceRegistry) + // add wasm types + wasmtypes.RegisterInterfaces(interfaceRegistry) + wasmtypes.RegisterLegacyAminoCodec(amino) // add babylon types types.RegisterInterfaces(interfaceRegistry) types.RegisterLegacyAminoCodec(amino) @@ -99,17 +123,18 @@ func makeEncodingConfig(_ testing.TB) encodingConfig { } type TestKeepers struct { - Ctx sdk.Context - StakingKeeper *stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - BankKeeper bankkeeper.Keeper - StoreKey *storetypes.KVStoreKey - EncodingConfig encodingConfig - BabylonKeeper *keeper.Keeper - AccountKeeper authkeeper.AccountKeeper - WasmKeeper *wasmkeeper.Keeper - WasmMsgServer wasmtypes.MsgServer - Faucet *wasmkeeper.TestFaucet + Ctx sdk.Context + StakingKeeper *stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + BankKeeper bankkeeper.Keeper + StoreKey *storetypes.KVStoreKey + EncodingConfig encodingConfig + BabylonKeeper *keeper.Keeper + BabylonMsgServer types.MsgServer + AccountKeeper authkeeper.AccountKeeper + WasmKeeper *wasmkeeper.Keeper + WasmMsgServer wasmtypes.MsgServer + Faucet *wasmkeeper.TestFaucet } func NewTestKeepers(t testing.TB, opts ...keeper.Option) TestKeepers { @@ -267,7 +292,7 @@ func NewTestKeepers(t testing.TB, opts ...keeper.Option) TestKeepers { querier, t.TempDir(), wasmtypes.DefaultWasmConfig(), - []string{"iterator", "staking", "stargate", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "virtual_staking"}, + []string{"iterator", "staking", "stargate", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0", "virtual_staking"}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) require.NoError(t, wasmKeeper.SetParams(ctx, wasmtypes.DefaultParams())) @@ -284,19 +309,64 @@ func NewTestKeepers(t testing.TB, opts ...keeper.Option) TestKeepers { opts..., ) require.NoError(t, babylonKeeper.SetParams(ctx, types.DefaultParams(sdk.DefaultBondDenom))) + babylonMsgServer := keeper.NewMsgServer(babylonKeeper) faucet := wasmkeeper.NewTestFaucet(t, ctx, bankKeeper, minttypes.ModuleName, sdk.NewInt64Coin(sdk.DefaultBondDenom, 1_000_000_000_000)) return TestKeepers{ - Ctx: ctx, - AccountKeeper: accountKeeper, - StakingKeeper: stakingKeeper, - SlashingKeeper: slashingKeeper, - BankKeeper: bankKeeper, - StoreKey: keys[types.StoreKey], - EncodingConfig: encConfig, - BabylonKeeper: babylonKeeper, - WasmKeeper: &wasmKeeper, - WasmMsgServer: wasmMsgServer, - Faucet: faucet, + Ctx: ctx, + AccountKeeper: accountKeeper, + StakingKeeper: stakingKeeper, + SlashingKeeper: slashingKeeper, + BankKeeper: bankKeeper, + StoreKey: keys[types.StoreKey], + EncodingConfig: encConfig, + BabylonKeeper: babylonKeeper, + BabylonMsgServer: babylonMsgServer, + WasmKeeper: &wasmKeeper, + WasmMsgServer: wasmMsgServer, + Faucet: faucet, } } + +const ( + TestDataPath = "../../../tests/testdata" + BabylonContractCodePath = TestDataPath + "/babylon_contract.wasm" + BtcStakingContractCodePath = TestDataPath + "/btc_staking.wasm" + BtcFinalityContractCodePath = TestDataPath + "/btc_finality.wasm" +) + +func GetGZippedContractCode(path string) ([]byte, error) { + wasm, err := os.ReadFile(path) + if err != nil { + return nil, err + } + // gzip the wasm file + if ioutils.IsWasm(wasm) { + wasm, err = ioutils.GzipIt(wasm) + + if err != nil { + return nil, err + } + } else if !ioutils.IsGzip(wasm) { + return nil, fmt.Errorf("invalid input file. Use wasm binary or gzip") + } + + return wasm, nil +} + +func GetGZippedContractCodes() ([]byte, []byte, []byte) { + babylonContractCode, err := GetGZippedContractCode(BabylonContractCodePath) + if err != nil { + panic(err) + } + btcStakingContractCode, err := GetGZippedContractCode(BtcStakingContractCodePath) + if err != nil { + panic(err) + } + btcFinalityContractCode, err := GetGZippedContractCode(BtcFinalityContractCodePath) + if err != nil { + panic(err) + } + + return babylonContractCode, btcStakingContractCode, btcFinalityContractCode +} diff --git a/x/babylon/keeper/msg_server.go b/x/babylon/keeper/msg_server.go index c7e280a..01cbee8 100644 --- a/x/babylon/keeper/msg_server.go +++ b/x/babylon/keeper/msg_server.go @@ -57,8 +57,26 @@ func (ms msgServer) InstantiateBabylonContracts(goCtx context.Context, req *type return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "only authority can override instantiated contracts; expected %s, got %s", ms.k.authority, req.Signer) } + // construct the init message + initMsg, err := types.NewInitMsg( + ms.k.authority, + ¶ms, + req.Network, + req.BabylonTag, + req.BtcConfirmationDepth, + req.CheckpointFinalizationTimeout, + req.NotifyCosmosZone, + req.BtcStakingMsg, + req.BtcFinalityMsg, + req.ConsumerName, + req.ConsumerDescription, + ) + if err != nil { + return nil, err + } + // instantiate the contracts - babylonContractAddr, btcStakingContractAddr, btcFinalityContractAddr, err := ms.k.InstantiateBabylonContracts(ctx, req.InitMsg) + babylonContractAddr, btcStakingContractAddr, btcFinalityContractAddr, err := ms.k.InstantiateBabylonContracts(ctx, initMsg) if err != nil { return nil, err } diff --git a/x/babylon/keeper/msg_server_test.go b/x/babylon/keeper/msg_server_test.go index b55569d..52b9400 100644 --- a/x/babylon/keeper/msg_server_test.go +++ b/x/babylon/keeper/msg_server_test.go @@ -1 +1,89 @@ -package keeper +package keeper_test + +import ( + "encoding/json" + "testing" + + "github.com/babylonlabs-io/babylon-sdk/x/babylon/types" + "github.com/stretchr/testify/require" +) + +func TestStoreBabylonContractCodes(t *testing.T) { + keepers := NewTestKeepers(t) + msgServer := keepers.BabylonMsgServer + + babylonContractCode, btcStakingContractCode, btcFinalityContractCode := GetGZippedContractCodes() + + // store Babylon contract codes + _, err := msgServer.StoreBabylonContractCodes(keepers.Ctx, &types.MsgStoreBabylonContractCodes{ + BabylonContractCode: babylonContractCode, + BtcStakingContractCode: btcStakingContractCode, + BtcFinalityContractCode: btcFinalityContractCode, + }) + require.NoError(t, err) + + // ensure params are set + params := keepers.BabylonKeeper.GetParams(keepers.Ctx) + require.Positive(t, params.BabylonContractCodeId) + require.Positive(t, params.BtcStakingContractCodeId) + require.Positive(t, params.BtcFinalityContractCodeId) + + // ensure non-gov account cannot override + _, err = msgServer.StoreBabylonContractCodes(keepers.Ctx, &types.MsgStoreBabylonContractCodes{ + BabylonContractCode: babylonContractCode, + BtcStakingContractCode: btcStakingContractCode, + BtcFinalityContractCode: btcFinalityContractCode, + }) + require.Error(t, err) + + // gov can override + _, err = msgServer.StoreBabylonContractCodes(keepers.Ctx, &types.MsgStoreBabylonContractCodes{ + Signer: keepers.BabylonKeeper.GetAuthority(), + BabylonContractCode: babylonContractCode, + BtcStakingContractCode: btcStakingContractCode, + BtcFinalityContractCode: btcFinalityContractCode, + }) + require.NoError(t, err) +} + +// TODO: fix this test +func TestInstantiateBabylonContracts(t *testing.T) { + keepers := NewTestKeepers(t) + msgServer := keepers.BabylonMsgServer + + // store Babylon contract codes + babylonContractCode, btcStakingContractCode, btcFinalityContractCode := GetGZippedContractCodes() + _, err := msgServer.StoreBabylonContractCodes(keepers.Ctx, &types.MsgStoreBabylonContractCodes{ + BabylonContractCode: babylonContractCode, + BtcStakingContractCode: btcStakingContractCode, + BtcFinalityContractCode: btcFinalityContractCode, + }) + require.NoError(t, err) + + // BTC staking init message + btcStakingInitMsg := map[string]interface{}{ + "admin": keepers.BabylonKeeper.GetAuthority(), + } + btcStakingInitMsgBytes, err := json.Marshal(btcStakingInitMsg) + require.NoError(t, err) + // BTC finality init message + btcFinalityInitMsg := map[string]interface{}{ + "admin": keepers.BabylonKeeper.GetAuthority(), + } + btcFinalityInitMsgBytes, err := json.Marshal(btcFinalityInitMsg) + require.NoError(t, err) + + // instantiate Babylon contract + _, err = msgServer.InstantiateBabylonContracts(keepers.Ctx, &types.MsgInstantiateBabylonContracts{ + Network: "regtest", + BabylonTag: "01020304", + BtcConfirmationDepth: 1, + CheckpointFinalizationTimeout: 2, + NotifyCosmosZone: false, + BtcStakingMsg: btcStakingInitMsgBytes, + BtcFinalityMsg: btcFinalityInitMsgBytes, + ConsumerName: "test-consumer", + ConsumerDescription: "test-consumer-description", + }) + require.NoError(t, err) +} diff --git a/x/babylon/types/babylon.go b/x/babylon/types/babylon.go index 45cd09b..bc83cd3 100644 --- a/x/babylon/types/babylon.go +++ b/x/babylon/types/babylon.go @@ -1,5 +1,7 @@ package types +import "encoding/json" + // Config represents the configuration for the Babylon contract type BabylonContractConfig struct { Network string `json:"network"` @@ -20,36 +22,37 @@ type BabylonContractConfig struct { ConsumerDescription string `json:"consumer_description,omitempty"` } -type BabylonContractInitMsg struct { - // Network represents the Bitcoin network (mainnet, testnet, etc.) - Network string `json:"network"` - // BabylonTag is a string encoding four bytes used for identification / tagging of the Babylon zone. - // NOTE: this is a hex string, not raw bytes - BabylonTag string `json:"babylon_tag"` - // BTCConfirmationDepth is the number of confirmations required for BTC headers - BTCConfirmationDepth uint32 `json:"btc_confirmation_depth"` - // CheckpointFinalizationTimeout is the timeout period for checkpoint finalization - CheckpointFinalizationTimeout uint32 `json:"checkpoint_finalization_timeout"` - // NotifyCosmosZone indicates whether to send Cosmos zone messages notifying BTC-finalised headers. - // NOTE: If set to true, then the Cosmos zone needs to integrate the corresponding message handler - // as well - NotifyCosmosZone bool `json:"notify_cosmos_zone"` - // BTCStakingCodeID is the code ID for the BTC staking contract, if set - BTCStakingCodeID *uint64 `json:"btc_staking_code_id,omitempty"` - // BTCStakingMsg is the instantiation message for the BTC staking contract. - // This message is opaque to the Babylon contract, and depends on the specific staking contract - // being instantiated - BTCStakingMsg []byte `json:"btc_staking_msg,omitempty"` - // BTCFinalityCodeID is the code ID for the BTC finality contract, if set - BTCFinalityCodeID *uint64 `json:"btc_finality_code_id,omitempty"` - // BTCFinalityMsg is the instantiation message for the BTC finality contract. - // This message is opaque to the Babylon contract, and depends on the specific finality contract - // being instantiated - BTCFinalityMsg []byte `json:"btc_finality_msg,omitempty"` - // Admin is the Wasm migration / upgrade admin of the BTC staking contract and the BTC finality contract - Admin string `json:"admin,omitempty"` - // ConsumerName represents the name of the Consumer - ConsumerName string `json:"consumer_name,omitempty"` - // ConsumerDescription represents the description of the Consumer - ConsumerDescription string `json:"consumer_description,omitempty"` +// NewInitMsg creates the init message for the Babylon contract +func NewInitMsg( + govAccount string, + params *Params, + network string, + babylonTag string, + btcConfirmationDepth uint32, + checkpointFinalizationTimeout uint32, + notifyCosmosZone bool, + btcStakingInitMsgBytes []byte, + btcFinalityInitMsgBytes []byte, + consumerName string, + consumerDescription string, +) ([]byte, error) { + initMsg := map[string]interface{}{ + "network": network, + "babylon_tag": babylonTag, + "btc_confirmation_depth": btcConfirmationDepth, + "checkpoint_finalization_timeout": checkpointFinalizationTimeout, + "notify_cosmos_zone": notifyCosmosZone, + "btc_staking_code_id": params.BtcStakingContractCodeId, + "btc_staking_msg": btcStakingInitMsgBytes, + "consumer_name": consumerName, + "consumer_description": consumerDescription, + "btc_finality_code_id": params.BtcFinalityContractCodeId, + "btc_finality_msg": btcFinalityInitMsgBytes, + "admin": govAccount, + } + initMsgBytes, err := json.Marshal(initMsg) + if err != nil { + return nil, err + } + return initMsgBytes, nil } diff --git a/x/babylon/types/codec.go b/x/babylon/types/codec.go index ff8e82c..63ef3c6 100644 --- a/x/babylon/types/codec.go +++ b/x/babylon/types/codec.go @@ -10,12 +10,18 @@ import ( // RegisterLegacyAminoCodec register types with legacy amino func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgStoreBabylonContractCodes{}, "babylon/MsgStoreBabylonContractCodes", nil) + cdc.RegisterConcrete(&MsgInstantiateBabylonContracts{}, "babylon/MsgInstantiateBabylonContracts", nil) + cdc.RegisterConcrete(&MsgUpdateParams{}, "babylon/MsgUpdateParams", nil) } // RegisterInterfaces register types with interface registry func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), + &MsgStoreBabylonContractCodes{}, + &MsgInstantiateBabylonContracts{}, + &MsgUpdateParams{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/babylon/types/tx.pb.go b/x/babylon/types/tx.pb.go index 78b525a..8fd3627 100644 --- a/x/babylon/types/tx.pb.go +++ b/x/babylon/types/tx.pb.go @@ -122,8 +122,28 @@ var xxx_messageInfo_MsgStoreBabylonContractCodesResponse proto.InternalMessageIn type MsgInstantiateBabylonContracts struct { // signer is the address who submits the message. Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - // init_msg is the instantiation message for the Babylon contract. - InitMsg []byte `protobuf:"bytes,2,opt,name=init_msg,json=initMsg,proto3" json:"init_msg,omitempty"` + // network is the Bitcoin network to connect to (e.g. "regtest", "testnet", + // "mainnet") + Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"` + // babylon_tag is a unique identifier for this Babylon instance + BabylonTag string `protobuf:"bytes,3,opt,name=babylon_tag,json=babylonTag,proto3" json:"babylon_tag,omitempty"` + // btc_confirmation_depth is the number of confirmations required for Bitcoin + // transactions + BtcConfirmationDepth uint32 `protobuf:"varint,4,opt,name=btc_confirmation_depth,json=btcConfirmationDepth,proto3" json:"btc_confirmation_depth,omitempty"` + // checkpoint_finalization_timeout is the timeout in blocks for checkpoint + // finalization + CheckpointFinalizationTimeout uint32 `protobuf:"varint,5,opt,name=checkpoint_finalization_timeout,json=checkpointFinalizationTimeout,proto3" json:"checkpoint_finalization_timeout,omitempty"` + // notify_cosmos_zone indicates whether to notify the Cosmos zone of events + NotifyCosmosZone bool `protobuf:"varint,6,opt,name=notify_cosmos_zone,json=notifyCosmosZone,proto3" json:"notify_cosmos_zone,omitempty"` + // btc_staking_msg is the initialization message for the BTC staking contract + BtcStakingMsg []byte `protobuf:"bytes,7,opt,name=btc_staking_msg,json=btcStakingMsg,proto3" json:"btc_staking_msg,omitempty"` + // btc_finality_msg is the initialization message for the BTC finality + // contract + BtcFinalityMsg []byte `protobuf:"bytes,8,opt,name=btc_finality_msg,json=btcFinalityMsg,proto3" json:"btc_finality_msg,omitempty"` + // consumer_name is the name of this consumer chain + ConsumerName string `protobuf:"bytes,9,opt,name=consumer_name,json=consumerName,proto3" json:"consumer_name,omitempty"` + // consumer_description is a description of this consumer chain + ConsumerDescription string `protobuf:"bytes,10,opt,name=consumer_description,json=consumerDescription,proto3" json:"consumer_description,omitempty"` } func (m *MsgInstantiateBabylonContracts) Reset() { *m = MsgInstantiateBabylonContracts{} } @@ -295,42 +315,54 @@ func init() { } var fileDescriptor_406c9f025b2f9448 = []byte{ - // 551 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcf, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0xb3, 0x4d, 0x8d, 0x76, 0x5a, 0x14, 0xd6, 0x6a, 0x92, 0xad, 0xac, 0x25, 0x96, 0x12, - 0x8b, 0xd9, 0x35, 0xf1, 0x07, 0xb4, 0x3d, 0x25, 0x01, 0xc1, 0x43, 0x40, 0x12, 0xbc, 0x78, 0x09, - 0xb3, 0x3f, 0x9c, 0x0e, 0x4d, 0x66, 0xc2, 0xbe, 0xd7, 0xd2, 0x78, 0x12, 0x6f, 0xde, 0xbc, 0x0a, - 0x82, 0xff, 0x42, 0x0f, 0x9e, 0x3d, 0xe7, 0x58, 0x3c, 0x79, 0x12, 0x4d, 0x0e, 0xfd, 0x37, 0x24, - 0xbb, 0xb3, 0x69, 0x12, 0x71, 0x83, 0xf5, 0xb4, 0x33, 0xbc, 0xef, 0xe7, 0x7d, 0xbf, 0x3b, 0xf3, - 0x18, 0xb2, 0xe5, 0x50, 0xa7, 0xdf, 0x91, 0xa2, 0x43, 0x1d, 0xb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xd8, 0xd3, 0xb8, 0xf2, 0xf6, 0xfc, 0x74, 0x47, 0xab, 0xb5, - 0x06, 0xbf, 0xcc, 0xd4, 0x60, 0x68, 0x6a, 0x67, 0x43, 0x53, 0xfb, 0x39, 0x34, 0xb5, 0x0f, 0x23, - 0x33, 0x75, 0x36, 0x32, 0x53, 0xdf, 0x47, 0x66, 0xea, 0xd5, 0x13, 0xc6, 0xf1, 0xe0, 0xc8, 0xb1, - 0x5c, 0xd9, 0xb5, 0xa7, 0x4c, 0x4a, 0x5c, 0xc6, 0xdb, 0x12, 0x78, 0x87, 0xf6, 0xc9, 0xe4, 0xe5, - 0xc2, 0x7e, 0xcf, 0x07, 0x27, 0x13, 0x3e, 0x58, 0x8f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x53, - 0x29, 0x66, 0x64, 0x6a, 0x05, 0x00, 0x00, + // 739 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x4f, 0xdb, 0x48, + 0x14, 0x8e, 0x09, 0x04, 0x32, 0xfc, 0x94, 0xc9, 0x2e, 0x4e, 0xd8, 0x35, 0x28, 0x20, 0x94, 0x45, + 0x10, 0x6f, 0x58, 0xb6, 0x12, 0x70, 0x22, 0x41, 0x48, 0x3d, 0xa4, 0xaa, 0x1c, 0x7a, 0xe1, 0x12, + 0x8d, 0xed, 0xc1, 0x19, 0x05, 0xcf, 0x58, 0x9e, 0x09, 0x25, 0x9c, 0xaa, 0xde, 0x7a, 0xeb, 0xb5, + 0x52, 0xa5, 0xfe, 0x0b, 0x1c, 0x7a, 0xee, 0x99, 0x23, 0xea, 0xa9, 0xa7, 0xaa, 0x85, 0x03, 0xd7, + 0xfe, 0x09, 0x95, 0xc7, 0x76, 0xe2, 0xa4, 0xaa, 0x51, 0xe9, 0xc9, 0x33, 0xfe, 0xbe, 0x6f, 0xde, + 0x7b, 0xdf, 0x7b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0x5c, 0x02, 0x73, 0x03, 0x5d, 0xf5, 0x89, 0x13, 0x82, 0x38, 0x13, 0xeb, 0xa5, 0xcf, 0x5c, + 0x01, 0xd3, 0x26, 0x25, 0xac, 0xe3, 0x20, 0xaf, 0x49, 0xa0, 0x83, 0x94, 0xac, 0x30, 0x68, 0x2a, + 0x7a, 0xf9, 0x04, 0x3a, 0x48, 0xae, 0x80, 0x5c, 0x8f, 0x64, 0x21, 0x66, 0x7a, 0xd8, 0xf5, 0x6b, + 0x50, 0x80, 0xe0, 0xce, 0x47, 0xd8, 0x41, 0x1f, 0x1a, 0x1c, 0x8d, 0x12, 0x58, 0x4b, 0xee, 0x78, + 0x6f, 0x38, 0xde, 0x4a, 0x60, 0xb6, 0xce, 0xec, 0x67, 0xae, 0x05, 0x39, 0x7a, 0x0a, 0x3d, 0xe8, + 0x30, 0xf9, 0x11, 0xc8, 0xc2, 0x0e, 0x6f, 0x51, 0x0f, 0xf3, 0xee, 0xbd, 0x03, 0xd1, 0xa7, 0xca, + 0xfb, 0x20, 0xe3, 0x8a, 0x13, 0xc4, 0x48, 0x4c, 0x6e, 0xad, 0x94, 0x13, 0xfe, 0x1f, 0xe5, 0x20, + 0x58, 0x75, 0xf4, 0xea, 0xf3, 0x52, 0x4a, 0x0f, 0x85, 0xbb, 0x33, 0x7e, 0x15, 0xfd, 0x23, 0x8b, + 0x79, 0xb0, 0x30, 0x94, 0x5d, 0x94, 0xf9, 0xd6, 0x87, 0x34, 0x48, 0xfb, 0x86, 0xbe, 0x91, 0x40, + 0xfe, 0xe7, 0xff, 0x83, 0x9d, 0xc4, 0x1c, 0x92, 0xbe, 0x9f, 0xc2, 0xfe, 0x83, 0xa5, 0x51, 0x8e, + 0xf2, 0x3b, 0x09, 0x2c, 0x26, 0x7d, 0x77, 0x7b, 0xf7, 0x85, 0x48, 0x10, 0x17, 0x6a, 0xbf, 0x21, + 0xee, 0x65, 0xe8, 0x81, 0xa9, 0x81, 0xde, 0x6f, 0xdc, 0x77, 0x68, 0x9c, 0x5d, 0xd8, 0xfe, 0x15, + 0x76, 0x14, 0xb3, 0x30, 0xf6, 0xe2, 0xee, 0x72, 0x5d, 0xaa, 0x36, 0xae, 0xbe, 0xaa, 0xa9, 0xab, + 0x1b, 0x55, 0xba, 0xbe, 0x51, 0xa5, 0x2f, 0x37, 0xaa, 0xf4, 0xfa, 0x56, 0x4d, 0x5d, 0xdf, 0xaa, + 0xa9, 0x4f, 0xb7, 0x6a, 0xea, 0xf8, 0x7f, 0x1b, 0xf3, 0x56, 0xc7, 0x28, 0x9b, 0xd4, 0xd1, 0x62, + 0x41, 0x36, 0x31, 0x8d, 0xb6, 0x9b, 0xcc, 0x6a, 0x6b, 0xe7, 0xbd, 0x0b, 0x83, 0x77, 0x5d, 0xc4, + 0x8c, 0x8c, 0xb8, 0x27, 0xfe, 0xfb, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x43, 0xc9, 0xb7, 0x23, 0xe1, + 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -591,10 +623,65 @@ func (m *MsgInstantiateBabylonContracts) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if len(m.InitMsg) > 0 { - i -= len(m.InitMsg) - copy(dAtA[i:], m.InitMsg) - i = encodeVarintTx(dAtA, i, uint64(len(m.InitMsg))) + if len(m.ConsumerDescription) > 0 { + i -= len(m.ConsumerDescription) + copy(dAtA[i:], m.ConsumerDescription) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerDescription))) + i-- + dAtA[i] = 0x52 + } + if len(m.ConsumerName) > 0 { + i -= len(m.ConsumerName) + copy(dAtA[i:], m.ConsumerName) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConsumerName))) + i-- + dAtA[i] = 0x4a + } + if len(m.BtcFinalityMsg) > 0 { + i -= len(m.BtcFinalityMsg) + copy(dAtA[i:], m.BtcFinalityMsg) + i = encodeVarintTx(dAtA, i, uint64(len(m.BtcFinalityMsg))) + i-- + dAtA[i] = 0x42 + } + if len(m.BtcStakingMsg) > 0 { + i -= len(m.BtcStakingMsg) + copy(dAtA[i:], m.BtcStakingMsg) + i = encodeVarintTx(dAtA, i, uint64(len(m.BtcStakingMsg))) + i-- + dAtA[i] = 0x3a + } + if m.NotifyCosmosZone { + i-- + if m.NotifyCosmosZone { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.CheckpointFinalizationTimeout != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CheckpointFinalizationTimeout)) + i-- + dAtA[i] = 0x28 + } + if m.BtcConfirmationDepth != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BtcConfirmationDepth)) + i-- + dAtA[i] = 0x20 + } + if len(m.BabylonTag) > 0 { + i -= len(m.BabylonTag) + copy(dAtA[i:], m.BabylonTag) + i = encodeVarintTx(dAtA, i, uint64(len(m.BabylonTag))) + i-- + dAtA[i] = 0x1a + } + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = encodeVarintTx(dAtA, i, uint64(len(m.Network))) i-- dAtA[i] = 0x12 } @@ -749,7 +836,36 @@ func (m *MsgInstantiateBabylonContracts) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.InitMsg) + l = len(m.Network) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BabylonTag) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BtcConfirmationDepth != 0 { + n += 1 + sovTx(uint64(m.BtcConfirmationDepth)) + } + if m.CheckpointFinalizationTimeout != 0 { + n += 1 + sovTx(uint64(m.CheckpointFinalizationTimeout)) + } + if m.NotifyCosmosZone { + n += 2 + } + l = len(m.BtcStakingMsg) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BtcFinalityMsg) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConsumerDescription) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1092,7 +1208,129 @@ func (m *MsgInstantiateBabylonContracts) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitMsg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Network = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BabylonTag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BabylonTag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BtcConfirmationDepth", wireType) + } + m.BtcConfirmationDepth = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BtcConfirmationDepth |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckpointFinalizationTimeout", wireType) + } + m.CheckpointFinalizationTimeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CheckpointFinalizationTimeout |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NotifyCosmosZone", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NotifyCosmosZone = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BtcStakingMsg", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1119,10 +1357,108 @@ func (m *MsgInstantiateBabylonContracts) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InitMsg = append(m.InitMsg[:0], dAtA[iNdEx:postIndex]...) - if m.InitMsg == nil { - m.InitMsg = []byte{} + m.BtcStakingMsg = append(m.BtcStakingMsg[:0], dAtA[iNdEx:postIndex]...) + if m.BtcStakingMsg == nil { + m.BtcStakingMsg = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BtcFinalityMsg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BtcFinalityMsg = append(m.BtcFinalityMsg[:0], dAtA[iNdEx:postIndex]...) + if m.BtcFinalityMsg == nil { + m.BtcFinalityMsg = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerDescription", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.ConsumerDescription = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex