From f6af2b15fcf6b2a064341b03d0767c938f51a2d0 Mon Sep 17 00:00:00 2001 From: shiki-tak Date: Tue, 8 Aug 2023 19:45:27 +0900 Subject: [PATCH] feat: add l1_to_l2_gas_ratio in rollup info and fix GetAllRollup's param --- docs/core/proto-docs.md | 2 + proto/finschia/or/rollup/v1/rollup.proto | 3 +- proto/finschia/or/rollup/v1/tx.proto | 3 +- x/or/demo/prepare_rollup.sh | 2 +- x/or/rollup/client/cli/tx.go | 14 ++- x/or/rollup/keeper/msg_server.go | 1 + x/or/rollup/keeper/rollup.go | 3 +- x/or/rollup/types/message_create_rollup.go | 3 +- x/or/rollup/types/rollup.pb.go | 103 ++++++++++++------ x/or/rollup/types/tx.pb.go | 121 ++++++++++++++------- 10 files changed, 170 insertions(+), 85 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 6626ec1c6b..3426c9774d 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -9702,6 +9702,7 @@ Msg defines the Msg service. | ----- | ---- | ----- | ----------- | | `rollup_name` | [string](#string) | | | | `creator` | [string](#string) | | | +| `l1_to_l2_gas_ratio` | [uint64](#uint64) | | | | `permissioned_addresses` | [Sequencers](#finschia.or.rollup.v1.Sequencers) | | | @@ -10025,6 +10026,7 @@ Params defines the parameters for the module. | ----- | ---- | ----- | ----------- | | `rollup_name` | [string](#string) | | | | `creator` | [string](#string) | | | +| `l1_to_l2_gas_ratio` | [uint64](#uint64) | | | | `permissioned_addresses` | [Sequencers](#finschia.or.rollup.v1.Sequencers) | | | diff --git a/proto/finschia/or/rollup/v1/rollup.proto b/proto/finschia/or/rollup/v1/rollup.proto index e5b783cb63..1590559bc5 100644 --- a/proto/finschia/or/rollup/v1/rollup.proto +++ b/proto/finschia/or/rollup/v1/rollup.proto @@ -11,7 +11,8 @@ option go_package = "github.com/Finschia/finschia-sdk/x/or/rollup/types"; message Rollup { string rollup_name = 1; string creator = 2; - Sequencers permissioned_addresses = 3 [(gogoproto.nullable) = false]; + uint64 l1_to_l2_gas_ratio = 3; + Sequencers permissioned_addresses = 4 [(gogoproto.nullable) = false]; } message Sequencer { diff --git a/proto/finschia/or/rollup/v1/tx.proto b/proto/finschia/or/rollup/v1/tx.proto index 0bd8e79bdd..775b8d59ee 100644 --- a/proto/finschia/or/rollup/v1/tx.proto +++ b/proto/finschia/or/rollup/v1/tx.proto @@ -20,7 +20,8 @@ service Msg { message MsgCreateRollup { string rollup_name = 1; string creator = 2; - Sequencers permissioned_addresses = 3 [(gogoproto.nullable) = false]; + uint64 l1_to_l2_gas_ratio = 3; + Sequencers permissioned_addresses = 4 [(gogoproto.nullable) = false]; } message MsgRegisterSequencer { diff --git a/x/or/demo/prepare_rollup.sh b/x/or/demo/prepare_rollup.sh index f271c53352..ec203ca75d 100644 --- a/x/or/demo/prepare_rollup.sh +++ b/x/or/demo/prepare_rollup.sh @@ -22,7 +22,7 @@ INITBALANCE=$(simd query bank balances $SEQUENCERADDRESS --home $BASE_DIR --outp echo $INITBALANCE echo "# Create rollup" -simd tx rollup create-rollup $ROLLUPNAME --from $SEQUENCER --keyring-backend=test --home $BASE_DIR --chain-id sim -y +simd tx rollup create-rollup $ROLLUPNAME 5 --from $SEQUENCER --keyring-backend=test --home $BASE_DIR --chain-id sim -y sleep 5 diff --git a/x/or/rollup/client/cli/tx.go b/x/or/rollup/client/cli/tx.go index 8531a75292..32b3413d09 100644 --- a/x/or/rollup/client/cli/tx.go +++ b/x/or/rollup/client/cli/tx.go @@ -3,6 +3,7 @@ package cli import ( "encoding/json" "fmt" + "strconv" "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" @@ -40,14 +41,18 @@ func GetTxCmd() *cobra.Command { func NewCreateRollupCmd() *cobra.Command { cmd := &cobra.Command{ // TODO: If rollup:sequencer=1:N, add [max-sequencers] parameter - Use: "create-rollup [rollup_name] [permissioned-addresses]", + Use: "create-rollup [rollup_name] [l1_to_l2_gas_ratio] [permissioned-addresses]", Short: "Create a new rollup", - Args: cobra.RangeArgs(1, 2), + Args: cobra.RangeArgs(2, 3), RunE: func(cmd *cobra.Command, args []string) (err error) { argRollupName := args[0] + argL1ToL2GasRatio, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } argPermissionedAddresses := new(types.Sequencers) - if len(args) == 2 { - err = json.Unmarshal([]byte(args[1]), argPermissionedAddresses) + if len(args) == 3 { + err = json.Unmarshal([]byte(args[2]), argPermissionedAddresses) if err != nil { return err } @@ -61,6 +66,7 @@ func NewCreateRollupCmd() *cobra.Command { msg := types.NewMsgCreateRollup( argRollupName, clientCtx.GetFromAddress().String(), + argL1ToL2GasRatio, argPermissionedAddresses, ) diff --git a/x/or/rollup/keeper/msg_server.go b/x/or/rollup/keeper/msg_server.go index 47c044d305..69887cd3aa 100644 --- a/x/or/rollup/keeper/msg_server.go +++ b/x/or/rollup/keeper/msg_server.go @@ -30,6 +30,7 @@ func (k msgServer) CreateRollup(goCtx context.Context, msg *types.MsgCreateRollu rollup := types.Rollup{ RollupName: msg.RollupName, Creator: msg.Creator, + L1ToL2GasRatio: msg.L1ToL2GasRatio, PermissionedAddresses: msg.PermissionedAddresses, } diff --git a/x/or/rollup/keeper/rollup.go b/x/or/rollup/keeper/rollup.go index d821b80d47..9181f9c8d3 100644 --- a/x/or/rollup/keeper/rollup.go +++ b/x/or/rollup/keeper/rollup.go @@ -3,7 +3,6 @@ package keeper import ( "github.com/Finschia/finschia-sdk/store/prefix" sdk "github.com/Finschia/finschia-sdk/types" - "github.com/Finschia/finschia-sdk/types/query" "github.com/Finschia/finschia-sdk/x/or/rollup/types" ) @@ -24,7 +23,7 @@ func (k Keeper) SetRollup(ctx sdk.Context, rollup types.Rollup) { store.Set(types.RollupKey(rollup.RollupName), b) } -func (k Keeper) GetAllRollup(ctx sdk.Context, pagination *query.PageRequest) (list []types.Rollup) { +func (k Keeper) GetAllRollup(ctx sdk.Context) (list []types.Rollup) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RollupKeyPrefix) iterator := sdk.KVStorePrefixIterator(store, []byte{}) diff --git a/x/or/rollup/types/message_create_rollup.go b/x/or/rollup/types/message_create_rollup.go index f859813e2d..2d99e9b0d8 100644 --- a/x/or/rollup/types/message_create_rollup.go +++ b/x/or/rollup/types/message_create_rollup.go @@ -13,10 +13,11 @@ const ( var _ sdk.Msg = (*MsgCreateRollup)(nil) -func NewMsgCreateRollup(rollupName, creator string, permissionedAddresses *Sequencers) *MsgCreateRollup { +func NewMsgCreateRollup(rollupName, creator string, l1ToL2GasRatio uint64, permissionedAddresses *Sequencers) *MsgCreateRollup { return &MsgCreateRollup{ RollupName: rollupName, Creator: creator, + L1ToL2GasRatio: l1ToL2GasRatio, PermissionedAddresses: *permissionedAddresses, } } diff --git a/x/or/rollup/types/rollup.pb.go b/x/or/rollup/types/rollup.pb.go index f7063b7b16..296cfa099f 100644 --- a/x/or/rollup/types/rollup.pb.go +++ b/x/or/rollup/types/rollup.pb.go @@ -29,7 +29,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Rollup struct { RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` - PermissionedAddresses Sequencers `protobuf:"bytes,3,opt,name=permissioned_addresses,json=permissionedAddresses,proto3" json:"permissioned_addresses"` + L1ToL2GasRatio uint64 `protobuf:"varint,3,opt,name=l1_to_l2_gas_ratio,json=l1ToL2GasRatio,proto3" json:"l1_to_l2_gas_ratio,omitempty"` + PermissionedAddresses Sequencers `protobuf:"bytes,4,opt,name=permissioned_addresses,json=permissionedAddresses,proto3" json:"permissioned_addresses"` } func (m *Rollup) Reset() { *m = Rollup{} } @@ -79,6 +80,13 @@ func (m *Rollup) GetCreator() string { return "" } +func (m *Rollup) GetL1ToL2GasRatio() uint64 { + if m != nil { + return m.L1ToL2GasRatio + } + return 0 +} + func (m *Rollup) GetPermissionedAddresses() Sequencers { if m != nil { return m.PermissionedAddresses @@ -315,37 +323,39 @@ func init() { } var fileDescriptor_11aa090da04695ac = []byte{ - // 472 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xcd, 0x36, 0x90, 0x2a, 0x93, 0x0b, 0x58, 0x29, 0x72, 0x2a, 0xe4, 0x06, 0x9f, 0x22, 0x50, - 0x77, 0x95, 0x20, 0x3e, 0xa0, 0x01, 0xe5, 0x02, 0x42, 0xc8, 0xdc, 0x38, 0x10, 0xd9, 0xce, 0xd4, - 0xb5, 0x1a, 0x7b, 0xcc, 0xae, 0x1d, 0xe1, 0x03, 0xbf, 0x80, 0xf8, 0x05, 0xc4, 0x2f, 0xf0, 0x11, - 0x15, 0xa7, 0x1e, 0x39, 0x21, 0x94, 0xfc, 0x08, 0x8a, 0x77, 0x9d, 0x44, 0x55, 0x51, 0x7a, 0xf3, - 0xcc, 0xbc, 0x99, 0x79, 0xf3, 0x9e, 0x17, 0xdc, 0xf3, 0x38, 0x55, 0xe1, 0x45, 0xec, 0x0b, 0x92, - 0x42, 0xd2, 0x7c, 0x5e, 0x64, 0x62, 0x31, 0x34, 0x5f, 0x3c, 0x93, 0x94, 0x93, 0x75, 0x54, 0x63, - 0x38, 0x49, 0x6e, 0x2a, 0x8b, 0xe1, 0x71, 0x2f, 0x24, 0x95, 0x90, 0x9a, 0x56, 0x20, 0xa1, 0x03, - 0xdd, 0x71, 0xdc, 0x8b, 0x88, 0xa2, 0x39, 0x8a, 0x2a, 0x0a, 0x8a, 0x73, 0xe1, 0xa7, 0xa5, 0x29, - 0x39, 0x1a, 0x28, 0x02, 0x5f, 0xa1, 0x58, 0x0c, 0x03, 0xcc, 0xfd, 0xa1, 0x08, 0x29, 0x4e, 0x4d, - 0xbd, 0x1b, 0x51, 0x44, 0x7a, 0xe4, 0xfa, 0x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0xd7, 0x4e, - 0x73, 0xe3, 0x34, 0x7f, 0x49, 0x71, 0x6a, 0x44, 0xd4, 0x68, 0xf7, 0x0b, 0x58, 0x3b, 0xfa, 0x96, - 0x77, 0x75, 0x79, 0x02, 0xb0, 0x61, 0xb0, 0xe6, 0xd4, 0x1c, 0x74, 0x46, 0xfd, 0x7d, 0xfe, 0x99, - 0xcd, 0x3b, 0x9d, 0xee, 0x53, 0x80, 0xed, 0x7a, 0xeb, 0x31, 0xb4, 0xb7, 0x3f, 0x05, 0xeb, 0x37, - 0x07, 0x6d, 0x6f, 0x9b, 0x18, 0xbf, 0xb9, 0x5a, 0x3a, 0xec, 0x7a, 0xe9, 0xb0, 0xbf, 0x4b, 0x87, - 0x7d, 0x5b, 0x39, 0x8d, 0xeb, 0x95, 0xd3, 0xf8, 0xbd, 0x72, 0x1a, 0x1f, 0x46, 0x51, 0x9c, 0x5f, - 0x14, 0x01, 0x0f, 0x29, 0x11, 0x93, 0xfa, 0x45, 0xd5, 0x64, 0x4e, 0xd5, 0xec, 0x52, 0x7c, 0xde, - 0x79, 0x60, 0x79, 0x99, 0xa1, 0x0a, 0x5a, 0x95, 0xb5, 0xcf, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, - 0xf9, 0xce, 0xab, 0x95, 0x83, 0x03, 0x00, 0x00, + // 508 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6e, 0xd3, 0x4e, + 0x14, 0xce, 0x34, 0xf9, 0xa5, 0xca, 0x44, 0xfa, 0x09, 0x46, 0x29, 0x72, 0x2a, 0xe4, 0x06, 0xaf, + 0xa2, 0xa2, 0xce, 0xc8, 0x46, 0x1c, 0xa0, 0x01, 0x85, 0x05, 0x15, 0x42, 0x86, 0x15, 0x0b, 0xac, + 0xb1, 0x33, 0x75, 0xad, 0x3a, 0x7e, 0x66, 0xc6, 0x8e, 0xf0, 0x82, 0x2b, 0x20, 0xae, 0xc0, 0x1d, + 0x38, 0x44, 0xc5, 0x86, 0x2e, 0x59, 0x21, 0x94, 0x5c, 0x04, 0xc5, 0x33, 0x4e, 0xa2, 0xaa, 0xa8, + 0xec, 0xe6, 0xfd, 0xfd, 0xbe, 0xf7, 0xbd, 0x37, 0xd8, 0x39, 0x4f, 0x32, 0x15, 0x5d, 0x24, 0x9c, + 0x81, 0x64, 0x12, 0xd2, 0xb4, 0xcc, 0xd9, 0xc2, 0x35, 0x2f, 0x9a, 0x4b, 0x28, 0x80, 0x1c, 0x34, + 0x39, 0x14, 0x24, 0x35, 0x91, 0x85, 0x7b, 0x38, 0x8c, 0x40, 0xcd, 0x41, 0x05, 0x75, 0x12, 0xd3, + 0x86, 0xae, 0x38, 0x1c, 0xc6, 0x00, 0x71, 0x2a, 0x58, 0x6d, 0x85, 0xe5, 0x39, 0xe3, 0x59, 0x65, + 0x42, 0xb6, 0x4e, 0x64, 0x21, 0x57, 0x82, 0x2d, 0xdc, 0x50, 0x14, 0xdc, 0x65, 0x11, 0x24, 0x99, + 0x89, 0x0f, 0x62, 0x88, 0x41, 0xb7, 0x5c, 0xbf, 0xb4, 0xd7, 0xf9, 0x81, 0x70, 0xd7, 0xaf, 0x91, + 0xc9, 0x11, 0xee, 0x6b, 0x0e, 0x41, 0xc6, 0xe7, 0xc2, 0x42, 0x23, 0x34, 0xee, 0xf9, 0x58, 0xbb, + 0x5e, 0xf1, 0xb9, 0x20, 0x16, 0xde, 0x8f, 0xa4, 0xe0, 0x05, 0x48, 0x6b, 0xaf, 0x0e, 0x36, 0x26, + 0x39, 0xc6, 0x24, 0x75, 0x83, 0x02, 0x82, 0xd4, 0x0b, 0x62, 0xae, 0x02, 0xc9, 0x8b, 0x04, 0xac, + 0xf6, 0x08, 0x8d, 0x3b, 0xfe, 0xff, 0xa9, 0xfb, 0x16, 0xce, 0xbc, 0x17, 0x5c, 0xf9, 0x6b, 0x2f, + 0x79, 0x8f, 0x1f, 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x18, 0x6f, 0xe1, 0xc9, 0x43, 0xdc, 0xdb, + 0x1e, 0x05, 0x1a, 0xb5, 0xc7, 0x3d, 0x7f, 0xeb, 0x98, 0x9c, 0x5d, 0x2d, 0x6d, 0x74, 0xbd, 0xb4, + 0xd1, 0xef, 0xa5, 0x8d, 0xbe, 0xac, 0xec, 0xd6, 0xf5, 0xca, 0x6e, 0xfd, 0x5c, 0xd9, 0xad, 0x77, + 0x5e, 0x9c, 0x14, 0x17, 0x65, 0x48, 0x23, 0x98, 0xb3, 0x69, 0xf3, 0xfb, 0x1a, 0x32, 0x27, 0x6a, + 0x76, 0xc9, 0x3e, 0xee, 0x7c, 0xc6, 0xa2, 0xca, 0x85, 0x0a, 0xbb, 0xf5, 0x6a, 0x9f, 0xfc, 0x09, + 0x00, 0x00, 0xff, 0xff, 0xd9, 0x9a, 0xd0, 0x12, 0xaf, 0x03, 0x00, 0x00, } func (m *Rollup) Marshal() (dAtA []byte, err error) { @@ -377,7 +387,12 @@ func (m *Rollup) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintRollup(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 + if m.L1ToL2GasRatio != 0 { + i = encodeVarintRollup(dAtA, i, uint64(m.L1ToL2GasRatio)) + i-- + dAtA[i] = 0x18 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -592,6 +607,9 @@ func (m *Rollup) Size() (n int) { if l > 0 { n += 1 + l + sovRollup(uint64(l)) } + if m.L1ToL2GasRatio != 0 { + n += 1 + sovRollup(uint64(m.L1ToL2GasRatio)) + } l = m.PermissionedAddresses.Size() n += 1 + l + sovRollup(uint64(l)) return n @@ -771,6 +789,25 @@ func (m *Rollup) Unmarshal(dAtA []byte) error { m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1ToL2GasRatio", wireType) + } + m.L1ToL2GasRatio = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.L1ToL2GasRatio |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PermissionedAddresses", wireType) } diff --git a/x/or/rollup/types/tx.pb.go b/x/or/rollup/types/tx.pb.go index 222c786a62..0aa61c54d4 100644 --- a/x/or/rollup/types/tx.pb.go +++ b/x/or/rollup/types/tx.pb.go @@ -34,7 +34,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgCreateRollup struct { RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` - PermissionedAddresses Sequencers `protobuf:"bytes,3,opt,name=permissioned_addresses,json=permissionedAddresses,proto3" json:"permissioned_addresses"` + L1ToL2GasRatio uint64 `protobuf:"varint,3,opt,name=l1_to_l2_gas_ratio,json=l1ToL2GasRatio,proto3" json:"l1_to_l2_gas_ratio,omitempty"` + PermissionedAddresses Sequencers `protobuf:"bytes,4,opt,name=permissioned_addresses,json=permissionedAddresses,proto3" json:"permissioned_addresses"` } func (m *MsgCreateRollup) Reset() { *m = MsgCreateRollup{} } @@ -84,6 +85,13 @@ func (m *MsgCreateRollup) GetCreator() string { return "" } +func (m *MsgCreateRollup) GetL1ToL2GasRatio() uint64 { + if m != nil { + return m.L1ToL2GasRatio + } + return 0 +} + func (m *MsgCreateRollup) GetPermissionedAddresses() Sequencers { if m != nil { return m.PermissionedAddresses @@ -511,46 +519,48 @@ func init() { func init() { proto.RegisterFile("finschia/or/rollup/v1/tx.proto", fileDescriptor_c08605be9a42de51) } var fileDescriptor_c08605be9a42de51 = []byte{ - // 613 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8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, 0x2f, 0x2c, 0xed, 0xd7, 0x85, 0xa5, 0x7d, 0xba, 0xb4, 0x6a, - 0xe7, 0x97, 0x56, 0xed, 0xc7, 0xa5, 0x55, 0x3b, 0xe8, 0x04, 0x61, 0x7a, 0x9c, 0x79, 0xc4, 0x67, - 0x11, 0xdd, 0x53, 0x8f, 0xb3, 0xca, 0xbf, 0x29, 0x7a, 0x27, 0xf4, 0x74, 0xe8, 0xad, 0x4e, 0xf3, - 0x04, 0x85, 0x37, 0x5b, 0xbc, 0x53, 0x5b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x58, 0xbb, 0x89, - 0xb0, 0x71, 0x06, 0x00, 0x00, + // 644 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x49, 0x68, 0x61, 0x82, 0x28, 0x35, 0x29, 0x24, 0x56, 0xe5, 0xb6, 0x3e, 0xa0, 0xfe, + 0xa8, 0x6b, 0x39, 0x15, 0x0f, 0xd0, 0x16, 0x95, 0x03, 0x0d, 0x42, 0x06, 0xa9, 0x52, 0x0f, 0x58, + 0x6b, 0x67, 0xeb, 0x5a, 0x75, 0xbc, 0x66, 0xd7, 0x0e, 0xf5, 0x2b, 0x70, 0x02, 0x9e, 0x85, 0x87, + 0xa8, 0x38, 0xf5, 0xd8, 0x13, 0x42, 0xed, 0x8b, 0xa0, 0xd8, 0xbb, 0x26, 0x4d, 0x1a, 0xd2, 0xde, + 0xb8, 0x79, 0xe7, 0xfb, 0xbe, 0xd9, 0x99, 0xf9, 0xc6, 0x0b, 0xfa, 0x51, 0x10, 0x71, 0xef, 0x38, + 0xc0, 0x26, 0x65, 0x26, 0xa3, 0x61, 0x98, 0xc6, 0x66, 0xdf, 0x32, 0x93, 0x53, 0x14, 0x33, 0x9a, + 0x50, 0x75, 0x41, 0xe2, 0x88, 0x32,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 0x68, 0x30, 0x32, 0xdc, 0xfe, 0x52, 0x83, 0x6a, 0x87, 0xfb, 0xea, 0x11, + 0x3c, 0xba, 0xf6, 0xdb, 0xbd, 0x98, 0xb0, 0xef, 0x23, 0x8d, 0x68, 0xe8, 0x76, 0x3c, 0x79, 0x9f, + 0x9a, 0xc2, 0xfc, 0xf8, 0x3f, 0xb0, 0x31, 0x39, 0xc9, 0x18, 0x59, 0xdb, 0xba, 0x03, 0xb9, 0xbc, + 0xf6, 0x00, 0x66, 0xe5, 0x9e, 0xae, 0x4c, 0xd6, 0x0b, 0x8a, 0xb6, 0x36, 0x95, 0x52, 0x26, 0x3e, + 0x84, 0x07, 0xe5, 0xb2, 0x19, 0x93, 0x65, 0x92, 0xa3, 0xad, 0x4f, 0xe7, 0x94, 0xb9, 0x29, 0xcc, + 0x8d, 0x78, 0xac, 0xae, 0xfd, 0xab, 0xf9, 0x6b, 0x54, 0xcd, 0xba, 0x35, 0x55, 0x5e, 0xb8, 0xb3, + 0x7f, 0x76, 0xa9, 0x2b, 0xe7, 0x97, 0xba, 0xf2, 0xfb, 0x52, 0x57, 0xbe, 0x5e, 0xe9, 0x95, 0xf3, + 0x2b, 0xbd, 0x72, 0x71, 0xa5, 0x57, 0x0e, 0xdb, 0x7e, 0x90, 0x1c, 0xa7, 0x2e, 0xf2, 0x68, 0xcf, + 0xdc, 0x93, 0x0f, 0xb9, 0xcc, 0xbf, 0xc9, 0xbb, 0x27, 0xe6, 0xe9, 0xd0, 0xbb, 0x9e, 0x64, 0x31, + 0xe1, 0xee, 0x4c, 0xfe, 0x4e, 0x6d, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xf4, 0x75, 0xa0, + 0x9d, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -806,7 +816,12 @@ func (m *MsgCreateRollup) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 + if m.L1ToL2GasRatio != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.L1ToL2GasRatio)) + i-- + dAtA[i] = 0x18 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -1140,6 +1155,9 @@ func (m *MsgCreateRollup) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.L1ToL2GasRatio != 0 { + n += 1 + sovTx(uint64(m.L1ToL2GasRatio)) + } l = m.PermissionedAddresses.Size() n += 1 + l + sovTx(uint64(l)) return n @@ -1360,6 +1378,25 @@ func (m *MsgCreateRollup) Unmarshal(dAtA []byte) error { m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field L1ToL2GasRatio", wireType) + } + m.L1ToL2GasRatio = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.L1ToL2GasRatio |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PermissionedAddresses", wireType) }