From fa9599d5acee5861a65d5bf43a46e400c03e1edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Martini=C4=87?= Date: Thu, 23 Jun 2022 15:31:47 +0200 Subject: [PATCH] Temporary command to upload smart contracts (#265) --- go.mod | 3 + go.sum | 5 + proto/evm/query.proto | 2 +- proto/evm/turnstone.proto | 2 + proto/evm/tx.proto | 12 + x/evm/client/cli/tx.go | 3 +- .../cli/tx_upload_new_smart_contract_temp.go | 49 ++ x/evm/handler.go | 5 +- x/evm/keeper/grpc_query_get_valset_by_id.go | 14 +- x/evm/keeper/keeper.go | 21 + x/evm/keeper/msg_server_submit_new_job.go | 7 - ...g_server_upload_new_smart_contract_temp.go | 25 + x/evm/types/codec.go | 8 +- x/evm/types/expected_keepers.go | 1 + .../message_upload_new_smart_contract_temp.go | 50 ++ ...age_upload_new_smart_contract_temp_test.go | 40 ++ x/evm/types/query.pb.go | 56 +- x/evm/types/turnstone.pb.go | 169 ++++- x/evm/types/tx.pb.go | 576 +++++++++++++++++- x/valset/module.go | 2 +- 20 files changed, 957 insertions(+), 93 deletions(-) create mode 100644 x/evm/client/cli/tx_upload_new_smart_contract_temp.go create mode 100644 x/evm/keeper/msg_server_upload_new_smart_contract_temp.go create mode 100644 x/evm/types/message_upload_new_smart_contract_temp.go create mode 100644 x/evm/types/message_upload_new_smart_contract_temp_test.go diff --git a/go.mod b/go.mod index d357936d..f92939a2 100644 --- a/go.mod +++ b/go.mod @@ -59,11 +59,13 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/ghodss/yaml v1.0.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.5.8 // indirect @@ -72,6 +74,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 8165be85..8bfec975 100644 --- a/go.sum +++ b/go.sum @@ -621,6 +621,7 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -740,6 +741,8 @@ github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -907,6 +910,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 h1:BGNSrTRW4rwfhJiFwvwF4XQ0Y72Jj9YEgxVrtovbD5o= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3/go.mod h1:VHn7KgNsRriXa4mcgtkpR00OXyQY6g67JWMvn+R27A4= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/evm/query.proto b/proto/evm/query.proto index 5fef4216..a474ed30 100644 --- a/proto/evm/query.proto +++ b/proto/evm/query.proto @@ -18,7 +18,7 @@ service Query { } // Queries a list of GetValsetByID items. rpc GetValsetByID(QueryGetValsetByIDRequest) returns (QueryGetValsetByIDResponse) { - option (google.api.http).get = "/palomachain/paloma/evm/get_valset_by_id/{valsettID}"; + option (google.api.http).get = "/palomachain/paloma/evm/get_valset_by_id/{valsetID}"; } // this line is used by starport scaffolding # 2 diff --git a/proto/evm/turnstone.proto b/proto/evm/turnstone.proto index 0921b8f7..867be79a 100644 --- a/proto/evm/turnstone.proto +++ b/proto/evm/turnstone.proto @@ -26,6 +26,8 @@ message UpdateValset { message UploadSmartContract { bytes bytecode = 1; + bytes abi = 2; + bytes constructorInput = 3; } diff --git a/proto/evm/tx.proto b/proto/evm/tx.proto index 58374be0..41ff9d81 100644 --- a/proto/evm/tx.proto +++ b/proto/evm/tx.proto @@ -8,6 +8,7 @@ option go_package = "github.com/palomachain/paloma/x/evm/types"; // Msg defines the Msg service. service Msg { rpc SubmitNewJob(MsgSubmitNewJob) returns (MsgSubmitNewJobResponse); + rpc UploadNewSmartContractTemp(MsgUploadNewSmartContractTemp) returns (MsgUploadNewSmartContractTempResponse); // this line is used by starport scaffolding # proto/tx/rpc } @@ -26,4 +27,15 @@ message MsgSubmitNewJob { message MsgSubmitNewJobResponse { } +message MsgUploadNewSmartContractTemp { + string creator = 1; + string abi = 2; + string bytecode = 3; + string constructorInput = 4; + string chainID = 5; +} + +message MsgUploadNewSmartContractTempResponse { +} + // this line is used by starport scaffolding # proto/tx/message diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index e0effb67..c6c73cc8 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -31,7 +31,8 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdSubmitNewJob()) - // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdUploadNewSmartContractTemp()) +// this line is used by starport scaffolding # 1 return cmd } diff --git a/x/evm/client/cli/tx_upload_new_smart_contract_temp.go b/x/evm/client/cli/tx_upload_new_smart_contract_temp.go new file mode 100644 index 00000000..8b8ee1b0 --- /dev/null +++ b/x/evm/client/cli/tx_upload_new_smart_contract_temp.go @@ -0,0 +1,49 @@ +package cli + +import ( + "strconv" + + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/palomachain/paloma/x/evm/types" +) + +var _ = strconv.Itoa(0) + +func CmdUploadNewSmartContractTemp() *cobra.Command { + cmd := &cobra.Command{ + Use: "upload-new-smart-contract-temp [abi] [bytecode] [constructor-input] [chain-id]", + Short: "Broadcast message UploadNewSmartContractTemp", + Args: cobra.ExactArgs(4), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argAbi := args[0] + argBytecode := args[1] + argConstructorInput := args[2] + argChainID := args[3] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUploadNewSmartContractTemp( + clientCtx.GetFromAddress().String(), + argAbi, + argBytecode, + argConstructorInput, + argChainID, + + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} \ No newline at end of file diff --git a/x/evm/handler.go b/x/evm/handler.go index 394d35e7..6bbeb899 100644 --- a/x/evm/handler.go +++ b/x/evm/handler.go @@ -20,7 +20,10 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgSubmitNewJob: res, err := msgServer.SubmitNewJob(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 + case *types.MsgUploadNewSmartContractTemp: + res, err := msgServer.UploadNewSmartContractTemp(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) +// this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/evm/keeper/grpc_query_get_valset_by_id.go b/x/evm/keeper/grpc_query_get_valset_by_id.go index e5b8686a..8ec59447 100644 --- a/x/evm/keeper/grpc_query_get_valset_by_id.go +++ b/x/evm/keeper/grpc_query_get_valset_by_id.go @@ -5,10 +5,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/evm/types" + valsettypes "github.com/palomachain/paloma/x/valset/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) +// GetValsetByID returns the valset given chain id and valset id. if the valset +// id is non-pozitive then it returns the latest valset existing. func (k Keeper) GetValsetByID(goCtx context.Context, req *types.QueryGetValsetByIDRequest) (*types.QueryGetValsetByIDResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") @@ -16,10 +19,19 @@ func (k Keeper) GetValsetByID(goCtx context.Context, req *types.QueryGetValsetBy ctx := sdk.UnwrapSDKContext(goCtx) - snapshot, err := k.Valset.FindSnapshotByID(ctx, req.GetValsetID()) + var snapshot *valsettypes.Snapshot + var err error + + if req.GetValsetID() > 0 { + snapshot, err = k.Valset.FindSnapshotByID(ctx, req.GetValsetID()) + } else { + snapshot, err = k.Valset.GetCurrentSnapshot(ctx) + } + if err != nil { return nil, err } + valset := transformSnapshotToTurnstoneValset(snapshot, req.GetChainID()) return &types.QueryGetValsetByIDResponse{ diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index 3c5bf93e..72d6a543 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -105,6 +105,27 @@ func (k Keeper) AddSmartContractExecutionToConsensus( ) } +func (k Keeper) addUploadSmartContractToConsensus( + ctx sdk.Context, + chainID string, + upload *types.UploadSmartContract, +) error { + return k.ConsensusKeeper.PutMessageForSigning( + ctx, + consensustypes.Queue( + ConsensusTurnstoneMessage, + consensustypes.ChainTypeEVM, + chainID, + ), + &types.Message{ + ChainID: chainID, + Action: &types.Message_UploadSmartContract{ + UploadSmartContract: upload, + }, + }, + ) +} + // {"target_contract_info":{"method":"foo","chain_id":"abc","compass_id":"abc","contract_address":"0xabc","smart_contract_abi":"abc"},"paloma_address":"paloma1sp6yeu2cdemlh0jpterpe3as9mvx36ck6ys0ce","eth_address":[0,0,0,0,0,0,0,0,0,0,0,0,22,248,182,92,183,148,210,0,134,193,229,48,158,88,192,76,57,198,237,233]} type executeEVMFromCosmWasm struct { TargetContractInfo struct { diff --git a/x/evm/keeper/msg_server_submit_new_job.go b/x/evm/keeper/msg_server_submit_new_job.go index d49dd1af..d775d529 100644 --- a/x/evm/keeper/msg_server_submit_new_job.go +++ b/x/evm/keeper/msg_server_submit_new_job.go @@ -12,13 +12,6 @@ import ( func (k msgServer) SubmitNewJob(goCtx context.Context, msg *types.MsgSubmitNewJob) (*types.MsgSubmitNewJobResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - // TODO: check if ValidateBasic is being called somewhere in the Cosmos SDK - // and if this is redundant call. - // It should be caled on the "server" side as well as the client side of things. - if err := msg.ValidateBasic(); err != nil { - return nil, err - } - err := k.AddSmartContractExecutionToConsensus( ctx, msg.GetChainID(), diff --git a/x/evm/keeper/msg_server_upload_new_smart_contract_temp.go b/x/evm/keeper/msg_server_upload_new_smart_contract_temp.go new file mode 100644 index 00000000..de8bc6c8 --- /dev/null +++ b/x/evm/keeper/msg_server_upload_new_smart_contract_temp.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/palomachain/paloma/x/evm/types" +) + +func (k msgServer) UploadNewSmartContractTemp(goCtx context.Context, msg *types.MsgUploadNewSmartContractTemp) (*types.MsgUploadNewSmartContractTempResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + err := k.addUploadSmartContractToConsensus(ctx, msg.GetChainID(), &types.UploadSmartContract{ + Bytecode: common.FromHex(msg.GetBytecode()), + Abi: []byte(msg.GetAbi()), + ConstructorInput: common.FromHex(msg.GetConstructorInput()), + }) + + if err != nil { + return nil, err + } + + return &types.MsgUploadNewSmartContractTempResponse{}, nil +} diff --git a/x/evm/types/codec.go b/x/evm/types/codec.go index a225654a..ae4f6119 100644 --- a/x/evm/types/codec.go +++ b/x/evm/types/codec.go @@ -10,7 +10,8 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgSubmitNewJob{}, "evm/SubmitNewJob", nil) - // this line is used by starport scaffolding # 2 + cdc.RegisterConcrete(&MsgUploadNewSmartContractTemp{}, "evm/UploadNewSmartContractTemp", nil) +// this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -21,7 +22,10 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &ArbitrarySmartContractCall{}, &Message{}, ) - // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUploadNewSmartContractTemp{}, +) +// this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/evm/types/expected_keepers.go b/x/evm/types/expected_keepers.go index 6f8b884f..058565ed 100644 --- a/x/evm/types/expected_keepers.go +++ b/x/evm/types/expected_keepers.go @@ -26,4 +26,5 @@ type ConsensusKeeper interface { type ValsetKeeper interface { FindSnapshotByID(ctx sdk.Context, id uint64) (*valsettypes.Snapshot, error) + GetCurrentSnapshot(ctx sdk.Context) (*valsettypes.Snapshot, error) } diff --git a/x/evm/types/message_upload_new_smart_contract_temp.go b/x/evm/types/message_upload_new_smart_contract_temp.go new file mode 100644 index 00000000..6c96ab1c --- /dev/null +++ b/x/evm/types/message_upload_new_smart_contract_temp.go @@ -0,0 +1,50 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUploadNewSmartContractTemp = "upload_new_smart_contract_temp" + +var _ sdk.Msg = &MsgUploadNewSmartContractTemp{} + +func NewMsgUploadNewSmartContractTemp(creator string, abi string, bytecode string, constructorInput string, chainID string) *MsgUploadNewSmartContractTemp { + return &MsgUploadNewSmartContractTemp{ + Creator: creator, + Abi: abi, + Bytecode: bytecode, + ConstructorInput: constructorInput, + ChainID: chainID, + } +} + +func (msg *MsgUploadNewSmartContractTemp) Route() string { + return RouterKey +} + +func (msg *MsgUploadNewSmartContractTemp) Type() string { + return TypeMsgUploadNewSmartContractTemp +} + +func (msg *MsgUploadNewSmartContractTemp) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUploadNewSmartContractTemp) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUploadNewSmartContractTemp) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} + diff --git a/x/evm/types/message_upload_new_smart_contract_temp_test.go b/x/evm/types/message_upload_new_smart_contract_temp_test.go new file mode 100644 index 00000000..d44e2d72 --- /dev/null +++ b/x/evm/types/message_upload_new_smart_contract_temp_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + "github.com/palomachain/paloma/testutil/sample" +) + +func TestMsgUploadNewSmartContractTemp_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUploadNewSmartContractTemp + err error + }{ + { + name: "invalid address", + msg: MsgUploadNewSmartContractTemp{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUploadNewSmartContractTemp{ + Creator: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index b8cc48b2..3574e59f 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -219,34 +219,34 @@ func init() { func init() { proto.RegisterFile("evm/query.proto", fileDescriptor_11c0d37eed5339f7) } var fileDescriptor_11c0d37eed5339f7 = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4f, 0x8b, 0xd3, 0x40, - 0x14, 0xcf, 0x94, 0x35, 0xea, 0x88, 0x28, 0xb3, 0x8b, 0xd4, 0x20, 0x63, 0xc9, 0x41, 0xd6, 0x15, - 0x32, 0xb4, 0xca, 0x9e, 0xf6, 0x54, 0x03, 0x92, 0x9b, 0x1b, 0xc5, 0x83, 0x97, 0x32, 0xa9, 0x43, - 0x1a, 0x68, 0x66, 0xd2, 0xcc, 0x24, 0x18, 0xc4, 0x8b, 0x37, 0x6f, 0x82, 0x5f, 0xc5, 0x0f, 0x51, - 0x3c, 0x15, 0xbc, 0x78, 0x12, 0x69, 0xfd, 0x20, 0x92, 0x99, 0xa9, 0x5a, 0x4c, 0xfd, 0x73, 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x21, 0x0a, 0xfb, 0xbd, 0x01, 0x38, 0xbe, 0x1c, 0x6f, 0x5b, - 0xff, 0x29, 0xf4, 0xba, 0x24, 0x6d, 0xdc, 0x53, 0xe8, 0x1a, 0x8d, 0xbf, 0xc5, 0x35, 0xdc, 0xd8, - 0xa2, 0x47, 0x1f, 0x7b, 0xf0, 0x82, 0x96, 0x45, 0x6f, 0x01, 0x74, 0xcd, 0x2e, 0xe8, 0x64, 0x1f, - 0xf9, 0xf7, 0xf3, 0x79, 0xf7, 0xfe, 0x09, 0x6b, 0x52, 0xfa, 0x77, 0xde, 0x7c, 0xfa, 0xf6, 0xbe, - 0x37, 0x40, 0x98, 0xfc, 0x42, 0xb2, 0x35, 0xf9, 0xf9, 0x13, 0xd1, 0x07, 0x00, 0xaf, 0xee, 0xec, - 0x89, 0x86, 0x7f, 0xb4, 0xe9, 0x3a, 0xb3, 0x37, 0xfa, 0x1f, 0x8a, 0x0d, 0x78, 0xa6, 0x03, 0x9e, - 0xa2, 0x07, 0xfb, 0x02, 0xa6, 0x4c, 0x4d, 0xcc, 0xe9, 0x26, 0x49, 0x33, 0xc9, 0x5e, 0x90, 0x57, - 0xa6, 0x53, 0x51, 0xf8, 0x7a, 0xfc, 0x70, 0xb9, 0xc6, 0x60, 0xb5, 0xc6, 0xe0, 0xeb, 0x1a, 0x83, - 0x77, 0x1b, 0xec, 0xac, 0x36, 0xd8, 0xf9, 0xbc, 0xc1, 0xce, 0xf3, 0xbb, 0x69, 0xa6, 0x66, 0x55, - 0x12, 0x4c, 0x45, 0xde, 0xa5, 0xfc, 0x52, 0x6b, 0xab, 0xa6, 0x60, 0x32, 0x71, 0xf5, 0x63, 0xbd, - 0xff, 0x3d, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xdd, 0x66, 0x7e, 0x5e, 0x03, 0x00, 0x00, + // 431 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 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xb7, 0x18, 0x6c, 0xb6, 0x18, 0x7c, 0xdd, 0x62, + 0xf0, 0x6e, 0x87, 0x9d, 0xcd, 0x0e, 0x3b, 0x9f, 0x77, 0xd8, 0x79, 0x7e, 0x3b, 0x4e, 0xd4, 0xa2, + 0x88, 0x82, 0xb9, 0x48, 0x9b, 0xc0, 0x2f, 0x35, 0x5a, 0x55, 0x19, 0x93, 0x91, 0xab, 0xff, 0xd5, + 0xe1, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0xf1, 0x1f, 0x98, 0x5d, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/evm/types/turnstone.pb.go b/x/evm/types/turnstone.pb.go index 924b0321..1ac0c2a9 100644 --- a/x/evm/types/turnstone.pb.go +++ b/x/evm/types/turnstone.pb.go @@ -197,7 +197,9 @@ func (m *UpdateValset) GetValset() *Valset { } type UploadSmartContract struct { - Bytecode []byte `protobuf:"bytes,1,opt,name=bytecode,proto3" json:"bytecode,omitempty"` + Bytecode []byte `protobuf:"bytes,1,opt,name=bytecode,proto3" json:"bytecode,omitempty"` + Abi []byte `protobuf:"bytes,2,opt,name=abi,proto3" json:"abi,omitempty"` + ConstructorInput []byte `protobuf:"bytes,3,opt,name=constructorInput,proto3" json:"constructorInput,omitempty"` } func (m *UploadSmartContract) Reset() { *m = UploadSmartContract{} } @@ -240,6 +242,20 @@ func (m *UploadSmartContract) GetBytecode() []byte { return nil } +func (m *UploadSmartContract) GetAbi() []byte { + if m != nil { + return m.Abi + } + return nil +} + +func (m *UploadSmartContract) GetConstructorInput() []byte { + if m != nil { + return m.ConstructorInput + } + return nil +} + type Message struct { TurnstoneID string `protobuf:"bytes,1,opt,name=turnstoneID,proto3" json:"turnstoneID,omitempty"` ChainID string `protobuf:"bytes,2,opt,name=chainID,proto3" json:"chainID,omitempty"` @@ -365,36 +381,37 @@ func init() { func init() { proto.RegisterFile("evm/turnstone.proto", fileDescriptor_cc379548e12cc9d8) } var fileDescriptor_cc379548e12cc9d8 = []byte{ - // 457 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcf, 0x8a, 0x9b, 0x40, - 0x18, 0x77, 0x62, 0xea, 0x6e, 0xbe, 0x08, 0x5b, 0x26, 0x65, 0x91, 0x3d, 0x88, 0x48, 0xa1, 0x96, - 0x82, 0xd2, 0x14, 0x7a, 0xef, 0x26, 0x94, 0xa4, 0xb4, 0x97, 0x09, 0xdb, 0x43, 0x29, 0x94, 0x51, - 0x07, 0x23, 0xa8, 0x23, 0xce, 0x98, 0x6e, 0x1e, 0xa1, 0xb7, 0x3e, 0x56, 0x8f, 0xdb, 0x5b, 0x8f, - 0x25, 0x79, 0x91, 0xc5, 0x89, 0x09, 0xee, 0x6e, 0x72, 0xfb, 0x7e, 0xe3, 0x37, 0xbf, 0x7f, 0x32, - 0x30, 0x62, 0xab, 0x3c, 0x90, 0x75, 0x55, 0x08, 0xc9, 0x0b, 0xe6, 0x97, 0x15, 0x97, 0x1c, 0x5f, - 0x96, 0x34, 0xe3, 0x39, 0x8d, 0x96, 0x34, 0x2d, 0xfc, 0xdd, 0xec, 0xb3, 0x55, 0x7e, 0xf5, 0x22, - 0xe1, 0x09, 0x57, 0x2b, 0x41, 0x33, 0xed, 0xb6, 0xdd, 0xef, 0x60, 0x7c, 0xa5, 0x99, 0x60, 0x12, - 0xdb, 0x00, 0x2b, 0x9a, 0xa5, 0x31, 0x95, 0xbc, 0x12, 0x16, 0x72, 0x74, 0x6f, 0x40, 0x3a, 0x27, - 0xf8, 0x12, 0x8c, 0x92, 0xff, 0x64, 0x95, 0xb0, 0x7a, 0x8e, 0xee, 0xf5, 0x49, 0x8b, 0xf0, 0x15, - 0x9c, 0xaf, 0x14, 0xc3, 0x7c, 0x6a, 0xe9, 0x0e, 0xf2, 0xfa, 0xe4, 0x80, 0xdd, 0x5f, 0x08, 0x2e, - 0x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0xe5, 0x29, 0xc6, 0x6e, 0x87, 0x33, 0x8d, 0x3c, 0xb8, 0x8b, - 0x7f, 0xc0, 0xa8, 0x7e, 0xda, 0x8d, 0xf5, 0x4c, 0x51, 0xbe, 0x39, 0x4d, 0xf9, 0xe4, 0xca, 0x4c, - 0x23, 0xc7, 0x98, 0xae, 0xcf, 0xc1, 0xa0, 0x91, 0x4c, 0x79, 0x71, 0x3d, 0xf9, 0xb3, 0xb1, 0xd1, - 0xdd, 0xc6, 0x46, 0xff, 0x37, 0x36, 0xfa, 0xbd, 0xb5, 0xb5, 0xbb, 0xad, 0xad, 0xfd, 0xdb, 0xda, - 0xda, 0xb7, 0xd7, 0x49, 0x2a, 0x97, 0x75, 0xe8, 0x47, 0x3c, 0x0f, 0x3a, 0x8a, 0xed, 0x1c, 0xdc, - 0x06, 0xea, 0xd5, 0xac, 0x4b, 0x26, 0x42, 0x43, 0x3d, 0x82, 0x77, 0xf7, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x0c, 0xe0, 0xfa, 0x3d, 0x49, 0x03, 0x00, 0x00, + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0x41, 0x8b, 0x9b, 0x40, + 0x14, 0xd6, 0x35, 0x75, 0x37, 0x2f, 0xc2, 0x2e, 0x93, 0xb2, 0xc8, 0x1e, 0x44, 0xa4, 0x50, 0xdb, + 0x82, 0x42, 0x0a, 0xbd, 0x77, 0x13, 0x4a, 0x52, 0xda, 0xcb, 0x84, 0xed, 0xa1, 0x14, 0xca, 0xa8, + 0x83, 0x11, 0xd4, 0x91, 0x99, 0x31, 0xdd, 0xfc, 0x84, 0xde, 0xfa, 0xb3, 0x7a, 0xdc, 0xde, 0x7a, + 0x2c, 0xc9, 0x1f, 0x29, 0x4e, 0x4c, 0x70, 0x37, 0xc9, 0xed, 0x7d, 0xcf, 0xe7, 0xf7, 0xbd, 0xef, + 0x7b, 0x0c, 0x0c, 0xe9, 0xb2, 0x08, 0x65, 0xcd, 0x4b, 0x21, 0x59, 0x49, 0x83, 0x8a, 0x33, 0xc9, + 0xd0, 0x75, 0x45, 0x72, 0x56, 0x90, 0x78, 0x41, 0xb2, 0x32, 0xd8, 0xd6, 0x01, 0x5d, 0x16, 0x37, + 0xcf, 0x53, 0x96, 0x32, 0x35, 0x12, 0x36, 0xd5, 0x76, 0xda, 0xfb, 0x06, 0xe6, 0x17, 0x92, 0x0b, + 0x2a, 0x91, 0x03, 0xb0, 0x24, 0x79, 0x96, 0x10, 0xc9, 0xb8, 0xb0, 0x75, 0xd7, 0xf0, 0xfb, 0xb8, + 0xd3, 0x41, 0xd7, 0x60, 0x56, 0xec, 0x07, 0xe5, 0xc2, 0x3e, 0x73, 0x0d, 0xbf, 0x87, 0x5b, 0x84, + 0x6e, 0xe0, 0x62, 0xa9, 0x18, 0x66, 0x13, 0xdb, 0x70, 0x75, 0xbf, 0x87, 0xf7, 0xd8, 0xfb, 0xa9, + 0xc3, 0xe5, 0xbc, 0x8e, 0x8a, 0x4c, 0x7e, 0x62, 0x69, 0x16, 0x8f, 0x49, 0x9e, 0xa3, 0x00, 0xd0, + 0x82, 0xde, 0x8f, 0x59, 0x29, 0x39, 0x89, 0xe5, 0xfb, 0x24, 0xe1, 0x54, 0x34, 0x7a, 0xba, 0xdf, + 0xc7, 0x47, 0xbe, 0xa0, 0x2b, 0x30, 0x48, 0x94, 0xd9, 0x67, 0xae, 0xee, 0x5b, 0xb8, 0x29, 0x91, + 0x0d, 0xe7, 0x15, 0x59, 0xe5, 0x8c, 0x24, 0x4a, 0xd0, 0xc2, 0x3b, 0xd8, 0xec, 0x92, 0x50, 0x92, + 0xe4, 0x59, 0x49, 0xed, 0x9e, 0xab, 0xfb, 0x06, 0xde, 0x63, 0xef, 0x03, 0x58, 0x77, 0x55, 0x42, + 0x24, 0x6d, 0xfd, 0xbe, 0x03, 0x73, 0xbb, 0xa7, 0xd2, 0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e, 0x82, 0x98, 0x15, + 0x61, 0x47, 0xb1, 0xad, 0xc3, 0xfb, 0x50, 0xbd, 0xb9, 0x55, 0x45, 0x45, 0x64, 0xaa, 0x27, 0xf4, + 0xf6, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x22, 0x41, 0x6b, 0x09, 0x87, 0x03, 0x00, 0x00, } func (m *Valset) Marshal() (dAtA []byte, err error) { @@ -556,6 +573,20 @@ func (m *UploadSmartContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ConstructorInput) > 0 { + i -= len(m.ConstructorInput) + copy(dAtA[i:], m.ConstructorInput) + i = encodeVarintTurnstone(dAtA, i, uint64(len(m.ConstructorInput))) + i-- + dAtA[i] = 0x1a + } + if len(m.Abi) > 0 { + i -= len(m.Abi) + copy(dAtA[i:], m.Abi) + i = encodeVarintTurnstone(dAtA, i, uint64(len(m.Abi))) + i-- + dAtA[i] = 0x12 + } if len(m.Bytecode) > 0 { i -= len(m.Bytecode) copy(dAtA[i:], m.Bytecode) @@ -758,6 +789,14 @@ func (m *UploadSmartContract) Size() (n int) { if l > 0 { n += 1 + l + sovTurnstone(uint64(l)) } + l = len(m.Abi) + if l > 0 { + n += 1 + l + sovTurnstone(uint64(l)) + } + l = len(m.ConstructorInput) + if l > 0 { + n += 1 + l + sovTurnstone(uint64(l)) + } return n } @@ -1319,6 +1358,74 @@ func (m *UploadSmartContract) Unmarshal(dAtA []byte) error { m.Bytecode = []byte{} } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abi", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTurnstone + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTurnstone + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Abi = append(m.Abi[:0], dAtA[iNdEx:postIndex]...) + if m.Abi == nil { + m.Abi = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstructorInput", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTurnstone + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTurnstone + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTurnstone + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConstructorInput = append(m.ConstructorInput[:0], dAtA[iNdEx:postIndex]...) + if m.ConstructorInput == nil { + m.ConstructorInput = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTurnstone(dAtA[iNdEx:]) diff --git a/x/evm/types/tx.pb.go b/x/evm/types/tx.pb.go index 1977d694..b5d5fa0f 100644 --- a/x/evm/types/tx.pb.go +++ b/x/evm/types/tx.pb.go @@ -155,34 +155,155 @@ func (m *MsgSubmitNewJobResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitNewJobResponse proto.InternalMessageInfo +type MsgUploadNewSmartContractTemp struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Abi string `protobuf:"bytes,2,opt,name=abi,proto3" json:"abi,omitempty"` + Bytecode string `protobuf:"bytes,3,opt,name=bytecode,proto3" json:"bytecode,omitempty"` + ConstructorInput string `protobuf:"bytes,4,opt,name=constructorInput,proto3" json:"constructorInput,omitempty"` + ChainID string `protobuf:"bytes,5,opt,name=chainID,proto3" json:"chainID,omitempty"` +} + +func (m *MsgUploadNewSmartContractTemp) Reset() { *m = MsgUploadNewSmartContractTemp{} } +func (m *MsgUploadNewSmartContractTemp) String() string { return proto.CompactTextString(m) } +func (*MsgUploadNewSmartContractTemp) ProtoMessage() {} +func (*MsgUploadNewSmartContractTemp) Descriptor() ([]byte, []int) { + return fileDescriptor_d72e73a3d1d93781, []int{2} +} +func (m *MsgUploadNewSmartContractTemp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUploadNewSmartContractTemp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUploadNewSmartContractTemp.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUploadNewSmartContractTemp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUploadNewSmartContractTemp.Merge(m, src) +} +func (m *MsgUploadNewSmartContractTemp) XXX_Size() int { + return m.Size() +} +func (m *MsgUploadNewSmartContractTemp) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUploadNewSmartContractTemp.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUploadNewSmartContractTemp proto.InternalMessageInfo + +func (m *MsgUploadNewSmartContractTemp) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUploadNewSmartContractTemp) GetAbi() string { + if m != nil { + return m.Abi + } + return "" +} + +func (m *MsgUploadNewSmartContractTemp) GetBytecode() string { + if m != nil { + return m.Bytecode + } + return "" +} + +func (m *MsgUploadNewSmartContractTemp) GetConstructorInput() string { + if m != nil { + return m.ConstructorInput + } + return "" +} + +func (m *MsgUploadNewSmartContractTemp) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +type MsgUploadNewSmartContractTempResponse struct { +} + +func (m *MsgUploadNewSmartContractTempResponse) Reset() { *m = MsgUploadNewSmartContractTempResponse{} } +func (m *MsgUploadNewSmartContractTempResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUploadNewSmartContractTempResponse) ProtoMessage() {} +func (*MsgUploadNewSmartContractTempResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d72e73a3d1d93781, []int{3} +} +func (m *MsgUploadNewSmartContractTempResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUploadNewSmartContractTempResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUploadNewSmartContractTempResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUploadNewSmartContractTempResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUploadNewSmartContractTempResponse.Merge(m, src) +} +func (m *MsgUploadNewSmartContractTempResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUploadNewSmartContractTempResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUploadNewSmartContractTempResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUploadNewSmartContractTempResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSubmitNewJob)(nil), "palomachain.paloma.evm.MsgSubmitNewJob") proto.RegisterType((*MsgSubmitNewJobResponse)(nil), "palomachain.paloma.evm.MsgSubmitNewJobResponse") + proto.RegisterType((*MsgUploadNewSmartContractTemp)(nil), "palomachain.paloma.evm.MsgUploadNewSmartContractTemp") + proto.RegisterType((*MsgUploadNewSmartContractTempResponse)(nil), "palomachain.paloma.evm.MsgUploadNewSmartContractTempResponse") } func init() { proto.RegisterFile("evm/tx.proto", fileDescriptor_d72e73a3d1d93781) } var fileDescriptor_d72e73a3d1d93781 = []byte{ - // 301 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xcf, 0x4a, 0x02, 0x41, - 0x18, 0x77, 0xb2, 0x14, 0x3f, 0x84, 0x62, 0x0e, 0x3a, 0x45, 0x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0x42, 0x73, 0x6b, 0xd1, 0x2e, 0xba, 0xdc, 0x0c, 0x1d, 0x5e, 0x18, 0x28, 0x77, 0x5c, 0x9f, 0x2a, - 0xa8, 0xff, 0xb8, 0xc3, 0xa9, 0xf8, 0xfd, 0x68, 0x62, 0xab, 0xce, 0x51, 0xf4, 0xcf, 0xe0, 0xba, - 0xe1, 0x4d, 0xfb, 0x6d, 0xc6, 0xc9, 0x74, 0xc6, 0xc9, 0xc7, 0x8c, 0x93, 0xd7, 0x39, 0x2f, 0x4d, - 0xe7, 0xbc, 0xf4, 0x3e, 0xe7, 0xa5, 0xe7, 0xf3, 0x7e, 0xe6, 0xd5, 0x28, 0x16, 0x89, 0xd1, 0xd1, - 0x46, 0xd1, 0x15, 0x8e, 0x8a, 0x28, 0x7c, 0x75, 0x92, 0xa3, 0x8b, 0x2b, 0xe1, 0xb3, 0x97, 0x5f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xba, 0x94, 0xac, 0xd2, 0xe9, 0x01, 0x00, 0x00, + // 409 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd4, 0x30, + 0x10, 0xc6, 0xd7, 0xbb, 0x74, 0x4b, 0x47, 0x95, 0xa8, 0x7c, 0x68, 0x4d, 0x04, 0x11, 0x5a, 0x09, + 0x15, 0x38, 0x24, 0x12, 0x08, 0x89, 0x0b, 0x07, 0x28, 0x97, 0x22, 0x6d, 0x85, 0xda, 0x72, 0xe1, + 0xe6, 0x24, 0xa3, 0x24, 0x52, 0x1d, 0x5b, 0xb6, 0xd3, 0x26, 0x77, 0x1e, 0x00, 0xf1, 0x1e, 0xbc, + 0x07, 0xc7, 0x3d, 0x72, 0x44, 0xbb, 0x07, 0x5e, 0x03, 0xad, 0x37, 0x61, 0xff, 0xc0, 0x46, 0xa8, + 0xb7, 0xf9, 0x66, 0xc6, 0xf1, 0xf7, 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4c, 0xb0, 0x01, 0xfd, + 0xa3, 0xe9, 0x33, 0x38, 0x88, 0x65, 0x61, 0xac, 0x2e, 0x63, 0x2b, 0xf5, 0x69, 0xa1, 0x4a, 0xdb, + 0x30, 0xff, 0x95, 0x5f, 0x45, 0xd9, 0x59, 0x47, 0x39, 0x86, 0xc7, 0x9d, 0x76, 0x5b, 0xb0, 0xe7, + 0x9f, 0xfb, 0x30, 0x18, 0x9b, 0x94, 0x66, 0xb0, 0xbf, 0xf6, 0x87, 0x8f, 0x83, 0x7f, 0x3f, 0x87, + 0x60, 0x63, 0x42, 0x5e, 0xf8, 0x9f, 0x8d, 0xed, 0x8d, 0xf4, 0x2b, 0x01, 0xaf, 0x63, 0x8e, 0x2f, + 0x3b, 0xbe, 0xb7, 0xfd, 0x98, 0xf7, 0xfa, 0x56, 0xc7, 0x5a, 0x53, 0x6f, 0x4f, 0xbe, 0x4f, 0x7d, + 0x32, 0x99, 0xfa, 0xe4, 0xe7, 0xd4, 0x27, 0x5f, 0x66, 0x7e, 0x6f, 0x32, 0xf3, 0x7b, 0x3f, 0x66, + 0x7e, 0xef, 0xd3, 0xd3, 0x34, 0xb7, 0x59, 0x19, 0x05, 0xb1, 0x14, 0xe1, 0xca, 0x15, 0x4d, 0x1c, + 0x56, 0xa1, 0x5b, 0xa2, 0x5a, 0xa1, 0x89, 0x86, 0x6e, 0x91, 0x5e, 0xfc, 0x0e, 0x00, 0x00, 0xff, + 0xff, 0xeb, 0x62, 0x07, 0xf3, 0x58, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -198,6 +319,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { SubmitNewJob(ctx context.Context, in *MsgSubmitNewJob, opts ...grpc.CallOption) (*MsgSubmitNewJobResponse, error) + UploadNewSmartContractTemp(ctx context.Context, in *MsgUploadNewSmartContractTemp, opts ...grpc.CallOption) (*MsgUploadNewSmartContractTempResponse, error) } type msgClient struct { @@ -217,9 +339,19 @@ func (c *msgClient) SubmitNewJob(ctx context.Context, in *MsgSubmitNewJob, opts return out, nil } +func (c *msgClient) UploadNewSmartContractTemp(ctx context.Context, in *MsgUploadNewSmartContractTemp, opts ...grpc.CallOption) (*MsgUploadNewSmartContractTempResponse, error) { + out := new(MsgUploadNewSmartContractTempResponse) + err := c.cc.Invoke(ctx, "/palomachain.paloma.evm.Msg/UploadNewSmartContractTemp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { SubmitNewJob(context.Context, *MsgSubmitNewJob) (*MsgSubmitNewJobResponse, error) + UploadNewSmartContractTemp(context.Context, *MsgUploadNewSmartContractTemp) (*MsgUploadNewSmartContractTempResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -229,6 +361,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) SubmitNewJob(ctx context.Context, req *MsgSubmitNewJob) (*MsgSubmitNewJobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitNewJob not implemented") } +func (*UnimplementedMsgServer) UploadNewSmartContractTemp(ctx context.Context, req *MsgUploadNewSmartContractTemp) (*MsgUploadNewSmartContractTempResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadNewSmartContractTemp not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -252,6 +387,24 @@ func _Msg_SubmitNewJob_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_UploadNewSmartContractTemp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUploadNewSmartContractTemp) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UploadNewSmartContractTemp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.evm.Msg/UploadNewSmartContractTemp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UploadNewSmartContractTemp(ctx, req.(*MsgUploadNewSmartContractTemp)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "palomachain.paloma.evm.Msg", HandlerType: (*MsgServer)(nil), @@ -260,6 +413,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitNewJob", Handler: _Msg_SubmitNewJob_Handler, }, + { + MethodName: "UploadNewSmartContractTemp", + Handler: _Msg_UploadNewSmartContractTemp_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "evm/tx.proto", @@ -360,6 +517,87 @@ func (m *MsgSubmitNewJobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgUploadNewSmartContractTemp) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUploadNewSmartContractTemp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUploadNewSmartContractTemp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0x2a + } + if len(m.ConstructorInput) > 0 { + i -= len(m.ConstructorInput) + copy(dAtA[i:], m.ConstructorInput) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConstructorInput))) + i-- + dAtA[i] = 0x22 + } + if len(m.Bytecode) > 0 { + i -= len(m.Bytecode) + copy(dAtA[i:], m.Bytecode) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bytecode))) + i-- + dAtA[i] = 0x1a + } + if len(m.Abi) > 0 { + i -= len(m.Abi) + copy(dAtA[i:], m.Abi) + i = encodeVarintTx(dAtA, i, uint64(len(m.Abi))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUploadNewSmartContractTempResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUploadNewSmartContractTempResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUploadNewSmartContractTempResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -417,6 +655,44 @@ func (m *MsgSubmitNewJobResponse) Size() (n int) { return n } +func (m *MsgUploadNewSmartContractTemp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Abi) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Bytecode) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConstructorInput) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUploadNewSmartContractTempResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -747,6 +1023,266 @@ func (m *MsgSubmitNewJobResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUploadNewSmartContractTemp) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUploadNewSmartContractTemp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUploadNewSmartContractTemp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abi", 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.Abi = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bytecode", 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.Bytecode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstructorInput", 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.ConstructorInput = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", 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.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUploadNewSmartContractTempResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUploadNewSmartContractTempResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUploadNewSmartContractTempResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/valset/module.go b/x/valset/module.go index f65c278c..41588be2 100644 --- a/x/valset/module.go +++ b/x/valset/module.go @@ -173,7 +173,7 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} // returns no validator updates. func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { // TODO: THIS IS ONLY TEMPORARY - if ctx.BlockHeader().Height%20 == 0 { + if ctx.BlockHeight()%20 == 0 || ctx.BlockHeight() == 1 { am.keeper.TriggerSnapshotBuild(ctx) } return []abci.ValidatorUpdate{}