From 19344ca9de88a3d4bfc490bf6da5e6688f19722b Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Wed, 10 Jul 2024 17:18:48 +0100 Subject: [PATCH 01/11] TEN RPC: replace custom query with personal transactions --- go/common/enclave.go | 5 ++--- go/common/gethencoding/geth_encoding.go | 14 ++------------ go/common/types.go | 20 ++++++++++---------- go/enclave/enclave.go | 7 +++---- go/enclave/rpc/GetCustomQuery.go | 6 +++--- go/enclave/rpc_server.go | 2 +- go/host/rpc/clientapi/client_api_eth.go | 6 +++--- go/host/rpc/clientapi/client_api_scan.go | 8 ++++++++ go/host/rpc/enclaverpc/enclave_client.go | 2 +- go/responses/types.go | 20 ++++++++++---------- 10 files changed, 43 insertions(+), 47 deletions(-) diff --git a/go/common/enclave.go b/go/common/enclave.go index d528b001c2..0185a23a83 100644 --- a/go/common/enclave.go +++ b/go/common/enclave.go @@ -141,9 +141,8 @@ type EnclaveScan interface { // GetTotalContractCount returns the total number of contracts that have been deployed GetTotalContractCount(context.Context) (*big.Int, SystemError) - // GetCustomQuery returns the data of a custom query - // todo - better name and description - GetCustomQuery(ctx context.Context, encryptedParams EncryptedParamsGetStorageAt) (*responses.PrivateQueryResponse, SystemError) + // GetPersonalTransactions returns the user's recent transactions according to specified pagination + GetPersonalTransactions(ctx context.Context, encryptedParams EncryptedParamsGetPersonalTransactions) (*responses.PersonalTransactionsResponse, SystemError) // EnclavePublicConfig returns network data that is known to the enclave but can be shared publicly EnclavePublicConfig(context.Context) (*EnclavePublicConfig, SystemError) diff --git a/go/common/gethencoding/geth_encoding.go b/go/common/gethencoding/geth_encoding.go index 014d44c44d..c093177a4d 100644 --- a/go/common/gethencoding/geth_encoding.go +++ b/go/common/gethencoding/geth_encoding.go @@ -345,20 +345,10 @@ func (enc *gethEncodingServiceImpl) CreateEthBlockFromBatch(ctx context.Context, return (*types.Block)(unsafe.Pointer(&lb)), nil } -// ExtractPrivateCustomQuery is designed to support a wide range of custom Ten queries. +// ExtractPrivateTransactionsQuery is designed to support a wide range of custom Ten queries. // The first parameter here is the method name, which is used to determine the query type. // The second parameter is the query parameters. -func ExtractPrivateCustomQuery(methodName any, queryParams any) (*common.ListPrivateTransactionsQueryParams, error) { - // we expect the first parameter to be a string - methodNameStr, ok := methodName.(string) - if !ok { - return nil, fmt.Errorf("expected methodName as string but was type %T", methodName) - } - // currently we only have to support this custom query method in the enclave - if methodNameStr != common.ListPrivateTransactionsCQMethod { - return nil, fmt.Errorf("unsupported method %s", methodNameStr) - } - +func ExtractPrivateTransactionsQuery(methodName any, queryParams any) (*common.ListPrivateTransactionsQueryParams, error) { // we expect second param to be a json string queryParamsStr, ok := queryParams.(string) if !ok { diff --git a/go/common/types.go b/go/common/types.go index 12442745f6..4455dd126e 100644 --- a/go/common/types.go +++ b/go/common/types.go @@ -63,16 +63,16 @@ type ( EncryptedTx []byte // A single transaction, encoded as a JSON list of transaction binary hexes and encrypted using the enclave's public key EncryptedTransactions []byte // A blob of encrypted transactions, as they're stored in the rollup, with the nonce prepended. - EncryptedParamsGetBalance []byte // The params for an RPC getBalance request, as a JSON object encrypted with the public key of the enclave. - EncryptedParamsCall []byte // As above, but for an RPC call request. - EncryptedParamsGetTxByHash []byte // As above, but for an RPC getTransactionByHash request. - EncryptedParamsGetTxReceipt []byte // As above, but for an RPC getTransactionReceipt request. - EncryptedParamsLogSubscription []byte // As above, but for an RPC logs subscription request. - EncryptedParamsSendRawTx []byte // As above, but for an RPC sendRawTransaction request. - EncryptedParamsGetTxCount []byte // As above, but for an RPC getTransactionCount request. - EncryptedParamsEstimateGas []byte // As above, but for an RPC estimateGas request. - EncryptedParamsGetLogs []byte // As above, but for an RPC getLogs request. - EncryptedParamsGetStorageAt []byte + EncryptedParamsGetBalance []byte // The params for an RPC getBalance request, as a JSON object encrypted with the public key of the enclave. + EncryptedParamsCall []byte // As above, but for an RPC call request. + EncryptedParamsGetTxByHash []byte // As above, but for an RPC getTransactionByHash request. + EncryptedParamsGetTxReceipt []byte // As above, but for an RPC getTransactionReceipt request. + EncryptedParamsLogSubscription []byte // As above, but for an RPC logs subscription request. + EncryptedParamsSendRawTx []byte // As above, but for an RPC sendRawTransaction request. + EncryptedParamsGetTxCount []byte // As above, but for an RPC getTransactionCount request. + EncryptedParamsEstimateGas []byte // As above, but for an RPC estimateGas request. + EncryptedParamsGetLogs []byte // As above, but for an RPC getLogs request. + EncryptedParamsGetPersonalTransactions []byte Nonce = uint64 EncodedRollup []byte diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 552f2a0ea9..96f64a10d5 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -855,15 +855,14 @@ func (e *enclaveImpl) GetTotalContractCount(ctx context.Context) (*big.Int, comm return e.storage.GetContractCount(ctx) } -// GetCustomQuery is a generic query method for queries that don't match the eth API. -// todo: get rid of this method and use specific methods for each query (e.g. GetPersonalTransactions) -func (e *enclaveImpl) GetCustomQuery(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.PrivateQueryResponse, common.SystemError) { +// GetPersonalTransactions returns the recent private transactions for the given account +func (e *enclaveImpl) GetPersonalTransactions(ctx context.Context, encryptedParams common.EncryptedParamsGetPersonalTransactions) (*responses.PersonalTransactionsResponse, common.SystemError) { // ensure the enclave is running if e.stopControl.IsStopping() { return nil, responses.ToInternalError(fmt.Errorf("requested GetPrivateTransactions with the enclave stopping")) } - return rpc.WithVKEncryption(ctx, e.rpcEncryptionManager, encryptedParams, rpc.GetCustomQueryValidate, rpc.GetCustomQueryExecute) + return rpc.WithVKEncryption(ctx, e.rpcEncryptionManager, encryptedParams, rpc.GetPersonalTransactionsValidate, rpc.GetPersonalTransactionsExecute) } func (e *enclaveImpl) EnclavePublicConfig(context.Context) (*common.EnclavePublicConfig, common.SystemError) { diff --git a/go/enclave/rpc/GetCustomQuery.go b/go/enclave/rpc/GetCustomQuery.go index e804a24120..57ef85a546 100644 --- a/go/enclave/rpc/GetCustomQuery.go +++ b/go/enclave/rpc/GetCustomQuery.go @@ -7,14 +7,14 @@ import ( "github.com/ten-protocol/go-ten/go/common/gethencoding" ) -func GetCustomQueryValidate(reqParams []any, builder *CallBuilder[common.ListPrivateTransactionsQueryParams, common.PrivateTransactionsQueryResponse], _ *EncryptionManager) error { +func GetPersonalTransactionsValidate(reqParams []any, builder *CallBuilder[common.ListPrivateTransactionsQueryParams, common.PrivateTransactionsQueryResponse], _ *EncryptionManager) error { // Parameters are [PrivateCustomQueryHeader, PrivateCustomQueryArgs, null] if len(reqParams) != 3 { builder.Err = fmt.Errorf("unexpected number of parameters (expected %d, got %d)", 3, len(reqParams)) return nil } - privateCustomQuery, err := gethencoding.ExtractPrivateCustomQuery(reqParams[0], reqParams[1]) + privateCustomQuery, err := gethencoding.ExtractPrivateTransactionsQuery(reqParams[0], reqParams[1]) if err != nil { builder.Err = fmt.Errorf("unable to extract query - %w", err) return nil @@ -25,7 +25,7 @@ func GetCustomQueryValidate(reqParams []any, builder *CallBuilder[common.ListPri return nil } -func GetCustomQueryExecute(builder *CallBuilder[common.ListPrivateTransactionsQueryParams, common.PrivateTransactionsQueryResponse], rpc *EncryptionManager) error { +func GetPersonalTransactionsExecute(builder *CallBuilder[common.ListPrivateTransactionsQueryParams, common.PrivateTransactionsQueryResponse], rpc *EncryptionManager) error { err := authenticateFrom(builder.VK, builder.From) if err != nil { builder.Err = err diff --git a/go/enclave/rpc_server.go b/go/enclave/rpc_server.go index 6b5cf31a28..a29be9c27e 100644 --- a/go/enclave/rpc_server.go +++ b/go/enclave/rpc_server.go @@ -452,7 +452,7 @@ func (s *RPCServer) GetTotalContractCount(ctx context.Context, _ *generated.GetT } func (s *RPCServer) GetReceiptsByAddress(ctx context.Context, req *generated.GetReceiptsByAddressRequest) (*generated.GetReceiptsByAddressResponse, error) { - enclaveResp, sysError := s.enclave.GetCustomQuery(ctx, req.EncryptedParams) + enclaveResp, sysError := s.enclave.GetPersonalTransactions(ctx, req.EncryptedParams) if sysError != nil { s.logger.Error("Error getting receipt", log.ErrKey, sysError) return &generated.GetReceiptsByAddressResponse{SystemError: toRPCError(sysError)}, nil diff --git a/go/host/rpc/clientapi/client_api_eth.go b/go/host/rpc/clientapi/client_api_eth.go index 703da1c40b..2b721b0c7b 100644 --- a/go/host/rpc/clientapi/client_api_eth.go +++ b/go/host/rpc/clientapi/client_api_eth.go @@ -178,9 +178,9 @@ func (api *EthereumAPI) GetTransactionByHash(ctx context.Context, encryptedParam return *enclaveResponse, nil } -// GetStorageAt is a reused method for listing the users transactions -func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.Receipts, error) { - return api.host.EnclaveClient().GetCustomQuery(ctx, encryptedParams) +// GetStorageAt is not currently supported (some narrow version of it may be supported in the future for proxy contracts). +func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common.EncryptedParamsGetPersonalTransactions) (*responses.Receipts, error) { + return nil, fmt.Errorf("GetStorageAt is not supported on TEN") } // FeeHistory is a placeholder for an RPC method required by MetaMask/Remix. diff --git a/go/host/rpc/clientapi/client_api_scan.go b/go/host/rpc/clientapi/client_api_scan.go index 7b6feb5395..57530a6b40 100644 --- a/go/host/rpc/clientapi/client_api_scan.go +++ b/go/host/rpc/clientapi/client_api_scan.go @@ -5,6 +5,7 @@ import ( "math/big" gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ten-protocol/go-ten/go/responses" "github.com/ethereum/go-ethereum/log" "github.com/ten-protocol/go-ten/go/common" @@ -118,3 +119,10 @@ func (s *ScanAPI) GetRollupBatches(rollupHash gethcommon.Hash) (*common.BatchLis func (s *ScanAPI) GetBatchTransactions(batchHash gethcommon.Hash) (*common.TransactionListingResponse, error) { return s.host.Storage().FetchBatchTransactions(batchHash) } + +// These methods are for private user data, they will need to be requested with VK (e.g. via the gateway) + +// GetPersonalTransactions gets the private transactions data for a given user +func (s *ScanAPI) GetPersonalTransactions(ctx context.Context, encryptedParams common.EncryptedParamsGetPersonalTransactions) (*responses.Receipts, error) { + return s.host.EnclaveClient().GetPersonalTransactions(ctx, encryptedParams) +} diff --git a/go/host/rpc/enclaverpc/enclave_client.go b/go/host/rpc/enclaverpc/enclave_client.go index 583434d4d3..5c1c71e9f4 100644 --- a/go/host/rpc/enclaverpc/enclave_client.go +++ b/go/host/rpc/enclaverpc/enclave_client.go @@ -587,7 +587,7 @@ func (c *Client) GetTotalContractCount(ctx context.Context) (*big.Int, common.Sy return big.NewInt(response.Count), nil } -func (c *Client) GetCustomQuery(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.PrivateQueryResponse, common.SystemError) { +func (c *Client) GetPersonalTransactions(ctx context.Context, encryptedParams common.EncryptedParamsGetPersonalTransactions) (*responses.PersonalTransactionsResponse, common.SystemError) { timeoutCtx, cancel := context.WithTimeout(ctx, c.enclaveRPCTimeout) defer cancel() diff --git a/go/responses/types.go b/go/responses/types.go index d4d6ea2d06..9138e44a3c 100644 --- a/go/responses/types.go +++ b/go/responses/types.go @@ -24,16 +24,16 @@ func (ur *UserResponse[T]) Error() error { // Responses type ( - Balance = EnclaveResponse // The response for an RPC getBalance request, as a JSON object encrypted with the viewing key of the user. - Call = EnclaveResponse // As above, but for an RPC call request. - TxReceipt = EnclaveResponse // As above, but for an RPC getTransactionReceipt request. - RawTx = EnclaveResponse // As above, but for an RPC sendRawTransaction request. - TxByHash = EnclaveResponse // As above, but for an RPC getTransactionByHash request. - TxCount = EnclaveResponse // As above, but for an RPC getTransactionCount request. - Gas = EnclaveResponse // As above, but for an RPC estimateGas response. - Logs = EnclaveResponse - Receipts = EnclaveResponse - PrivateQueryResponse = EnclaveResponse + Balance = EnclaveResponse // The response for an RPC getBalance request, as a JSON object encrypted with the viewing key of the user. + Call = EnclaveResponse // As above, but for an RPC call request. + TxReceipt = EnclaveResponse // As above, but for an RPC getTransactionReceipt request. + RawTx = EnclaveResponse // As above, but for an RPC sendRawTransaction request. + TxByHash = EnclaveResponse // As above, but for an RPC getTransactionByHash request. + TxCount = EnclaveResponse // As above, but for an RPC getTransactionCount request. + Gas = EnclaveResponse // As above, but for an RPC estimateGas response. + Logs = EnclaveResponse + Receipts = EnclaveResponse + PersonalTransactionsResponse = EnclaveResponse ) // Data Types From fd59ed7dbf3b1711094a504ac49be0ffe136fd48 Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Wed, 10 Jul 2024 17:22:55 +0100 Subject: [PATCH 02/11] update rpc method, add todo to do before PR ready --- go/obsclient/authclient.go | 3 ++- go/rpc/client.go | 13 +++++++------ tools/walletextension/rpcapi/blockchain_api.go | 3 +-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/go/obsclient/authclient.go b/go/obsclient/authclient.go index 7c379002ce..40a038db4a 100644 --- a/go/obsclient/authclient.go +++ b/go/obsclient/authclient.go @@ -261,7 +261,8 @@ func (ac *AuthObsClient) GetPrivateTransactions(ctx context.Context, address *ge return nil, 0, fmt.Errorf("unable to marshal query params - %w", err) } var result common.PrivateTransactionsQueryResponse - err = ac.rpcClient.CallContext(ctx, &result, rpc.GetStorageAt, common.ListPrivateTransactionsCQMethod, string(queryParamStr), nil) + // todo @matt don't use the string method name here and avoid stringifying the params + err = ac.rpcClient.CallContext(ctx, &result, rpc.GetPersonalTransactions, common.ListPrivateTransactionsCQMethod, string(queryParamStr), nil) if err != nil { return nil, 0, err } diff --git a/go/rpc/client.go b/go/rpc/client.go index 81227b0266..6a87987b4d 100644 --- a/go/rpc/client.go +++ b/go/rpc/client.go @@ -44,12 +44,13 @@ const ( GetBatchByHeight = "scan_getBatchByHeight" GetTransaction = "scan_getTransaction" - GetRollupListing = "scan_getRollupListing" - GetBatchListingNew = "scan_getBatchListingNew" - GetRollupByHash = "scan_getRollupByHash" - GetRollupBatches = "scan_getRollupBatches" - GetRollupBySeqNo = "scan_getRollupBySeqNo" - GetBatchTransactions = "scan_getBatchTransactions" + GetRollupListing = "scan_getRollupListing" + GetBatchListingNew = "scan_getBatchListingNew" + GetRollupByHash = "scan_getRollupByHash" + GetRollupBatches = "scan_getRollupBatches" + GetRollupBySeqNo = "scan_getRollupBySeqNo" + GetBatchTransactions = "scan_getBatchTransactions" + GetPersonalTransactions = "scan_getPersonalTransactions" ) // Client is used by client applications to interact with the Ten node diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 775a3bf842..6915e8950d 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -165,8 +165,7 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A if err != nil { return nil, fmt.Errorf("unable to extract address from custom query params: %w", err) } - // todo: we should be calling something like `ten_getPrivateTransactions` here, this custom query stuff only needs to be in the gateway layer - resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{account: userAddr}, "eth_getStorageAt", address.Hex(), params, nil) + resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{account: userAddr}, "scan_getPersonalTransactions", address.Hex(), params, nil) if err != nil { return nil, fmt.Errorf("unable to execute custom query: %w", err) } From c7517c1d1d1a86cf60a6e60e07faf7599a950436 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Thu, 11 Jul 2024 14:13:40 +0300 Subject: [PATCH 03/11] getStorageAt whitelist implementation. --- go/common/enclave.go | 2 + go/common/privacy/whitelist.go | 28 + go/common/rpc/generated/enclave.pb.go | 735 +++++++++++------- go/common/rpc/generated/enclave.proto | 11 + go/common/rpc/generated/enclave_grpc.pb.go | 43 +- go/common/types.go | 1 + go/enclave/enclave.go | 8 + go/enclave/rpc/TenStorageRead.go | 95 +++ go/enclave/rpc_server.go | 9 + go/host/rpc/clientapi/client_api_eth.go | 8 +- go/host/rpc/enclaverpc/enclave_client.go | 16 + go/responses/types.go | 1 + .../helpful/spin_up_local_network_test.go | 2 +- .../walletextension/rpcapi/blockchain_api.go | 26 +- 14 files changed, 683 insertions(+), 302 deletions(-) create mode 100644 go/common/privacy/whitelist.go create mode 100644 go/enclave/rpc/TenStorageRead.go diff --git a/go/common/enclave.go b/go/common/enclave.go index 0185a23a83..94bb74a03a 100644 --- a/go/common/enclave.go +++ b/go/common/enclave.go @@ -86,6 +86,8 @@ type Enclave interface { // GetCode returns the code stored at the given address in the state for the given rollup hash. GetCode(ctx context.Context, address gethcommon.Address, rollupHash *gethcommon.Hash) ([]byte, SystemError) + GetStorageSlot(ctx context.Context, encryptedParams EncryptedParamsGetStorageSlot) (*responses.EnclaveResponse, SystemError) + // Subscribe adds a log subscription to the enclave under the given ID, provided the request is authenticated // correctly. The events will be populated in the BlockSubmissionResponse. If there is an existing subscription // with the given ID, it is overwritten. diff --git a/go/common/privacy/whitelist.go b/go/common/privacy/whitelist.go new file mode 100644 index 0000000000..2296c4c8c8 --- /dev/null +++ b/go/common/privacy/whitelist.go @@ -0,0 +1,28 @@ +package privacy + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/crypto" +) + +type Whitelist struct { + AllowedStorageSlots map[string]bool +} + +func NewWhitelist() *Whitelist { + whitelistMap := make(map[string]bool) + whitelistMap[toEip1967HashHex("eip1967.proxy.beacon")] = true + + return &Whitelist{ + AllowedStorageSlots: whitelistMap, + } +} + +func toEip1967HashHex(key string) string { + hash := crypto.Keccak256Hash([]byte(key)) + hashAsbig := hash.Big() + eipHashHex := "0x" + hashAsbig.Sub(hashAsbig, big.NewInt(1)).Text(16) + + return eipHashHex +} diff --git a/go/common/rpc/generated/enclave.pb.go b/go/common/rpc/generated/enclave.pb.go index 721c3db445..6fcfefa80b 100644 --- a/go/common/rpc/generated/enclave.pb.go +++ b/go/common/rpc/generated/enclave.pb.go @@ -2804,6 +2804,108 @@ func (x *GetBalanceResponse) GetSystemError() *SystemError { return nil } +type GetStorageSlotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EncryptedParams []byte `protobuf:"bytes,1,opt,name=encryptedParams,proto3" json:"encryptedParams,omitempty"` +} + +func (x *GetStorageSlotRequest) Reset() { + *x = GetStorageSlotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_enclave_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStorageSlotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStorageSlotRequest) ProtoMessage() {} + +func (x *GetStorageSlotRequest) ProtoReflect() protoreflect.Message { + mi := &file_enclave_proto_msgTypes[56] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetStorageSlotRequest.ProtoReflect.Descriptor instead. +func (*GetStorageSlotRequest) Descriptor() ([]byte, []int) { + return file_enclave_proto_rawDescGZIP(), []int{56} +} + +func (x *GetStorageSlotRequest) GetEncryptedParams() []byte { + if x != nil { + return x.EncryptedParams + } + return nil +} + +type GetStorageSlotResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EncodedEnclaveResponse []byte `protobuf:"bytes,1,opt,name=encodedEnclaveResponse,proto3" json:"encodedEnclaveResponse,omitempty"` + SystemError *SystemError `protobuf:"bytes,2,opt,name=systemError,proto3" json:"systemError,omitempty"` +} + +func (x *GetStorageSlotResponse) Reset() { + *x = GetStorageSlotResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_enclave_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStorageSlotResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStorageSlotResponse) ProtoMessage() {} + +func (x *GetStorageSlotResponse) ProtoReflect() protoreflect.Message { + mi := &file_enclave_proto_msgTypes[57] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetStorageSlotResponse.ProtoReflect.Descriptor instead. +func (*GetStorageSlotResponse) Descriptor() ([]byte, []int) { + return file_enclave_proto_rawDescGZIP(), []int{57} +} + +func (x *GetStorageSlotResponse) GetEncodedEnclaveResponse() []byte { + if x != nil { + return x.EncodedEnclaveResponse + } + return nil +} + +func (x *GetStorageSlotResponse) GetSystemError() *SystemError { + if x != nil { + return x.SystemError + } + return nil +} + type GetCodeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2816,7 +2918,7 @@ type GetCodeRequest struct { func (x *GetCodeRequest) Reset() { *x = GetCodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[56] + mi := &file_enclave_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2829,7 +2931,7 @@ func (x *GetCodeRequest) String() string { func (*GetCodeRequest) ProtoMessage() {} func (x *GetCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[56] + mi := &file_enclave_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2842,7 +2944,7 @@ func (x *GetCodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCodeRequest.ProtoReflect.Descriptor instead. func (*GetCodeRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{56} + return file_enclave_proto_rawDescGZIP(), []int{58} } func (x *GetCodeRequest) GetAddress() []byte { @@ -2871,7 +2973,7 @@ type GetCodeResponse struct { func (x *GetCodeResponse) Reset() { *x = GetCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[57] + mi := &file_enclave_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2884,7 +2986,7 @@ func (x *GetCodeResponse) String() string { func (*GetCodeResponse) ProtoMessage() {} func (x *GetCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[57] + mi := &file_enclave_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2897,7 +2999,7 @@ func (x *GetCodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCodeResponse.ProtoReflect.Descriptor instead. func (*GetCodeResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{57} + return file_enclave_proto_rawDescGZIP(), []int{59} } func (x *GetCodeResponse) GetCode() []byte { @@ -2926,7 +3028,7 @@ type SubscribeRequest struct { func (x *SubscribeRequest) Reset() { *x = SubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[58] + mi := &file_enclave_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2939,7 +3041,7 @@ func (x *SubscribeRequest) String() string { func (*SubscribeRequest) ProtoMessage() {} func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[58] + mi := &file_enclave_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2952,7 +3054,7 @@ func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{58} + return file_enclave_proto_rawDescGZIP(), []int{60} } func (x *SubscribeRequest) GetId() []byte { @@ -2980,7 +3082,7 @@ type SubscribeResponse struct { func (x *SubscribeResponse) Reset() { *x = SubscribeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[59] + mi := &file_enclave_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2993,7 +3095,7 @@ func (x *SubscribeResponse) String() string { func (*SubscribeResponse) ProtoMessage() {} func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[59] + mi := &file_enclave_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3006,7 +3108,7 @@ func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead. func (*SubscribeResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{59} + return file_enclave_proto_rawDescGZIP(), []int{61} } func (x *SubscribeResponse) GetSystemError() *SystemError { @@ -3027,7 +3129,7 @@ type UnsubscribeRequest struct { func (x *UnsubscribeRequest) Reset() { *x = UnsubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[60] + mi := &file_enclave_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3040,7 +3142,7 @@ func (x *UnsubscribeRequest) String() string { func (*UnsubscribeRequest) ProtoMessage() {} func (x *UnsubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[60] + mi := &file_enclave_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3053,7 +3155,7 @@ func (x *UnsubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnsubscribeRequest.ProtoReflect.Descriptor instead. func (*UnsubscribeRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{60} + return file_enclave_proto_rawDescGZIP(), []int{62} } func (x *UnsubscribeRequest) GetId() []byte { @@ -3074,7 +3176,7 @@ type UnsubscribeResponse struct { func (x *UnsubscribeResponse) Reset() { *x = UnsubscribeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[61] + mi := &file_enclave_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3087,7 +3189,7 @@ func (x *UnsubscribeResponse) String() string { func (*UnsubscribeResponse) ProtoMessage() {} func (x *UnsubscribeResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[61] + mi := &file_enclave_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3100,7 +3202,7 @@ func (x *UnsubscribeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnsubscribeResponse.ProtoReflect.Descriptor instead. func (*UnsubscribeResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{61} + return file_enclave_proto_rawDescGZIP(), []int{63} } func (x *UnsubscribeResponse) GetSystemError() *SystemError { @@ -3121,7 +3223,7 @@ type EstimateGasRequest struct { func (x *EstimateGasRequest) Reset() { *x = EstimateGasRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[62] + mi := &file_enclave_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3134,7 +3236,7 @@ func (x *EstimateGasRequest) String() string { func (*EstimateGasRequest) ProtoMessage() {} func (x *EstimateGasRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[62] + mi := &file_enclave_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3147,7 +3249,7 @@ func (x *EstimateGasRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EstimateGasRequest.ProtoReflect.Descriptor instead. func (*EstimateGasRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{62} + return file_enclave_proto_rawDescGZIP(), []int{64} } func (x *EstimateGasRequest) GetEncryptedParams() []byte { @@ -3169,7 +3271,7 @@ type EstimateGasResponse struct { func (x *EstimateGasResponse) Reset() { *x = EstimateGasResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[63] + mi := &file_enclave_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3182,7 +3284,7 @@ func (x *EstimateGasResponse) String() string { func (*EstimateGasResponse) ProtoMessage() {} func (x *EstimateGasResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[63] + mi := &file_enclave_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3195,7 +3297,7 @@ func (x *EstimateGasResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EstimateGasResponse.ProtoReflect.Descriptor instead. func (*EstimateGasResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{63} + return file_enclave_proto_rawDescGZIP(), []int{65} } func (x *EstimateGasResponse) GetEncodedEnclaveResponse() []byte { @@ -3223,7 +3325,7 @@ type GetLogsRequest struct { func (x *GetLogsRequest) Reset() { *x = GetLogsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[64] + mi := &file_enclave_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3236,7 +3338,7 @@ func (x *GetLogsRequest) String() string { func (*GetLogsRequest) ProtoMessage() {} func (x *GetLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[64] + mi := &file_enclave_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3249,7 +3351,7 @@ func (x *GetLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLogsRequest.ProtoReflect.Descriptor instead. func (*GetLogsRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{64} + return file_enclave_proto_rawDescGZIP(), []int{66} } func (x *GetLogsRequest) GetEncryptedParams() []byte { @@ -3271,7 +3373,7 @@ type GetLogsResponse struct { func (x *GetLogsResponse) Reset() { *x = GetLogsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[65] + mi := &file_enclave_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3284,7 +3386,7 @@ func (x *GetLogsResponse) String() string { func (*GetLogsResponse) ProtoMessage() {} func (x *GetLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[65] + mi := &file_enclave_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3297,7 +3399,7 @@ func (x *GetLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLogsResponse.ProtoReflect.Descriptor instead. func (*GetLogsResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{65} + return file_enclave_proto_rawDescGZIP(), []int{67} } func (x *GetLogsResponse) GetEncodedEnclaveResponse() []byte { @@ -3326,7 +3428,7 @@ type HealthCheckResponse struct { func (x *HealthCheckResponse) Reset() { *x = HealthCheckResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[66] + mi := &file_enclave_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3339,7 +3441,7 @@ func (x *HealthCheckResponse) String() string { func (*HealthCheckResponse) ProtoMessage() {} func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[66] + mi := &file_enclave_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3352,7 +3454,7 @@ func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{66} + return file_enclave_proto_rawDescGZIP(), []int{68} } func (x *HealthCheckResponse) GetStatus() bool { @@ -3378,7 +3480,7 @@ type EmptyArgs struct { func (x *EmptyArgs) Reset() { *x = EmptyArgs{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[67] + mi := &file_enclave_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3391,7 +3493,7 @@ func (x *EmptyArgs) String() string { func (*EmptyArgs) ProtoMessage() {} func (x *EmptyArgs) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[67] + mi := &file_enclave_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3404,7 +3506,7 @@ func (x *EmptyArgs) ProtoReflect() protoreflect.Message { // Deprecated: Use EmptyArgs.ProtoReflect.Descriptor instead. func (*EmptyArgs) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{67} + return file_enclave_proto_rawDescGZIP(), []int{69} } type AttestationReportMsg struct { @@ -3422,7 +3524,7 @@ type AttestationReportMsg struct { func (x *AttestationReportMsg) Reset() { *x = AttestationReportMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[68] + mi := &file_enclave_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3435,7 +3537,7 @@ func (x *AttestationReportMsg) String() string { func (*AttestationReportMsg) ProtoMessage() {} func (x *AttestationReportMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[68] + mi := &file_enclave_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3448,7 +3550,7 @@ func (x *AttestationReportMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationReportMsg.ProtoReflect.Descriptor instead. func (*AttestationReportMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{68} + return file_enclave_proto_rawDescGZIP(), []int{70} } func (x *AttestationReportMsg) GetReport() []byte { @@ -3498,7 +3600,7 @@ type BlockSubmissionResponseMsg struct { func (x *BlockSubmissionResponseMsg) Reset() { *x = BlockSubmissionResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[69] + mi := &file_enclave_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3511,7 +3613,7 @@ func (x *BlockSubmissionResponseMsg) String() string { func (*BlockSubmissionResponseMsg) ProtoMessage() {} func (x *BlockSubmissionResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[69] + mi := &file_enclave_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3524,7 +3626,7 @@ func (x *BlockSubmissionResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockSubmissionResponseMsg.ProtoReflect.Descriptor instead. func (*BlockSubmissionResponseMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{69} + return file_enclave_proto_rawDescGZIP(), []int{71} } func (x *BlockSubmissionResponseMsg) GetProducedSecretResponses() []*SecretResponseMsg { @@ -3553,7 +3655,7 @@ type BlockSubmissionErrorMsg struct { func (x *BlockSubmissionErrorMsg) Reset() { *x = BlockSubmissionErrorMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[70] + mi := &file_enclave_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3566,7 +3668,7 @@ func (x *BlockSubmissionErrorMsg) String() string { func (*BlockSubmissionErrorMsg) ProtoMessage() {} func (x *BlockSubmissionErrorMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[70] + mi := &file_enclave_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3579,7 +3681,7 @@ func (x *BlockSubmissionErrorMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockSubmissionErrorMsg.ProtoReflect.Descriptor instead. func (*BlockSubmissionErrorMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{70} + return file_enclave_proto_rawDescGZIP(), []int{72} } func (x *BlockSubmissionErrorMsg) GetCause() string { @@ -3611,7 +3713,7 @@ type CrossChainMsg struct { func (x *CrossChainMsg) Reset() { *x = CrossChainMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[71] + mi := &file_enclave_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3624,7 +3726,7 @@ func (x *CrossChainMsg) String() string { func (*CrossChainMsg) ProtoMessage() {} func (x *CrossChainMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[71] + mi := &file_enclave_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3637,7 +3739,7 @@ func (x *CrossChainMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainMsg.ProtoReflect.Descriptor instead. func (*CrossChainMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{71} + return file_enclave_proto_rawDescGZIP(), []int{73} } func (x *CrossChainMsg) GetSender() []byte { @@ -3688,7 +3790,7 @@ type ExtBatchMsg struct { func (x *ExtBatchMsg) Reset() { *x = ExtBatchMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[72] + mi := &file_enclave_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3701,7 +3803,7 @@ func (x *ExtBatchMsg) String() string { func (*ExtBatchMsg) ProtoMessage() {} func (x *ExtBatchMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[72] + mi := &file_enclave_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3714,7 +3816,7 @@ func (x *ExtBatchMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtBatchMsg.ProtoReflect.Descriptor instead. func (*ExtBatchMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{72} + return file_enclave_proto_rawDescGZIP(), []int{74} } func (x *ExtBatchMsg) GetHeader() *BatchHeaderMsg { @@ -3767,7 +3869,7 @@ type BatchHeaderMsg struct { func (x *BatchHeaderMsg) Reset() { *x = BatchHeaderMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[73] + mi := &file_enclave_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3780,7 +3882,7 @@ func (x *BatchHeaderMsg) String() string { func (*BatchHeaderMsg) ProtoMessage() {} func (x *BatchHeaderMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[73] + mi := &file_enclave_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3793,7 +3895,7 @@ func (x *BatchHeaderMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchHeaderMsg.ProtoReflect.Descriptor instead. func (*BatchHeaderMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{73} + return file_enclave_proto_rawDescGZIP(), []int{75} } func (x *BatchHeaderMsg) GetParentHash() []byte { @@ -3942,7 +4044,7 @@ type ExtRollupMsg struct { func (x *ExtRollupMsg) Reset() { *x = ExtRollupMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[74] + mi := &file_enclave_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3955,7 +4057,7 @@ func (x *ExtRollupMsg) String() string { func (*ExtRollupMsg) ProtoMessage() {} func (x *ExtRollupMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[74] + mi := &file_enclave_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3968,7 +4070,7 @@ func (x *ExtRollupMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtRollupMsg.ProtoReflect.Descriptor instead. func (*ExtRollupMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{74} + return file_enclave_proto_rawDescGZIP(), []int{76} } func (x *ExtRollupMsg) GetHeader() *RollupHeaderMsg { @@ -4011,7 +4113,7 @@ type RollupHeaderMsg struct { func (x *RollupHeaderMsg) Reset() { *x = RollupHeaderMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[75] + mi := &file_enclave_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4024,7 +4126,7 @@ func (x *RollupHeaderMsg) String() string { func (*RollupHeaderMsg) ProtoMessage() {} func (x *RollupHeaderMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[75] + mi := &file_enclave_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4037,7 +4139,7 @@ func (x *RollupHeaderMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use RollupHeaderMsg.ProtoReflect.Descriptor instead. func (*RollupHeaderMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{75} + return file_enclave_proto_rawDescGZIP(), []int{77} } func (x *RollupHeaderMsg) GetParentHash() []byte { @@ -4118,7 +4220,7 @@ type SecretResponseMsg struct { func (x *SecretResponseMsg) Reset() { *x = SecretResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[76] + mi := &file_enclave_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4131,7 +4233,7 @@ func (x *SecretResponseMsg) String() string { func (*SecretResponseMsg) ProtoMessage() {} func (x *SecretResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[76] + mi := &file_enclave_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4144,7 +4246,7 @@ func (x *SecretResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use SecretResponseMsg.ProtoReflect.Descriptor instead. func (*SecretResponseMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{76} + return file_enclave_proto_rawDescGZIP(), []int{78} } func (x *SecretResponseMsg) GetSecret() []byte { @@ -4195,7 +4297,7 @@ type WithdrawalMsg struct { func (x *WithdrawalMsg) Reset() { *x = WithdrawalMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[77] + mi := &file_enclave_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4208,7 +4310,7 @@ func (x *WithdrawalMsg) String() string { func (*WithdrawalMsg) ProtoMessage() {} func (x *WithdrawalMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[77] + mi := &file_enclave_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4221,7 +4323,7 @@ func (x *WithdrawalMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use WithdrawalMsg.ProtoReflect.Descriptor instead. func (*WithdrawalMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{77} + return file_enclave_proto_rawDescGZIP(), []int{79} } func (x *WithdrawalMsg) GetAmount() []byte { @@ -4547,6 +4649,19 @@ var file_enclave_proto_rawDesc = []byte{ 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x22, 0x41, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, + 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, + 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x45, 0x6e, 0x63, + 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x16, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x6c, 0x61, + 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x4a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, @@ -4745,7 +4860,7 @@ var file_enclave_proto_rawDesc = []byte{ 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x32, 0xab, 0x15, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x32, 0x84, 0x16, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x3f, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x65, 0x6e, @@ -4821,104 +4936,109 @@ var file_enclave_proto_rawDesc = []byte{ 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x48, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, - 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, - 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, - 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, - 0x47, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, - 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x07, - 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, - 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x45, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, - 0x14, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x12, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, - 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x42, 0x79, 0x53, 0x65, 0x71, 0x4e, - 0x6f, 0x12, 0x21, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, - 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x42, 0x79, 0x53, 0x65, 0x71, 0x4e, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x6c, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x6c, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x14, - 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x26, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, - 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x15, 0x44, 0x65, 0x62, 0x75, 0x67, - 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x27, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x62, - 0x75, 0x67, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x65, 0x6e, 0x65, + 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x20, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x6c, 0x6f, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x6c, 0x6f, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x09, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, + 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, + 0x65, 0x47, 0x61, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x47, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, + 0x12, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, + 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0b, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x14, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x1e, + 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x45, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1a, 0x2e, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x42, 0x79, 0x53, 0x65, 0x71, 0x4e, 0x6f, 0x12, 0x21, 0x2e, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x42, + 0x79, 0x53, 0x65, 0x71, 0x4e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x2e, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, + 0x6c, 0x75, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, + 0x6c, 0x6c, 0x75, 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x6c, + 0x75, 0x70, 0x12, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x14, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, + 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x26, 0x2e, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x6c, 0x0a, 0x15, 0x44, 0x65, 0x62, 0x75, 0x67, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x54, 0x72, 0x61, 0x63, 0x65, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, - 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x32, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, - 0x01, 0x12, 0x6f, 0x0a, 0x16, 0x44, 0x65, 0x62, 0x75, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x79, 0x12, 0x28, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, - 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, + 0x65, 0x62, 0x75, 0x67, 0x54, 0x72, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, + 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x21, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x6f, 0x0a, 0x16, 0x44, 0x65, + 0x62, 0x75, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x76, + 0x61, 0x6e, 0x63, 0x79, 0x12, 0x28, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, + 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x69, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x42, - 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, - 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, + 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x13, 0x45, - 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x25, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, + 0x73, 0x12, 0x26, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, + 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x73, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x13, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x2e, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x50, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x17, 0x5a, 0x15, 0x65, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x17, 0x5a, 0x15, + 0x65, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4933,7 +5053,7 @@ func file_enclave_proto_rawDescGZIP() []byte { return file_enclave_proto_rawDescData } -var file_enclave_proto_msgTypes = make([]protoimpl.MessageInfo, 78) +var file_enclave_proto_msgTypes = make([]protoimpl.MessageInfo, 80) var file_enclave_proto_goTypes = []interface{}{ (*EnclavePublicConfigRequest)(nil), // 0: generated.EnclavePublicConfigRequest (*EnclavePublicConfigResponse)(nil), // 1: generated.EnclavePublicConfigResponse @@ -4991,28 +5111,30 @@ var file_enclave_proto_goTypes = []interface{}{ (*GetTransactionReceiptResponse)(nil), // 53: generated.GetTransactionReceiptResponse (*GetBalanceRequest)(nil), // 54: generated.GetBalanceRequest (*GetBalanceResponse)(nil), // 55: generated.GetBalanceResponse - (*GetCodeRequest)(nil), // 56: generated.GetCodeRequest - (*GetCodeResponse)(nil), // 57: generated.GetCodeResponse - (*SubscribeRequest)(nil), // 58: generated.SubscribeRequest - (*SubscribeResponse)(nil), // 59: generated.SubscribeResponse - (*UnsubscribeRequest)(nil), // 60: generated.UnsubscribeRequest - (*UnsubscribeResponse)(nil), // 61: generated.UnsubscribeResponse - (*EstimateGasRequest)(nil), // 62: generated.EstimateGasRequest - (*EstimateGasResponse)(nil), // 63: generated.EstimateGasResponse - (*GetLogsRequest)(nil), // 64: generated.GetLogsRequest - (*GetLogsResponse)(nil), // 65: generated.GetLogsResponse - (*HealthCheckResponse)(nil), // 66: generated.HealthCheckResponse - (*EmptyArgs)(nil), // 67: generated.EmptyArgs - (*AttestationReportMsg)(nil), // 68: generated.AttestationReportMsg - (*BlockSubmissionResponseMsg)(nil), // 69: generated.BlockSubmissionResponseMsg - (*BlockSubmissionErrorMsg)(nil), // 70: generated.BlockSubmissionErrorMsg - (*CrossChainMsg)(nil), // 71: generated.CrossChainMsg - (*ExtBatchMsg)(nil), // 72: generated.ExtBatchMsg - (*BatchHeaderMsg)(nil), // 73: generated.BatchHeaderMsg - (*ExtRollupMsg)(nil), // 74: generated.ExtRollupMsg - (*RollupHeaderMsg)(nil), // 75: generated.RollupHeaderMsg - (*SecretResponseMsg)(nil), // 76: generated.SecretResponseMsg - (*WithdrawalMsg)(nil), // 77: generated.WithdrawalMsg + (*GetStorageSlotRequest)(nil), // 56: generated.GetStorageSlotRequest + (*GetStorageSlotResponse)(nil), // 57: generated.GetStorageSlotResponse + (*GetCodeRequest)(nil), // 58: generated.GetCodeRequest + (*GetCodeResponse)(nil), // 59: generated.GetCodeResponse + (*SubscribeRequest)(nil), // 60: generated.SubscribeRequest + (*SubscribeResponse)(nil), // 61: generated.SubscribeResponse + (*UnsubscribeRequest)(nil), // 62: generated.UnsubscribeRequest + (*UnsubscribeResponse)(nil), // 63: generated.UnsubscribeResponse + (*EstimateGasRequest)(nil), // 64: generated.EstimateGasRequest + (*EstimateGasResponse)(nil), // 65: generated.EstimateGasResponse + (*GetLogsRequest)(nil), // 66: generated.GetLogsRequest + (*GetLogsResponse)(nil), // 67: generated.GetLogsResponse + (*HealthCheckResponse)(nil), // 68: generated.HealthCheckResponse + (*EmptyArgs)(nil), // 69: generated.EmptyArgs + (*AttestationReportMsg)(nil), // 70: generated.AttestationReportMsg + (*BlockSubmissionResponseMsg)(nil), // 71: generated.BlockSubmissionResponseMsg + (*BlockSubmissionErrorMsg)(nil), // 72: generated.BlockSubmissionErrorMsg + (*CrossChainMsg)(nil), // 73: generated.CrossChainMsg + (*ExtBatchMsg)(nil), // 74: generated.ExtBatchMsg + (*BatchHeaderMsg)(nil), // 75: generated.BatchHeaderMsg + (*ExtRollupMsg)(nil), // 76: generated.ExtRollupMsg + (*RollupHeaderMsg)(nil), // 77: generated.RollupHeaderMsg + (*SecretResponseMsg)(nil), // 78: generated.SecretResponseMsg + (*WithdrawalMsg)(nil), // 79: generated.WithdrawalMsg } var file_enclave_proto_depIdxs = []int32{ 13, // 0: generated.EnclavePublicConfigResponse.systemError:type_name -> generated.SystemError @@ -5023,19 +5145,19 @@ var file_enclave_proto_depIdxs = []int32{ 13, // 5: generated.GetTotalContractCountResponse.systemError:type_name -> generated.SystemError 13, // 6: generated.DebugEventLogRelevancyResponse.systemError:type_name -> generated.SystemError 13, // 7: generated.DebugTraceTransactionResponse.systemError:type_name -> generated.SystemError - 74, // 8: generated.CreateRollupResponse.msg:type_name -> generated.ExtRollupMsg + 76, // 8: generated.CreateRollupResponse.msg:type_name -> generated.ExtRollupMsg 13, // 9: generated.CreateRollupResponse.systemError:type_name -> generated.SystemError 13, // 10: generated.StatusResponse.systemError:type_name -> generated.SystemError - 68, // 11: generated.AttestationResponse.attestationReportMsg:type_name -> generated.AttestationReportMsg + 70, // 11: generated.AttestationResponse.attestationReportMsg:type_name -> generated.AttestationReportMsg 13, // 12: generated.AttestationResponse.systemError:type_name -> generated.SystemError 13, // 13: generated.GenerateSecretResponse.systemError:type_name -> generated.SystemError 13, // 14: generated.InitEnclaveResponse.systemError:type_name -> generated.SystemError 13, // 15: generated.EnclaveIDResponse.systemError:type_name -> generated.SystemError 13, // 16: generated.StartResponse.systemError:type_name -> generated.SystemError - 69, // 17: generated.SubmitBlockResponse.blockSubmissionResponse:type_name -> generated.BlockSubmissionResponseMsg + 71, // 17: generated.SubmitBlockResponse.blockSubmissionResponse:type_name -> generated.BlockSubmissionResponseMsg 13, // 18: generated.SubmitBlockResponse.systemError:type_name -> generated.SystemError 13, // 19: generated.SubmitTxResponse.systemError:type_name -> generated.SystemError - 72, // 20: generated.SubmitBatchRequest.batch:type_name -> generated.ExtBatchMsg + 74, // 20: generated.SubmitBatchRequest.batch:type_name -> generated.ExtBatchMsg 13, // 21: generated.SubmitBatchResponse.systemError:type_name -> generated.SystemError 13, // 22: generated.ObsCallResponse.systemError:type_name -> generated.SystemError 13, // 23: generated.GetTransactionCountResponse.systemError:type_name -> generated.SystemError @@ -5043,89 +5165,92 @@ var file_enclave_proto_depIdxs = []int32{ 13, // 25: generated.GetTransactionResponse.systemError:type_name -> generated.SystemError 13, // 26: generated.GetTransactionReceiptResponse.systemError:type_name -> generated.SystemError 13, // 27: generated.GetBalanceResponse.systemError:type_name -> generated.SystemError - 13, // 28: generated.GetCodeResponse.systemError:type_name -> generated.SystemError - 13, // 29: generated.SubscribeResponse.systemError:type_name -> generated.SystemError - 13, // 30: generated.UnsubscribeResponse.systemError:type_name -> generated.SystemError - 13, // 31: generated.EstimateGasResponse.systemError:type_name -> generated.SystemError - 13, // 32: generated.GetLogsResponse.systemError:type_name -> generated.SystemError - 13, // 33: generated.HealthCheckResponse.systemError:type_name -> generated.SystemError - 13, // 34: generated.AttestationReportMsg.systemError:type_name -> generated.SystemError - 76, // 35: generated.BlockSubmissionResponseMsg.producedSecretResponses:type_name -> generated.SecretResponseMsg - 70, // 36: generated.BlockSubmissionResponseMsg.error:type_name -> generated.BlockSubmissionErrorMsg - 73, // 37: generated.ExtBatchMsg.header:type_name -> generated.BatchHeaderMsg - 71, // 38: generated.BatchHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg - 75, // 39: generated.ExtRollupMsg.header:type_name -> generated.RollupHeaderMsg - 71, // 40: generated.RollupHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg - 13, // 41: generated.SecretResponseMsg.systemError:type_name -> generated.SystemError - 26, // 42: generated.EnclaveProto.Status:input_type -> generated.StatusRequest - 28, // 43: generated.EnclaveProto.Attestation:input_type -> generated.AttestationRequest - 30, // 44: generated.EnclaveProto.GenerateSecret:input_type -> generated.GenerateSecretRequest - 32, // 45: generated.EnclaveProto.InitEnclave:input_type -> generated.InitEnclaveRequest - 34, // 46: generated.EnclaveProto.EnclaveID:input_type -> generated.EnclaveIDRequest - 38, // 47: generated.EnclaveProto.SubmitL1Block:input_type -> generated.SubmitBlockRequest - 40, // 48: generated.EnclaveProto.SubmitTx:input_type -> generated.SubmitTxRequest - 42, // 49: generated.EnclaveProto.SubmitBatch:input_type -> generated.SubmitBatchRequest - 44, // 50: generated.EnclaveProto.ObsCall:input_type -> generated.ObsCallRequest - 46, // 51: generated.EnclaveProto.GetTransactionCount:input_type -> generated.GetTransactionCountRequest - 48, // 52: generated.EnclaveProto.Stop:input_type -> generated.StopRequest - 50, // 53: generated.EnclaveProto.GetTransaction:input_type -> generated.GetTransactionRequest - 52, // 54: generated.EnclaveProto.GetTransactionReceipt:input_type -> generated.GetTransactionReceiptRequest - 54, // 55: generated.EnclaveProto.GetBalance:input_type -> generated.GetBalanceRequest - 56, // 56: generated.EnclaveProto.GetCode:input_type -> generated.GetCodeRequest - 58, // 57: generated.EnclaveProto.Subscribe:input_type -> generated.SubscribeRequest - 60, // 58: generated.EnclaveProto.Unsubscribe:input_type -> generated.UnsubscribeRequest - 62, // 59: generated.EnclaveProto.EstimateGas:input_type -> generated.EstimateGasRequest - 64, // 60: generated.EnclaveProto.GetLogs:input_type -> generated.GetLogsRequest - 67, // 61: generated.EnclaveProto.HealthCheck:input_type -> generated.EmptyArgs - 4, // 62: generated.EnclaveProto.GetBatch:input_type -> generated.GetBatchRequest - 5, // 63: generated.EnclaveProto.GetBatchBySeqNo:input_type -> generated.GetBatchBySeqNoRequest - 7, // 64: generated.EnclaveProto.GetRollupData:input_type -> generated.GetRollupDataRequest - 20, // 65: generated.EnclaveProto.CreateBatch:input_type -> generated.CreateBatchRequest - 22, // 66: generated.EnclaveProto.CreateRollup:input_type -> generated.CreateRollupRequest - 24, // 67: generated.EnclaveProto.ExportCrossChainData:input_type -> generated.ExportCrossChainDataRequest - 18, // 68: generated.EnclaveProto.DebugTraceTransaction:input_type -> generated.DebugTraceTransactionRequest - 10, // 69: generated.EnclaveProto.StreamL2Updates:input_type -> generated.StreamL2UpdatesRequest - 16, // 70: generated.EnclaveProto.DebugEventLogRelevancy:input_type -> generated.DebugEventLogRelevancyRequest - 14, // 71: generated.EnclaveProto.GetTotalContractCount:input_type -> generated.GetTotalContractCountRequest - 2, // 72: generated.EnclaveProto.GetPrivateTransactions:input_type -> generated.GetReceiptsByAddressRequest - 0, // 73: generated.EnclaveProto.EnclavePublicConfig:input_type -> generated.EnclavePublicConfigRequest - 27, // 74: generated.EnclaveProto.Status:output_type -> generated.StatusResponse - 29, // 75: generated.EnclaveProto.Attestation:output_type -> generated.AttestationResponse - 31, // 76: generated.EnclaveProto.GenerateSecret:output_type -> generated.GenerateSecretResponse - 33, // 77: generated.EnclaveProto.InitEnclave:output_type -> generated.InitEnclaveResponse - 35, // 78: generated.EnclaveProto.EnclaveID:output_type -> generated.EnclaveIDResponse - 39, // 79: generated.EnclaveProto.SubmitL1Block:output_type -> generated.SubmitBlockResponse - 41, // 80: generated.EnclaveProto.SubmitTx:output_type -> generated.SubmitTxResponse - 43, // 81: generated.EnclaveProto.SubmitBatch:output_type -> generated.SubmitBatchResponse - 45, // 82: generated.EnclaveProto.ObsCall:output_type -> generated.ObsCallResponse - 47, // 83: generated.EnclaveProto.GetTransactionCount:output_type -> generated.GetTransactionCountResponse - 49, // 84: generated.EnclaveProto.Stop:output_type -> generated.StopResponse - 51, // 85: generated.EnclaveProto.GetTransaction:output_type -> generated.GetTransactionResponse - 53, // 86: generated.EnclaveProto.GetTransactionReceipt:output_type -> generated.GetTransactionReceiptResponse - 55, // 87: generated.EnclaveProto.GetBalance:output_type -> generated.GetBalanceResponse - 57, // 88: generated.EnclaveProto.GetCode:output_type -> generated.GetCodeResponse - 59, // 89: generated.EnclaveProto.Subscribe:output_type -> generated.SubscribeResponse - 61, // 90: generated.EnclaveProto.Unsubscribe:output_type -> generated.UnsubscribeResponse - 63, // 91: generated.EnclaveProto.EstimateGas:output_type -> generated.EstimateGasResponse - 65, // 92: generated.EnclaveProto.GetLogs:output_type -> generated.GetLogsResponse - 66, // 93: generated.EnclaveProto.HealthCheck:output_type -> generated.HealthCheckResponse - 6, // 94: generated.EnclaveProto.GetBatch:output_type -> generated.GetBatchResponse - 6, // 95: generated.EnclaveProto.GetBatchBySeqNo:output_type -> generated.GetBatchResponse - 8, // 96: generated.EnclaveProto.GetRollupData:output_type -> generated.GetRollupDataResponse - 21, // 97: generated.EnclaveProto.CreateBatch:output_type -> generated.CreateBatchResponse - 23, // 98: generated.EnclaveProto.CreateRollup:output_type -> generated.CreateRollupResponse - 25, // 99: generated.EnclaveProto.ExportCrossChainData:output_type -> generated.ExportCrossChainDataResponse - 19, // 100: generated.EnclaveProto.DebugTraceTransaction:output_type -> generated.DebugTraceTransactionResponse - 11, // 101: generated.EnclaveProto.StreamL2Updates:output_type -> generated.EncodedUpdateResponse - 17, // 102: generated.EnclaveProto.DebugEventLogRelevancy:output_type -> generated.DebugEventLogRelevancyResponse - 15, // 103: generated.EnclaveProto.GetTotalContractCount:output_type -> generated.GetTotalContractCountResponse - 3, // 104: generated.EnclaveProto.GetPrivateTransactions:output_type -> generated.GetReceiptsByAddressResponse - 1, // 105: generated.EnclaveProto.EnclavePublicConfig:output_type -> generated.EnclavePublicConfigResponse - 74, // [74:106] is the sub-list for method output_type - 42, // [42:74] is the sub-list for method input_type - 42, // [42:42] is the sub-list for extension type_name - 42, // [42:42] is the sub-list for extension extendee - 0, // [0:42] is the sub-list for field type_name + 13, // 28: generated.GetStorageSlotResponse.systemError:type_name -> generated.SystemError + 13, // 29: generated.GetCodeResponse.systemError:type_name -> generated.SystemError + 13, // 30: generated.SubscribeResponse.systemError:type_name -> generated.SystemError + 13, // 31: generated.UnsubscribeResponse.systemError:type_name -> generated.SystemError + 13, // 32: generated.EstimateGasResponse.systemError:type_name -> generated.SystemError + 13, // 33: generated.GetLogsResponse.systemError:type_name -> generated.SystemError + 13, // 34: generated.HealthCheckResponse.systemError:type_name -> generated.SystemError + 13, // 35: generated.AttestationReportMsg.systemError:type_name -> generated.SystemError + 78, // 36: generated.BlockSubmissionResponseMsg.producedSecretResponses:type_name -> generated.SecretResponseMsg + 72, // 37: generated.BlockSubmissionResponseMsg.error:type_name -> generated.BlockSubmissionErrorMsg + 75, // 38: generated.ExtBatchMsg.header:type_name -> generated.BatchHeaderMsg + 73, // 39: generated.BatchHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg + 77, // 40: generated.ExtRollupMsg.header:type_name -> generated.RollupHeaderMsg + 73, // 41: generated.RollupHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg + 13, // 42: generated.SecretResponseMsg.systemError:type_name -> generated.SystemError + 26, // 43: generated.EnclaveProto.Status:input_type -> generated.StatusRequest + 28, // 44: generated.EnclaveProto.Attestation:input_type -> generated.AttestationRequest + 30, // 45: generated.EnclaveProto.GenerateSecret:input_type -> generated.GenerateSecretRequest + 32, // 46: generated.EnclaveProto.InitEnclave:input_type -> generated.InitEnclaveRequest + 34, // 47: generated.EnclaveProto.EnclaveID:input_type -> generated.EnclaveIDRequest + 38, // 48: generated.EnclaveProto.SubmitL1Block:input_type -> generated.SubmitBlockRequest + 40, // 49: generated.EnclaveProto.SubmitTx:input_type -> generated.SubmitTxRequest + 42, // 50: generated.EnclaveProto.SubmitBatch:input_type -> generated.SubmitBatchRequest + 44, // 51: generated.EnclaveProto.ObsCall:input_type -> generated.ObsCallRequest + 46, // 52: generated.EnclaveProto.GetTransactionCount:input_type -> generated.GetTransactionCountRequest + 48, // 53: generated.EnclaveProto.Stop:input_type -> generated.StopRequest + 50, // 54: generated.EnclaveProto.GetTransaction:input_type -> generated.GetTransactionRequest + 52, // 55: generated.EnclaveProto.GetTransactionReceipt:input_type -> generated.GetTransactionReceiptRequest + 54, // 56: generated.EnclaveProto.GetBalance:input_type -> generated.GetBalanceRequest + 58, // 57: generated.EnclaveProto.GetCode:input_type -> generated.GetCodeRequest + 56, // 58: generated.EnclaveProto.GetStorageSlot:input_type -> generated.GetStorageSlotRequest + 60, // 59: generated.EnclaveProto.Subscribe:input_type -> generated.SubscribeRequest + 62, // 60: generated.EnclaveProto.Unsubscribe:input_type -> generated.UnsubscribeRequest + 64, // 61: generated.EnclaveProto.EstimateGas:input_type -> generated.EstimateGasRequest + 66, // 62: generated.EnclaveProto.GetLogs:input_type -> generated.GetLogsRequest + 69, // 63: generated.EnclaveProto.HealthCheck:input_type -> generated.EmptyArgs + 4, // 64: generated.EnclaveProto.GetBatch:input_type -> generated.GetBatchRequest + 5, // 65: generated.EnclaveProto.GetBatchBySeqNo:input_type -> generated.GetBatchBySeqNoRequest + 7, // 66: generated.EnclaveProto.GetRollupData:input_type -> generated.GetRollupDataRequest + 20, // 67: generated.EnclaveProto.CreateBatch:input_type -> generated.CreateBatchRequest + 22, // 68: generated.EnclaveProto.CreateRollup:input_type -> generated.CreateRollupRequest + 24, // 69: generated.EnclaveProto.ExportCrossChainData:input_type -> generated.ExportCrossChainDataRequest + 18, // 70: generated.EnclaveProto.DebugTraceTransaction:input_type -> generated.DebugTraceTransactionRequest + 10, // 71: generated.EnclaveProto.StreamL2Updates:input_type -> generated.StreamL2UpdatesRequest + 16, // 72: generated.EnclaveProto.DebugEventLogRelevancy:input_type -> generated.DebugEventLogRelevancyRequest + 14, // 73: generated.EnclaveProto.GetTotalContractCount:input_type -> generated.GetTotalContractCountRequest + 2, // 74: generated.EnclaveProto.GetReceiptsByAddress:input_type -> generated.GetReceiptsByAddressRequest + 0, // 75: generated.EnclaveProto.EnclavePublicConfig:input_type -> generated.EnclavePublicConfigRequest + 27, // 76: generated.EnclaveProto.Status:output_type -> generated.StatusResponse + 29, // 77: generated.EnclaveProto.Attestation:output_type -> generated.AttestationResponse + 31, // 78: generated.EnclaveProto.GenerateSecret:output_type -> generated.GenerateSecretResponse + 33, // 79: generated.EnclaveProto.InitEnclave:output_type -> generated.InitEnclaveResponse + 35, // 80: generated.EnclaveProto.EnclaveID:output_type -> generated.EnclaveIDResponse + 39, // 81: generated.EnclaveProto.SubmitL1Block:output_type -> generated.SubmitBlockResponse + 41, // 82: generated.EnclaveProto.SubmitTx:output_type -> generated.SubmitTxResponse + 43, // 83: generated.EnclaveProto.SubmitBatch:output_type -> generated.SubmitBatchResponse + 45, // 84: generated.EnclaveProto.ObsCall:output_type -> generated.ObsCallResponse + 47, // 85: generated.EnclaveProto.GetTransactionCount:output_type -> generated.GetTransactionCountResponse + 49, // 86: generated.EnclaveProto.Stop:output_type -> generated.StopResponse + 51, // 87: generated.EnclaveProto.GetTransaction:output_type -> generated.GetTransactionResponse + 53, // 88: generated.EnclaveProto.GetTransactionReceipt:output_type -> generated.GetTransactionReceiptResponse + 55, // 89: generated.EnclaveProto.GetBalance:output_type -> generated.GetBalanceResponse + 59, // 90: generated.EnclaveProto.GetCode:output_type -> generated.GetCodeResponse + 57, // 91: generated.EnclaveProto.GetStorageSlot:output_type -> generated.GetStorageSlotResponse + 61, // 92: generated.EnclaveProto.Subscribe:output_type -> generated.SubscribeResponse + 63, // 93: generated.EnclaveProto.Unsubscribe:output_type -> generated.UnsubscribeResponse + 65, // 94: generated.EnclaveProto.EstimateGas:output_type -> generated.EstimateGasResponse + 67, // 95: generated.EnclaveProto.GetLogs:output_type -> generated.GetLogsResponse + 68, // 96: generated.EnclaveProto.HealthCheck:output_type -> generated.HealthCheckResponse + 6, // 97: generated.EnclaveProto.GetBatch:output_type -> generated.GetBatchResponse + 6, // 98: generated.EnclaveProto.GetBatchBySeqNo:output_type -> generated.GetBatchResponse + 8, // 99: generated.EnclaveProto.GetRollupData:output_type -> generated.GetRollupDataResponse + 21, // 100: generated.EnclaveProto.CreateBatch:output_type -> generated.CreateBatchResponse + 23, // 101: generated.EnclaveProto.CreateRollup:output_type -> generated.CreateRollupResponse + 25, // 102: generated.EnclaveProto.ExportCrossChainData:output_type -> generated.ExportCrossChainDataResponse + 19, // 103: generated.EnclaveProto.DebugTraceTransaction:output_type -> generated.DebugTraceTransactionResponse + 11, // 104: generated.EnclaveProto.StreamL2Updates:output_type -> generated.EncodedUpdateResponse + 17, // 105: generated.EnclaveProto.DebugEventLogRelevancy:output_type -> generated.DebugEventLogRelevancyResponse + 15, // 106: generated.EnclaveProto.GetTotalContractCount:output_type -> generated.GetTotalContractCountResponse + 3, // 107: generated.EnclaveProto.GetReceiptsByAddress:output_type -> generated.GetReceiptsByAddressResponse + 1, // 108: generated.EnclaveProto.EnclavePublicConfig:output_type -> generated.EnclavePublicConfigResponse + 76, // [76:109] is the sub-list for method output_type + 43, // [43:76] is the sub-list for method input_type + 43, // [43:43] is the sub-list for extension type_name + 43, // [43:43] is the sub-list for extension extendee + 0, // [0:43] is the sub-list for field type_name } func init() { file_enclave_proto_init() } @@ -5807,7 +5932,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCodeRequest); i { + switch v := v.(*GetStorageSlotRequest); i { case 0: return &v.state case 1: @@ -5819,7 +5944,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCodeResponse); i { + switch v := v.(*GetStorageSlotResponse); i { case 0: return &v.state case 1: @@ -5831,7 +5956,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeRequest); i { + switch v := v.(*GetCodeRequest); i { case 0: return &v.state case 1: @@ -5843,7 +5968,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeResponse); i { + switch v := v.(*GetCodeResponse); i { case 0: return &v.state case 1: @@ -5855,7 +5980,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnsubscribeRequest); i { + switch v := v.(*SubscribeRequest); i { case 0: return &v.state case 1: @@ -5867,7 +5992,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnsubscribeResponse); i { + switch v := v.(*SubscribeResponse); i { case 0: return &v.state case 1: @@ -5879,7 +6004,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EstimateGasRequest); i { + switch v := v.(*UnsubscribeRequest); i { case 0: return &v.state case 1: @@ -5891,7 +6016,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EstimateGasResponse); i { + switch v := v.(*UnsubscribeResponse); i { case 0: return &v.state case 1: @@ -5903,7 +6028,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLogsRequest); i { + switch v := v.(*EstimateGasRequest); i { case 0: return &v.state case 1: @@ -5915,7 +6040,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLogsResponse); i { + switch v := v.(*EstimateGasResponse); i { case 0: return &v.state case 1: @@ -5927,7 +6052,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckResponse); i { + switch v := v.(*GetLogsRequest); i { case 0: return &v.state case 1: @@ -5939,7 +6064,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyArgs); i { + switch v := v.(*GetLogsResponse); i { case 0: return &v.state case 1: @@ -5951,7 +6076,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AttestationReportMsg); i { + switch v := v.(*HealthCheckResponse); i { case 0: return &v.state case 1: @@ -5963,7 +6088,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockSubmissionResponseMsg); i { + switch v := v.(*EmptyArgs); i { case 0: return &v.state case 1: @@ -5975,7 +6100,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockSubmissionErrorMsg); i { + switch v := v.(*AttestationReportMsg); i { case 0: return &v.state case 1: @@ -5987,7 +6112,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CrossChainMsg); i { + switch v := v.(*BlockSubmissionResponseMsg); i { case 0: return &v.state case 1: @@ -5999,7 +6124,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtBatchMsg); i { + switch v := v.(*BlockSubmissionErrorMsg); i { case 0: return &v.state case 1: @@ -6011,7 +6136,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BatchHeaderMsg); i { + switch v := v.(*CrossChainMsg); i { case 0: return &v.state case 1: @@ -6023,7 +6148,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtRollupMsg); i { + switch v := v.(*ExtBatchMsg); i { case 0: return &v.state case 1: @@ -6035,7 +6160,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RollupHeaderMsg); i { + switch v := v.(*BatchHeaderMsg); i { case 0: return &v.state case 1: @@ -6047,7 +6172,7 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecretResponseMsg); i { + switch v := v.(*ExtRollupMsg); i { case 0: return &v.state case 1: @@ -6059,6 +6184,30 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RollupHeaderMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_enclave_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecretResponseMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_enclave_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WithdrawalMsg); i { case 0: return &v.state @@ -6078,7 +6227,7 @@ func file_enclave_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_enclave_proto_rawDesc, NumEnums: 0, - NumMessages: 78, + NumMessages: 80, NumExtensions: 0, NumServices: 1, }, diff --git a/go/common/rpc/generated/enclave.proto b/go/common/rpc/generated/enclave.proto index 6ea5be4800..4ed20ae996 100644 --- a/go/common/rpc/generated/enclave.proto +++ b/go/common/rpc/generated/enclave.proto @@ -59,6 +59,9 @@ service EnclaveProto { // GetCode returns the code stored at the given address in the state for the given rollup height or rollup hash rpc GetCode(GetCodeRequest) returns (GetCodeResponse) {} + rpc GetStorageSlot(GetStorageSlotRequest) returns (GetStorageSlotResponse) {} + + rpc Subscribe(SubscribeRequest) returns (SubscribeResponse) {} rpc Unsubscribe(UnsubscribeRequest) returns (UnsubscribeResponse) {} @@ -320,6 +323,14 @@ message GetBalanceResponse { SystemError systemError = 2; } +message GetStorageSlotRequest { + bytes encryptedParams = 1; +} +message GetStorageSlotResponse { + bytes encodedEnclaveResponse = 1; + SystemError systemError = 2; +} + message GetCodeRequest { bytes address = 1; bytes rollupHash = 2; diff --git a/go/common/rpc/generated/enclave_grpc.pb.go b/go/common/rpc/generated/enclave_grpc.pb.go index 5dba3f31ee..748bced462 100644 --- a/go/common/rpc/generated/enclave_grpc.pb.go +++ b/go/common/rpc/generated/enclave_grpc.pb.go @@ -34,6 +34,7 @@ const ( EnclaveProto_GetTransactionReceipt_FullMethodName = "/generated.EnclaveProto/GetTransactionReceipt" EnclaveProto_GetBalance_FullMethodName = "/generated.EnclaveProto/GetBalance" EnclaveProto_GetCode_FullMethodName = "/generated.EnclaveProto/GetCode" + EnclaveProto_GetStorageSlot_FullMethodName = "/generated.EnclaveProto/GetStorageSlot" EnclaveProto_Subscribe_FullMethodName = "/generated.EnclaveProto/Subscribe" EnclaveProto_Unsubscribe_FullMethodName = "/generated.EnclaveProto/Unsubscribe" EnclaveProto_EstimateGas_FullMethodName = "/generated.EnclaveProto/EstimateGas" @@ -49,7 +50,7 @@ const ( EnclaveProto_StreamL2Updates_FullMethodName = "/generated.EnclaveProto/StreamL2Updates" EnclaveProto_DebugEventLogRelevancy_FullMethodName = "/generated.EnclaveProto/DebugEventLogRelevancy" EnclaveProto_GetTotalContractCount_FullMethodName = "/generated.EnclaveProto/GetTotalContractCount" - EnclaveProto_GetReceiptsByAddress_FullMethodName = "/generated.EnclaveProto/GetPrivateTransactions" + EnclaveProto_GetReceiptsByAddress_FullMethodName = "/generated.EnclaveProto/GetReceiptsByAddress" EnclaveProto_EnclavePublicConfig_FullMethodName = "/generated.EnclaveProto/EnclavePublicConfig" ) @@ -97,6 +98,7 @@ type EnclaveProtoClient interface { GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) // GetCode returns the code stored at the given address in the state for the given rollup height or rollup hash GetCode(ctx context.Context, in *GetCodeRequest, opts ...grpc.CallOption) (*GetCodeResponse, error) + GetStorageSlot(ctx context.Context, in *GetStorageSlotRequest, opts ...grpc.CallOption) (*GetStorageSlotResponse, error) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error) Unsubscribe(ctx context.Context, in *UnsubscribeRequest, opts ...grpc.CallOption) (*UnsubscribeResponse, error) // EstimateGas returns the estimation of gas used for the given transactions @@ -265,6 +267,15 @@ func (c *enclaveProtoClient) GetCode(ctx context.Context, in *GetCodeRequest, op return out, nil } +func (c *enclaveProtoClient) GetStorageSlot(ctx context.Context, in *GetStorageSlotRequest, opts ...grpc.CallOption) (*GetStorageSlotResponse, error) { + out := new(GetStorageSlotResponse) + err := c.cc.Invoke(ctx, EnclaveProto_GetStorageSlot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *enclaveProtoClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (*SubscribeResponse, error) { out := new(SubscribeResponse) err := c.cc.Invoke(ctx, EnclaveProto_Subscribe_FullMethodName, in, out, opts...) @@ -485,6 +496,7 @@ type EnclaveProtoServer interface { GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) // GetCode returns the code stored at the given address in the state for the given rollup height or rollup hash GetCode(context.Context, *GetCodeRequest) (*GetCodeResponse, error) + GetStorageSlot(context.Context, *GetStorageSlotRequest) (*GetStorageSlotResponse, error) Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error) Unsubscribe(context.Context, *UnsubscribeRequest) (*UnsubscribeResponse, error) // EstimateGas returns the estimation of gas used for the given transactions @@ -560,6 +572,9 @@ func (UnimplementedEnclaveProtoServer) GetBalance(context.Context, *GetBalanceRe func (UnimplementedEnclaveProtoServer) GetCode(context.Context, *GetCodeRequest) (*GetCodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCode not implemented") } +func (UnimplementedEnclaveProtoServer) GetStorageSlot(context.Context, *GetStorageSlotRequest) (*GetStorageSlotResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStorageSlot not implemented") +} func (UnimplementedEnclaveProtoServer) Subscribe(context.Context, *SubscribeRequest) (*SubscribeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Subscribe not implemented") } @@ -606,7 +621,7 @@ func (UnimplementedEnclaveProtoServer) GetTotalContractCount(context.Context, *G return nil, status.Errorf(codes.Unimplemented, "method GetTotalContractCount not implemented") } func (UnimplementedEnclaveProtoServer) GetReceiptsByAddress(context.Context, *GetReceiptsByAddressRequest) (*GetReceiptsByAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPrivateTransactions not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetReceiptsByAddress not implemented") } func (UnimplementedEnclaveProtoServer) EnclavePublicConfig(context.Context, *EnclavePublicConfigRequest) (*EnclavePublicConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EnclavePublicConfig not implemented") @@ -894,6 +909,24 @@ func _EnclaveProto_GetCode_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _EnclaveProto_GetStorageSlot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetStorageSlotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EnclaveProtoServer).GetStorageSlot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EnclaveProto_GetStorageSlot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EnclaveProtoServer).GetStorageSlot(ctx, req.(*GetStorageSlotRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _EnclaveProto_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SubscribeRequest) if err := dec(in); err != nil { @@ -1270,6 +1303,10 @@ var EnclaveProto_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCode", Handler: _EnclaveProto_GetCode_Handler, }, + { + MethodName: "GetStorageSlot", + Handler: _EnclaveProto_GetStorageSlot_Handler, + }, { MethodName: "Subscribe", Handler: _EnclaveProto_Subscribe_Handler, @@ -1327,7 +1364,7 @@ var EnclaveProto_ServiceDesc = grpc.ServiceDesc{ Handler: _EnclaveProto_GetTotalContractCount_Handler, }, { - MethodName: "GetPrivateTransactions", + MethodName: "GetReceiptsByAddress", Handler: _EnclaveProto_GetReceiptsByAddress_Handler, }, { diff --git a/go/common/types.go b/go/common/types.go index 4455dd126e..33654c3ea7 100644 --- a/go/common/types.go +++ b/go/common/types.go @@ -73,6 +73,7 @@ type ( EncryptedParamsEstimateGas []byte // As above, but for an RPC estimateGas request. EncryptedParamsGetLogs []byte // As above, but for an RPC getLogs request. EncryptedParamsGetPersonalTransactions []byte + EncryptedParamsGetStorageSlot []byte Nonce = uint64 EncodedRollup []byte diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 96f64a10d5..ea2b930956 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -698,6 +698,14 @@ func (e *enclaveImpl) GetCode(ctx context.Context, address gethcommon.Address, b return stateDB.GetCode(address), nil } +func (e *enclaveImpl) GetStorageSlot(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageSlot) (*responses.EnclaveResponse, common.SystemError) { + if e.stopControl.IsStopping() { + return nil, responses.ToInternalError(fmt.Errorf("requested GetCode with the enclave stopping")) + } + + return rpc.WithVKEncryption(ctx, e.rpcEncryptionManager, encryptedParams, rpc.TenStorageReadValidate, rpc.TenStorageReadExecute) +} + func (e *enclaveImpl) Subscribe(ctx context.Context, id gethrpc.ID, encryptedSubscription common.EncryptedParamsLogSubscription) common.SystemError { if e.stopControl.IsStopping() { return responses.ToInternalError(fmt.Errorf("requested SubscribeForExecutedBatches with the enclave stopping")) diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go new file mode 100644 index 0000000000..3cc1fc4c9d --- /dev/null +++ b/go/enclave/rpc/TenStorageRead.go @@ -0,0 +1,95 @@ +package rpc + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ten-protocol/go-ten/go/common/gethencoding" + "github.com/ten-protocol/go-ten/go/common/log" + "github.com/ten-protocol/go-ten/go/common/privacy" + "github.com/ten-protocol/go-ten/go/common/syserr" + gethrpc "github.com/ten-protocol/go-ten/lib/gethfork/rpc" +) + +type StorageReadWithBlock struct { + address common.Address + storageSlot string + block *gethrpc.BlockNumberOrHash +} + +func TenStorageReadValidate(reqParams []any, builder *CallBuilder[StorageReadWithBlock, string], _ *EncryptionManager) error { + // Parameters are [TransactionArgs, BlockNumber, 2 more which we don't support yet] + if len(reqParams) < 2 || len(reqParams) > 3 { + builder.Err = fmt.Errorf("unexpected number of parameters") + return nil + } + + addressHex, ok := reqParams[0].(string) + if !ok { + builder.Err = fmt.Errorf("address not provided in parameters") + return nil + } + + address := common.HexToAddress(addressHex) + slot, ok := reqParams[1].(string) + if !ok { + builder.Err = fmt.Errorf("storage slot not provided in parameters") + return nil + } + + //todo: @siliev - this whitelist creation every time is bugging me + whitelist := privacy.NewWhitelist() + if !whitelist.AllowedStorageSlots[slot] { + builder.Err = fmt.Errorf("storage slot not whitelisted") + return nil + } + + blkNumber, err := gethencoding.ExtractBlockNumber(reqParams[2]) + if err != nil { + builder.Err = fmt.Errorf("unable to extract requested block number - %w", err) + return nil + } + + builder.Param = &StorageReadWithBlock{address, slot, blkNumber} + + return nil +} + +func TenStorageReadExecute(builder *CallBuilder[StorageReadWithBlock, string], rpc *EncryptionManager) error { + var err error + var stateDb *state.StateDB + blkNumber := builder.Param.block + hash := blkNumber.BlockHash + if hash != nil { + stateDb, err = rpc.registry.GetBatchState(builder.ctx, hash) + } + + number := blkNumber.BlockNumber + if number != nil { + stateDb, err = rpc.registry.GetBatchStateAtHeight(builder.ctx, number) + } + if err != nil { + builder.Err = err + return nil + } + + value, err := stateDb.GetTrie().GetStorage(builder.Param.address, common.HexToHash(builder.Param.storageSlot).Bytes()) + if err != nil { + rpc.logger.Debug("Failed eth_getStorageAt.", log.ErrKey, err) + + // return system errors to the host + if errors.Is(err, syserr.InternalError{}) { + return err + } + + builder.Err = err + return nil + } + + encodedResult := hexutil.Encode(value) + builder.ReturnValue = &encodedResult + return nil +} diff --git a/go/enclave/rpc_server.go b/go/enclave/rpc_server.go index a29be9c27e..f2f0ad6a50 100644 --- a/go/enclave/rpc_server.go +++ b/go/enclave/rpc_server.go @@ -214,6 +214,15 @@ func (s *RPCServer) GetTransactionReceipt(ctx context.Context, request *generate return &generated.GetTransactionReceiptResponse{EncodedEnclaveResponse: enclaveResponse.Encode()}, nil } +func (s *RPCServer) GetStorageSlot(ctx context.Context, request *generated.GetStorageSlotRequest) (*generated.GetStorageSlotResponse, error) { + enclaveResp, sysError := s.enclave.GetStorageSlot(ctx, request.EncryptedParams) + if sysError != nil { + s.logger.Error("Error getting storage slot", log.ErrKey, sysError) + return &generated.GetStorageSlotResponse{SystemError: toRPCError(sysError)}, nil + } + return &generated.GetStorageSlotResponse{EncodedEnclaveResponse: enclaveResp.Encode()}, nil +} + func (s *RPCServer) GetBalance(ctx context.Context, request *generated.GetBalanceRequest) (*generated.GetBalanceResponse, error) { enclaveResp, sysError := s.enclave.GetBalance(ctx, request.EncryptedParams) if sysError != nil { diff --git a/go/host/rpc/clientapi/client_api_eth.go b/go/host/rpc/clientapi/client_api_eth.go index 2b721b0c7b..ded05e75e7 100644 --- a/go/host/rpc/clientapi/client_api_eth.go +++ b/go/host/rpc/clientapi/client_api_eth.go @@ -179,8 +179,12 @@ func (api *EthereumAPI) GetTransactionByHash(ctx context.Context, encryptedParam } // GetStorageAt is not currently supported (some narrow version of it may be supported in the future for proxy contracts). -func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common.EncryptedParamsGetPersonalTransactions) (*responses.Receipts, error) { - return nil, fmt.Errorf("GetStorageAt is not supported on TEN") +func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageSlot) (responses.EnclaveResponse, error) { + enclaveResponse, sysError := api.host.EnclaveClient().GetStorageSlot(ctx, encryptedParams) + if sysError != nil { + return api.handleSysError("GetStorageAt", sysError) + } + return *enclaveResponse, nil } // FeeHistory is a placeholder for an RPC method required by MetaMask/Remix. diff --git a/go/host/rpc/enclaverpc/enclave_client.go b/go/host/rpc/enclaverpc/enclave_client.go index 5c1c71e9f4..81c6f1468f 100644 --- a/go/host/rpc/enclaverpc/enclave_client.go +++ b/go/host/rpc/enclaverpc/enclave_client.go @@ -74,6 +74,22 @@ func NewClient(enclaveRPCAddress string, enclaveRPCTimeout time.Duration, logger } } +func (c *Client) GetStorageSlot(ctx context.Context, encryptedParams common.EncryptedParamsGetStorageSlot) (*responses.EnclaveResponse, common.SystemError) { + timeoutCtx, cancel := context.WithTimeout(ctx, c.enclaveRPCTimeout) + defer cancel() + + response, err := c.protoClient.GetStorageSlot(timeoutCtx, &generated.GetStorageSlotRequest{EncryptedParams: encryptedParams}) + if err != nil { + return nil, syserr.NewRPCError(err) + } + if response != nil && response.SystemError != nil { + return nil, syserr.NewInternalError(fmt.Errorf("%s", response.SystemError.ErrorString)) + } + + return responses.ToEnclaveResponse(response.EncodedEnclaveResponse), nil + +} + func (c *Client) ExportCrossChainData(ctx context.Context, from uint64, to uint64) (*common.ExtCrossChainBundle, common.SystemError) { timeoutCtx, cancel := context.WithTimeout(ctx, c.enclaveRPCTimeout) defer cancel() diff --git a/go/responses/types.go b/go/responses/types.go index 9138e44a3c..7489f6bfd9 100644 --- a/go/responses/types.go +++ b/go/responses/types.go @@ -34,6 +34,7 @@ type ( Logs = EnclaveResponse Receipts = EnclaveResponse PersonalTransactionsResponse = EnclaveResponse + StorageSlotResponse = EnclaveResponse ) // Data Types diff --git a/integration/networktest/tests/helpful/spin_up_local_network_test.go b/integration/networktest/tests/helpful/spin_up_local_network_test.go index 9e96230a50..8d562dba24 100644 --- a/integration/networktest/tests/helpful/spin_up_local_network_test.go +++ b/integration/networktest/tests/helpful/spin_up_local_network_test.go @@ -32,7 +32,7 @@ const ( // Spins up a local network with a gateway, with all processes debuggable. The network will run until the test is stopped. // Note: If you want to access the gateway frontend you need to `npm run build` its frontend with NEXT_PUBLIC_API_GATEWAY_URL=http://localhost:11180 func TestRunLocalNetwork(t *testing.T) { - networktest.TestOnlyRunsInIDE(t) + // networktest.TestOnlyRunsInIDE(t) networktest.EnsureTestLogsSetUp("local-geth-network") networkConnector, cleanUp, err := env.LocalDevNetwork(devnetwork.WithGateway()).Prepare() if err != nil { diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 6915e8950d..3a08eac348 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -11,15 +11,21 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/gethapi" + "github.com/ten-protocol/go-ten/go/common/privacy" "github.com/ten-protocol/go-ten/lib/gethfork/rpc" ) type BlockChainAPI struct { - we *Services + we *Services + storageWhitelist *privacy.Whitelist } func NewBlockChainAPI(we *Services) *BlockChainAPI { - return &BlockChainAPI{we} + whitelist := privacy.NewWhitelist() + return &BlockChainAPI{ + we: we, + storageWhitelist: whitelist, + } } func (api *BlockChainAPI) ChainId() *hexutil.Big { //nolint:stylecheck @@ -176,7 +182,21 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A } return serialised, nil default: // address was not a recognised custom query method address - return nil, fmt.Errorf("eth_getStorageAt is not supported on TEN") + if !api.storageWhitelist.AllowedStorageSlots[params] { + return nil, fmt.Errorf("eth_getStorageAt is not supported on TEN") + } + + resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{tryUntilAuthorised: true}, "eth_getStorageAt", address.Hex(), params, nil) + if err != nil { + return nil, fmt.Errorf("unable to execute custom query: %w", err) + } + // turn resp object into hexutil.Bytes + serialised, err := json.Marshal(resp) + if err != nil { + return nil, fmt.Errorf("unable to marshal response object: %w", err) + } + return serialised, nil + } } From 2b249376a88ffeb80e05908725bd133018d08e12 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Thu, 11 Jul 2024 14:40:49 +0300 Subject: [PATCH 04/11] Added more exceptions. Fixed null response. Hopefully --- go/common/privacy/whitelist.go | 14 ++++++++++++-- go/enclave/rpc/TenStorageRead.go | 5 +++++ tools/walletextension/rpcapi/blockchain_api.go | 4 ++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/go/common/privacy/whitelist.go b/go/common/privacy/whitelist.go index 2296c4c8c8..0ac9579860 100644 --- a/go/common/privacy/whitelist.go +++ b/go/common/privacy/whitelist.go @@ -13,6 +13,8 @@ type Whitelist struct { func NewWhitelist() *Whitelist { whitelistMap := make(map[string]bool) whitelistMap[toEip1967HashHex("eip1967.proxy.beacon")] = true + whitelistMap[toEip1967HashHex("eip1967.proxy.implementation")] = true + whitelistMap[toEip1967FallbackHashHex("org.zeppelinos.proxy.implementation")] = true return &Whitelist{ AllowedStorageSlots: whitelistMap, @@ -21,8 +23,16 @@ func NewWhitelist() *Whitelist { func toEip1967HashHex(key string) string { hash := crypto.Keccak256Hash([]byte(key)) - hashAsbig := hash.Big() - eipHashHex := "0x" + hashAsbig.Sub(hashAsbig, big.NewInt(1)).Text(16) + hashAsBig := hash.Big() + eipHashHex := "0x" + hashAsBig.Sub(hashAsBig, big.NewInt(1)).Text(16) + + return eipHashHex +} + +func toEip1967FallbackHashHex(key string) string { + hash := crypto.Keccak256Hash([]byte(key)) + hashAsBig := hash.Big() + eipHashHex := "0x" + hashAsBig.Text(16) return eipHashHex } diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go index 3cc1fc4c9d..dfd6181148 100644 --- a/go/enclave/rpc/TenStorageRead.go +++ b/go/enclave/rpc/TenStorageRead.go @@ -89,6 +89,11 @@ func TenStorageReadExecute(builder *CallBuilder[StorageReadWithBlock, string], r return nil } + if len(value) == 0 { + builder.ReturnValue = nil + return nil + } + encodedResult := hexutil.Encode(value) builder.ReturnValue = &encodedResult return nil diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 3a08eac348..49cf6d38e5 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -190,6 +190,10 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A if err != nil { return nil, fmt.Errorf("unable to execute custom query: %w", err) } + if resp == nil { + return nil, nil + } + // turn resp object into hexutil.Bytes serialised, err := json.Marshal(resp) if err != nil { From 1f831edbb0db0f9e6dad6dc6c3db6e89c9130850 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Thu, 11 Jul 2024 15:25:54 +0300 Subject: [PATCH 05/11] Working proxy deployment. --- go/common/privacy/whitelist.go | 2 ++ go/enclave/rpc/TenStorageRead.go | 20 ++++++++++++++++++- .../walletextension/rpcapi/blockchain_api.go | 11 +++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/go/common/privacy/whitelist.go b/go/common/privacy/whitelist.go index 0ac9579860..e48fcee45e 100644 --- a/go/common/privacy/whitelist.go +++ b/go/common/privacy/whitelist.go @@ -15,6 +15,8 @@ func NewWhitelist() *Whitelist { whitelistMap[toEip1967HashHex("eip1967.proxy.beacon")] = true whitelistMap[toEip1967HashHex("eip1967.proxy.implementation")] = true whitelistMap[toEip1967FallbackHashHex("org.zeppelinos.proxy.implementation")] = true + whitelistMap[toEip1967HashHex("eip1967.proxy.admin")] = true + whitelistMap[toEip1967FallbackHashHex("org.zeppelinos.proxy.admin")] = true return &Whitelist{ AllowedStorageSlots: whitelistMap, diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go index dfd6181148..fd0cc05050 100644 --- a/go/enclave/rpc/TenStorageRead.go +++ b/go/enclave/rpc/TenStorageRead.go @@ -76,7 +76,25 @@ func TenStorageReadExecute(builder *CallBuilder[StorageReadWithBlock, string], r return nil } - value, err := stateDb.GetTrie().GetStorage(builder.Param.address, common.HexToHash(builder.Param.storageSlot).Bytes()) + storageSlot, err := common.ParseHexOrString(builder.Param.storageSlot) + if err != nil { + builder.Err = err + return nil + } + + account, err := stateDb.GetTrie().GetAccount(builder.Param.address) + if err != nil { + builder.Err = err + return nil + } + + trie, err := stateDb.Database().OpenTrie(account.Root) + if err != nil { + builder.Err = err + return nil + } + + value, err := trie.GetStorage(builder.Param.address, storageSlot) if err != nil { rpc.logger.Debug("Failed eth_getStorageAt.", log.ErrKey, err) diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 49cf6d38e5..94f7dcda99 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -194,13 +194,12 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A return nil, nil } - // turn resp object into hexutil.Bytes - serialised, err := json.Marshal(resp) - if err != nil { - return nil, fmt.Errorf("unable to marshal response object: %w", err) + respHex, ok := (*resp).(string) + if !ok { + return nil, fmt.Errorf("unable to decode response") } - return serialised, nil - + // turn resp object into hexutil.Bytes + return hexutil.MustDecode(respHex), nil } } From 2da9c402fd8ee866d1fabdd0cf4077ce7cf47457 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Fri, 12 Jul 2024 15:16:14 +0300 Subject: [PATCH 06/11] Fix for linter and build gate. Some comments. --- go/enclave/rpc/TenStorageRead.go | 11 +++++------ go/host/rpc/enclaverpc/enclave_client.go | 1 - .../tests/helpful/spin_up_local_network_test.go | 2 +- tools/walletextension/rpcapi/blockchain_api.go | 4 ---- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go index fd0cc05050..87613e0e98 100644 --- a/go/enclave/rpc/TenStorageRead.go +++ b/go/enclave/rpc/TenStorageRead.go @@ -14,14 +14,13 @@ import ( gethrpc "github.com/ten-protocol/go-ten/lib/gethfork/rpc" ) -type StorageReadWithBlock struct { +type storageReadWithBlock struct { address common.Address storageSlot string block *gethrpc.BlockNumberOrHash } -func TenStorageReadValidate(reqParams []any, builder *CallBuilder[StorageReadWithBlock, string], _ *EncryptionManager) error { - // Parameters are [TransactionArgs, BlockNumber, 2 more which we don't support yet] +func TenStorageReadValidate(reqParams []any, builder *CallBuilder[storageReadWithBlock, string], _ *EncryptionManager) error { if len(reqParams) < 2 || len(reqParams) > 3 { builder.Err = fmt.Errorf("unexpected number of parameters") return nil @@ -43,7 +42,7 @@ func TenStorageReadValidate(reqParams []any, builder *CallBuilder[StorageReadWit //todo: @siliev - this whitelist creation every time is bugging me whitelist := privacy.NewWhitelist() if !whitelist.AllowedStorageSlots[slot] { - builder.Err = fmt.Errorf("storage slot not whitelisted") + builder.Err = fmt.Errorf("eth_getStorageAt is not supported on TEN") return nil } @@ -53,12 +52,12 @@ func TenStorageReadValidate(reqParams []any, builder *CallBuilder[StorageReadWit return nil } - builder.Param = &StorageReadWithBlock{address, slot, blkNumber} + builder.Param = &storageReadWithBlock{address, slot, blkNumber} return nil } -func TenStorageReadExecute(builder *CallBuilder[StorageReadWithBlock, string], rpc *EncryptionManager) error { +func TenStorageReadExecute(builder *CallBuilder[storageReadWithBlock, string], rpc *EncryptionManager) error { var err error var stateDb *state.StateDB blkNumber := builder.Param.block diff --git a/go/host/rpc/enclaverpc/enclave_client.go b/go/host/rpc/enclaverpc/enclave_client.go index 81c6f1468f..cef24fb274 100644 --- a/go/host/rpc/enclaverpc/enclave_client.go +++ b/go/host/rpc/enclaverpc/enclave_client.go @@ -87,7 +87,6 @@ func (c *Client) GetStorageSlot(ctx context.Context, encryptedParams common.Encr } return responses.ToEnclaveResponse(response.EncodedEnclaveResponse), nil - } func (c *Client) ExportCrossChainData(ctx context.Context, from uint64, to uint64) (*common.ExtCrossChainBundle, common.SystemError) { diff --git a/integration/networktest/tests/helpful/spin_up_local_network_test.go b/integration/networktest/tests/helpful/spin_up_local_network_test.go index 8d562dba24..9e96230a50 100644 --- a/integration/networktest/tests/helpful/spin_up_local_network_test.go +++ b/integration/networktest/tests/helpful/spin_up_local_network_test.go @@ -32,7 +32,7 @@ const ( // Spins up a local network with a gateway, with all processes debuggable. The network will run until the test is stopped. // Note: If you want to access the gateway frontend you need to `npm run build` its frontend with NEXT_PUBLIC_API_GATEWAY_URL=http://localhost:11180 func TestRunLocalNetwork(t *testing.T) { - // networktest.TestOnlyRunsInIDE(t) + networktest.TestOnlyRunsInIDE(t) networktest.EnsureTestLogsSetUp("local-geth-network") networkConnector, cleanUp, err := env.LocalDevNetwork(devnetwork.WithGateway()).Prepare() if err != nil { diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 94f7dcda99..4648b58fe6 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -182,10 +182,6 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A } return serialised, nil default: // address was not a recognised custom query method address - if !api.storageWhitelist.AllowedStorageSlots[params] { - return nil, fmt.Errorf("eth_getStorageAt is not supported on TEN") - } - resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{tryUntilAuthorised: true}, "eth_getStorageAt", address.Hex(), params, nil) if err != nil { return nil, fmt.Errorf("unable to execute custom query: %w", err) From fcd276731778db910355c94a6680fe75725d0707 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Mon, 15 Jul 2024 15:19:44 +0300 Subject: [PATCH 07/11] dumping progress. --- tools/walletextension/rpcapi/blockchain_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 4648b58fe6..714bf8c475 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -184,7 +184,7 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A default: // address was not a recognised custom query method address resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{tryUntilAuthorised: true}, "eth_getStorageAt", address.Hex(), params, nil) if err != nil { - return nil, fmt.Errorf("unable to execute custom query: %w", err) + return nil, fmt.Errorf("unable to execute eth_getStorageAt: %w", err) } if resp == nil { return nil, nil From 1e7368bf501ee478a454c0723a55522d5a0c468b Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Tue, 16 Jul 2024 12:40:52 +0300 Subject: [PATCH 08/11] Fix for test. --- integration/obscurogateway/tengateway_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integration/obscurogateway/tengateway_test.go b/integration/obscurogateway/tengateway_test.go index 72f25c9b56..f411d35a4b 100644 --- a/integration/obscurogateway/tengateway_test.go +++ b/integration/obscurogateway/tengateway_test.go @@ -737,6 +737,12 @@ func testGetStorageAtForReturningUserID(t *testing.T, httpURL, wsURL string, w w t.Error("eth_getStorageAt did not respond with not found error") } + err = user.RegisterAccounts() + if err != nil { + t.Errorf("Failed to register accounts: %s", err) + return + } + // make a request to GetStorageAt with wrong parameters to get userID, but correct userID respBody3 := makeHTTPEthJSONReq(httpURL, tenrpc.GetStorageAt, user.tgClient.UserID(), []interface{}{"0x0000000000000000000000000000000000000007", "0", nil}) expectedErr := "not supported" From 922d31da95182c83ad24ce9bb8cf34bf55065c3a Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Tue, 16 Jul 2024 13:20:50 +0300 Subject: [PATCH 09/11] PR review comments. --- go/enclave/rpc/TenStorageRead.go | 13 ++++++------- tools/walletextension/rpcapi/blockchain_api.go | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go index 87613e0e98..8287d2ef85 100644 --- a/go/enclave/rpc/TenStorageRead.go +++ b/go/enclave/rpc/TenStorageRead.go @@ -15,7 +15,7 @@ import ( ) type storageReadWithBlock struct { - address common.Address + address *common.Address storageSlot string block *gethrpc.BlockNumberOrHash } @@ -26,13 +26,12 @@ func TenStorageReadValidate(reqParams []any, builder *CallBuilder[storageReadWit return nil } - addressHex, ok := reqParams[0].(string) - if !ok { - builder.Err = fmt.Errorf("address not provided in parameters") + address, err := gethencoding.ExtractAddress(reqParams[0]) + if err != nil { + builder.Err = fmt.Errorf("error extracting address - %w", err) return nil } - address := common.HexToAddress(addressHex) slot, ok := reqParams[1].(string) if !ok { builder.Err = fmt.Errorf("storage slot not provided in parameters") @@ -81,7 +80,7 @@ func TenStorageReadExecute(builder *CallBuilder[storageReadWithBlock, string], r return nil } - account, err := stateDb.GetTrie().GetAccount(builder.Param.address) + account, err := stateDb.GetTrie().GetAccount(*builder.Param.address) if err != nil { builder.Err = err return nil @@ -93,7 +92,7 @@ func TenStorageReadExecute(builder *CallBuilder[storageReadWithBlock, string], r return nil } - value, err := trie.GetStorage(builder.Param.address, storageSlot) + value, err := trie.GetStorage(*builder.Param.address, storageSlot) if err != nil { rpc.logger.Debug("Failed eth_getStorageAt.", log.ErrKey, err) diff --git a/tools/walletextension/rpcapi/blockchain_api.go b/tools/walletextension/rpcapi/blockchain_api.go index 5b41b17efb..aeb6a01ed9 100644 --- a/tools/walletextension/rpcapi/blockchain_api.go +++ b/tools/walletextension/rpcapi/blockchain_api.go @@ -182,7 +182,7 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address gethcommon.A } return serialised, nil default: // address was not a recognised custom query method address - resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{tryUntilAuthorised: true}, "eth_getStorageAt", address.Hex(), params, nil) + resp, err := ExecAuthRPC[any](ctx, api.we, &ExecCfg{tryUntilAuthorised: true}, "eth_getStorageAt", address, params, nil) if err != nil { return nil, fmt.Errorf("unable to execute eth_getStorageAt: %w", err) } From aae31288d38b001b0b63309a92d3ad79a19e8908 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Tue, 16 Jul 2024 13:43:48 +0300 Subject: [PATCH 10/11] Addressed remaining PR comments. --- go/enclave/rpc/TenStorageRead.go | 6 ++---- go/enclave/rpc/rpc_encryption_manager.go | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go index 8287d2ef85..423d82f4e7 100644 --- a/go/enclave/rpc/TenStorageRead.go +++ b/go/enclave/rpc/TenStorageRead.go @@ -9,7 +9,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ten-protocol/go-ten/go/common/gethencoding" "github.com/ten-protocol/go-ten/go/common/log" - "github.com/ten-protocol/go-ten/go/common/privacy" "github.com/ten-protocol/go-ten/go/common/syserr" gethrpc "github.com/ten-protocol/go-ten/lib/gethfork/rpc" ) @@ -20,7 +19,7 @@ type storageReadWithBlock struct { block *gethrpc.BlockNumberOrHash } -func TenStorageReadValidate(reqParams []any, builder *CallBuilder[storageReadWithBlock, string], _ *EncryptionManager) error { +func TenStorageReadValidate(reqParams []any, builder *CallBuilder[storageReadWithBlock, string], rpc *EncryptionManager) error { if len(reqParams) < 2 || len(reqParams) > 3 { builder.Err = fmt.Errorf("unexpected number of parameters") return nil @@ -39,8 +38,7 @@ func TenStorageReadValidate(reqParams []any, builder *CallBuilder[storageReadWit } //todo: @siliev - this whitelist creation every time is bugging me - whitelist := privacy.NewWhitelist() - if !whitelist.AllowedStorageSlots[slot] { + if !rpc.whitelist.AllowedStorageSlots[slot] { builder.Err = fmt.Errorf("eth_getStorageAt is not supported on TEN") return nil } diff --git a/go/enclave/rpc/rpc_encryption_manager.go b/go/enclave/rpc/rpc_encryption_manager.go index a974a9389f..2c94d76a99 100644 --- a/go/enclave/rpc/rpc_encryption_manager.go +++ b/go/enclave/rpc/rpc_encryption_manager.go @@ -3,6 +3,7 @@ package rpc import ( "fmt" + "github.com/ten-protocol/go-ten/go/common/privacy" "github.com/ten-protocol/go-ten/go/config" "github.com/ten-protocol/go-ten/go/enclave/gas" @@ -29,6 +30,7 @@ type EncryptionManager struct { l1BlockProcessor components.L1BlockProcessor config *config.EnclaveConfig logger gethlog.Logger + whitelist *privacy.Whitelist } func NewEncryptionManager(enclavePrivateKeyECIES *ecies.PrivateKey, storage storage.Storage, registry components.BatchRegistry, processors *crosschain.Processors, service nodetype.NodeType, config *config.EnclaveConfig, oracle gas.Oracle, blockResolver storage.BlockResolver, l1BlockProcessor components.L1BlockProcessor, chain l2chain.ObscuroChain, logger gethlog.Logger) *EncryptionManager { @@ -44,6 +46,7 @@ func NewEncryptionManager(enclavePrivateKeyECIES *ecies.PrivateKey, storage stor gasOracle: oracle, logger: logger, enclavePrivateKeyECIES: enclavePrivateKeyECIES, + whitelist: privacy.NewWhitelist(), } } From 43f9cb9b3f5b260f3121cc8c5a31e47fe0ba78c3 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Tue, 16 Jul 2024 13:44:03 +0300 Subject: [PATCH 11/11] Removed old comment. --- go/enclave/rpc/TenStorageRead.go | 1 - 1 file changed, 1 deletion(-) diff --git a/go/enclave/rpc/TenStorageRead.go b/go/enclave/rpc/TenStorageRead.go index 423d82f4e7..0de76e6470 100644 --- a/go/enclave/rpc/TenStorageRead.go +++ b/go/enclave/rpc/TenStorageRead.go @@ -37,7 +37,6 @@ func TenStorageReadValidate(reqParams []any, builder *CallBuilder[storageReadWit return nil } - //todo: @siliev - this whitelist creation every time is bugging me if !rpc.whitelist.AllowedStorageSlots[slot] { builder.Err = fmt.Errorf("eth_getStorageAt is not supported on TEN") return nil