From 09bfa2f8e0876b33338ae44bf457779b27fcfc30 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Tue, 7 Jan 2025 14:16:35 +0200 Subject: [PATCH 01/10] remove dead code (#2238) --- go/enclave/nodetype/sequencer.go | 12 ++---------- go/enclave/storage/interfaces.go | 4 ---- go/enclave/storage/storage.go | 9 --------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/go/enclave/nodetype/sequencer.go b/go/enclave/nodetype/sequencer.go index 7c32d6416..182840eb2 100644 --- a/go/enclave/nodetype/sequencer.go +++ b/go/enclave/nodetype/sequencer.go @@ -414,16 +414,8 @@ func (s *sequencer) OnL1Fork(ctx context.Context, fork *common.ChainFork) error return fmt.Errorf("could not duplicate batches. Cause %w", err) } - rollup, err := s.storage.FetchReorgedRollup(ctx, fork.NonCanonicalPath) - if err == nil { - s.logger.Error("Reissue rollup", log.RollupHashKey, rollup) - // todo - tudor - finalise the logic to reissue a rollup when the block used for compression was reorged - return nil - } - if !errors.Is(err, errutil.ErrNotFound) { - return fmt.Errorf("could not call FetchReorgedRollup. Cause: %w", err) - } - + // note: there is no need to do anything about Rollups that were published against re-orged blocks + // because the state machine in the host will detect that case return nil } diff --git a/go/enclave/storage/interfaces.go b/go/enclave/storage/interfaces.go index 9b641de17..6c2ba7e2b 100644 --- a/go/enclave/storage/interfaces.go +++ b/go/enclave/storage/interfaces.go @@ -32,10 +32,6 @@ type BlockResolver interface { StoreBlock(ctx context.Context, block *types.Header, fork *common.ChainFork) error // IsAncestor returns true if maybeAncestor is an ancestor of the L1 BlockHeader, and false otherwise IsAncestor(ctx context.Context, block *types.Header, maybeAncestor *types.Header) bool - // IsBlockAncestor returns true if maybeAncestor is an ancestor of the L1 BlockHeader, and false otherwise - // Takes into consideration that the BlockHeader to verify might be on a branch we haven't received yet - // todo (low priority) - this is super confusing, analyze the usage - IsBlockAncestor(ctx context.Context, block *types.Header, maybeAncestor common.L1BlockHash) bool } type BatchResolver interface { diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index fbefa4730..be875cb95 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -388,15 +388,6 @@ func (s *storageImpl) IsAncestor(ctx context.Context, block *types.Header, maybe return s.IsAncestor(ctx, p, maybeAncestor) } -func (s *storageImpl) IsBlockAncestor(ctx context.Context, block *types.Header, maybeAncestor common.L1BlockHash) bool { - defer s.logDuration("IsBlockAncestor", measure.NewStopwatch()) - resolvedBlock, err := s.FetchBlock(ctx, maybeAncestor) - if err != nil { - return false - } - return s.IsAncestor(ctx, block, resolvedBlock) -} - func (s *storageImpl) HealthCheck(ctx context.Context) (bool, error) { defer s.logDuration("HealthCheck", measure.NewStopwatch()) seqNo, err := s.FetchCurrentSequencerNo(ctx) From 62ecfaa82529c5a03e4c36742bd2dd3cb918512c Mon Sep 17 00:00:00 2001 From: badgersrus <43809877+badgersrus@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:43:05 +0100 Subject: [PATCH 02/10] Remove message bus owner key (#2241) * remove owner key from message bus manager --- go/enclave/crosschain/interfaces.go | 9 --- go/enclave/crosschain/message_bus_manager.go | 60 +------------------- go/enclave/crosschain/processors.go | 4 +- go/enclave/enclave.go | 2 +- go/enclave/rpc/SubmitTx.go | 5 -- 5 files changed, 5 insertions(+), 75 deletions(-) diff --git a/go/enclave/crosschain/interfaces.go b/go/enclave/crosschain/interfaces.go index 6876bbc8a..ee6b43207 100644 --- a/go/enclave/crosschain/interfaces.go +++ b/go/enclave/crosschain/interfaces.go @@ -31,21 +31,12 @@ type BlockMessageExtractor interface { } type Manager interface { - // IsSyntheticTransaction - Determines if a given L2 transaction is coming from the synthetic owner address. - IsSyntheticTransaction(transaction *common.L2Tx) bool - - // GetOwner - Returns the address of the identity owning the message bus. - GetOwner() common.L2Address - // GetBusAddress - Returns the L2 address of the message bus contract. GetBusAddress() *common.L2Address // Initialize - Derives the address of the message bus contract. Initialize(systemAddresses common.SystemContractAddresses) error - // GenerateMessageBusDeployTx - Returns a signed message bus deployment transaction. - GenerateMessageBusDeployTx() (*common.L2Tx, error) - // ExtractOutboundMessages - Finds relevant logs in the receipts and converts them to cross chain messages. ExtractOutboundMessages(ctx context.Context, receipts common.L2Receipts) (common.CrossChainMessages, error) diff --git a/go/enclave/crosschain/message_bus_manager.go b/go/enclave/crosschain/message_bus_manager.go index 2ecae0b39..8baafa753 100644 --- a/go/enclave/crosschain/message_bus_manager.go +++ b/go/enclave/crosschain/message_bus_manager.go @@ -9,75 +9,43 @@ import ( "github.com/ethereum/go-ethereum/core/tracing" "github.com/holiman/uint256" - "github.com/ten-protocol/go-ten/go/enclave/core" - "github.com/ten-protocol/go-ten/go/enclave/storage" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" gethlog "github.com/ethereum/go-ethereum/log" - "github.com/ten-protocol/go-ten/contracts/generated/MessageBus" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/log" - "github.com/ten-protocol/go-ten/go/wallet" -) - -// todo (#1549) - implement with cryptography epic -const ( // DO NOT USE OR CHANGE THIS KEY IN THE REST OF THE CODEBASE - ownerKeyHex = "6e384a07a01263518a18a5424c7b6bbfc3604ba7d93f47e3a455cbdd7f9f0682" ) type MessageBusManager struct { messageBusAddress *gethcommon.Address storage storage.Storage logger gethlog.Logger - wallet wallet.Wallet } -func NewObscuroMessageBusManager( - storage storage.Storage, /*key *ecdsa.PrivateKey,*/ - chainID *big.Int, +func NewTenMessageBusManager( + storage storage.Storage, logger gethlog.Logger, ) Manager { // todo (#1549) - implement with cryptography epic, remove this key and use the DeriveKey - key, _ := crypto.HexToECDSA(ownerKeyHex) logger = logger.New(log.CmpKey, log.CrossChainCmp) - wallet := wallet.NewInMemoryWalletFromPK(chainID, key, logger) - - logger.Info(fmt.Sprintf("L2 Cross Chain Owner Address: %s", wallet.Address().Hex())) return &MessageBusManager{ messageBusAddress: nil, storage: storage, logger: logger, - wallet: wallet, } } -func (m *MessageBusManager) IsSyntheticTransaction(transaction *common.L2Tx) bool { - sender, err := core.GetExternalTxSigner(transaction) - if err != nil { - return false - } - // The message bus manager considers the transaction synthetic only if the sender is - // the owner identity which should be available only to enclaves. - return bytes.Equal(sender.Bytes(), m.GetOwner().Bytes()) -} - -// GetOwner - Returns the address of the identity owning the message bus. -func (m *MessageBusManager) GetOwner() common.L2Address { - return m.wallet.Address() -} - // GetBusAddress - Returns the L2 address of the message bus contract. // todo - figure out how to expose the deployed contract to the external world. Perhaps extract event from contract construction? func (m *MessageBusManager) GetBusAddress() *common.L2Address { return m.messageBusAddress } -// DeriveMessageBusAddress - Derives the address of the message bus contract. +// Initialize - Derives the address of the message bus contract. func (m *MessageBusManager) Initialize(systemAddresses common.SystemContractAddresses) error { address, ok := systemAddresses["MessageBus"] if !ok { @@ -88,28 +56,6 @@ func (m *MessageBusManager) Initialize(systemAddresses common.SystemContractAddr return nil } -// GenerateMessageBusDeployTx - Returns a signed message bus deployment transaction. -func (m *MessageBusManager) GenerateMessageBusDeployTx() (*common.L2Tx, error) { - tx := &types.LegacyTx{ - Nonce: 0, // The first transaction of the owner identity should always be deploying the contract - Value: gethcommon.Big0, - Gas: 5_000_000, // It's quite the expensive contract. - GasPrice: gethcommon.Big0, // Synthetic transactions are on the house. Or the house. - Data: gethcommon.FromHex(MessageBus.MessageBusMetaData.Bin), - To: nil, // Geth requires nil instead of gethcommon.Address{} which equates to zero address in order to return receipt. - } - - stx, err := m.wallet.SignTransaction(tx) - if err != nil { - return nil, err - } - - m.logger.Trace(fmt.Sprintf("Generated synthetic deployment transaction for the MessageBus contract %s - TX HASH: %s", m.messageBusAddress.Hex(), stx.Hash().Hex()), - log.CmpKey, log.CrossChainCmp) - - return stx, nil -} - // ExtractOutboundMessages - Finds relevant logs in the receipts and converts them to cross chain messages. func (m *MessageBusManager) ExtractOutboundMessages(ctx context.Context, receipts common.L2Receipts) (common.CrossChainMessages, error) { logs, err := filterLogsFromReceipts(receipts, m.messageBusAddress, &CrossChainEventID) diff --git a/go/enclave/crosschain/processors.go b/go/enclave/crosschain/processors.go index 697e99186..ca43e2ec8 100644 --- a/go/enclave/crosschain/processors.go +++ b/go/enclave/crosschain/processors.go @@ -2,7 +2,6 @@ package crosschain import ( "fmt" - "math/big" "github.com/ten-protocol/go-ten/go/common" @@ -22,11 +21,10 @@ type Processors struct { func New( l1BusAddress *gethcommon.Address, storage storage.Storage, - chainID *big.Int, logger gethlog.Logger, ) *Processors { processors := Processors{} - processors.Local = NewObscuroMessageBusManager(storage, chainID, logger) + processors.Local = NewTenMessageBusManager(storage, logger) processors.Remote = NewBlockMessageExtractor(l1BusAddress, storage, logger) return &processors } diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index ccd8625e9..c7e4178a1 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -82,7 +82,7 @@ func NewEnclave(config *enclaveconfig.EnclaveConfig, genesis *genesis.Genesis, m daEncryptionService := crypto.NewDAEncryptionService(sharedSecretService, logger) rpcKeyService := crypto.NewRPCKeyService(sharedSecretService, logger) - crossChainProcessors := crosschain.New(&config.MessageBusAddress, storage, big.NewInt(config.TenChainID), logger) + crossChainProcessors := crosschain.New(&config.MessageBusAddress, storage, logger) // initialise system contracts scb := system.NewSystemContractCallbacks(storage, &config.SystemContractOwner, logger) diff --git a/go/enclave/rpc/SubmitTx.go b/go/enclave/rpc/SubmitTx.go index 6a1974d1c..7114ec0cd 100644 --- a/go/enclave/rpc/SubmitTx.go +++ b/go/enclave/rpc/SubmitTx.go @@ -24,11 +24,6 @@ func SubmitTxValidate(reqParams []any, builder *CallBuilder[common.L2Tx, gethcom } func SubmitTxExecute(builder *CallBuilder[common.L2Tx, gethcommon.Hash], rpc *EncryptionManager) error { - if rpc.processors.Local.IsSyntheticTransaction(builder.Param) { - builder.Err = fmt.Errorf("synthetic transaction coming from external rpc") - return nil - } - if err := rpc.mempool.SubmitTx(builder.Param); err != nil { rpc.logger.Debug("Could not submit transaction", log.TxKey, builder.Param.Hash(), log.ErrKey, err) builder.Err = err From c01b5913348e28cb50d479700d777bcb01e735d9 Mon Sep 17 00:00:00 2001 From: Matt <98158711+BedrockSquirrel@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:10:36 +0000 Subject: [PATCH 03/10] Sequencer: require L1-permissioned enlave ID (#2233) --- go/common/enclave.go | 3 - go/common/l1_transaction.go | 2 + go/common/rpc/generated/enclave.pb.go | 1494 ++++++++--------- go/common/rpc/generated/enclave.proto | 9 - go/common/rpc/generated/enclave_grpc.pb.go | 167 +- go/enclave/config/config.go | 4 - go/enclave/enclave.go | 8 - go/enclave/enclave_admin_service.go | 44 +- go/enclave/rpc_server.go | 10 - go/enclave/storage/storage.go | 21 +- go/host/enclave/guardian.go | 18 +- go/host/enclave/service.go | 54 +- go/host/host.go | 3 +- go/host/l1/dataservice.go | 8 +- go/host/rpc/enclaverpc/enclave_client.go | 22 - integration/common/constants.go | 2 - integration/ethereummock/mgmt_contract_lib.go | 14 +- integration/ethereummock/node.go | 14 + .../simulation/devnetwork/dev_network.go | 18 +- integration/simulation/devnetwork/node.go | 6 - integration/simulation/network/inmemory.go | 26 + .../simulation/network/network_utils.go | 1 - integration/simulation/network/socket.go | 54 +- .../simulation/p2p/in_mem_ten_client.go | 17 +- 24 files changed, 916 insertions(+), 1103 deletions(-) diff --git a/go/common/enclave.go b/go/common/enclave.go index 32ab062f7..2cb340fd4 100644 --- a/go/common/enclave.go +++ b/go/common/enclave.go @@ -64,9 +64,6 @@ type EnclaveInit interface { // EnclaveAdmin provides administrative functions for managing an enclave. type EnclaveAdmin interface { - // AddSequencer - called by the host when a new sequencer is added to the management contract - AddSequencer(id EnclaveID, proof types.Receipt) SystemError - // MakeActive - backup sequencer enclave can become active at the command of the host MakeActive() SystemError diff --git a/go/common/l1_transaction.go b/go/common/l1_transaction.go index b11f934ce..c44066b79 100644 --- a/go/common/l1_transaction.go +++ b/go/common/l1_transaction.go @@ -49,6 +49,8 @@ type L1InitializeSecretTx struct { Attestation EncodedAttestationReport } +type L1PermissionSeqTx struct{} + // The following types and structs are used for processing the l1 blocks and categorising the transactions to be processed // by the enclave. diff --git a/go/common/rpc/generated/enclave.pb.go b/go/common/rpc/generated/enclave.pb.go index 8eeba5812..8ede44855 100644 --- a/go/common/rpc/generated/enclave.pb.go +++ b/go/common/rpc/generated/enclave.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc-gen-go v1.28.0 +// protoc v4.24.3 // source: enclave.proto package generated @@ -1333,108 +1333,6 @@ func (x *MakeActiveResponse) GetSystemError() *SystemError { return nil } -type AddSequencerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EnclaveId []byte `protobuf:"bytes,1,opt,name=enclaveId,proto3" json:"enclaveId,omitempty"` - Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (x *AddSequencerRequest) Reset() { - *x = AddSequencerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddSequencerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddSequencerRequest) ProtoMessage() {} - -func (x *AddSequencerRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[26] - 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 AddSequencerRequest.ProtoReflect.Descriptor instead. -func (*AddSequencerRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{26} -} - -func (x *AddSequencerRequest) GetEnclaveId() []byte { - if x != nil { - return x.EnclaveId - } - return nil -} - -func (x *AddSequencerRequest) GetProof() []byte { - if x != nil { - return x.Proof - } - return nil -} - -type AddSequencerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SystemError *SystemError `protobuf:"bytes,2,opt,name=systemError,proto3" json:"systemError,omitempty"` -} - -func (x *AddSequencerResponse) Reset() { - *x = AddSequencerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddSequencerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddSequencerResponse) ProtoMessage() {} - -func (x *AddSequencerResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[27] - 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 AddSequencerResponse.ProtoReflect.Descriptor instead. -func (*AddSequencerResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{27} -} - -func (x *AddSequencerResponse) GetSystemError() *SystemError { - if x != nil { - return x.SystemError - } - return nil -} - type AttestationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1444,7 +1342,7 @@ type AttestationRequest struct { func (x *AttestationRequest) Reset() { *x = AttestationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[28] + mi := &file_enclave_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1457,7 +1355,7 @@ func (x *AttestationRequest) String() string { func (*AttestationRequest) ProtoMessage() {} func (x *AttestationRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[28] + mi := &file_enclave_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1470,7 +1368,7 @@ func (x *AttestationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationRequest.ProtoReflect.Descriptor instead. func (*AttestationRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{28} + return file_enclave_proto_rawDescGZIP(), []int{26} } type AttestationResponse struct { @@ -1485,7 +1383,7 @@ type AttestationResponse struct { func (x *AttestationResponse) Reset() { *x = AttestationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[29] + mi := &file_enclave_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1498,7 +1396,7 @@ func (x *AttestationResponse) String() string { func (*AttestationResponse) ProtoMessage() {} func (x *AttestationResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[29] + mi := &file_enclave_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1511,7 +1409,7 @@ func (x *AttestationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationResponse.ProtoReflect.Descriptor instead. func (*AttestationResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{29} + return file_enclave_proto_rawDescGZIP(), []int{27} } func (x *AttestationResponse) GetAttestationReportMsg() *AttestationReportMsg { @@ -1537,7 +1435,7 @@ type GenerateSecretRequest struct { func (x *GenerateSecretRequest) Reset() { *x = GenerateSecretRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[30] + mi := &file_enclave_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1550,7 +1448,7 @@ func (x *GenerateSecretRequest) String() string { func (*GenerateSecretRequest) ProtoMessage() {} func (x *GenerateSecretRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[30] + mi := &file_enclave_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1563,7 +1461,7 @@ func (x *GenerateSecretRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GenerateSecretRequest.ProtoReflect.Descriptor instead. func (*GenerateSecretRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{30} + return file_enclave_proto_rawDescGZIP(), []int{28} } type GenerateSecretResponse struct { @@ -1578,7 +1476,7 @@ type GenerateSecretResponse struct { func (x *GenerateSecretResponse) Reset() { *x = GenerateSecretResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[31] + mi := &file_enclave_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1591,7 +1489,7 @@ func (x *GenerateSecretResponse) String() string { func (*GenerateSecretResponse) ProtoMessage() {} func (x *GenerateSecretResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[31] + mi := &file_enclave_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1604,7 +1502,7 @@ func (x *GenerateSecretResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GenerateSecretResponse.ProtoReflect.Descriptor instead. func (*GenerateSecretResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{31} + return file_enclave_proto_rawDescGZIP(), []int{29} } func (x *GenerateSecretResponse) GetEncryptedSharedEnclaveSecret() []byte { @@ -1632,7 +1530,7 @@ type InitEnclaveRequest struct { func (x *InitEnclaveRequest) Reset() { *x = InitEnclaveRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[32] + mi := &file_enclave_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1645,7 +1543,7 @@ func (x *InitEnclaveRequest) String() string { func (*InitEnclaveRequest) ProtoMessage() {} func (x *InitEnclaveRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[32] + mi := &file_enclave_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1658,7 +1556,7 @@ func (x *InitEnclaveRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InitEnclaveRequest.ProtoReflect.Descriptor instead. func (*InitEnclaveRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{32} + return file_enclave_proto_rawDescGZIP(), []int{30} } func (x *InitEnclaveRequest) GetEncryptedSharedEnclaveSecret() []byte { @@ -1679,7 +1577,7 @@ type InitEnclaveResponse struct { func (x *InitEnclaveResponse) Reset() { *x = InitEnclaveResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[33] + mi := &file_enclave_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1692,7 +1590,7 @@ func (x *InitEnclaveResponse) String() string { func (*InitEnclaveResponse) ProtoMessage() {} func (x *InitEnclaveResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[33] + mi := &file_enclave_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1705,7 +1603,7 @@ func (x *InitEnclaveResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InitEnclaveResponse.ProtoReflect.Descriptor instead. func (*InitEnclaveResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{33} + return file_enclave_proto_rawDescGZIP(), []int{31} } func (x *InitEnclaveResponse) GetSystemError() *SystemError { @@ -1724,7 +1622,7 @@ type EnclaveIDRequest struct { func (x *EnclaveIDRequest) Reset() { *x = EnclaveIDRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[34] + mi := &file_enclave_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1737,7 +1635,7 @@ func (x *EnclaveIDRequest) String() string { func (*EnclaveIDRequest) ProtoMessage() {} func (x *EnclaveIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[34] + mi := &file_enclave_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1750,7 +1648,7 @@ func (x *EnclaveIDRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EnclaveIDRequest.ProtoReflect.Descriptor instead. func (*EnclaveIDRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{34} + return file_enclave_proto_rawDescGZIP(), []int{32} } type EnclaveIDResponse struct { @@ -1765,7 +1663,7 @@ type EnclaveIDResponse struct { func (x *EnclaveIDResponse) Reset() { *x = EnclaveIDResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[35] + mi := &file_enclave_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1778,7 +1676,7 @@ func (x *EnclaveIDResponse) String() string { func (*EnclaveIDResponse) ProtoMessage() {} func (x *EnclaveIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[35] + mi := &file_enclave_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1791,7 +1689,7 @@ func (x *EnclaveIDResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EnclaveIDResponse.ProtoReflect.Descriptor instead. func (*EnclaveIDResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{35} + return file_enclave_proto_rawDescGZIP(), []int{33} } func (x *EnclaveIDResponse) GetEnclaveID() []byte { @@ -1817,7 +1715,7 @@ type RPCEncryptionKeyRequest struct { func (x *RPCEncryptionKeyRequest) Reset() { *x = RPCEncryptionKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[36] + mi := &file_enclave_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1830,7 +1728,7 @@ func (x *RPCEncryptionKeyRequest) String() string { func (*RPCEncryptionKeyRequest) ProtoMessage() {} func (x *RPCEncryptionKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[36] + mi := &file_enclave_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1843,7 +1741,7 @@ func (x *RPCEncryptionKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RPCEncryptionKeyRequest.ProtoReflect.Descriptor instead. func (*RPCEncryptionKeyRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{36} + return file_enclave_proto_rawDescGZIP(), []int{34} } type RPCEncryptionKeyResponse struct { @@ -1858,7 +1756,7 @@ type RPCEncryptionKeyResponse struct { func (x *RPCEncryptionKeyResponse) Reset() { *x = RPCEncryptionKeyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[37] + mi := &file_enclave_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1871,7 +1769,7 @@ func (x *RPCEncryptionKeyResponse) String() string { func (*RPCEncryptionKeyResponse) ProtoMessage() {} func (x *RPCEncryptionKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[37] + mi := &file_enclave_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1884,7 +1782,7 @@ func (x *RPCEncryptionKeyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RPCEncryptionKeyResponse.ProtoReflect.Descriptor instead. func (*RPCEncryptionKeyResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{37} + return file_enclave_proto_rawDescGZIP(), []int{35} } func (x *RPCEncryptionKeyResponse) GetRpcPubKey() []byte { @@ -1912,7 +1810,7 @@ type StartRequest struct { func (x *StartRequest) Reset() { *x = StartRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[38] + mi := &file_enclave_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1925,7 +1823,7 @@ func (x *StartRequest) String() string { func (*StartRequest) ProtoMessage() {} func (x *StartRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[38] + mi := &file_enclave_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1938,7 +1836,7 @@ func (x *StartRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StartRequest.ProtoReflect.Descriptor instead. func (*StartRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{38} + return file_enclave_proto_rawDescGZIP(), []int{36} } func (x *StartRequest) GetEncodedBlock() []byte { @@ -1959,7 +1857,7 @@ type StartResponse struct { func (x *StartResponse) Reset() { *x = StartResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[39] + mi := &file_enclave_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1972,7 +1870,7 @@ func (x *StartResponse) String() string { func (*StartResponse) ProtoMessage() {} func (x *StartResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[39] + mi := &file_enclave_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1985,7 +1883,7 @@ func (x *StartResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StartResponse.ProtoReflect.Descriptor instead. func (*StartResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{39} + return file_enclave_proto_rawDescGZIP(), []int{37} } func (x *StartResponse) GetSystemError() *SystemError { @@ -2007,7 +1905,7 @@ type SubmitBlockRequest struct { func (x *SubmitBlockRequest) Reset() { *x = SubmitBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[40] + mi := &file_enclave_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2020,7 +1918,7 @@ func (x *SubmitBlockRequest) String() string { func (*SubmitBlockRequest) ProtoMessage() {} func (x *SubmitBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[40] + mi := &file_enclave_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2033,7 +1931,7 @@ func (x *SubmitBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitBlockRequest.ProtoReflect.Descriptor instead. func (*SubmitBlockRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{40} + return file_enclave_proto_rawDescGZIP(), []int{38} } func (x *SubmitBlockRequest) GetEncodedBlock() []byte { @@ -2062,7 +1960,7 @@ type SubmitBlockResponse struct { func (x *SubmitBlockResponse) Reset() { *x = SubmitBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[41] + mi := &file_enclave_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2075,7 +1973,7 @@ func (x *SubmitBlockResponse) String() string { func (*SubmitBlockResponse) ProtoMessage() {} func (x *SubmitBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[41] + mi := &file_enclave_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2088,7 +1986,7 @@ func (x *SubmitBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitBlockResponse.ProtoReflect.Descriptor instead. func (*SubmitBlockResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{41} + return file_enclave_proto_rawDescGZIP(), []int{39} } func (x *SubmitBlockResponse) GetBlockSubmissionResponse() *BlockSubmissionResponseMsg { @@ -2116,7 +2014,7 @@ type EncCallRequest struct { func (x *EncCallRequest) Reset() { *x = EncCallRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[42] + mi := &file_enclave_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2129,7 +2027,7 @@ func (x *EncCallRequest) String() string { func (*EncCallRequest) ProtoMessage() {} func (x *EncCallRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[42] + mi := &file_enclave_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2142,7 +2040,7 @@ func (x *EncCallRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EncCallRequest.ProtoReflect.Descriptor instead. func (*EncCallRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{42} + return file_enclave_proto_rawDescGZIP(), []int{40} } func (x *EncCallRequest) GetEncryptedParams() []byte { @@ -2164,7 +2062,7 @@ type EncCallResponse struct { func (x *EncCallResponse) Reset() { *x = EncCallResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[43] + mi := &file_enclave_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2177,7 +2075,7 @@ func (x *EncCallResponse) String() string { func (*EncCallResponse) ProtoMessage() {} func (x *EncCallResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[43] + mi := &file_enclave_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2190,7 +2088,7 @@ func (x *EncCallResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EncCallResponse.ProtoReflect.Descriptor instead. func (*EncCallResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{43} + return file_enclave_proto_rawDescGZIP(), []int{41} } func (x *EncCallResponse) GetEncodedEnclaveResponse() []byte { @@ -2218,7 +2116,7 @@ type SubmitBatchRequest struct { func (x *SubmitBatchRequest) Reset() { *x = SubmitBatchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[44] + mi := &file_enclave_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2231,7 +2129,7 @@ func (x *SubmitBatchRequest) String() string { func (*SubmitBatchRequest) ProtoMessage() {} func (x *SubmitBatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[44] + mi := &file_enclave_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2244,7 +2142,7 @@ func (x *SubmitBatchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitBatchRequest.ProtoReflect.Descriptor instead. func (*SubmitBatchRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{44} + return file_enclave_proto_rawDescGZIP(), []int{42} } func (x *SubmitBatchRequest) GetBatch() *ExtBatchMsg { @@ -2265,7 +2163,7 @@ type SubmitBatchResponse struct { func (x *SubmitBatchResponse) Reset() { *x = SubmitBatchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[45] + mi := &file_enclave_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2278,7 +2176,7 @@ func (x *SubmitBatchResponse) String() string { func (*SubmitBatchResponse) ProtoMessage() {} func (x *SubmitBatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[45] + mi := &file_enclave_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2291,7 +2189,7 @@ func (x *SubmitBatchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitBatchResponse.ProtoReflect.Descriptor instead. func (*SubmitBatchResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{45} + return file_enclave_proto_rawDescGZIP(), []int{43} } func (x *SubmitBatchResponse) GetSystemError() *SystemError { @@ -2310,7 +2208,7 @@ type StopRequest struct { func (x *StopRequest) Reset() { *x = StopRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[46] + mi := &file_enclave_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2323,7 +2221,7 @@ func (x *StopRequest) String() string { func (*StopRequest) ProtoMessage() {} func (x *StopRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[46] + mi := &file_enclave_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2336,7 +2234,7 @@ func (x *StopRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopRequest.ProtoReflect.Descriptor instead. func (*StopRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{46} + return file_enclave_proto_rawDescGZIP(), []int{44} } type StopResponse struct { @@ -2350,7 +2248,7 @@ type StopResponse struct { func (x *StopResponse) Reset() { *x = StopResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[47] + mi := &file_enclave_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2363,7 +2261,7 @@ func (x *StopResponse) String() string { func (*StopResponse) ProtoMessage() {} func (x *StopResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[47] + mi := &file_enclave_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2376,7 +2274,7 @@ func (x *StopResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopResponse.ProtoReflect.Descriptor instead. func (*StopResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{47} + return file_enclave_proto_rawDescGZIP(), []int{45} } func (x *StopResponse) GetSystemError() *SystemError { @@ -2398,7 +2296,7 @@ type GetCodeRequest struct { func (x *GetCodeRequest) Reset() { *x = GetCodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[48] + mi := &file_enclave_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2411,7 +2309,7 @@ func (x *GetCodeRequest) String() string { func (*GetCodeRequest) ProtoMessage() {} func (x *GetCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[48] + mi := &file_enclave_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2424,7 +2322,7 @@ func (x *GetCodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCodeRequest.ProtoReflect.Descriptor instead. func (*GetCodeRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{48} + return file_enclave_proto_rawDescGZIP(), []int{46} } func (x *GetCodeRequest) GetAddress() []byte { @@ -2453,7 +2351,7 @@ type GetCodeResponse struct { func (x *GetCodeResponse) Reset() { *x = GetCodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[49] + mi := &file_enclave_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2466,7 +2364,7 @@ func (x *GetCodeResponse) String() string { func (*GetCodeResponse) ProtoMessage() {} func (x *GetCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[49] + mi := &file_enclave_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2479,7 +2377,7 @@ func (x *GetCodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetCodeResponse.ProtoReflect.Descriptor instead. func (*GetCodeResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{49} + return file_enclave_proto_rawDescGZIP(), []int{47} } func (x *GetCodeResponse) GetCode() []byte { @@ -2508,7 +2406,7 @@ type SubscribeRequest struct { func (x *SubscribeRequest) Reset() { *x = SubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[50] + mi := &file_enclave_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2521,7 +2419,7 @@ func (x *SubscribeRequest) String() string { func (*SubscribeRequest) ProtoMessage() {} func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[50] + mi := &file_enclave_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2534,7 +2432,7 @@ func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{50} + return file_enclave_proto_rawDescGZIP(), []int{48} } func (x *SubscribeRequest) GetId() []byte { @@ -2562,7 +2460,7 @@ type SubscribeResponse struct { func (x *SubscribeResponse) Reset() { *x = SubscribeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[51] + mi := &file_enclave_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2575,7 +2473,7 @@ func (x *SubscribeResponse) String() string { func (*SubscribeResponse) ProtoMessage() {} func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[51] + mi := &file_enclave_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2588,7 +2486,7 @@ func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead. func (*SubscribeResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{51} + return file_enclave_proto_rawDescGZIP(), []int{49} } func (x *SubscribeResponse) GetSystemError() *SystemError { @@ -2609,7 +2507,7 @@ type UnsubscribeRequest struct { func (x *UnsubscribeRequest) Reset() { *x = UnsubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[52] + mi := &file_enclave_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2622,7 +2520,7 @@ func (x *UnsubscribeRequest) String() string { func (*UnsubscribeRequest) ProtoMessage() {} func (x *UnsubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[52] + mi := &file_enclave_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2635,7 +2533,7 @@ func (x *UnsubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnsubscribeRequest.ProtoReflect.Descriptor instead. func (*UnsubscribeRequest) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{52} + return file_enclave_proto_rawDescGZIP(), []int{50} } func (x *UnsubscribeRequest) GetId() []byte { @@ -2656,7 +2554,7 @@ type UnsubscribeResponse struct { func (x *UnsubscribeResponse) Reset() { *x = UnsubscribeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[53] + mi := &file_enclave_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2669,7 +2567,7 @@ func (x *UnsubscribeResponse) String() string { func (*UnsubscribeResponse) ProtoMessage() {} func (x *UnsubscribeResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[53] + mi := &file_enclave_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2682,7 +2580,7 @@ func (x *UnsubscribeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnsubscribeResponse.ProtoReflect.Descriptor instead. func (*UnsubscribeResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{53} + return file_enclave_proto_rawDescGZIP(), []int{51} } func (x *UnsubscribeResponse) GetSystemError() *SystemError { @@ -2704,7 +2602,7 @@ type HealthCheckResponse struct { func (x *HealthCheckResponse) Reset() { *x = HealthCheckResponse{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[54] + mi := &file_enclave_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2717,7 +2615,7 @@ func (x *HealthCheckResponse) String() string { func (*HealthCheckResponse) ProtoMessage() {} func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[54] + mi := &file_enclave_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2730,7 +2628,7 @@ func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{54} + return file_enclave_proto_rawDescGZIP(), []int{52} } func (x *HealthCheckResponse) GetStatus() bool { @@ -2756,7 +2654,7 @@ type EmptyArgs struct { func (x *EmptyArgs) Reset() { *x = EmptyArgs{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[55] + mi := &file_enclave_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2769,7 +2667,7 @@ func (x *EmptyArgs) String() string { func (*EmptyArgs) ProtoMessage() {} func (x *EmptyArgs) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[55] + mi := &file_enclave_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2782,7 +2680,7 @@ func (x *EmptyArgs) ProtoReflect() protoreflect.Message { // Deprecated: Use EmptyArgs.ProtoReflect.Descriptor instead. func (*EmptyArgs) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{55} + return file_enclave_proto_rawDescGZIP(), []int{53} } type AttestationReportMsg struct { @@ -2800,7 +2698,7 @@ type AttestationReportMsg struct { func (x *AttestationReportMsg) Reset() { *x = AttestationReportMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[56] + mi := &file_enclave_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2813,7 +2711,7 @@ func (x *AttestationReportMsg) String() string { func (*AttestationReportMsg) ProtoMessage() {} func (x *AttestationReportMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[56] + mi := &file_enclave_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2826,7 +2724,7 @@ func (x *AttestationReportMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AttestationReportMsg.ProtoReflect.Descriptor instead. func (*AttestationReportMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{56} + return file_enclave_proto_rawDescGZIP(), []int{54} } func (x *AttestationReportMsg) GetReport() []byte { @@ -2876,7 +2774,7 @@ type BlockSubmissionResponseMsg struct { func (x *BlockSubmissionResponseMsg) Reset() { *x = BlockSubmissionResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[57] + mi := &file_enclave_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2889,7 +2787,7 @@ func (x *BlockSubmissionResponseMsg) String() string { func (*BlockSubmissionResponseMsg) ProtoMessage() {} func (x *BlockSubmissionResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[57] + mi := &file_enclave_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2902,7 +2800,7 @@ func (x *BlockSubmissionResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockSubmissionResponseMsg.ProtoReflect.Descriptor instead. func (*BlockSubmissionResponseMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{57} + return file_enclave_proto_rawDescGZIP(), []int{55} } func (x *BlockSubmissionResponseMsg) GetProducedSecretResponses() []*SecretResponseMsg { @@ -2931,7 +2829,7 @@ type BlockSubmissionErrorMsg struct { func (x *BlockSubmissionErrorMsg) Reset() { *x = BlockSubmissionErrorMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[58] + mi := &file_enclave_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2944,7 +2842,7 @@ func (x *BlockSubmissionErrorMsg) String() string { func (*BlockSubmissionErrorMsg) ProtoMessage() {} func (x *BlockSubmissionErrorMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[58] + mi := &file_enclave_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2957,7 +2855,7 @@ func (x *BlockSubmissionErrorMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockSubmissionErrorMsg.ProtoReflect.Descriptor instead. func (*BlockSubmissionErrorMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{58} + return file_enclave_proto_rawDescGZIP(), []int{56} } func (x *BlockSubmissionErrorMsg) GetCause() string { @@ -2989,7 +2887,7 @@ type CrossChainMsg struct { func (x *CrossChainMsg) Reset() { *x = CrossChainMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[59] + mi := &file_enclave_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3002,7 +2900,7 @@ func (x *CrossChainMsg) String() string { func (*CrossChainMsg) ProtoMessage() {} func (x *CrossChainMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[59] + mi := &file_enclave_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3015,7 +2913,7 @@ func (x *CrossChainMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainMsg.ProtoReflect.Descriptor instead. func (*CrossChainMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{59} + return file_enclave_proto_rawDescGZIP(), []int{57} } func (x *CrossChainMsg) GetSender() []byte { @@ -3066,7 +2964,7 @@ type ExtBatchMsg struct { func (x *ExtBatchMsg) Reset() { *x = ExtBatchMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[60] + mi := &file_enclave_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3079,7 +2977,7 @@ func (x *ExtBatchMsg) String() string { func (*ExtBatchMsg) ProtoMessage() {} func (x *ExtBatchMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[60] + mi := &file_enclave_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3092,7 +2990,7 @@ func (x *ExtBatchMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtBatchMsg.ProtoReflect.Descriptor instead. func (*ExtBatchMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{60} + return file_enclave_proto_rawDescGZIP(), []int{58} } func (x *ExtBatchMsg) GetHeader() *BatchHeaderMsg { @@ -3121,29 +3019,28 @@ type BatchHeaderMsg struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ParentHash []byte `protobuf:"bytes,1,opt,name=ParentHash,proto3" json:"ParentHash,omitempty"` - Proof []byte `protobuf:"bytes,2,opt,name=Proof,proto3" json:"Proof,omitempty"` - Root []byte `protobuf:"bytes,3,opt,name=Root,proto3" json:"Root,omitempty"` - TxHash []byte `protobuf:"bytes,4,opt,name=TxHash,proto3" json:"TxHash,omitempty"` - Number uint64 `protobuf:"varint,5,opt,name=Number,proto3" json:"Number,omitempty"` - SequencerOrderNo uint64 `protobuf:"varint,6,opt,name=SequencerOrderNo,proto3" json:"SequencerOrderNo,omitempty"` - ReceiptHash []byte `protobuf:"bytes,7,opt,name=ReceiptHash,proto3" json:"ReceiptHash,omitempty"` - Extra []byte `protobuf:"bytes,8,opt,name=Extra,proto3" json:"Extra,omitempty"` - Signature []byte `protobuf:"bytes,9,opt,name=Signature,proto3" json:"Signature,omitempty"` - GasLimit uint64 `protobuf:"varint,10,opt,name=GasLimit,proto3" json:"GasLimit,omitempty"` - GasUsed uint64 `protobuf:"varint,11,opt,name=GasUsed,proto3" json:"GasUsed,omitempty"` - Time uint64 `protobuf:"varint,12,opt,name=Time,proto3" json:"Time,omitempty"` - BaseFee uint64 `protobuf:"varint,13,opt,name=BaseFee,proto3" json:"BaseFee,omitempty"` - CrossChainMessages []*CrossChainMsg `protobuf:"bytes,16,rep,name=CrossChainMessages,proto3" json:"CrossChainMessages,omitempty"` - TransferTree []byte `protobuf:"bytes,17,opt,name=TransferTree,proto3" json:"TransferTree,omitempty"` - Coinbase []byte `protobuf:"bytes,18,opt,name=Coinbase,proto3" json:"Coinbase,omitempty"` - CrossChainTree []byte `protobuf:"bytes,19,opt,name=CrossChainTree,proto3" json:"CrossChainTree,omitempty"` + ParentHash []byte `protobuf:"bytes,1,opt,name=ParentHash,proto3" json:"ParentHash,omitempty"` + Proof []byte `protobuf:"bytes,2,opt,name=Proof,proto3" json:"Proof,omitempty"` + Root []byte `protobuf:"bytes,3,opt,name=Root,proto3" json:"Root,omitempty"` + TxHash []byte `protobuf:"bytes,4,opt,name=TxHash,proto3" json:"TxHash,omitempty"` + Number uint64 `protobuf:"varint,5,opt,name=Number,proto3" json:"Number,omitempty"` + SequencerOrderNo uint64 `protobuf:"varint,6,opt,name=SequencerOrderNo,proto3" json:"SequencerOrderNo,omitempty"` + ReceiptHash []byte `protobuf:"bytes,7,opt,name=ReceiptHash,proto3" json:"ReceiptHash,omitempty"` + Extra []byte `protobuf:"bytes,8,opt,name=Extra,proto3" json:"Extra,omitempty"` + Signature []byte `protobuf:"bytes,9,opt,name=Signature,proto3" json:"Signature,omitempty"` + GasLimit uint64 `protobuf:"varint,10,opt,name=GasLimit,proto3" json:"GasLimit,omitempty"` + GasUsed uint64 `protobuf:"varint,11,opt,name=GasUsed,proto3" json:"GasUsed,omitempty"` + Time uint64 `protobuf:"varint,12,opt,name=Time,proto3" json:"Time,omitempty"` + BaseFee uint64 `protobuf:"varint,13,opt,name=BaseFee,proto3" json:"BaseFee,omitempty"` + TransferTree []byte `protobuf:"bytes,17,opt,name=TransferTree,proto3" json:"TransferTree,omitempty"` + Coinbase []byte `protobuf:"bytes,18,opt,name=Coinbase,proto3" json:"Coinbase,omitempty"` + CrossChainTree []byte `protobuf:"bytes,19,opt,name=CrossChainTree,proto3" json:"CrossChainTree,omitempty"` } func (x *BatchHeaderMsg) Reset() { *x = BatchHeaderMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[61] + mi := &file_enclave_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3156,7 +3053,7 @@ func (x *BatchHeaderMsg) String() string { func (*BatchHeaderMsg) ProtoMessage() {} func (x *BatchHeaderMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[61] + mi := &file_enclave_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3169,7 +3066,7 @@ func (x *BatchHeaderMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchHeaderMsg.ProtoReflect.Descriptor instead. func (*BatchHeaderMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{61} + return file_enclave_proto_rawDescGZIP(), []int{59} } func (x *BatchHeaderMsg) GetParentHash() []byte { @@ -3263,13 +3160,6 @@ func (x *BatchHeaderMsg) GetBaseFee() uint64 { return 0 } -func (x *BatchHeaderMsg) GetCrossChainMessages() []*CrossChainMsg { - if x != nil { - return x.CrossChainMessages - } - return nil -} - func (x *BatchHeaderMsg) GetTransferTree() []byte { if x != nil { return x.TransferTree @@ -3304,7 +3194,7 @@ type ExtRollupMsg struct { func (x *ExtRollupMsg) Reset() { *x = ExtRollupMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[62] + mi := &file_enclave_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3317,7 +3207,7 @@ func (x *ExtRollupMsg) String() string { func (*ExtRollupMsg) ProtoMessage() {} func (x *ExtRollupMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[62] + mi := &file_enclave_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3330,7 +3220,7 @@ func (x *ExtRollupMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtRollupMsg.ProtoReflect.Descriptor instead. func (*ExtRollupMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{62} + return file_enclave_proto_rawDescGZIP(), []int{60} } func (x *ExtRollupMsg) GetHeader() *RollupHeaderMsg { @@ -3373,7 +3263,7 @@ type RollupHeaderMsg struct { func (x *RollupHeaderMsg) Reset() { *x = RollupHeaderMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[63] + mi := &file_enclave_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3386,7 +3276,7 @@ func (x *RollupHeaderMsg) String() string { func (*RollupHeaderMsg) ProtoMessage() {} func (x *RollupHeaderMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[63] + mi := &file_enclave_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3399,7 +3289,7 @@ func (x *RollupHeaderMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use RollupHeaderMsg.ProtoReflect.Descriptor instead. func (*RollupHeaderMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{63} + return file_enclave_proto_rawDescGZIP(), []int{61} } func (x *RollupHeaderMsg) GetParentHash() []byte { @@ -3480,7 +3370,7 @@ type SecretResponseMsg struct { func (x *SecretResponseMsg) Reset() { *x = SecretResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[64] + mi := &file_enclave_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3493,7 +3383,7 @@ func (x *SecretResponseMsg) String() string { func (*SecretResponseMsg) ProtoMessage() {} func (x *SecretResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[64] + mi := &file_enclave_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3506,7 +3396,7 @@ func (x *SecretResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use SecretResponseMsg.ProtoReflect.Descriptor instead. func (*SecretResponseMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{64} + return file_enclave_proto_rawDescGZIP(), []int{62} } func (x *SecretResponseMsg) GetSecret() []byte { @@ -3557,7 +3447,7 @@ type WithdrawalMsg struct { func (x *WithdrawalMsg) Reset() { *x = WithdrawalMsg{} if protoimpl.UnsafeEnabled { - mi := &file_enclave_proto_msgTypes[65] + mi := &file_enclave_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3570,7 +3460,7 @@ func (x *WithdrawalMsg) String() string { func (*WithdrawalMsg) ProtoMessage() {} func (x *WithdrawalMsg) ProtoReflect() protoreflect.Message { - mi := &file_enclave_proto_msgTypes[65] + mi := &file_enclave_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3583,7 +3473,7 @@ func (x *WithdrawalMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use WithdrawalMsg.ProtoReflect.Descriptor instead. func (*WithdrawalMsg) Descriptor() ([]byte, []int) { - return file_enclave_proto_rawDescGZIP(), []int{65} + return file_enclave_proto_rawDescGZIP(), []int{63} } func (x *WithdrawalMsg) GetAmount() []byte { @@ -3749,424 +3639,404 @@ var file_enclave_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 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, 0x49, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x53, - 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x65, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x22, 0x50, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x73, + 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa4, + 0x01, 0x0a, 0x13, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x14, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x73, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x4d, 0x73, 0x67, 0x52, 0x14, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x73, 0x67, 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, 0x14, 0x0a, 0x12, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa4, 0x01, 0x0a, 0x13, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x14, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x74, - 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4d, - 0x73, 0x67, 0x52, 0x14, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x96, + 0x01, 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x1c, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x6c, + 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 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, 0x58, 0x0a, 0x12, 0x49, 0x6e, 0x69, 0x74, 0x45, + 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, + 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x22, 0x4f, 0x0a, 0x13, 0x49, 0x6e, 0x69, 0x74, 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, 0x01, 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, 0x12, 0x0a, 0x10, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6b, 0x0a, 0x11, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, + 0x65, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, + 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x65, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 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, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x72, + 0x0a, 0x18, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x70, + 0x63, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, + 0x70, 0x63, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 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, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, - 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x96, 0x01, 0x0a, 0x16, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, - 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1c, 0x65, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x45, 0x6e, 0x63, - 0x6c, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 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, 0x58, 0x0a, 0x12, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, 0x63, 0x6c, - 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x1c, 0x65, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x45, 0x6e, 0x63, - 0x6c, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x64, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x4f, - 0x0a, 0x13, 0x49, 0x6e, 0x69, 0x74, 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, 0x01, 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, - 0x12, 0x0a, 0x10, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x6b, 0x0a, 0x11, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x63, 0x6c, - 0x61, 0x76, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x6e, 0x63, - 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 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, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x72, 0x0a, 0x18, 0x52, - 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x70, 0x63, 0x50, 0x75, - 0x62, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x70, 0x63, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 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, - 0x32, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x22, 0x0a, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x22, 0x49, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x18, 0x01, 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, 0x6c, - 0x0a, 0x12, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x50, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x22, 0xb0, 0x01, 0x0a, - 0x13, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x17, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x17, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, - 0x3a, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 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, 0x83, 0x01, 0x0a, 0x0f, - 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 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, + 0x6f, 0x72, 0x22, 0x32, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x49, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 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, + 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 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, 0x42, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2e, 0x45, 0x78, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x73, 0x67, 0x52, 0x05, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x22, 0x4f, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 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, 0x0d, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 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, - 0x50, 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, 0x12, 0x24, 0x0a, 0x0d, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x72, 0x4f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x72, 0x4f, 0x72, 0x48, 0x61, 0x73, - 0x68, 0x22, 0x5f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, + 0x72, 0x22, 0x6c, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x14, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x64, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x22, + 0xb0, 0x01, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x17, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x52, + 0x17, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 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, 0x58, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x15, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x65, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4d, 0x0a, 0x11, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 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, 0x24, 0x0a, 0x12, 0x55, - 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x4f, 0x0a, 0x13, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x6f, 0x72, 0x22, 0x3a, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 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, 0x83, + 0x01, 0x0a, 0x0f, 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 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, 0x42, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x05, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x78, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x73, + 0x67, 0x52, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x22, 0x4f, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, + 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, 0x0d, 0x0a, 0x0b, 0x53, 0x74, 0x6f, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 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, + 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 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, 0x67, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 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, 0x0b, 0x0a, 0x09, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x41, 0x72, 0x67, 0x73, 0x22, 0xc0, 0x01, 0x0a, 0x14, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x73, - 0x67, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x75, 0x62, - 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x12, - 0x20, 0x0a, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x05, 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, 0xae, 0x01, 0x0a, 0x1a, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x56, 0x0a, 0x17, 0x70, 0x72, + 0x6f, 0x72, 0x22, 0x50, 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, 0x12, 0x24, + 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x72, 0x4f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x72, 0x4f, 0x72, + 0x48, 0x61, 0x73, 0x68, 0x22, 0x5f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 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, 0x58, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x15, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x65, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x4d, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 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, 0x24, + 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x4f, 0x0a, 0x13, 0x55, 0x6e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x62, 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, 0x67, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 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, 0x0b, + 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x41, 0x72, 0x67, 0x73, 0x22, 0xc0, 0x01, 0x0a, 0x14, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x50, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, + 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, + 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x05, 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, 0xae, + 0x01, 0x0a, 0x1a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x56, 0x0a, + 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x47, 0x0a, 0x17, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6c, 0x31, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6c, - 0x31, 0x48, 0x65, 0x61, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, - 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4e, - 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x4e, 0x6f, 0x6e, 0x63, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0x6e, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x73, 0x67, - 0x12, 0x31, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x74, 0x78, - 0x73, 0x22, 0xa2, 0x04, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, - 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x6f, - 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, - 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, - 0x0a, 0x10, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x4e, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, - 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, - 0x45, 0x78, 0x74, 0x72, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x45, 0x78, 0x74, - 0x72, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x08, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x47, - 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x42, 0x61, - 0x73, 0x65, 0x46, 0x65, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x42, 0x61, 0x73, - 0x65, 0x46, 0x65, 0x65, 0x12, 0x48, 0x0a, 0x12, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x6f, - 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x12, 0x43, 0x72, 0x6f, 0x73, - 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x22, - 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x18, 0x11, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x72, - 0x65, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x12, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x43, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x26, - 0x0a, 0x0e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x72, 0x65, 0x65, - 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x54, 0x72, 0x65, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, 0x52, 0x6f, - 0x6c, 0x6c, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x12, 0x32, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x4d, 0x73, 0x67, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x73, 0x12, 0x32, 0x0a, 0x14, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6c, - 0x6c, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x14, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xdb, 0x02, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x50, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2c, 0x0a, 0x11, 0x43, 0x6f, 0x6d, - 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x31, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x4c, 0x31, 0x48, 0x65, 0x61, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, - 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, - 0x65, 0x49, 0x44, 0x12, 0x48, 0x0a, 0x12, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x6f, 0x73, - 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x12, 0x43, 0x72, 0x6f, 0x73, 0x73, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4c, - 0x61, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x71, 0x4e, 0x6f, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0e, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, - 0x71, 0x4e, 0x6f, 0x22, 0xc9, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 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, - 0x61, 0x0a, 0x0d, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x4d, 0x73, 0x67, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 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, 0xfc, 0x10, 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, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, - 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, - 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x12, 0x1d, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, 0x63, - 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, 0x63, 0x6c, - 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, - 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x12, 0x1b, 0x2e, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x52, 0x50, 0x43, 0x45, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x50, 0x43, 0x45, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x4c, 0x31, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x65, 0x64, 0x52, 0x50, 0x43, 0x12, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, - 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, + 0x47, 0x0a, 0x17, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x61, + 0x75, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x31, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x6c, 0x31, 0x48, 0x65, 0x61, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x6f, + 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x4e, + 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x6e, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x4d, 0x73, 0x67, 0x12, 0x31, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x03, 0x74, 0x78, 0x73, 0x22, 0xd8, 0x03, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x50, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x12, 0x0a, + 0x04, 0x52, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x53, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x12, 0x20, 0x0a, + 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x14, 0x0a, 0x05, 0x45, 0x78, 0x74, 0x72, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x43, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x43, 0x72, 0x6f, 0x73, 0x73, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x72, 0x65, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x72, 0x65, 0x65, 0x22, + 0x9c, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x4d, 0x73, 0x67, + 0x12, 0x32, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x6f, 0x6c, + 0x6c, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x61, 0x74, 0x63, 0x68, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x63, 0x61, + 0x6c, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x63, 0x61, 0x6c, 0x6c, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xdb, + 0x02, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4d, + 0x73, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x2c, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x4c, 0x31, 0x48, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x43, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x31, 0x48, 0x65, 0x61, 0x64, + 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x12, 0x48, 0x0a, 0x12, + 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, + 0x73, 0x67, 0x52, 0x12, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x53, 0x65, 0x71, 0x4e, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x4c, 0x61, + 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x65, 0x71, 0x4e, 0x6f, 0x22, 0xc9, 0x01, 0x0a, + 0x11, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, + 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, + 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x38, + 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 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, 0x61, 0x0a, 0x0d, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 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, 0xa9, 0x10, 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, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, + 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, + 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, + 0x20, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, + 0x63, 0x6c, 0x61, 0x76, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, + 0x65, 0x49, 0x44, 0x12, 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, + 0x45, 0x6e, 0x63, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, + 0x6c, 0x61, 0x76, 0x65, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x5d, 0x0a, 0x10, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2e, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x50, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4c, 0x31, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, - 0x6d, 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x6d, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x39, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, - 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x07, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 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, 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, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, + 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x47, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x52, 0x50, + 0x43, 0x12, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, + 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 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, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x04, 0x53, 0x74, + 0x6f, 0x70, 0x12, 0x16, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, + 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x19, 0x2e, 0x67, 0x65, 0x6e, 0x65, 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, 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, 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, + 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, 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, 0x66, 0x0a, 0x13, 0x45, 0x6e, 0x63, + 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, 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, - 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, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x4d, 0x61, 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, - 0x1c, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x4d, 0x61, 0x6b, 0x65, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, - 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x12, 0x1e, - 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x72, 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, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x4d, 0x61, + 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x64, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 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 ( @@ -4181,7 +4051,7 @@ func file_enclave_proto_rawDescGZIP() []byte { return file_enclave_proto_rawDescData } -var file_enclave_proto_msgTypes = make([]protoimpl.MessageInfo, 67) +var file_enclave_proto_msgTypes = make([]protoimpl.MessageInfo, 65) var file_enclave_proto_goTypes = []interface{}{ (*EnclavePublicConfigRequest)(nil), // 0: generated.EnclavePublicConfigRequest (*EnclavePublicConfigResponse)(nil), // 1: generated.EnclavePublicConfigResponse @@ -4209,143 +4079,137 @@ var file_enclave_proto_goTypes = []interface{}{ (*StatusResponse)(nil), // 23: generated.StatusResponse (*MakeActiveRequest)(nil), // 24: generated.MakeActiveRequest (*MakeActiveResponse)(nil), // 25: generated.MakeActiveResponse - (*AddSequencerRequest)(nil), // 26: generated.AddSequencerRequest - (*AddSequencerResponse)(nil), // 27: generated.AddSequencerResponse - (*AttestationRequest)(nil), // 28: generated.AttestationRequest - (*AttestationResponse)(nil), // 29: generated.AttestationResponse - (*GenerateSecretRequest)(nil), // 30: generated.GenerateSecretRequest - (*GenerateSecretResponse)(nil), // 31: generated.GenerateSecretResponse - (*InitEnclaveRequest)(nil), // 32: generated.InitEnclaveRequest - (*InitEnclaveResponse)(nil), // 33: generated.InitEnclaveResponse - (*EnclaveIDRequest)(nil), // 34: generated.EnclaveIDRequest - (*EnclaveIDResponse)(nil), // 35: generated.EnclaveIDResponse - (*RPCEncryptionKeyRequest)(nil), // 36: generated.RPCEncryptionKeyRequest - (*RPCEncryptionKeyResponse)(nil), // 37: generated.RPCEncryptionKeyResponse - (*StartRequest)(nil), // 38: generated.StartRequest - (*StartResponse)(nil), // 39: generated.StartResponse - (*SubmitBlockRequest)(nil), // 40: generated.SubmitBlockRequest - (*SubmitBlockResponse)(nil), // 41: generated.SubmitBlockResponse - (*EncCallRequest)(nil), // 42: generated.EncCallRequest - (*EncCallResponse)(nil), // 43: generated.EncCallResponse - (*SubmitBatchRequest)(nil), // 44: generated.SubmitBatchRequest - (*SubmitBatchResponse)(nil), // 45: generated.SubmitBatchResponse - (*StopRequest)(nil), // 46: generated.StopRequest - (*StopResponse)(nil), // 47: generated.StopResponse - (*GetCodeRequest)(nil), // 48: generated.GetCodeRequest - (*GetCodeResponse)(nil), // 49: generated.GetCodeResponse - (*SubscribeRequest)(nil), // 50: generated.SubscribeRequest - (*SubscribeResponse)(nil), // 51: generated.SubscribeResponse - (*UnsubscribeRequest)(nil), // 52: generated.UnsubscribeRequest - (*UnsubscribeResponse)(nil), // 53: generated.UnsubscribeResponse - (*HealthCheckResponse)(nil), // 54: generated.HealthCheckResponse - (*EmptyArgs)(nil), // 55: generated.EmptyArgs - (*AttestationReportMsg)(nil), // 56: generated.AttestationReportMsg - (*BlockSubmissionResponseMsg)(nil), // 57: generated.BlockSubmissionResponseMsg - (*BlockSubmissionErrorMsg)(nil), // 58: generated.BlockSubmissionErrorMsg - (*CrossChainMsg)(nil), // 59: generated.CrossChainMsg - (*ExtBatchMsg)(nil), // 60: generated.ExtBatchMsg - (*BatchHeaderMsg)(nil), // 61: generated.BatchHeaderMsg - (*ExtRollupMsg)(nil), // 62: generated.ExtRollupMsg - (*RollupHeaderMsg)(nil), // 63: generated.RollupHeaderMsg - (*SecretResponseMsg)(nil), // 64: generated.SecretResponseMsg - (*WithdrawalMsg)(nil), // 65: generated.WithdrawalMsg - nil, // 66: generated.EnclavePublicConfigResponse.PublicSystemContractsEntry + (*AttestationRequest)(nil), // 26: generated.AttestationRequest + (*AttestationResponse)(nil), // 27: generated.AttestationResponse + (*GenerateSecretRequest)(nil), // 28: generated.GenerateSecretRequest + (*GenerateSecretResponse)(nil), // 29: generated.GenerateSecretResponse + (*InitEnclaveRequest)(nil), // 30: generated.InitEnclaveRequest + (*InitEnclaveResponse)(nil), // 31: generated.InitEnclaveResponse + (*EnclaveIDRequest)(nil), // 32: generated.EnclaveIDRequest + (*EnclaveIDResponse)(nil), // 33: generated.EnclaveIDResponse + (*RPCEncryptionKeyRequest)(nil), // 34: generated.RPCEncryptionKeyRequest + (*RPCEncryptionKeyResponse)(nil), // 35: generated.RPCEncryptionKeyResponse + (*StartRequest)(nil), // 36: generated.StartRequest + (*StartResponse)(nil), // 37: generated.StartResponse + (*SubmitBlockRequest)(nil), // 38: generated.SubmitBlockRequest + (*SubmitBlockResponse)(nil), // 39: generated.SubmitBlockResponse + (*EncCallRequest)(nil), // 40: generated.EncCallRequest + (*EncCallResponse)(nil), // 41: generated.EncCallResponse + (*SubmitBatchRequest)(nil), // 42: generated.SubmitBatchRequest + (*SubmitBatchResponse)(nil), // 43: generated.SubmitBatchResponse + (*StopRequest)(nil), // 44: generated.StopRequest + (*StopResponse)(nil), // 45: generated.StopResponse + (*GetCodeRequest)(nil), // 46: generated.GetCodeRequest + (*GetCodeResponse)(nil), // 47: generated.GetCodeResponse + (*SubscribeRequest)(nil), // 48: generated.SubscribeRequest + (*SubscribeResponse)(nil), // 49: generated.SubscribeResponse + (*UnsubscribeRequest)(nil), // 50: generated.UnsubscribeRequest + (*UnsubscribeResponse)(nil), // 51: generated.UnsubscribeResponse + (*HealthCheckResponse)(nil), // 52: generated.HealthCheckResponse + (*EmptyArgs)(nil), // 53: generated.EmptyArgs + (*AttestationReportMsg)(nil), // 54: generated.AttestationReportMsg + (*BlockSubmissionResponseMsg)(nil), // 55: generated.BlockSubmissionResponseMsg + (*BlockSubmissionErrorMsg)(nil), // 56: generated.BlockSubmissionErrorMsg + (*CrossChainMsg)(nil), // 57: generated.CrossChainMsg + (*ExtBatchMsg)(nil), // 58: generated.ExtBatchMsg + (*BatchHeaderMsg)(nil), // 59: generated.BatchHeaderMsg + (*ExtRollupMsg)(nil), // 60: generated.ExtRollupMsg + (*RollupHeaderMsg)(nil), // 61: generated.RollupHeaderMsg + (*SecretResponseMsg)(nil), // 62: generated.SecretResponseMsg + (*WithdrawalMsg)(nil), // 63: generated.WithdrawalMsg + nil, // 64: generated.EnclavePublicConfigResponse.PublicSystemContractsEntry } var file_enclave_proto_depIdxs = []int32{ - 66, // 0: generated.EnclavePublicConfigResponse.publicSystemContracts:type_name -> generated.EnclavePublicConfigResponse.PublicSystemContractsEntry + 64, // 0: generated.EnclavePublicConfigResponse.publicSystemContracts:type_name -> generated.EnclavePublicConfigResponse.PublicSystemContractsEntry 11, // 1: generated.EnclavePublicConfigResponse.systemError:type_name -> generated.SystemError 11, // 2: generated.GetBatchResponse.systemError:type_name -> generated.SystemError 7, // 3: generated.GetRollupDataResponse.msg:type_name -> generated.PublicRollupDataMsg 11, // 4: generated.GetRollupDataResponse.systemError:type_name -> generated.SystemError 11, // 5: generated.GetTotalContractCountResponse.systemError:type_name -> generated.SystemError 11, // 6: generated.DebugTraceTransactionResponse.systemError:type_name -> generated.SystemError - 62, // 7: generated.CreateRollupResponse.msg:type_name -> generated.ExtRollupMsg + 60, // 7: generated.CreateRollupResponse.msg:type_name -> generated.ExtRollupMsg 11, // 8: generated.CreateRollupResponse.systemError:type_name -> generated.SystemError 11, // 9: generated.StatusResponse.systemError:type_name -> generated.SystemError 11, // 10: generated.MakeActiveResponse.systemError:type_name -> generated.SystemError - 11, // 11: generated.AddSequencerResponse.systemError:type_name -> generated.SystemError - 56, // 12: generated.AttestationResponse.attestationReportMsg:type_name -> generated.AttestationReportMsg - 11, // 13: generated.AttestationResponse.systemError:type_name -> generated.SystemError - 11, // 14: generated.GenerateSecretResponse.systemError:type_name -> generated.SystemError - 11, // 15: generated.InitEnclaveResponse.systemError:type_name -> generated.SystemError - 11, // 16: generated.EnclaveIDResponse.systemError:type_name -> generated.SystemError - 11, // 17: generated.RPCEncryptionKeyResponse.systemError:type_name -> generated.SystemError - 11, // 18: generated.StartResponse.systemError:type_name -> generated.SystemError - 57, // 19: generated.SubmitBlockResponse.blockSubmissionResponse:type_name -> generated.BlockSubmissionResponseMsg - 11, // 20: generated.SubmitBlockResponse.systemError:type_name -> generated.SystemError - 11, // 21: generated.EncCallResponse.systemError:type_name -> generated.SystemError - 60, // 22: generated.SubmitBatchRequest.batch:type_name -> generated.ExtBatchMsg - 11, // 23: generated.SubmitBatchResponse.systemError:type_name -> generated.SystemError - 11, // 24: generated.StopResponse.systemError:type_name -> generated.SystemError - 11, // 25: generated.GetCodeResponse.systemError:type_name -> generated.SystemError - 11, // 26: generated.SubscribeResponse.systemError:type_name -> generated.SystemError - 11, // 27: generated.UnsubscribeResponse.systemError:type_name -> generated.SystemError - 11, // 28: generated.HealthCheckResponse.systemError:type_name -> generated.SystemError - 11, // 29: generated.AttestationReportMsg.systemError:type_name -> generated.SystemError - 64, // 30: generated.BlockSubmissionResponseMsg.producedSecretResponses:type_name -> generated.SecretResponseMsg - 58, // 31: generated.BlockSubmissionResponseMsg.error:type_name -> generated.BlockSubmissionErrorMsg - 61, // 32: generated.ExtBatchMsg.header:type_name -> generated.BatchHeaderMsg - 59, // 33: generated.BatchHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg - 63, // 34: generated.ExtRollupMsg.header:type_name -> generated.RollupHeaderMsg - 59, // 35: generated.RollupHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg - 11, // 36: generated.SecretResponseMsg.systemError:type_name -> generated.SystemError - 22, // 37: generated.EnclaveProto.Status:input_type -> generated.StatusRequest - 28, // 38: generated.EnclaveProto.Attestation:input_type -> generated.AttestationRequest - 30, // 39: generated.EnclaveProto.GenerateSecret:input_type -> generated.GenerateSecretRequest - 32, // 40: generated.EnclaveProto.InitEnclave:input_type -> generated.InitEnclaveRequest - 34, // 41: generated.EnclaveProto.EnclaveID:input_type -> generated.EnclaveIDRequest - 36, // 42: generated.EnclaveProto.RPCEncryptionKey:input_type -> generated.RPCEncryptionKeyRequest - 40, // 43: generated.EnclaveProto.SubmitL1Block:input_type -> generated.SubmitBlockRequest - 42, // 44: generated.EnclaveProto.EncryptedRPC:input_type -> generated.EncCallRequest - 44, // 45: generated.EnclaveProto.SubmitBatch:input_type -> generated.SubmitBatchRequest - 46, // 46: generated.EnclaveProto.Stop:input_type -> generated.StopRequest - 48, // 47: generated.EnclaveProto.GetCode:input_type -> generated.GetCodeRequest - 50, // 48: generated.EnclaveProto.Subscribe:input_type -> generated.SubscribeRequest - 52, // 49: generated.EnclaveProto.Unsubscribe:input_type -> generated.UnsubscribeRequest - 55, // 50: generated.EnclaveProto.HealthCheck:input_type -> generated.EmptyArgs - 2, // 51: generated.EnclaveProto.GetBatch:input_type -> generated.GetBatchRequest - 3, // 52: generated.EnclaveProto.GetBatchBySeqNo:input_type -> generated.GetBatchBySeqNoRequest - 5, // 53: generated.EnclaveProto.GetRollupData:input_type -> generated.GetRollupDataRequest - 16, // 54: generated.EnclaveProto.CreateBatch:input_type -> generated.CreateBatchRequest - 18, // 55: generated.EnclaveProto.CreateRollup:input_type -> generated.CreateRollupRequest - 20, // 56: generated.EnclaveProto.ExportCrossChainData:input_type -> generated.ExportCrossChainDataRequest - 14, // 57: generated.EnclaveProto.DebugTraceTransaction:input_type -> generated.DebugTraceTransactionRequest - 8, // 58: generated.EnclaveProto.StreamL2Updates:input_type -> generated.StreamL2UpdatesRequest - 12, // 59: generated.EnclaveProto.GetTotalContractCount:input_type -> generated.GetTotalContractCountRequest - 0, // 60: generated.EnclaveProto.EnclavePublicConfig:input_type -> generated.EnclavePublicConfigRequest - 24, // 61: generated.EnclaveProto.MakeActive:input_type -> generated.MakeActiveRequest - 26, // 62: generated.EnclaveProto.AddSequencer:input_type -> generated.AddSequencerRequest - 23, // 63: generated.EnclaveProto.Status:output_type -> generated.StatusResponse - 29, // 64: generated.EnclaveProto.Attestation:output_type -> generated.AttestationResponse - 31, // 65: generated.EnclaveProto.GenerateSecret:output_type -> generated.GenerateSecretResponse - 33, // 66: generated.EnclaveProto.InitEnclave:output_type -> generated.InitEnclaveResponse - 35, // 67: generated.EnclaveProto.EnclaveID:output_type -> generated.EnclaveIDResponse - 37, // 68: generated.EnclaveProto.RPCEncryptionKey:output_type -> generated.RPCEncryptionKeyResponse - 41, // 69: generated.EnclaveProto.SubmitL1Block:output_type -> generated.SubmitBlockResponse - 43, // 70: generated.EnclaveProto.EncryptedRPC:output_type -> generated.EncCallResponse - 45, // 71: generated.EnclaveProto.SubmitBatch:output_type -> generated.SubmitBatchResponse - 47, // 72: generated.EnclaveProto.Stop:output_type -> generated.StopResponse - 49, // 73: generated.EnclaveProto.GetCode:output_type -> generated.GetCodeResponse - 51, // 74: generated.EnclaveProto.Subscribe:output_type -> generated.SubscribeResponse - 53, // 75: generated.EnclaveProto.Unsubscribe:output_type -> generated.UnsubscribeResponse - 54, // 76: generated.EnclaveProto.HealthCheck:output_type -> generated.HealthCheckResponse - 4, // 77: generated.EnclaveProto.GetBatch:output_type -> generated.GetBatchResponse - 4, // 78: generated.EnclaveProto.GetBatchBySeqNo:output_type -> generated.GetBatchResponse - 6, // 79: generated.EnclaveProto.GetRollupData:output_type -> generated.GetRollupDataResponse - 17, // 80: generated.EnclaveProto.CreateBatch:output_type -> generated.CreateBatchResponse - 19, // 81: generated.EnclaveProto.CreateRollup:output_type -> generated.CreateRollupResponse - 21, // 82: generated.EnclaveProto.ExportCrossChainData:output_type -> generated.ExportCrossChainDataResponse - 15, // 83: generated.EnclaveProto.DebugTraceTransaction:output_type -> generated.DebugTraceTransactionResponse - 9, // 84: generated.EnclaveProto.StreamL2Updates:output_type -> generated.EncodedUpdateResponse - 13, // 85: generated.EnclaveProto.GetTotalContractCount:output_type -> generated.GetTotalContractCountResponse - 1, // 86: generated.EnclaveProto.EnclavePublicConfig:output_type -> generated.EnclavePublicConfigResponse - 25, // 87: generated.EnclaveProto.MakeActive:output_type -> generated.MakeActiveResponse - 27, // 88: generated.EnclaveProto.AddSequencer:output_type -> generated.AddSequencerResponse - 63, // [63:89] is the sub-list for method output_type - 37, // [37:63] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name + 54, // 11: generated.AttestationResponse.attestationReportMsg:type_name -> generated.AttestationReportMsg + 11, // 12: generated.AttestationResponse.systemError:type_name -> generated.SystemError + 11, // 13: generated.GenerateSecretResponse.systemError:type_name -> generated.SystemError + 11, // 14: generated.InitEnclaveResponse.systemError:type_name -> generated.SystemError + 11, // 15: generated.EnclaveIDResponse.systemError:type_name -> generated.SystemError + 11, // 16: generated.RPCEncryptionKeyResponse.systemError:type_name -> generated.SystemError + 11, // 17: generated.StartResponse.systemError:type_name -> generated.SystemError + 55, // 18: generated.SubmitBlockResponse.blockSubmissionResponse:type_name -> generated.BlockSubmissionResponseMsg + 11, // 19: generated.SubmitBlockResponse.systemError:type_name -> generated.SystemError + 11, // 20: generated.EncCallResponse.systemError:type_name -> generated.SystemError + 58, // 21: generated.SubmitBatchRequest.batch:type_name -> generated.ExtBatchMsg + 11, // 22: generated.SubmitBatchResponse.systemError:type_name -> generated.SystemError + 11, // 23: generated.StopResponse.systemError:type_name -> generated.SystemError + 11, // 24: generated.GetCodeResponse.systemError:type_name -> generated.SystemError + 11, // 25: generated.SubscribeResponse.systemError:type_name -> generated.SystemError + 11, // 26: generated.UnsubscribeResponse.systemError:type_name -> generated.SystemError + 11, // 27: generated.HealthCheckResponse.systemError:type_name -> generated.SystemError + 11, // 28: generated.AttestationReportMsg.systemError:type_name -> generated.SystemError + 62, // 29: generated.BlockSubmissionResponseMsg.producedSecretResponses:type_name -> generated.SecretResponseMsg + 56, // 30: generated.BlockSubmissionResponseMsg.error:type_name -> generated.BlockSubmissionErrorMsg + 59, // 31: generated.ExtBatchMsg.header:type_name -> generated.BatchHeaderMsg + 61, // 32: generated.ExtRollupMsg.header:type_name -> generated.RollupHeaderMsg + 57, // 33: generated.RollupHeaderMsg.CrossChainMessages:type_name -> generated.CrossChainMsg + 11, // 34: generated.SecretResponseMsg.systemError:type_name -> generated.SystemError + 22, // 35: generated.EnclaveProto.Status:input_type -> generated.StatusRequest + 26, // 36: generated.EnclaveProto.Attestation:input_type -> generated.AttestationRequest + 28, // 37: generated.EnclaveProto.GenerateSecret:input_type -> generated.GenerateSecretRequest + 30, // 38: generated.EnclaveProto.InitEnclave:input_type -> generated.InitEnclaveRequest + 32, // 39: generated.EnclaveProto.EnclaveID:input_type -> generated.EnclaveIDRequest + 34, // 40: generated.EnclaveProto.RPCEncryptionKey:input_type -> generated.RPCEncryptionKeyRequest + 38, // 41: generated.EnclaveProto.SubmitL1Block:input_type -> generated.SubmitBlockRequest + 40, // 42: generated.EnclaveProto.EncryptedRPC:input_type -> generated.EncCallRequest + 42, // 43: generated.EnclaveProto.SubmitBatch:input_type -> generated.SubmitBatchRequest + 44, // 44: generated.EnclaveProto.Stop:input_type -> generated.StopRequest + 46, // 45: generated.EnclaveProto.GetCode:input_type -> generated.GetCodeRequest + 48, // 46: generated.EnclaveProto.Subscribe:input_type -> generated.SubscribeRequest + 50, // 47: generated.EnclaveProto.Unsubscribe:input_type -> generated.UnsubscribeRequest + 53, // 48: generated.EnclaveProto.HealthCheck:input_type -> generated.EmptyArgs + 2, // 49: generated.EnclaveProto.GetBatch:input_type -> generated.GetBatchRequest + 3, // 50: generated.EnclaveProto.GetBatchBySeqNo:input_type -> generated.GetBatchBySeqNoRequest + 5, // 51: generated.EnclaveProto.GetRollupData:input_type -> generated.GetRollupDataRequest + 16, // 52: generated.EnclaveProto.CreateBatch:input_type -> generated.CreateBatchRequest + 18, // 53: generated.EnclaveProto.CreateRollup:input_type -> generated.CreateRollupRequest + 20, // 54: generated.EnclaveProto.ExportCrossChainData:input_type -> generated.ExportCrossChainDataRequest + 14, // 55: generated.EnclaveProto.DebugTraceTransaction:input_type -> generated.DebugTraceTransactionRequest + 8, // 56: generated.EnclaveProto.StreamL2Updates:input_type -> generated.StreamL2UpdatesRequest + 12, // 57: generated.EnclaveProto.GetTotalContractCount:input_type -> generated.GetTotalContractCountRequest + 0, // 58: generated.EnclaveProto.EnclavePublicConfig:input_type -> generated.EnclavePublicConfigRequest + 24, // 59: generated.EnclaveProto.MakeActive:input_type -> generated.MakeActiveRequest + 23, // 60: generated.EnclaveProto.Status:output_type -> generated.StatusResponse + 27, // 61: generated.EnclaveProto.Attestation:output_type -> generated.AttestationResponse + 29, // 62: generated.EnclaveProto.GenerateSecret:output_type -> generated.GenerateSecretResponse + 31, // 63: generated.EnclaveProto.InitEnclave:output_type -> generated.InitEnclaveResponse + 33, // 64: generated.EnclaveProto.EnclaveID:output_type -> generated.EnclaveIDResponse + 35, // 65: generated.EnclaveProto.RPCEncryptionKey:output_type -> generated.RPCEncryptionKeyResponse + 39, // 66: generated.EnclaveProto.SubmitL1Block:output_type -> generated.SubmitBlockResponse + 41, // 67: generated.EnclaveProto.EncryptedRPC:output_type -> generated.EncCallResponse + 43, // 68: generated.EnclaveProto.SubmitBatch:output_type -> generated.SubmitBatchResponse + 45, // 69: generated.EnclaveProto.Stop:output_type -> generated.StopResponse + 47, // 70: generated.EnclaveProto.GetCode:output_type -> generated.GetCodeResponse + 49, // 71: generated.EnclaveProto.Subscribe:output_type -> generated.SubscribeResponse + 51, // 72: generated.EnclaveProto.Unsubscribe:output_type -> generated.UnsubscribeResponse + 52, // 73: generated.EnclaveProto.HealthCheck:output_type -> generated.HealthCheckResponse + 4, // 74: generated.EnclaveProto.GetBatch:output_type -> generated.GetBatchResponse + 4, // 75: generated.EnclaveProto.GetBatchBySeqNo:output_type -> generated.GetBatchResponse + 6, // 76: generated.EnclaveProto.GetRollupData:output_type -> generated.GetRollupDataResponse + 17, // 77: generated.EnclaveProto.CreateBatch:output_type -> generated.CreateBatchResponse + 19, // 78: generated.EnclaveProto.CreateRollup:output_type -> generated.CreateRollupResponse + 21, // 79: generated.EnclaveProto.ExportCrossChainData:output_type -> generated.ExportCrossChainDataResponse + 15, // 80: generated.EnclaveProto.DebugTraceTransaction:output_type -> generated.DebugTraceTransactionResponse + 9, // 81: generated.EnclaveProto.StreamL2Updates:output_type -> generated.EncodedUpdateResponse + 13, // 82: generated.EnclaveProto.GetTotalContractCount:output_type -> generated.GetTotalContractCountResponse + 1, // 83: generated.EnclaveProto.EnclavePublicConfig:output_type -> generated.EnclavePublicConfigResponse + 25, // 84: generated.EnclaveProto.MakeActive:output_type -> generated.MakeActiveResponse + 60, // [60:85] is the sub-list for method output_type + 35, // [35:60] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name } func init() { file_enclave_proto_init() } @@ -4667,30 +4531,6 @@ func file_enclave_proto_init() { } } file_enclave_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSequencerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_enclave_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSequencerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_enclave_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttestationRequest); i { case 0: return &v.state @@ -4702,7 +4542,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttestationResponse); i { case 0: return &v.state @@ -4714,7 +4554,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenerateSecretRequest); i { case 0: return &v.state @@ -4726,7 +4566,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenerateSecretResponse); i { case 0: return &v.state @@ -4738,7 +4578,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InitEnclaveRequest); i { case 0: return &v.state @@ -4750,7 +4590,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InitEnclaveResponse); i { case 0: return &v.state @@ -4762,7 +4602,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnclaveIDRequest); i { case 0: return &v.state @@ -4774,7 +4614,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnclaveIDResponse); i { case 0: return &v.state @@ -4786,7 +4626,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RPCEncryptionKeyRequest); i { case 0: return &v.state @@ -4798,7 +4638,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RPCEncryptionKeyResponse); i { case 0: return &v.state @@ -4810,7 +4650,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StartRequest); i { case 0: return &v.state @@ -4822,7 +4662,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StartResponse); i { case 0: return &v.state @@ -4834,7 +4674,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitBlockRequest); i { case 0: return &v.state @@ -4846,7 +4686,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitBlockResponse); i { case 0: return &v.state @@ -4858,7 +4698,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EncCallRequest); i { case 0: return &v.state @@ -4870,7 +4710,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EncCallResponse); i { case 0: return &v.state @@ -4882,7 +4722,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitBatchRequest); i { case 0: return &v.state @@ -4894,7 +4734,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitBatchResponse); i { case 0: return &v.state @@ -4906,7 +4746,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StopRequest); i { case 0: return &v.state @@ -4918,7 +4758,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StopResponse); i { case 0: return &v.state @@ -4930,7 +4770,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCodeRequest); i { case 0: return &v.state @@ -4942,7 +4782,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetCodeResponse); i { case 0: return &v.state @@ -4954,7 +4794,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubscribeRequest); i { case 0: return &v.state @@ -4966,7 +4806,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubscribeResponse); i { case 0: return &v.state @@ -4978,7 +4818,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnsubscribeRequest); i { case 0: return &v.state @@ -4990,7 +4830,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnsubscribeResponse); i { case 0: return &v.state @@ -5002,7 +4842,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HealthCheckResponse); i { case 0: return &v.state @@ -5014,7 +4854,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EmptyArgs); i { case 0: return &v.state @@ -5026,7 +4866,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttestationReportMsg); i { case 0: return &v.state @@ -5038,7 +4878,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockSubmissionResponseMsg); i { case 0: return &v.state @@ -5050,7 +4890,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockSubmissionErrorMsg); i { case 0: return &v.state @@ -5062,7 +4902,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainMsg); i { case 0: return &v.state @@ -5074,7 +4914,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtBatchMsg); i { case 0: return &v.state @@ -5086,7 +4926,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchHeaderMsg); i { case 0: return &v.state @@ -5098,7 +4938,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtRollupMsg); i { case 0: return &v.state @@ -5110,7 +4950,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RollupHeaderMsg); i { case 0: return &v.state @@ -5122,7 +4962,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecretResponseMsg); i { case 0: return &v.state @@ -5134,7 +4974,7 @@ func file_enclave_proto_init() { return nil } } - file_enclave_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + file_enclave_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WithdrawalMsg); i { case 0: return &v.state @@ -5154,7 +4994,7 @@ func file_enclave_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_enclave_proto_rawDesc, NumEnums: 0, - NumMessages: 67, + NumMessages: 65, NumExtensions: 0, NumServices: 1, }, diff --git a/go/common/rpc/generated/enclave.proto b/go/common/rpc/generated/enclave.proto index 3d4c71235..8185b7e79 100644 --- a/go/common/rpc/generated/enclave.proto +++ b/go/common/rpc/generated/enclave.proto @@ -30,7 +30,6 @@ service EnclaveProto { rpc GetTotalContractCount(GetTotalContractCountRequest) returns (GetTotalContractCountResponse) {} rpc EnclavePublicConfig(EnclavePublicConfigRequest) returns (EnclavePublicConfigResponse) {} rpc MakeActive(MakeActiveRequest) returns (MakeActiveResponse) {} - rpc AddSequencer(AddSequencerRequest) returns (AddSequencerResponse) {} } message EnclavePublicConfigRequest {} @@ -140,14 +139,6 @@ message MakeActiveResponse { SystemError systemError = 1; } -message AddSequencerRequest { - bytes enclaveId = 1; - bytes proof = 2; -} -message AddSequencerResponse { - SystemError systemError = 2; -} - message AttestationRequest {} message AttestationResponse { AttestationReportMsg attestationReportMsg = 1; diff --git a/go/common/rpc/generated/enclave_grpc.pb.go b/go/common/rpc/generated/enclave_grpc.pb.go index fc93f8f12..a529926b8 100644 --- a/go/common/rpc/generated/enclave_grpc.pb.go +++ b/go/common/rpc/generated/enclave_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.24.3 // source: enclave.proto package generated @@ -18,35 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - EnclaveProto_Status_FullMethodName = "/generated.EnclaveProto/Status" - EnclaveProto_Attestation_FullMethodName = "/generated.EnclaveProto/Attestation" - EnclaveProto_GenerateSecret_FullMethodName = "/generated.EnclaveProto/GenerateSecret" - EnclaveProto_InitEnclave_FullMethodName = "/generated.EnclaveProto/InitEnclave" - EnclaveProto_EnclaveID_FullMethodName = "/generated.EnclaveProto/EnclaveID" - EnclaveProto_RPCEncryptionKey_FullMethodName = "/generated.EnclaveProto/RPCEncryptionKey" - EnclaveProto_SubmitL1Block_FullMethodName = "/generated.EnclaveProto/SubmitL1Block" - EnclaveProto_EncryptedRPC_FullMethodName = "/generated.EnclaveProto/EncryptedRPC" - EnclaveProto_SubmitBatch_FullMethodName = "/generated.EnclaveProto/SubmitBatch" - EnclaveProto_Stop_FullMethodName = "/generated.EnclaveProto/Stop" - EnclaveProto_GetCode_FullMethodName = "/generated.EnclaveProto/GetCode" - EnclaveProto_Subscribe_FullMethodName = "/generated.EnclaveProto/Subscribe" - EnclaveProto_Unsubscribe_FullMethodName = "/generated.EnclaveProto/Unsubscribe" - EnclaveProto_HealthCheck_FullMethodName = "/generated.EnclaveProto/HealthCheck" - EnclaveProto_GetBatch_FullMethodName = "/generated.EnclaveProto/GetBatch" - EnclaveProto_GetBatchBySeqNo_FullMethodName = "/generated.EnclaveProto/GetBatchBySeqNo" - EnclaveProto_GetRollupData_FullMethodName = "/generated.EnclaveProto/GetRollupData" - EnclaveProto_CreateBatch_FullMethodName = "/generated.EnclaveProto/CreateBatch" - EnclaveProto_CreateRollup_FullMethodName = "/generated.EnclaveProto/CreateRollup" - EnclaveProto_ExportCrossChainData_FullMethodName = "/generated.EnclaveProto/ExportCrossChainData" - EnclaveProto_DebugTraceTransaction_FullMethodName = "/generated.EnclaveProto/DebugTraceTransaction" - EnclaveProto_StreamL2Updates_FullMethodName = "/generated.EnclaveProto/StreamL2Updates" - EnclaveProto_GetTotalContractCount_FullMethodName = "/generated.EnclaveProto/GetTotalContractCount" - EnclaveProto_EnclavePublicConfig_FullMethodName = "/generated.EnclaveProto/EnclavePublicConfig" - EnclaveProto_MakeActive_FullMethodName = "/generated.EnclaveProto/MakeActive" - EnclaveProto_AddSequencer_FullMethodName = "/generated.EnclaveProto/AddSequencer" -) - // EnclaveProtoClient is the client API for EnclaveProto service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -76,7 +47,6 @@ type EnclaveProtoClient interface { GetTotalContractCount(ctx context.Context, in *GetTotalContractCountRequest, opts ...grpc.CallOption) (*GetTotalContractCountResponse, error) EnclavePublicConfig(ctx context.Context, in *EnclavePublicConfigRequest, opts ...grpc.CallOption) (*EnclavePublicConfigResponse, error) MakeActive(ctx context.Context, in *MakeActiveRequest, opts ...grpc.CallOption) (*MakeActiveResponse, error) - AddSequencer(ctx context.Context, in *AddSequencerRequest, opts ...grpc.CallOption) (*AddSequencerResponse, error) } type enclaveProtoClient struct { @@ -89,7 +59,7 @@ func NewEnclaveProtoClient(cc grpc.ClientConnInterface) EnclaveProtoClient { func (c *enclaveProtoClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) - err := c.cc.Invoke(ctx, EnclaveProto_Status_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/Status", in, out, opts...) if err != nil { return nil, err } @@ -98,7 +68,7 @@ func (c *enclaveProtoClient) Status(ctx context.Context, in *StatusRequest, opts func (c *enclaveProtoClient) Attestation(ctx context.Context, in *AttestationRequest, opts ...grpc.CallOption) (*AttestationResponse, error) { out := new(AttestationResponse) - err := c.cc.Invoke(ctx, EnclaveProto_Attestation_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/Attestation", in, out, opts...) if err != nil { return nil, err } @@ -107,7 +77,7 @@ func (c *enclaveProtoClient) Attestation(ctx context.Context, in *AttestationReq func (c *enclaveProtoClient) GenerateSecret(ctx context.Context, in *GenerateSecretRequest, opts ...grpc.CallOption) (*GenerateSecretResponse, error) { out := new(GenerateSecretResponse) - err := c.cc.Invoke(ctx, EnclaveProto_GenerateSecret_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/GenerateSecret", in, out, opts...) if err != nil { return nil, err } @@ -116,7 +86,7 @@ func (c *enclaveProtoClient) GenerateSecret(ctx context.Context, in *GenerateSec func (c *enclaveProtoClient) InitEnclave(ctx context.Context, in *InitEnclaveRequest, opts ...grpc.CallOption) (*InitEnclaveResponse, error) { out := new(InitEnclaveResponse) - err := c.cc.Invoke(ctx, EnclaveProto_InitEnclave_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/InitEnclave", in, out, opts...) if err != nil { return nil, err } @@ -125,7 +95,7 @@ func (c *enclaveProtoClient) InitEnclave(ctx context.Context, in *InitEnclaveReq func (c *enclaveProtoClient) EnclaveID(ctx context.Context, in *EnclaveIDRequest, opts ...grpc.CallOption) (*EnclaveIDResponse, error) { out := new(EnclaveIDResponse) - err := c.cc.Invoke(ctx, EnclaveProto_EnclaveID_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/EnclaveID", in, out, opts...) if err != nil { return nil, err } @@ -134,7 +104,7 @@ func (c *enclaveProtoClient) EnclaveID(ctx context.Context, in *EnclaveIDRequest func (c *enclaveProtoClient) RPCEncryptionKey(ctx context.Context, in *RPCEncryptionKeyRequest, opts ...grpc.CallOption) (*RPCEncryptionKeyResponse, error) { out := new(RPCEncryptionKeyResponse) - err := c.cc.Invoke(ctx, EnclaveProto_RPCEncryptionKey_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/RPCEncryptionKey", in, out, opts...) if err != nil { return nil, err } @@ -143,7 +113,7 @@ func (c *enclaveProtoClient) RPCEncryptionKey(ctx context.Context, in *RPCEncryp func (c *enclaveProtoClient) SubmitL1Block(ctx context.Context, in *SubmitBlockRequest, opts ...grpc.CallOption) (*SubmitBlockResponse, error) { out := new(SubmitBlockResponse) - err := c.cc.Invoke(ctx, EnclaveProto_SubmitL1Block_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/SubmitL1Block", in, out, opts...) if err != nil { return nil, err } @@ -152,7 +122,7 @@ func (c *enclaveProtoClient) SubmitL1Block(ctx context.Context, in *SubmitBlockR func (c *enclaveProtoClient) EncryptedRPC(ctx context.Context, in *EncCallRequest, opts ...grpc.CallOption) (*EncCallResponse, error) { out := new(EncCallResponse) - err := c.cc.Invoke(ctx, EnclaveProto_EncryptedRPC_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/EncryptedRPC", in, out, opts...) if err != nil { return nil, err } @@ -161,7 +131,7 @@ func (c *enclaveProtoClient) EncryptedRPC(ctx context.Context, in *EncCallReques func (c *enclaveProtoClient) SubmitBatch(ctx context.Context, in *SubmitBatchRequest, opts ...grpc.CallOption) (*SubmitBatchResponse, error) { out := new(SubmitBatchResponse) - err := c.cc.Invoke(ctx, EnclaveProto_SubmitBatch_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/SubmitBatch", in, out, opts...) if err != nil { return nil, err } @@ -170,7 +140,7 @@ func (c *enclaveProtoClient) SubmitBatch(ctx context.Context, in *SubmitBatchReq func (c *enclaveProtoClient) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) { out := new(StopResponse) - err := c.cc.Invoke(ctx, EnclaveProto_Stop_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/Stop", in, out, opts...) if err != nil { return nil, err } @@ -179,7 +149,7 @@ func (c *enclaveProtoClient) Stop(ctx context.Context, in *StopRequest, opts ... func (c *enclaveProtoClient) GetCode(ctx context.Context, in *GetCodeRequest, opts ...grpc.CallOption) (*GetCodeResponse, error) { out := new(GetCodeResponse) - err := c.cc.Invoke(ctx, EnclaveProto_GetCode_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/GetCode", in, out, opts...) if err != nil { return nil, err } @@ -188,7 +158,7 @@ func (c *enclaveProtoClient) GetCode(ctx context.Context, in *GetCodeRequest, op 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...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/Subscribe", in, out, opts...) if err != nil { return nil, err } @@ -197,7 +167,7 @@ func (c *enclaveProtoClient) Subscribe(ctx context.Context, in *SubscribeRequest func (c *enclaveProtoClient) Unsubscribe(ctx context.Context, in *UnsubscribeRequest, opts ...grpc.CallOption) (*UnsubscribeResponse, error) { out := new(UnsubscribeResponse) - err := c.cc.Invoke(ctx, EnclaveProto_Unsubscribe_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/Unsubscribe", in, out, opts...) if err != nil { return nil, err } @@ -206,7 +176,7 @@ func (c *enclaveProtoClient) Unsubscribe(ctx context.Context, in *UnsubscribeReq func (c *enclaveProtoClient) HealthCheck(ctx context.Context, in *EmptyArgs, opts ...grpc.CallOption) (*HealthCheckResponse, error) { out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, EnclaveProto_HealthCheck_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/HealthCheck", in, out, opts...) if err != nil { return nil, err } @@ -215,7 +185,7 @@ func (c *enclaveProtoClient) HealthCheck(ctx context.Context, in *EmptyArgs, opt func (c *enclaveProtoClient) GetBatch(ctx context.Context, in *GetBatchRequest, opts ...grpc.CallOption) (*GetBatchResponse, error) { out := new(GetBatchResponse) - err := c.cc.Invoke(ctx, EnclaveProto_GetBatch_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/GetBatch", in, out, opts...) if err != nil { return nil, err } @@ -224,7 +194,7 @@ func (c *enclaveProtoClient) GetBatch(ctx context.Context, in *GetBatchRequest, func (c *enclaveProtoClient) GetBatchBySeqNo(ctx context.Context, in *GetBatchBySeqNoRequest, opts ...grpc.CallOption) (*GetBatchResponse, error) { out := new(GetBatchResponse) - err := c.cc.Invoke(ctx, EnclaveProto_GetBatchBySeqNo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/GetBatchBySeqNo", in, out, opts...) if err != nil { return nil, err } @@ -233,7 +203,7 @@ func (c *enclaveProtoClient) GetBatchBySeqNo(ctx context.Context, in *GetBatchBy func (c *enclaveProtoClient) GetRollupData(ctx context.Context, in *GetRollupDataRequest, opts ...grpc.CallOption) (*GetRollupDataResponse, error) { out := new(GetRollupDataResponse) - err := c.cc.Invoke(ctx, EnclaveProto_GetRollupData_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/GetRollupData", in, out, opts...) if err != nil { return nil, err } @@ -242,7 +212,7 @@ func (c *enclaveProtoClient) GetRollupData(ctx context.Context, in *GetRollupDat func (c *enclaveProtoClient) CreateBatch(ctx context.Context, in *CreateBatchRequest, opts ...grpc.CallOption) (*CreateBatchResponse, error) { out := new(CreateBatchResponse) - err := c.cc.Invoke(ctx, EnclaveProto_CreateBatch_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/CreateBatch", in, out, opts...) if err != nil { return nil, err } @@ -251,7 +221,7 @@ func (c *enclaveProtoClient) CreateBatch(ctx context.Context, in *CreateBatchReq func (c *enclaveProtoClient) CreateRollup(ctx context.Context, in *CreateRollupRequest, opts ...grpc.CallOption) (*CreateRollupResponse, error) { out := new(CreateRollupResponse) - err := c.cc.Invoke(ctx, EnclaveProto_CreateRollup_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/CreateRollup", in, out, opts...) if err != nil { return nil, err } @@ -260,7 +230,7 @@ func (c *enclaveProtoClient) CreateRollup(ctx context.Context, in *CreateRollupR func (c *enclaveProtoClient) ExportCrossChainData(ctx context.Context, in *ExportCrossChainDataRequest, opts ...grpc.CallOption) (*ExportCrossChainDataResponse, error) { out := new(ExportCrossChainDataResponse) - err := c.cc.Invoke(ctx, EnclaveProto_ExportCrossChainData_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/ExportCrossChainData", in, out, opts...) if err != nil { return nil, err } @@ -269,7 +239,7 @@ func (c *enclaveProtoClient) ExportCrossChainData(ctx context.Context, in *Expor func (c *enclaveProtoClient) DebugTraceTransaction(ctx context.Context, in *DebugTraceTransactionRequest, opts ...grpc.CallOption) (*DebugTraceTransactionResponse, error) { out := new(DebugTraceTransactionResponse) - err := c.cc.Invoke(ctx, EnclaveProto_DebugTraceTransaction_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/DebugTraceTransaction", in, out, opts...) if err != nil { return nil, err } @@ -277,7 +247,7 @@ func (c *enclaveProtoClient) DebugTraceTransaction(ctx context.Context, in *Debu } func (c *enclaveProtoClient) StreamL2Updates(ctx context.Context, in *StreamL2UpdatesRequest, opts ...grpc.CallOption) (EnclaveProto_StreamL2UpdatesClient, error) { - stream, err := c.cc.NewStream(ctx, &EnclaveProto_ServiceDesc.Streams[0], EnclaveProto_StreamL2Updates_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &EnclaveProto_ServiceDesc.Streams[0], "/generated.EnclaveProto/StreamL2Updates", opts...) if err != nil { return nil, err } @@ -310,7 +280,7 @@ func (x *enclaveProtoStreamL2UpdatesClient) Recv() (*EncodedUpdateResponse, erro func (c *enclaveProtoClient) GetTotalContractCount(ctx context.Context, in *GetTotalContractCountRequest, opts ...grpc.CallOption) (*GetTotalContractCountResponse, error) { out := new(GetTotalContractCountResponse) - err := c.cc.Invoke(ctx, EnclaveProto_GetTotalContractCount_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/GetTotalContractCount", in, out, opts...) if err != nil { return nil, err } @@ -319,7 +289,7 @@ func (c *enclaveProtoClient) GetTotalContractCount(ctx context.Context, in *GetT func (c *enclaveProtoClient) EnclavePublicConfig(ctx context.Context, in *EnclavePublicConfigRequest, opts ...grpc.CallOption) (*EnclavePublicConfigResponse, error) { out := new(EnclavePublicConfigResponse) - err := c.cc.Invoke(ctx, EnclaveProto_EnclavePublicConfig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/EnclavePublicConfig", in, out, opts...) if err != nil { return nil, err } @@ -328,16 +298,7 @@ func (c *enclaveProtoClient) EnclavePublicConfig(ctx context.Context, in *Enclav func (c *enclaveProtoClient) MakeActive(ctx context.Context, in *MakeActiveRequest, opts ...grpc.CallOption) (*MakeActiveResponse, error) { out := new(MakeActiveResponse) - err := c.cc.Invoke(ctx, EnclaveProto_MakeActive_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *enclaveProtoClient) AddSequencer(ctx context.Context, in *AddSequencerRequest, opts ...grpc.CallOption) (*AddSequencerResponse, error) { - out := new(AddSequencerResponse) - err := c.cc.Invoke(ctx, EnclaveProto_AddSequencer_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/generated.EnclaveProto/MakeActive", in, out, opts...) if err != nil { return nil, err } @@ -373,7 +334,6 @@ type EnclaveProtoServer interface { GetTotalContractCount(context.Context, *GetTotalContractCountRequest) (*GetTotalContractCountResponse, error) EnclavePublicConfig(context.Context, *EnclavePublicConfigRequest) (*EnclavePublicConfigResponse, error) MakeActive(context.Context, *MakeActiveRequest) (*MakeActiveResponse, error) - AddSequencer(context.Context, *AddSequencerRequest) (*AddSequencerResponse, error) mustEmbedUnimplementedEnclaveProtoServer() } @@ -456,9 +416,6 @@ func (UnimplementedEnclaveProtoServer) EnclavePublicConfig(context.Context, *Enc func (UnimplementedEnclaveProtoServer) MakeActive(context.Context, *MakeActiveRequest) (*MakeActiveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MakeActive not implemented") } -func (UnimplementedEnclaveProtoServer) AddSequencer(context.Context, *AddSequencerRequest) (*AddSequencerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddSequencer not implemented") -} func (UnimplementedEnclaveProtoServer) mustEmbedUnimplementedEnclaveProtoServer() {} // UnsafeEnclaveProtoServer may be embedded to opt out of forward compatibility for this service. @@ -482,7 +439,7 @@ func _EnclaveProto_Status_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_Status_FullMethodName, + FullMethod: "/generated.EnclaveProto/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).Status(ctx, req.(*StatusRequest)) @@ -500,7 +457,7 @@ func _EnclaveProto_Attestation_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_Attestation_FullMethodName, + FullMethod: "/generated.EnclaveProto/Attestation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).Attestation(ctx, req.(*AttestationRequest)) @@ -518,7 +475,7 @@ func _EnclaveProto_GenerateSecret_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_GenerateSecret_FullMethodName, + FullMethod: "/generated.EnclaveProto/GenerateSecret", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).GenerateSecret(ctx, req.(*GenerateSecretRequest)) @@ -536,7 +493,7 @@ func _EnclaveProto_InitEnclave_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_InitEnclave_FullMethodName, + FullMethod: "/generated.EnclaveProto/InitEnclave", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).InitEnclave(ctx, req.(*InitEnclaveRequest)) @@ -554,7 +511,7 @@ func _EnclaveProto_EnclaveID_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_EnclaveID_FullMethodName, + FullMethod: "/generated.EnclaveProto/EnclaveID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).EnclaveID(ctx, req.(*EnclaveIDRequest)) @@ -572,7 +529,7 @@ func _EnclaveProto_RPCEncryptionKey_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_RPCEncryptionKey_FullMethodName, + FullMethod: "/generated.EnclaveProto/RPCEncryptionKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).RPCEncryptionKey(ctx, req.(*RPCEncryptionKeyRequest)) @@ -590,7 +547,7 @@ func _EnclaveProto_SubmitL1Block_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_SubmitL1Block_FullMethodName, + FullMethod: "/generated.EnclaveProto/SubmitL1Block", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).SubmitL1Block(ctx, req.(*SubmitBlockRequest)) @@ -608,7 +565,7 @@ func _EnclaveProto_EncryptedRPC_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_EncryptedRPC_FullMethodName, + FullMethod: "/generated.EnclaveProto/EncryptedRPC", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).EncryptedRPC(ctx, req.(*EncCallRequest)) @@ -626,7 +583,7 @@ func _EnclaveProto_SubmitBatch_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_SubmitBatch_FullMethodName, + FullMethod: "/generated.EnclaveProto/SubmitBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).SubmitBatch(ctx, req.(*SubmitBatchRequest)) @@ -644,7 +601,7 @@ func _EnclaveProto_Stop_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_Stop_FullMethodName, + FullMethod: "/generated.EnclaveProto/Stop", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).Stop(ctx, req.(*StopRequest)) @@ -662,7 +619,7 @@ func _EnclaveProto_GetCode_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_GetCode_FullMethodName, + FullMethod: "/generated.EnclaveProto/GetCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).GetCode(ctx, req.(*GetCodeRequest)) @@ -680,7 +637,7 @@ func _EnclaveProto_Subscribe_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_Subscribe_FullMethodName, + FullMethod: "/generated.EnclaveProto/Subscribe", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).Subscribe(ctx, req.(*SubscribeRequest)) @@ -698,7 +655,7 @@ func _EnclaveProto_Unsubscribe_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_Unsubscribe_FullMethodName, + FullMethod: "/generated.EnclaveProto/Unsubscribe", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).Unsubscribe(ctx, req.(*UnsubscribeRequest)) @@ -716,7 +673,7 @@ func _EnclaveProto_HealthCheck_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_HealthCheck_FullMethodName, + FullMethod: "/generated.EnclaveProto/HealthCheck", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).HealthCheck(ctx, req.(*EmptyArgs)) @@ -734,7 +691,7 @@ func _EnclaveProto_GetBatch_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_GetBatch_FullMethodName, + FullMethod: "/generated.EnclaveProto/GetBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).GetBatch(ctx, req.(*GetBatchRequest)) @@ -752,7 +709,7 @@ func _EnclaveProto_GetBatchBySeqNo_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_GetBatchBySeqNo_FullMethodName, + FullMethod: "/generated.EnclaveProto/GetBatchBySeqNo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).GetBatchBySeqNo(ctx, req.(*GetBatchBySeqNoRequest)) @@ -770,7 +727,7 @@ func _EnclaveProto_GetRollupData_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_GetRollupData_FullMethodName, + FullMethod: "/generated.EnclaveProto/GetRollupData", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).GetRollupData(ctx, req.(*GetRollupDataRequest)) @@ -788,7 +745,7 @@ func _EnclaveProto_CreateBatch_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_CreateBatch_FullMethodName, + FullMethod: "/generated.EnclaveProto/CreateBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).CreateBatch(ctx, req.(*CreateBatchRequest)) @@ -806,7 +763,7 @@ func _EnclaveProto_CreateRollup_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_CreateRollup_FullMethodName, + FullMethod: "/generated.EnclaveProto/CreateRollup", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).CreateRollup(ctx, req.(*CreateRollupRequest)) @@ -824,7 +781,7 @@ func _EnclaveProto_ExportCrossChainData_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_ExportCrossChainData_FullMethodName, + FullMethod: "/generated.EnclaveProto/ExportCrossChainData", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).ExportCrossChainData(ctx, req.(*ExportCrossChainDataRequest)) @@ -842,7 +799,7 @@ func _EnclaveProto_DebugTraceTransaction_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_DebugTraceTransaction_FullMethodName, + FullMethod: "/generated.EnclaveProto/DebugTraceTransaction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).DebugTraceTransaction(ctx, req.(*DebugTraceTransactionRequest)) @@ -881,7 +838,7 @@ func _EnclaveProto_GetTotalContractCount_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_GetTotalContractCount_FullMethodName, + FullMethod: "/generated.EnclaveProto/GetTotalContractCount", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).GetTotalContractCount(ctx, req.(*GetTotalContractCountRequest)) @@ -899,7 +856,7 @@ func _EnclaveProto_EnclavePublicConfig_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_EnclavePublicConfig_FullMethodName, + FullMethod: "/generated.EnclaveProto/EnclavePublicConfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).EnclavePublicConfig(ctx, req.(*EnclavePublicConfigRequest)) @@ -917,7 +874,7 @@ func _EnclaveProto_MakeActive_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EnclaveProto_MakeActive_FullMethodName, + FullMethod: "/generated.EnclaveProto/MakeActive", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EnclaveProtoServer).MakeActive(ctx, req.(*MakeActiveRequest)) @@ -925,24 +882,6 @@ func _EnclaveProto_MakeActive_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _EnclaveProto_AddSequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddSequencerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EnclaveProtoServer).AddSequencer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: EnclaveProto_AddSequencer_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EnclaveProtoServer).AddSequencer(ctx, req.(*AddSequencerRequest)) - } - return interceptor(ctx, in, info, handler) -} - // EnclaveProto_ServiceDesc is the grpc.ServiceDesc for EnclaveProto service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1046,10 +985,6 @@ var EnclaveProto_ServiceDesc = grpc.ServiceDesc{ MethodName: "MakeActive", Handler: _EnclaveProto_MakeActive_Handler, }, - { - MethodName: "AddSequencer", - Handler: _EnclaveProto_AddSequencer_Handler, - }, }, Streams: []grpc.StreamDesc{ { diff --git a/go/enclave/config/config.go b/go/enclave/config/config.go index e65024a15..1c3c15417 100644 --- a/go/enclave/config/config.go +++ b/go/enclave/config/config.go @@ -5,7 +5,6 @@ import ( "time" gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/config" ) @@ -75,8 +74,6 @@ type EnclaveConfig struct { DebugNamespaceEnabled bool GasLocalExecutionCapFlag uint64 - // The type of the node. - todo - remove - NodeType common.NodeType // The public peer-to-peer IP address of the host the enclave service is tied to // This is required to advertise for node discovery, and we include it in the attestation // todo - should we really bind the physical address to the attestation. @@ -87,7 +84,6 @@ func EnclaveConfigFromTenConfig(tenCfg *config.TenConfig) *EnclaveConfig { return &EnclaveConfig{ NodeID: tenCfg.Node.ID, HostAddress: tenCfg.Node.HostAddress, - NodeType: tenCfg.Node.NodeType, WillAttest: tenCfg.Enclave.EnableAttestation, StoreExecutedTransactions: tenCfg.Enclave.StoreExecutedTransactions, diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index c7e4178a1..68cae8d2a 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -24,7 +24,6 @@ import ( "github.com/ten-protocol/go-ten/go/common/errutil" - "github.com/ethereum/go-ethereum/core/types" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/gethencoding" "github.com/ten-protocol/go-ten/go/common/log" @@ -215,13 +214,6 @@ func (e *enclaveImpl) Unsubscribe(id gethrpc.ID) common.SystemError { return e.rpcAPI.Unsubscribe(id) } -func (e *enclaveImpl) AddSequencer(id common.EnclaveID, proof types.Receipt) common.SystemError { - if systemError := checkStopping(e.stopControl); systemError != nil { - return systemError - } - return e.adminAPI.AddSequencer(id, proof) -} - func (e *enclaveImpl) MakeActive() common.SystemError { if systemError := checkStopping(e.stopControl); systemError != nil { return systemError diff --git a/go/enclave/enclave_admin_service.go b/go/enclave/enclave_admin_service.go index a0845b118..b5e514353 100644 --- a/go/enclave/enclave_admin_service.go +++ b/go/enclave/enclave_admin_service.go @@ -122,25 +122,12 @@ func NewEnclaveAdminAPI(config *enclaveconfig.EnclaveConfig, storage storage.Sto eas.service = sequencerService } - // Todo - this is temporary - until the host calls `AddSequencer` instead of relying on the config - which can be removed - if config.NodeType == common.ActiveSequencer { - err := storage.StoreNewEnclave(context.Background(), enclaveKeyService.EnclaveID(), enclaveKeyService.PublicKey()) - if err != nil { - logger.Crit("Failed to store enclave key", log.ErrKey, err) - return nil - } - err = eas.MakeActive() - if err != nil { - logger.Crit("Failed to create sequencer", log.ErrKey, err) - } - } - return eas } -func (e *enclaveAdminService) AddSequencer(id common.EnclaveID, _ types.Receipt) common.SystemError { - // todo - use the proof - // todo - this will currently store all enclaves +// addSequencer is used internally to add a sequencer enclaveID to the pool of attested enclaves. +// If it is the current enclave it will change the behaviour of this enclave to be a backup sequencer (ready to become active). +func (e *enclaveAdminService) addSequencer(id common.EnclaveID, _ types.Receipt) common.SystemError { err := e.storage.StoreNodeType(context.Background(), id, common.BackupSequencer) if err != nil { return responses.ToInternalError(err) @@ -157,18 +144,16 @@ func (e *enclaveAdminService) MakeActive() common.SystemError { e.mainMutex.Lock() defer e.mainMutex.Unlock() - // todo - uncomment once AddSequencer is called by the host - //if !e.isBackupSequencer(context.Background()) { - // return fmt.Errorf("only backup sequencer can become active") - //} - - // todo - remove because this enclave should already be a backup sequencer - e.mempool.SetValidateMode(false) + if !e.isBackupSequencer(context.Background()) { + // host may see this if it tries to promote its enclave before its ID has been added to the permission pool + return fmt.Errorf("only backup sequencer can become active") + } err := e.storage.StoreNodeType(context.Background(), e.enclaveKeyService.EnclaveID(), common.ActiveSequencer) if err != nil { return err } + e.service = e.sequencerService return nil } @@ -373,6 +358,17 @@ func (e *enclaveAdminService) HealthCheck(ctx context.Context) (bool, common.Sys return false, responses.ToInternalError(fmt.Errorf("requested HealthCheck with the enclave stopping")) } + // if we have seen no sequencer permissioned on the L1 yet then we are in an unusual bootstrapping network state + // and can return healthy + enclaveIDs, err := e.storage.GetSequencerEnclaveIDs(ctx) + if err != nil { + return false, fmt.Errorf("could not get sequencer enclaveIDs. Cause: %w", err) + } + if len(enclaveIDs) == 0 { + e.logger.Debug("No sequencer enclaveIDs found permissioned from L1, network is bootstrapping") + return true, nil + } + // check the storage health storageHealthy, err := e.storage.HealthCheck(ctx) if err != nil { @@ -492,7 +488,7 @@ func (e *enclaveAdminService) ingestL1Block(ctx context.Context, processed *comm sequencerAddedTxs := processed.GetEvents(common.SequencerAddedTx) for _, tx := range sequencerAddedTxs { if tx.HasSequencerEnclaveID() { - err = e.AddSequencer(tx.SequencerEnclaveID, *tx.Receipt) + err = e.addSequencer(tx.SequencerEnclaveID, *tx.Receipt) if err != nil { e.logger.Crit("Encountered error while adding sequencer enclaveID", log.ErrKey, err) } diff --git a/go/enclave/rpc_server.go b/go/enclave/rpc_server.go index 7d87fa621..631f31b75 100644 --- a/go/enclave/rpc_server.go +++ b/go/enclave/rpc_server.go @@ -8,7 +8,6 @@ import ( "math/big" "net" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/errutil" @@ -83,15 +82,6 @@ func (s *RPCServer) Status(ctx context.Context, _ *generated.StatusRequest) (*ge }, nil } -func (s *RPCServer) AddSequencer(ctx context.Context, in *generated.AddSequencerRequest) (*generated.AddSequencerResponse, error) { - rec := types.Receipt{} - err := rec.UnmarshalBinary(in.Proof) - if err != nil { - return &generated.AddSequencerResponse{SystemError: toRPCError(err)}, nil - } - return &generated.AddSequencerResponse{SystemError: toRPCError(s.enclave.AddSequencer(gethcommon.BytesToAddress(in.EnclaveId), rec))}, nil -} - func (s *RPCServer) MakeActive(ctx context.Context, in *generated.MakeActiveRequest) (*generated.MakeActiveResponse, error) { return &generated.MakeActiveResponse{SystemError: toRPCError(s.enclave.MakeActive())}, nil } diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index be875cb95..0fa66316c 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -390,16 +390,17 @@ func (s *storageImpl) IsAncestor(ctx context.Context, block *types.Header, maybe func (s *storageImpl) HealthCheck(ctx context.Context) (bool, error) { defer s.logDuration("HealthCheck", measure.NewStopwatch()) - seqNo, err := s.FetchCurrentSequencerNo(ctx) - if err != nil { - return false, err - } - - if seqNo == nil { - return false, fmt.Errorf("no batches are stored") - } - - return true, nil + return s.db != nil, nil + //seqNo, err := s.FetchCurrentSequencerNo(ctx) + //if err != nil { + // return false, err + //} + // + //if seqNo == nil { + // return false, fmt.Errorf("no batches are stored") + //} + // + //return true, nil } func (s *storageImpl) CreateStateDB(ctx context.Context, batchHash common.L2BatchHash) (*state.StateDB, error) { diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 55af443fc..27e212bd7 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -58,9 +58,10 @@ type guardianServiceLocator interface { // - if it is an active sequencer then the guardian will trigger batch/rollup creation // - guardian provides access to the enclave data and reports the enclave status for other services - acting as a gatekeeper type Guardian struct { - hostData host.Identity - state *StateTracker // state machine that tracks our view of the enclave's state - enclaveClient common.Enclave + hostData host.Identity + isActiveSequencer bool + state *StateTracker // state machine that tracks our view of the enclave's state + enclaveClient common.Enclave sl guardianServiceLocator storage storage.Storage @@ -134,9 +135,6 @@ func (g *Guardian) Start() error { } go g.mainLoop() - if g.hostData.IsSequencer { - g.startSequencerProcesses() - } // subscribe for L1 and P2P data txUnsub := g.sl.P2P().SubscribeForTx(g) @@ -197,7 +195,7 @@ func (g *Guardian) GetEnclaveID() *common.EnclaveID { } func (g *Guardian) PromoteToActiveSequencer() error { - if g.hostData.IsSequencer { + if g.isActiveSequencer { // this shouldn't happen and shouldn't be an issue if it does, but good to have visibility on it g.logger.Error("Unable to promote to active sequencer, already active") return nil @@ -206,7 +204,7 @@ func (g *Guardian) PromoteToActiveSequencer() error { if err != nil { return errors.Wrap(err, "could not promote enclave to active sequencer") } - g.hostData.IsSequencer = true + g.isActiveSequencer = true g.startSequencerProcesses() return nil } @@ -236,7 +234,7 @@ func (g *Guardian) HandleBatch(batch *common.ExtBatch) { // record the newest batch we've seen g.state.OnReceivedBatch(batch.Header.SequencerOrderNo) // Sequencer enclaves produce batches, they cannot receive them. Also, enclave will reject new batches if it is not up-to-date - if g.hostData.IsSequencer || !g.state.IsUpToDate() { + if g.isActiveSequencer || !g.state.IsUpToDate() { return // ignore batches until we're up-to-date } // todo - @matt - does it make sense to use a timeout context? @@ -555,7 +553,7 @@ func (g *Guardian) publishSharedSecretResponses(scrtResponses []*common.Produced for _, scrtResponse := range scrtResponses { // todo (#1624) - implement proper protocol so only one host responds to this secret requests initially // for now we just have the genesis host respond until protocol implemented - if !g.hostData.IsGenesis { + if !g.hostData.IsSequencer { g.logger.Trace("Not genesis node, not publishing response to secret request.", "requester", scrtResponse.RequesterID) return nil diff --git a/go/host/enclave/service.go b/go/host/enclave/service.go index c35232ccc..6e50d00cb 100644 --- a/go/host/enclave/service.go +++ b/go/host/enclave/service.go @@ -6,6 +6,7 @@ import ( "math/big" "sync" "sync/atomic" + "time" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ten-protocol/go-ten/go/common" @@ -16,6 +17,10 @@ import ( "github.com/ten-protocol/go-ten/lib/gethfork/rpc" ) +const ( + _promoteSeqRetryInterval = 1 * time.Second +) + // This private interface enforces the services that the enclaves service depends on type enclaveServiceLocator interface { P2P() host.P2P @@ -52,7 +57,9 @@ func (e *Service) Start() error { return err } } - e.activeSequencerID = e.enclaveGuardians[0].GetEnclaveID() + if e.hostData.IsSequencer { + go e.promoteNewActiveSequencer() + } return nil } @@ -87,7 +94,7 @@ func (e *Service) HealthStatus(ctx context.Context) host.HealthStatus { } if !guardian.GetEnclaveState().InSyncWithL1() { - errors = append(errors, fmt.Errorf("enclave[%d] not in sync with L1", i)) + errors = append(errors, fmt.Errorf("enclave[%d - %s] not in sync with L1 - %s", i, guardian.GetEnclaveID(), guardian.GetEnclaveState())) } } @@ -149,22 +156,7 @@ func (e *Service) NotifyUnavailable(enclaveID *common.EnclaveID) { e.enclaveGuardians = append(e.enclaveGuardians[:failedEnclaveIdx], e.enclaveGuardians[failedEnclaveIdx+1:]...) e.logger.Warn("Evicted enclave from HA pool.", log.EnclaveIDKey, enclaveID) - if *e.activeSequencerID == *enclaveID { - // sequencer enclave has failed, so we need to select another one to promote as the active sequencer - var i int - for i = 0; i < len(e.enclaveGuardians); i++ { - e.logger.Warn("Attempting to promote new sequencer.", log.EnclaveIDKey, e.enclaveGuardians[i].GetEnclaveID()) - err := e.enclaveGuardians[i].PromoteToActiveSequencer() - if err != nil { - e.logger.Warn("Failed to promote new sequencer.", log.ErrKey, err) - continue - } - e.activeSequencerID = e.enclaveGuardians[i].GetEnclaveID() - e.logger.Warn("Successfully promoted new sequencer.", log.EnclaveIDKey, e.activeSequencerID) - return - } - e.logger.Crit("All enclaves have failed, no sequencer to promote.") - } + go e.promoteNewActiveSequencer() } func (e *Service) SubmitAndBroadcastTx(ctx context.Context, encryptedParams common.EncryptedRequest) (*responses.RawTx, error) { @@ -197,3 +189,29 @@ func (e *Service) Subscribe(id rpc.ID, encryptedParams common.EncryptedParamsLog func (e *Service) Unsubscribe(id rpc.ID) error { return e.GetEnclaveClient().Unsubscribe(id) } + +// promoteNewActiveSequencer is a background goroutine that promotes a new active sequencer at startup or when the current one fails. +// It will never give up, it just cycles through current enclaves until one can be successfully promoted. +func (e *Service) promoteNewActiveSequencer() { + // remove activeSequencerID + e.activeSequencerID = nil + for e.activeSequencerID == nil && e.running.Load() { + if len(e.enclaveGuardians) == 0 { + e.logger.Crit("No enclaves to promote to active sequencer, sequencer host cannot continue.") + } + for _, guardian := range e.enclaveGuardians { + enclID := guardian.GetEnclaveID() + e.logger.Info("Attempting to promote new sequencer.", log.EnclaveIDKey, enclID) + err := guardian.PromoteToActiveSequencer() + if err != nil { + e.logger.Warn("Failed to promote new sequencer.", log.EnclaveIDKey, enclID, log.ErrKey, err) + continue + } + e.activeSequencerID = enclID + e.logger.Warn("Successfully promoted new sequencer.", log.EnclaveIDKey, e.activeSequencerID) + return + } + // wait for retry interval before trying again, enclaves may not be ready yet or we may not have permissioned them + time.Sleep(_promoteSeqRetryInterval) + } +} diff --git a/go/host/host.go b/go/host/host.go index 398bfeb81..4d24db1b8 100644 --- a/go/host/host.go +++ b/go/host/host.go @@ -84,8 +84,7 @@ func NewHost(config *hostconfig.HostConfig, hostServices *ServicesRegistry, p2p // clone the hostIdentity data for each enclave enclHostID := hostIdentity if i > 0 { - // only the first enclave can be the sequencer for now, others behave as read-only validators - enclHostID.IsSequencer = false + // we only let the first enclave be the genesis node to avoid initialization issues enclHostID.IsGenesis = false } enclGuardian := enclave.NewGuardian(config, enclHostID, hostServices, enclClient, hostStorage, host.stopControl, logger) diff --git a/go/host/l1/dataservice.go b/go/host/l1/dataservice.go index b0bc8d95c..67f888047 100644 --- a/go/host/l1/dataservice.go +++ b/go/host/l1/dataservice.go @@ -334,11 +334,11 @@ func (r *DataService) FetchBlockByHeight(height *big.Int) (*types.Block, error) // getEnclaveIdFromLog gets the enclave ID from the log topic func getEnclaveIdFromLog(log types.Log) (gethcommon.Address, error) { - if len(log.Topics) != 1 { - return gethcommon.Address{}, fmt.Errorf("invalid number of topics in log: %d", len(log.Topics)) + // the enclaveID field is not indexed, we read it from the data field + if len(log.Data) < 32 { + return gethcommon.Address{}, errors.New("log data too short, expected enclaveID address") } - - return gethcommon.BytesToAddress(log.Topics[0].Bytes()), nil + return gethcommon.BytesToAddress(log.Data[:32]), nil } func increment(i *big.Int) *big.Int { diff --git a/go/host/rpc/enclaverpc/enclave_client.go b/go/host/rpc/enclaverpc/enclave_client.go index 0bb0c6c0b..a858c666c 100644 --- a/go/host/rpc/enclaverpc/enclave_client.go +++ b/go/host/rpc/enclaverpc/enclave_client.go @@ -8,8 +8,6 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ten-protocol/go-ten/go/enclave/core" "github.com/ethereum/go-ethereum/rlp" @@ -514,23 +512,3 @@ func (c *Client) MakeActive() common.SystemError { } return nil } - -func (c *Client) AddSequencer(id common.EnclaveID, proof types.Receipt) common.SystemError { - blob, err := proof.MarshalBinary() - if err != nil { - return syserr.NewRPCError(err) - } - response, err := c.protoClient.AddSequencer( - context.Background(), - &generated.AddSequencerRequest{ - EnclaveId: id.Bytes(), - Proof: blob, - }) - if err != nil { - return syserr.NewRPCError(err) - } - if response != nil && response.SystemError != nil { - return syserr.NewInternalError(fmt.Errorf("%s", response.SystemError.ErrorString)) - } - return nil -} diff --git a/integration/common/constants.go b/integration/common/constants.go index fcf94c819..d831c32a7 100644 --- a/integration/common/constants.go +++ b/integration/common/constants.go @@ -9,7 +9,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" - "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/log" enclaveconfig "github.com/ten-protocol/go-ten/go/enclave/config" "github.com/ten-protocol/go-ten/go/wallet" @@ -68,7 +67,6 @@ func DefaultEnclaveConfig() *enclaveconfig.EnclaveConfig { NodeID: "", HostAddress: "127.0.0.1:10000", RPCAddress: "127.0.0.1:11000", - NodeType: common.ActiveSequencer, L1ChainID: 1337, TenChainID: 443, WillAttest: false, // todo (config) - attestation should be on by default before production release diff --git a/integration/ethereummock/mgmt_contract_lib.go b/integration/ethereummock/mgmt_contract_lib.go index fc32a9b89..6df804117 100644 --- a/integration/ethereummock/mgmt_contract_lib.go +++ b/integration/ethereummock/mgmt_contract_lib.go @@ -21,12 +21,16 @@ import ( ) var ( + // addresses used to simulate different methods on the mgmt contract depositTxAddr = datagenerator.RandomAddress() rollupTxAddr = datagenerator.RandomAddress() storeSecretTxAddr = datagenerator.RandomAddress() requestSecretTxAddr = datagenerator.RandomAddress() initializeSecretTxAddr = datagenerator.RandomAddress() - messageBusAddr = datagenerator.RandomAddress() + grantSeqTxAddr = datagenerator.RandomAddress() + + messageBusAddr = datagenerator.RandomAddress() + // ContractAddresses maps contract types to their addresses ContractAddresses = map[l1.ContractType][]gethcommon.Address{ l1.MgmtContract: { @@ -35,6 +39,7 @@ var ( storeSecretTxAddr, requestSecretTxAddr, initializeSecretTxAddr, + grantSeqTxAddr, }, l1.MsgBus: { messageBusAddr, @@ -144,6 +149,10 @@ func (m *mockContractLib) DecodeImportantAddressResponse([]byte) (gethcommon.Add return gethcommon.Address{}, nil } +func MockGrantSeqTxAddress() gethcommon.Address { + return grantSeqTxAddr +} + func decodeTx(tx *types.Transaction) common.L1TenTransaction { if len(tx.Data()) == 0 { panic("Data cannot be 0 in the mock implementation") @@ -166,6 +175,9 @@ func decodeTx(tx *types.Transaction) common.L1TenTransaction { t = &common.L1RequestSecretTx{} case initializeSecretTxAddr.Hex(): t = &common.L1InitializeSecretTx{} + case grantSeqTxAddr.Hex(): + // this tx is empty and entirely mocked, no need to decode + return &common.L1PermissionSeqTx{} default: panic("unexpected type") } diff --git a/integration/ethereummock/node.go b/integration/ethereummock/node.go index 31b483c7e..d97f968c9 100644 --- a/integration/ethereummock/node.go +++ b/integration/ethereummock/node.go @@ -94,6 +94,9 @@ type Node struct { mgmtContractLib mgmtcontractlib.MgmtContractLib logger gethlog.Logger + + // this mock state is to simulate the permissioning of the sequencer enclave, the L1 now 'knows the seq enclave ID' + tenSeqEnclaveID common.EnclaveID } func (m *Node) PrepareTransactionToSend(_ context.Context, txData types.TxData, _ gethcommon.Address) (types.TxData, error) { @@ -337,6 +340,7 @@ func (m *Node) GetLogs(fq ethereum.FilterQuery) ([]types.Log, error) { // map transaction types to their corresponding event topics var topic gethcommon.Hash + var data []byte switch tx.To().Hex() { case rollupTxAddr.Hex(): topic = crosschain.RollupAddedID @@ -350,6 +354,11 @@ func (m *Node) GetLogs(fq ethereum.FilterQuery) ([]types.Log, error) { topic = crosschain.NetworkSecretRequestedID case initializeSecretTxAddr.Hex(): topic = crosschain.SequencerEnclaveGrantedEventID + case grantSeqTxAddr.Hex(): + topic = crosschain.SequencerEnclaveGrantedEventID + // enclave ID address, padded out to 32 bytes to match standard eth fields + data = make([]byte, 32) + copy(data[12:], m.tenSeqEnclaveID[:]) default: continue } @@ -361,6 +370,7 @@ func (m *Node) GetLogs(fq ethereum.FilterQuery) ([]types.Log, error) { Topics: []gethcommon.Hash{topic}, BlockNumber: blk.NumberU64(), Index: uint(len(logs)), + Data: data, } logs = append(logs, dummyLog) } @@ -651,6 +661,10 @@ func (m *Node) ProcessBlobs(b *types.Block) error { return nil } +func (m *Node) PromoteEnclave(id common.EnclaveID) { + m.tenSeqEnclaveID = id +} + func NewMiner( id gethcommon.Address, cfg MiningConfig, diff --git a/integration/simulation/devnetwork/dev_network.go b/integration/simulation/devnetwork/dev_network.go index f61e599fd..2d5b5c62c 100644 --- a/integration/simulation/devnetwork/dev_network.go +++ b/integration/simulation/devnetwork/dev_network.go @@ -7,6 +7,7 @@ import ( "sync" "time" + "github.com/ten-protocol/go-ten/go/obsclient" "github.com/ten-protocol/go-ten/tools/walletextension" wecommon "github.com/ten-protocol/go-ten/tools/walletextension/common" @@ -156,7 +157,22 @@ func (s *InMemDevNetwork) Start() { s.startNodes() // sleep to allow the nodes to start - time.Sleep(10 * time.Second) + time.Sleep(15 * time.Second) + + seqClient, err := obsclient.Dial(s.SequencerRPCAddress()) + if err != nil { + panic(err) + } + h, _ := seqClient.Health() + if len(h.Enclaves) == 0 { + panic("no enclaves available to promote on sequencer") + } + for _, e := range h.Enclaves { + err = network.PermissionTenSequencerEnclave(s.networkWallets.MCOwnerWallet, s.l1Network.GetClient(0), s.l1SetupData.MgmtContractAddress, e.EnclaveID) + if err != nil { + panic(err) + } + } if s.tenConfig.TenGatewayEnabled { s.startTenGateway() diff --git a/integration/simulation/devnetwork/node.go b/integration/simulation/devnetwork/node.go index 490cc13e6..03319e693 100644 --- a/integration/simulation/devnetwork/node.go +++ b/integration/simulation/devnetwork/node.go @@ -198,16 +198,10 @@ func (n *InMemNodeOperator) createEnclaveContainer(idx int) *enclavecontainer.En hostAddr := fmt.Sprintf("%s:%d", network.Localhost, hostPort) defaultCfg := integrationCommon.DefaultEnclaveConfig() - enclaveType := n.nodeType - if n.nodeType == common.ActiveSequencer && idx > 0 { - // we only want one sequencer enclave for now - enclaveType = common.Validator - } enclaveConfig := &config.EnclaveConfig{ NodeID: fmt.Sprintf("%d", idx), HostAddress: hostAddr, RPCAddress: enclaveAddr, - NodeType: enclaveType, L1ChainID: integration.EthereumChainID, TenChainID: integration.TenChainID, WillAttest: false, diff --git a/integration/simulation/network/inmemory.go b/integration/simulation/network/inmemory.go index 9677e97c1..92cc85a33 100644 --- a/integration/simulation/network/inmemory.go +++ b/integration/simulation/network/inmemory.go @@ -4,6 +4,7 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/ten-protocol/go-ten/go/common/host" "github.com/ten-protocol/go-ten/go/ethadapter" "github.com/ten-protocol/go-ten/go/host/container" @@ -110,6 +111,31 @@ func (n *basicNetworkOfInMemoryNodes) Create(params *params.SimParams, stats *st } walletClients := createAuthClientsPerWallet(n.l2Clients, params.Wallets) + time.Sleep(params.AvgBlockDuration * 3) + + // permission the sequencer enclave on the L1 + health, err := tenClients[0].Health() + if err != nil { + panic(err) + } + if len(health.Enclaves) == 0 { + panic("no enclaves available to promote on sequencer") + } + + // mock implementation of the permissioning, tell the mock L1 the seq address + for _, node := range n.ethNodes { + node.PromoteEnclave(health.Enclaves[0].EnclaveID) + } + permMockAddr := ethereummock.MockGrantSeqTxAddress() + mockTx := types.NewTx(&types.LegacyTx{ + To: &permMockAddr, + Data: []byte{0x1}, + }) + err = n.ethNodes[0].SendTransaction(mockTx) + if err != nil { + return nil, err + } + return &RPCHandles{ EthClients: l1Clients, TenClients: tenClients, diff --git a/integration/simulation/network/network_utils.go b/integration/simulation/network/network_utils.go index 7a3fc5a3f..508b0a228 100644 --- a/integration/simulation/network/network_utils.go +++ b/integration/simulation/network/network_utils.go @@ -83,7 +83,6 @@ func createInMemTenNode( enclaveConfig := &enclaveconfig.EnclaveConfig{ NodeID: hostConfig.ID, - NodeType: nodeType, L1ChainID: integration.EthereumChainID, TenChainID: integration.TenChainID, WillAttest: false, diff --git a/integration/simulation/network/socket.go b/integration/simulation/network/socket.go index 211e02087..599569dfd 100644 --- a/integration/simulation/network/socket.go +++ b/integration/simulation/network/socket.go @@ -149,20 +149,46 @@ func (n *networkOfSocketNodes) Create(simParams *params.SimParams, _ *stats.Stat } walletClients := createAuthClientsPerWallet(n.l2Clients, simParams.Wallets) + time.Sleep(15 * simParams.AvgBlockDuration) + // permission the sequencer enclaveID - seqHealth, err := n.tenClients[0].Health() - if err != nil { - return nil, fmt.Errorf("unable to get sequencer enclaveID: %w", err) - } - if len(seqHealth.Enclaves) == 0 { - return nil, fmt.Errorf("no enclaves found in health response") + // we retry fetching the seqHealth until it comes back with the enclaveID as the nodes are still starting up + startTime := time.Now() + var seqEnclaveID *common.EnclaveID + for ; seqEnclaveID == nil; time.Sleep(100 * time.Millisecond) { + seqHealth, _ := n.tenClients[0].Health() + if seqHealth.Enclaves == nil || len(seqHealth.Enclaves) == 0 { + continue + } + seqEnclaveID = &seqHealth.Enclaves[0].EnclaveID + if time.Now().After(startTime.Add(2 * time.Minute)) { + return nil, fmt.Errorf("unable to get sequencer enclaveID after 2 minutes") + } } - seqEnclaveID := seqHealth.Enclaves[0].EnclaveID - err = PermissionTenSequencerEnclave(n.wallets.MCOwnerWallet, n.gethClients[0], simParams.L1TenData.MgmtContractAddress, seqEnclaveID) + + // permission the sequencer enclaveID (also requires retries as the enclaveID may not be attested yet) + err = PermissionTenSequencerEnclave(n.wallets.MCOwnerWallet, n.gethClients[0], simParams.L1TenData.MgmtContractAddress, *seqEnclaveID) if err != nil { return nil, fmt.Errorf("unable to permission sequencer enclaveID: %w", err) } + // wait for nodes to be healthy now we've permissioned + // make sure the nodes are healthy + for _, client := range n.tenClients { + startTime := time.Now() + healthy := false + for ; !healthy; time.Sleep(500 * time.Millisecond) { + h, _ := client.Health() + healthy = h.OverallHealth + if !healthy { + fmt.Println(h.Errors) + } + if time.Now().After(startTime.Add(3 * time.Minute)) { + return nil, fmt.Errorf("nodes not healthy after 3 minutes") + } + } + } + return &RPCHandles{ EthClients: n.gethClients, TenClients: n.tenClients, @@ -209,18 +235,6 @@ func (n *networkOfSocketNodes) createConnections(simParams *params.SimParams) er n.tenClients[idx] = obsclient.NewObsClient(l2Client) } - // make sure the nodes are healthy - for _, client := range n.tenClients { - startTime := time.Now() - healthy := false - for ; !healthy; time.Sleep(500 * time.Millisecond) { - h, _ := client.Health() - healthy = h.OverallHealth - if time.Now().After(startTime.Add(3 * time.Minute)) { - return fmt.Errorf("nodes not healthy after 3 minutes") - } - } - } return nil } diff --git a/integration/simulation/p2p/in_mem_ten_client.go b/integration/simulation/p2p/in_mem_ten_client.go index 38009f5a8..89196feb1 100644 --- a/integration/simulation/p2p/in_mem_ten_client.go +++ b/integration/simulation/p2p/in_mem_ten_client.go @@ -6,6 +6,7 @@ import ( "fmt" "math/big" + hostcommon "github.com/ten-protocol/go-ten/go/common/host" tenrpc "github.com/ten-protocol/go-ten/go/common/rpc" "github.com/ethereum/go-ethereum/common/hexutil" @@ -20,7 +21,6 @@ import ( "github.com/ten-protocol/go-ten/integration/common/testlog" gethcommon "github.com/ethereum/go-ethereum/common" - hostcommon "github.com/ten-protocol/go-ten/go/common/host" gethrpc "github.com/ten-protocol/go-ten/lib/gethfork/rpc" ) @@ -243,11 +243,18 @@ func (c *inMemTenClient) RegisterViewingKey(_ gethcommon.Address, _ []byte) erro } func (c *inMemTenClient) health(result interface{}) error { - if resPtr, ok := result.(*hostcommon.HealthCheck); ok { - *resPtr = hostcommon.HealthCheck{OverallHealth: true} - return nil + resPtr, ok := result.(*hostcommon.HealthCheck) + if !ok { + return fmt.Errorf("invalid type for result: expected *hostcommon.HealthCheck") + } + + healthPtr, err := c.tenAPI.Health(context.Background()) + if err != nil { + return err } - return fmt.Errorf("invalid type for result: expected *hostcommon.HealthCheck") + + *resPtr = *healthPtr // Dereference the pointer to assign the value + return nil } func (c *inMemTenClient) getTotalTransactions(result interface{}) error { From daa8eaabcb54de91cf1e1bec52cb4b4702db2aa4 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Mon, 13 Jan 2025 14:29:15 +0200 Subject: [PATCH 04/10] remove l1 block, close resources (#2242) * remove l1 block, close resources * fix * fix * fix * fix * fix * fix * fix --- go/common/encoding.go | 22 ---- go/common/gethencoding/geth_encoding.go | 4 +- go/common/gethutil/gethutil.go | 12 +- go/common/host/host.go | 6 - go/common/host/services.go | 8 +- go/common/log/log.go | 3 +- go/common/subscription/new_heads_manager.go | 5 +- go/common/types.go | 1 - go/common/utils.go | 22 ---- go/enclave/components/batch_executor.go | 4 +- go/enclave/enclave_admin_service.go | 2 +- go/enclave/rpc/GetTransaction.go | 6 +- go/enclave/storage/storage.go | 2 +- go/ethadapter/geth_rpc_client.go | 91 ++++++++------ go/ethadapter/interface.go | 13 +- go/host/container/host_container.go | 8 +- go/host/enclave/guardian.go | 18 ++- go/host/l1/dataservice.go | 94 ++++++++------ go/host/l1/publisher.go | 6 +- go/host/l1/statemachine.go | 4 +- go/host/storage/hostdb/block_test.go | 2 +- go/host/storage/hostdb/rollup.go | 4 +- go/host/storage/hostdb/rollup_test.go | 26 ++-- go/host/storage/interfaces.go | 2 +- go/host/storage/storage.go | 2 +- integration/common/testlog/testlog.go | 6 +- .../contract_deployer_test.go | 2 +- integration/datagenerator/rollup.go | 2 +- integration/eth2network/config.yml | 4 +- integration/ethereummock/db.go | 35 ++++-- integration/ethereummock/gethutil.go | 67 ---------- integration/ethereummock/mock_l1_network.go | 18 +-- integration/ethereummock/node.go | 119 ++++++++++-------- integration/ethereummock/utils.go | 23 +++- integration/faucet/faucet_test.go | 2 +- integration/simulation/devnetwork/config.go | 2 +- integration/simulation/output_stats.go | 8 +- integration/simulation/simulation.go | 8 +- .../simulation_full_network_test.go | 2 +- .../simulation/simulation_geth_in_mem_test.go | 2 +- integration/simulation/utils.go | 2 +- integration/simulation/validate_chain.go | 20 ++- integration/tengateway/tengateway_test.go | 2 +- integration/tenscan/tenscan_test.go | 2 +- 44 files changed, 337 insertions(+), 356 deletions(-) delete mode 100644 integration/ethereummock/gethutil.go diff --git a/go/common/encoding.go b/go/common/encoding.go index 8fc9f0337..a9fd0f51a 100644 --- a/go/common/encoding.go +++ b/go/common/encoding.go @@ -1,31 +1,9 @@ package common import ( - "fmt" - - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" ) -// EncodedL1Block the encoded version of an L1 block. -type EncodedL1Block []byte - -func EncodeBlock(b *types.Block) (EncodedL1Block, error) { - encoded, err := rlp.EncodeToBytes(b) - if err != nil { - return nil, fmt.Errorf("could not encode block to bytes. Cause: %w", err) - } - return encoded, nil -} - -func (eb EncodedL1Block) DecodeBlock() (*types.Block, error) { - b := types.Block{} - if err := rlp.DecodeBytes(eb, &b); err != nil { - return nil, fmt.Errorf("could not decode block from bytes. Cause: %w", err) - } - return &b, nil -} - func EncodeRollup(r *ExtRollup) (EncodedRollup, error) { return rlp.EncodeToBytes(r) } diff --git a/go/common/gethencoding/geth_encoding.go b/go/common/gethencoding/geth_encoding.go index 88e6f3885..edfb675db 100644 --- a/go/common/gethencoding/geth_encoding.go +++ b/go/common/gethencoding/geth_encoding.go @@ -11,6 +11,8 @@ import ( "time" "unsafe" + "github.com/ten-protocol/go-ten/go/common/gethutil" + gethlog "github.com/ethereum/go-ethereum/log" "github.com/ten-protocol/go-ten/go/common/log" "github.com/ten-protocol/go-ten/go/enclave/storage" @@ -288,7 +290,7 @@ func (enc *gethEncodingServiceImpl) CreateEthHeaderForBatch(ctx context.Context, gethHeader := types.Header{ ParentHash: convertedParentHash, - UncleHash: gethcommon.Hash{}, + UncleHash: gethutil.EmptyHash, Root: h.Root, TxHash: h.TxHash, ReceiptHash: h.ReceiptHash, diff --git a/go/common/gethutil/gethutil.go b/go/common/gethutil/gethutil.go index 514f31300..1cb8a0596 100644 --- a/go/common/gethutil/gethutil.go +++ b/go/common/gethutil/gethutil.go @@ -4,8 +4,6 @@ import ( "context" "fmt" - "github.com/ten-protocol/go-ten/go/enclave/storage" - gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ten-protocol/go-ten/go/common" @@ -13,12 +11,16 @@ import ( // Utilities for working with geth structures +type BlockResolver interface { + FetchBlock(ctx context.Context, blockHash common.L1BlockHash) (*types.Header, error) +} + // EmptyHash is useful for comparisons to check if hash has been set var EmptyHash = gethcommon.Hash{} // LCA - returns the latest common ancestor of the 2 blocks or an error if no common ancestor is found // it also returns the blocks that became canonical, and the once that are now the fork -func LCA(ctx context.Context, newCanonical *types.Header, oldCanonical *types.Header, resolver storage.BlockResolver) (*common.ChainFork, error) { +func LCA(ctx context.Context, newCanonical *types.Header, oldCanonical *types.Header, resolver BlockResolver) (*common.ChainFork, error) { b, cp, ncp, err := internalLCA(ctx, newCanonical, oldCanonical, resolver, []common.L1BlockHash{}, []common.L1BlockHash{}) return &common.ChainFork{ NewCanonical: newCanonical, @@ -29,9 +31,9 @@ func LCA(ctx context.Context, newCanonical *types.Header, oldCanonical *types.He }, err } -func internalLCA(ctx context.Context, newCanonical *types.Header, oldCanonical *types.Header, resolver storage.BlockResolver, canonicalPath []common.L1BlockHash, nonCanonicalPath []common.L1BlockHash) (*types.Header, []common.L1BlockHash, []common.L1BlockHash, error) { +func internalLCA(ctx context.Context, newCanonical *types.Header, oldCanonical *types.Header, resolver BlockResolver, canonicalPath []common.L1BlockHash, nonCanonicalPath []common.L1BlockHash) (*types.Header, []common.L1BlockHash, []common.L1BlockHash, error) { if newCanonical.Number.Uint64() == common.L1GenesisHeight || oldCanonical.Number.Uint64() == common.L1GenesisHeight { - return newCanonical, canonicalPath, nonCanonicalPath, nil + return oldCanonical, canonicalPath, nonCanonicalPath, nil } if newCanonical.Hash() == oldCanonical.Hash() { // this is where we reach the common ancestor, which we add to the canonical path diff --git a/go/common/host/host.go b/go/common/host/host.go index d1479049d..0b64dbf81 100644 --- a/go/common/host/host.go +++ b/go/common/host/host.go @@ -3,7 +3,6 @@ package host import ( "context" - "github.com/ethereum/go-ethereum/core/types" "github.com/ten-protocol/go-ten/go/common" hostconfig "github.com/ten-protocol/go-ten/go/host/config" "github.com/ten-protocol/go-ten/go/host/storage" @@ -38,11 +37,6 @@ type Host interface { NewHeadsChan() chan *common.BatchHeader } -type BlockStream struct { - Stream <-chan *types.Block // the channel which will receive the consecutive, canonical blocks - Stop func() // function to permanently stop the stream and clean up any associated processes/resources -} - type BatchMsg struct { Batches []*common.ExtBatch // The batches being sent. IsLive bool // true if these batches are being sent as new, false if in response to a p2p request diff --git a/go/common/host/services.go b/go/common/host/services.go index 9b1dcfbe4..f0464d2b9 100644 --- a/go/common/host/services.go +++ b/go/common/host/services.go @@ -80,18 +80,18 @@ type L1DataService interface { // Subscribe will register a block handler to receive new blocks as they arrive, returns unsubscribe func Subscribe(handler L1BlockHandler) func() - FetchBlockByHeight(height *big.Int) (*types.Block, error) + FetchBlockByHeight(height *big.Int) (*types.Header, error) // FetchNextBlock returns the next canonical block after a given block hash // It returns the new block, a bool which is true if the block is the current L1 head and a bool if the block is on a different fork to prevBlock - FetchNextBlock(prevBlock gethcommon.Hash) (*types.Block, bool, error) + FetchNextBlock(prevBlock gethcommon.Hash) (*types.Header, bool, error) // GetTenRelevantTransactions returns the events and transactions relevant to Ten - GetTenRelevantTransactions(block *common.L1Block) (*common.ProcessedL1Data, error) + GetTenRelevantTransactions(block *types.Header) (*common.ProcessedL1Data, error) } // L1BlockHandler is an interface for receiving new blocks from the repository as they arrive type L1BlockHandler interface { // HandleBlock will be called in a new goroutine for each new block as it arrives - HandleBlock(block *types.Block) + HandleBlock(block *types.Header) } // L1Publisher provides an interface for the host to interact with Ten data (management contract etc.) on L1 diff --git a/go/common/log/log.go b/go/common/log/log.go index 86f10876b..69649ac5f 100644 --- a/go/common/log/log.go +++ b/go/common/log/log.go @@ -19,7 +19,7 @@ const ( BatchHeightKey = "batch_height" BatchSeqNoKey = "batch_seq_num" RollupHashKey = "rollup" - CmpKey = "component" + CmpKey = "cmp" NodeIDKey = "node_id" EnclaveIDKey = "enclave_id" NetworkIDKey = "network_id" @@ -34,7 +34,6 @@ const ( HostCmp = "host" HostRPCCmp = "host_rpc" TxInjectCmp = "tx_inject" - TestLogCmp = "test_log" P2PCmp = "p2p" RPCClientCmp = "rpc_client" DeployerCmp = "deployer" diff --git a/go/common/subscription/new_heads_manager.go b/go/common/subscription/new_heads_manager.go index 4ebbb8ce0..5ec51050a 100644 --- a/go/common/subscription/new_heads_manager.go +++ b/go/common/subscription/new_heads_manager.go @@ -7,7 +7,8 @@ import ( "sync/atomic" "time" - gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ethereum/go-ethereum/core/types" gethlog "github.com/ethereum/go-ethereum/log" @@ -133,7 +134,7 @@ func (nhs *NewHeadsService) HealthStatus(context.Context) host.HealthStatus { func ConvertBatchHeader(head *common.BatchHeader) *types.Header { return &types.Header{ ParentHash: head.ParentHash, - UncleHash: gethcommon.Hash{}, + UncleHash: gethutil.EmptyHash, Coinbase: head.Coinbase, Root: head.Root, TxHash: head.TxHash, diff --git a/go/common/types.go b/go/common/types.go index 1f4001fc5..09e1756c8 100644 --- a/go/common/types.go +++ b/go/common/types.go @@ -33,7 +33,6 @@ type ( // MainNet aliases L1Address = common.Address L1BlockHash = common.Hash - L1Block = types.Block L1Transaction = types.Transaction L1Receipt = types.Receipt L1Receipts = types.Receipts diff --git a/go/common/utils.go b/go/common/utils.go index b4a3bc2fc..2ea26798e 100644 --- a/go/common/utils.go +++ b/go/common/utils.go @@ -1,19 +1,12 @@ package common import ( - "math/big" "math/rand" "time" - "github.com/ethereum/go-ethereum/core/types" - gethcommon "github.com/ethereum/go-ethereum/common" ) -type ( - Latency func() time.Duration -) - func MaxInt(x, y uint32) uint32 { if x < y { return y @@ -21,21 +14,6 @@ func MaxInt(x, y uint32) uint32 { return x } -// ShortHash converts the hash to a shorter uint64 for printing. -func ShortHash(hash gethcommon.Hash) uint64 { - return hash.Big().Uint64() -} - -// ShortAddress converts the address to a shorter uint64 for printing. -func ShortAddress(address gethcommon.Address) uint64 { - return address.Big().Uint64() -} - -// ShortNonce converts the nonce to a shorter uint64 for printing. -func ShortNonce(nonce types.BlockNonce) uint64 { - return new(big.Int).SetBytes(nonce[4:]).Uint64() -} - // ExtractPotentialAddress - given a 32 byte hash , it checks whether it can be an address and extracts that func ExtractPotentialAddress(hash gethcommon.Hash) *gethcommon.Address { bitlen := hash.Big().BitLen() diff --git a/go/enclave/components/batch_executor.go b/go/enclave/components/batch_executor.go index 7fc18033c..e49cb32bf 100644 --- a/go/enclave/components/batch_executor.go +++ b/go/enclave/components/batch_executor.go @@ -8,6 +8,8 @@ import ( "math/big" "sync" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/common/compression" gethcore "github.com/ethereum/go-ethereum/core" @@ -515,7 +517,7 @@ func (executor *batchExecutor) execResult(ec *BatchExecutionContext) (*ComputedB defer executor.stateDBMutex.Unlock() h, err := ec.stateDB.Commit(batch.Number().Uint64(), deleteEmptyObjects) if err != nil { - return gethcommon.Hash{}, fmt.Errorf("commit failure for batch %d. Cause: %w", ec.currentBatch.SeqNo(), err) + return gethutil.EmptyHash, fmt.Errorf("commit failure for batch %d. Cause: %w", ec.currentBatch.SeqNo(), err) } trieDB := executor.storage.TrieDB() err = trieDB.Commit(h, false) diff --git a/go/enclave/enclave_admin_service.go b/go/enclave/enclave_admin_service.go index b5e514353..0a5bea6b6 100644 --- a/go/enclave/enclave_admin_service.go +++ b/go/enclave/enclave_admin_service.go @@ -550,7 +550,7 @@ func (e *enclaveAdminService) getNodeType(ctx context.Context) common.NodeType { id := e.enclaveKeyService.EnclaveID() attestedEnclave, err := e.storage.GetEnclavePubKey(ctx, id) if err != nil { - e.logger.Warn("could not read enclave pub key. Defaulting to validator type", log.ErrKey, err) + e.logger.Info("could not read enclave pub key. Defaulting to validator type", log.ErrKey, err) return common.Validator } return attestedEnclave.Type diff --git a/go/enclave/rpc/GetTransaction.go b/go/enclave/rpc/GetTransaction.go index 767c6d525..ad374725a 100644 --- a/go/enclave/rpc/GetTransaction.go +++ b/go/enclave/rpc/GetTransaction.go @@ -5,6 +5,8 @@ import ( "fmt" "math/big" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/enclave/storage" "github.com/ten-protocol/go-ten/go/common/log" @@ -121,7 +123,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash gethcommon.Hash, blockNu R: (*hexutil.Big)(r), S: (*hexutil.Big)(s), } - if blockHash != (gethcommon.Hash{}) { + if blockHash != gethutil.EmptyHash { result.BlockHash = &blockHash result.BlockNumber = (*hexutil.Big)(new(big.Int).SetUint64(blockNumber)) result.TransactionIndex = (*hexutil.Uint64)(&index) @@ -138,7 +140,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash gethcommon.Hash, blockNu result.GasFeeCap = (*hexutil.Big)(tx.GasFeeCap()) result.GasTipCap = (*hexutil.Big)(tx.GasTipCap()) // if the transaction has been mined, compute the effective gas price - if baseFee != nil && blockHash != (gethcommon.Hash{}) { + if baseFee != nil && blockHash != gethutil.EmptyHash { // price = min(tip, gasFeeCap - baseFee) + baseFee price := math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee), tx.GasFeeCap()) result.GasPrice = (*hexutil.Big)(price) diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index 0fa66316c..392b3cd16 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -449,7 +449,7 @@ func (s *storageImpl) GetEnclavePubKey(ctx context.Context, enclaveId common.Enc return s.cachingService.ReadEnclavePubKey(ctx, enclaveId, func() (*AttestedEnclave, error) { key, nodeType, err := enclavedb.FetchAttestation(ctx, s.db.GetSQLDB(), enclaveId) if err != nil { - return nil, fmt.Errorf("could not retrieve attestation key for address %s. Cause: %w", enclaveId, err) + return nil, fmt.Errorf("could not retrieve attestation key for enclave %s. Cause: %w", enclaveId, err) } publicKey, err := gethcrypto.DecompressPubkey(key) diff --git a/go/ethadapter/geth_rpc_client.go b/go/ethadapter/geth_rpc_client.go index b2705c817..b0d90dc9f 100644 --- a/go/ethadapter/geth_rpc_client.go +++ b/go/ethadapter/geth_rpc_client.go @@ -8,6 +8,8 @@ import ( "math/big" "time" + "github.com/TwiN/gocache/v2" + "github.com/ethereum/go-ethereum/consensus/misc/eip4844" "github.com/ethereum/go-ethereum/params" "github.com/holiman/uint256" @@ -19,8 +21,6 @@ import ( "github.com/ethereum/go-ethereum/ethclient" gethlog "github.com/ethereum/go-ethereum/log" - lru "github.com/hashicorp/golang-lru/v2" - "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/log" @@ -45,7 +45,7 @@ type gethRPCClient struct { timeout time.Duration // the timeout for connecting to, or communicating with, the L1 node logger gethlog.Logger rpcURL string - blockCache *lru.Cache[gethcommon.Hash, *types.Block] + blockCache *gocache.Cache } // NewEthClientFromURL instantiates a new ethadapter.EthClient that connects to an ethereum node @@ -57,45 +57,49 @@ func NewEthClientFromURL(rpcURL string, timeout time.Duration, logger gethlog.Lo logger.Trace(fmt.Sprintf("Initialized eth node connection - addr: %s", rpcURL)) - // cache recent blocks to avoid re-fetching them (they are often re-used for checking for forks etc.) - blkCache, err := lru.New[gethcommon.Hash, *types.Block](_defaultBlockCacheSize) - if err != nil { - return nil, fmt.Errorf("unable to initialize block cache - %w", err) - } - return &gethRPCClient{ client: client, timeout: timeout, logger: logger, rpcURL: rpcURL, - blockCache: blkCache, + blockCache: newFifoCache(_defaultBlockCacheSize, 5*time.Minute), }, nil } +func newFifoCache(nrElem int, ttl time.Duration) *gocache.Cache { + cache := gocache.NewCache().WithMaxSize(nrElem).WithEvictionPolicy(gocache.FirstInFirstOut).WithDefaultTTL(ttl) + err := cache.StartJanitor() + if err != nil { + panic("failed to start cache.") + } + return cache +} + // NewEthClient instantiates a new ethadapter.EthClient that connects to an ethereum node func NewEthClient(ipaddress string, port uint, timeout time.Duration, logger gethlog.Logger) (EthClient, error) { return NewEthClientFromURL(fmt.Sprintf("ws://%s:%d", ipaddress, port), timeout, logger) } -func (e *gethRPCClient) FetchHeadBlock() (*types.Block, error) { +func (e *gethRPCClient) FetchHeadBlock() (*types.Header, error) { ctx, cancel := context.WithTimeout(context.Background(), e.timeout) defer cancel() - return e.client.BlockByNumber(ctx, nil) + return e.client.HeaderByNumber(ctx, nil) } func (e *gethRPCClient) Info() Info { return Info{} } -func (e *gethRPCClient) BlocksBetween(startingBlock *types.Header, lastBlock *types.Block) []*types.Block { - var blocksBetween []*types.Block +func (e *gethRPCClient) BlocksBetween(startingBlock *types.Header, lastBlock *types.Header) []*types.Header { + var blocksBetween []*types.Header var err error - for currentBlk := lastBlock; currentBlk != nil && !bytes.Equal(currentBlk.Hash().Bytes(), startingBlock.Hash().Bytes()) && !bytes.Equal(currentBlk.ParentHash().Bytes(), gethcommon.HexToHash("").Bytes()); { - currentBlk, err = e.BlockByHash(currentBlk.ParentHash()) + for currentBlk := lastBlock; currentBlk != nil && !bytes.Equal(currentBlk.Hash().Bytes(), startingBlock.Hash().Bytes()) && !bytes.Equal(currentBlk.ParentHash.Bytes(), gethcommon.HexToHash("").Bytes()); { + c := currentBlk.ParentHash + currentBlk, err = e.HeaderByHash(currentBlk.ParentHash) if err != nil { - e.logger.Crit(fmt.Sprintf("could not fetch parent block with hash %s.", currentBlk.ParentHash().String()), log.ErrKey, err) + e.logger.Crit(fmt.Sprintf("could not fetch parent block with hash %s.", c.String()), log.ErrKey, err) } blocksBetween = append(blocksBetween, currentBlk) } @@ -103,28 +107,26 @@ func (e *gethRPCClient) BlocksBetween(startingBlock *types.Header, lastBlock *ty return blocksBetween } -func (e *gethRPCClient) IsBlockAncestor(block *types.Block, maybeAncestor common.L1BlockHash) bool { +func (e *gethRPCClient) IsBlockAncestor(block *types.Header, maybeAncestor common.L1BlockHash) bool { if bytes.Equal(maybeAncestor.Bytes(), block.Hash().Bytes()) || bytes.Equal(maybeAncestor.Bytes(), (common.L1BlockHash{}).Bytes()) { return true } - if block.Number().Int64() == int64(common.L1GenesisHeight) { + if block.Number.Int64() == int64(common.L1GenesisHeight) { return false } - resolvedBlock, err := e.BlockByHash(maybeAncestor) + resolvedAncestorBlock, err := e.HeaderByHash(maybeAncestor) if err != nil { e.logger.Crit(fmt.Sprintf("could not fetch parent block with hash %s.", maybeAncestor.String()), log.ErrKey, err) } - if resolvedBlock == nil { - if resolvedBlock.Number().Int64() >= block.Number().Int64() { - return false - } + if resolvedAncestorBlock.Number.Int64() >= block.Number.Int64() { + return false } - p, err := e.BlockByHash(block.ParentHash()) + p, err := e.HeaderByHash(block.ParentHash) if err != nil { - e.logger.Crit(fmt.Sprintf("could not fetch parent block with hash %s", block.ParentHash().String()), log.ErrKey, err) + e.logger.Crit(fmt.Sprintf("could not fetch parent block with hash %s", block.ParentHash.String()), log.ErrKey, err) } if p == nil { return false @@ -162,14 +164,13 @@ func (e *gethRPCClient) Nonce(account gethcommon.Address) (uint64, error) { } func (e *gethRPCClient) BlockListener() (chan *types.Header, ethereum.Subscription) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - // we do not buffer here, we expect the consumer to always be ready to receive new blocks and not fall behind - ch := make(chan *types.Header, 1) + ch := make(chan *types.Header) var sub ethereum.Subscription var err error err = retry.Do(func() error { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() sub, err = e.client.SubscribeNewHead(ctx, ch) if err != nil { e.logger.Warn("could not subscribe for new head blocks", log.ErrKey, err) @@ -192,17 +193,25 @@ func (e *gethRPCClient) BlockNumber() (uint64, error) { return e.client.BlockNumber(ctx) } -func (e *gethRPCClient) BlockByNumber(n *big.Int) (*types.Block, error) { +func (e *gethRPCClient) HeaderByNumber(n *big.Int) (*types.Header, error) { ctx, cancel := context.WithTimeout(context.Background(), e.timeout) defer cancel() - return e.client.BlockByNumber(ctx, n) + b, err := e.client.BlockByNumber(ctx, n) + if err != nil { + return nil, err + } + return b.Header(), nil } -func (e *gethRPCClient) BlockByHash(hash gethcommon.Hash) (*types.Block, error) { - block, found := e.blockCache.Get(hash) +func (e *gethRPCClient) HeaderByHash(hash gethcommon.Hash) (*types.Header, error) { + cachedBlock, found := e.blockCache.Get(hash.Hex()) if found { - return block, nil + h, ok := cachedBlock.(types.Header) + if !ok { + return nil, fmt.Errorf("should not happen. could not cast cached block to header") + } + return &h, nil } // not in cache, fetch from RPC @@ -213,8 +222,15 @@ func (e *gethRPCClient) BlockByHash(hash gethcommon.Hash) (*types.Block, error) if err != nil { return nil, err } - e.blockCache.Add(hash, block) - return block, nil + e.blockCache.Set(hash.Hex(), *block.Header()) + return block.Header(), nil +} + +func (e *gethRPCClient) BlockByHash(hash gethcommon.Hash) (*types.Block, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + return e.client.BlockByHash(ctx, hash) } func (e *gethRPCClient) CallContract(msg ethereum.CallMsg) ([]byte, error) { @@ -243,6 +259,7 @@ func (e *gethRPCClient) GetLogs(q ethereum.FilterQuery) ([]types.Log, error) { } func (e *gethRPCClient) Stop() { + e.blockCache.StopJanitor() e.client.Close() } diff --git a/go/ethadapter/interface.go b/go/ethadapter/interface.go index 59e4daa77..20db0da9c 100644 --- a/go/ethadapter/interface.go +++ b/go/ethadapter/interface.go @@ -17,8 +17,9 @@ import ( // todo (#1617) - some of these methods are composed calls that should be decoupled in the future (ie: BlocksBetween or IsBlockAncestor) type EthClient interface { BlockNumber() (uint64, error) // retrieves the number of the head block + HeaderByHash(id gethcommon.Hash) (*types.Header, error) // retrieves a block header given a hash BlockByHash(id gethcommon.Hash) (*types.Block, error) // retrieves a block given a hash - BlockByNumber(n *big.Int) (*types.Block, error) // retrieves a block given a number - returns head block if n is nil + HeaderByNumber(n *big.Int) (*types.Header, error) // retrieves a block given a number - returns head block if n is nil SendTransaction(signedTx *types.Transaction) error // issues an ethereum transaction (expects signed tx) TransactionReceipt(hash gethcommon.Hash) (*types.Receipt, error) // fetches the ethereum transaction receipt TransactionByHash(hash gethcommon.Hash) (*types.Transaction, bool, error) // fetches the ethereum tx @@ -26,11 +27,11 @@ type EthClient interface { BalanceAt(account gethcommon.Address, blockNumber *big.Int) (*big.Int, error) // fetches the balance of the account GetLogs(q ethereum.FilterQuery) ([]types.Log, error) // fetches the logs for a given query - Info() Info // retrieves the node Info - FetchHeadBlock() (*types.Block, error) // retrieves the block at head height - BlocksBetween(block *types.Header, head *types.Block) []*types.Block // returns the blocks between two blocks - IsBlockAncestor(block *types.Block, proof common.L1BlockHash) bool // returns if the node considers a block the ancestor - BlockListener() (chan *types.Header, ethereum.Subscription) // subscribes to new blocks and returns a listener with the blocks heads and the subscription handler + Info() Info // retrieves the node Info + FetchHeadBlock() (*types.Header, error) // retrieves the block at head height + BlocksBetween(block *types.Header, head *types.Header) []*types.Header // returns the blocks between two blocks + IsBlockAncestor(block *types.Header, maybeAncestor common.L1BlockHash) bool // returns if the node considers a block the ancestor + BlockListener() (chan *types.Header, ethereum.Subscription) // subscribes to new blocks and returns a listener with the blocks heads and the subscription handler CallContract(msg ethereum.CallMsg) ([]byte, error) // Runs the provided call message on the latest block. diff --git a/go/host/container/host_container.go b/go/host/container/host_container.go index 41be97eb2..4c7f8a635 100644 --- a/go/host/container/host_container.go +++ b/go/host/container/host_container.go @@ -50,8 +50,8 @@ func (h *HostContainer) Start() error { if err != nil { return err } - h.logger.Info("Started Obscuro host...") - fmt.Println("Started Obscuro host...") + h.logger.Info("Started TEN host...") + fmt.Println("Started TEN host...") if h.rpcServer != nil { err = h.rpcServer.Start() @@ -59,8 +59,8 @@ func (h *HostContainer) Start() error { return err } - h.logger.Info("Started Obscuro host RPC Server...") - fmt.Println("Started Obscuro host RPC Server...") + h.logger.Info("Started TEN host RPC Server...") + fmt.Println("Started TEN host RPC Server...") } return nil diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 27e212bd7..18837ec2b 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -213,8 +213,8 @@ func (g *Guardian) PromoteToActiveSequencer() error { // Note: The L1 processing behaviour has two modes based on the state, either // - enclave is behind: lookup blocks to feed it 1-by-1 (see `catchupWithL1()`), ignore new live blocks that arrive here // - enclave is up-to-date: feed it these live blocks as they arrive, no need to lookup blocks -func (g *Guardian) HandleBlock(block *types.Block) { - g.logger.Debug("Received L1 block", log.BlockHashKey, block.Hash(), log.BlockHeightKey, block.Number()) +func (g *Guardian) HandleBlock(block *types.Header) { + g.logger.Debug("Received L1 block", log.BlockHashKey, block.Hash(), log.BlockHeightKey, block.Number) // record the newest block we've seen g.state.OnReceivedBlock(block.Hash()) if !g.state.InSyncWithL1() { @@ -463,8 +463,8 @@ func (g *Guardian) catchupWithL2() error { // returns false if the block was not processed // todo - @matt - think about removing the TryLock -func (g *Guardian) submitL1Block(block *common.L1Block, isLatest bool) (bool, error) { - g.logger.Trace("submitting L1 block", log.BlockHashKey, block.Hash(), log.BlockHeightKey, block.Number()) +func (g *Guardian) submitL1Block(block *types.Header, isLatest bool) (bool, error) { + g.logger.Trace("submitting L1 block", log.BlockHashKey, block.Hash(), log.BlockHeightKey, block.Number) if !g.submitDataLock.TryLock() { g.logger.Debug("Unable to submit block, enclave is busy processing data") return false, nil @@ -485,7 +485,7 @@ func (g *Guardian) submitL1Block(block *common.L1Block, isLatest bool) (bool, er // this is most common when we are returning to a previous fork and the enclave has already seen some of the blocks on it // note: logging this because we don't expect it to happen often and would like visibility on that. g.logger.Info("L1 block already processed by enclave, trying the next block", "block", block.Hash()) - nextHeight := big.NewInt(0).Add(block.Number(), big.NewInt(1)) + nextHeight := big.NewInt(0).Add(block.Number, big.NewInt(1)) nextCanonicalBlock, err := g.sl.L1Data().FetchBlockByHeight(nextHeight) if err != nil { return false, fmt.Errorf("failed to fetch next block after forking block=%s: %w", block.Hash(), err) @@ -499,10 +499,6 @@ func (g *Guardian) submitL1Block(block *common.L1Block, isLatest bool) (bool, er g.state.OnProcessedBlock(block.Hash()) g.processL1BlockTransactions(block, rollupTxs, syncContracts) - if err != nil { - return false, fmt.Errorf("submitted block to enclave but could not store the block processing result. Cause: %w", err) - } - // todo: make sure this doesn't respond to old requests (once we have a proper protocol for that) err = g.publishSharedSecretResponses(resp.ProducedSecretResponses) if err != nil { @@ -511,9 +507,9 @@ func (g *Guardian) submitL1Block(block *common.L1Block, isLatest bool) (bool, er return true, nil } -func (g *Guardian) processL1BlockTransactions(block *common.L1Block, rollupTxs []*common.L1RollupTx, syncContracts bool) { +func (g *Guardian) processL1BlockTransactions(block *types.Header, rollupTxs []*common.L1RollupTx, syncContracts bool) { // TODO (@will) this should be removed and pulled from the L1 - err := g.storage.AddBlock(block.Header()) + err := g.storage.AddBlock(block) if err != nil { g.logger.Error("Could not add block to host db.", log.ErrKey, err) } diff --git a/go/host/l1/dataservice.go b/go/host/l1/dataservice.go index 67f888047..c3bf53543 100644 --- a/go/host/l1/dataservice.go +++ b/go/host/l1/dataservice.go @@ -8,6 +8,8 @@ import ( "sync/atomic" "time" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/enclave/crosschain" "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" @@ -26,8 +28,8 @@ import ( ) var ( - // todo (@matt) make this configurable? - _timeoutNoBlocks = 30 * time.Second + l1BlockTime = 12 * time.Second + _timeoutNoBlocks = 2 * l1BlockTime // after this timeout we assume the subscription to the L1 node is not working one = big.NewInt(1) ErrNoNextBlock = errors.New("no next block") ) @@ -100,58 +102,66 @@ func (r *DataService) Subscribe(handler host.L1BlockHandler) func() { // FetchNextBlock calculates the next canonical block that should be sent to requester after a given hash. // It returns the block and a bool for whether it is the latest known head -func (r *DataService) FetchNextBlock(prevBlockHash gethcommon.Hash) (*types.Block, bool, error) { - if prevBlockHash == r.head { - // prevBlock is the latest known head +func (r *DataService) FetchNextBlock(remoteHead gethcommon.Hash) (*types.Header, bool, error) { + if remoteHead == r.head { + // remoteHead is the latest known head return nil, false, ErrNoNextBlock } - if prevBlockHash == (gethcommon.Hash{}) { - // prevBlock is empty, so we are starting from genesis - blk, err := r.ethClient.BlockByNumber(big.NewInt(0)) + if remoteHead == gethutil.EmptyHash { + // remoteHead is empty, so we are starting from genesis + blk, err := r.ethClient.HeaderByNumber(big.NewInt(0)) if err != nil { return nil, false, fmt.Errorf("could not find genesis block - %w", err) } return blk, false, nil } - // the latestCanonAncestor will usually return the prevBlock itself but this step is necessary to walk back if there was a fork - lca, err := r.latestCanonAncestor(prevBlockHash) + // the latestCanonAncestor will usually return the remoteHead itself but this step is necessary to walk back if there was a fork + fork, err := r.latestCanonAncestor(remoteHead) if err != nil { return nil, false, err } + // and send the canonical block at the height after that // (which may be a fork, or it may just be the next on the same branch if we are catching-up) - blk, err := r.ethClient.BlockByNumber(increment(lca.Number())) + blk, err := r.ethClient.HeaderByNumber(increment(fork.CommonAncestor.Number)) if err != nil { if errors.Is(err, ethereum.NotFound) { return nil, false, ErrNoNextBlock } - return nil, false, fmt.Errorf("could not find block after latest canon ancestor, height=%s - %w", increment(lca.Number()), err) + return nil, false, fmt.Errorf("could not find block after latest canon ancestor, height=%s - %w", increment(fork.CommonAncestor.Number), err) } return blk, blk.Hash() == r.head, nil } -func (r *DataService) latestCanonAncestor(blkHash gethcommon.Hash) (*types.Block, error) { - blk, err := r.ethClient.BlockByHash(blkHash) +func (r *DataService) FetchBlock(_ context.Context, blockHash common.L1BlockHash) (*types.Header, error) { + return r.ethClient.HeaderByHash(blockHash) +} + +func (r *DataService) latestCanonAncestor(blkHash gethcommon.Hash) (*common.ChainFork, error) { + ctx := context.Background() + currentHead, err := r.ethClient.HeaderByNumber(nil) if err != nil { - return nil, fmt.Errorf("unable to fetch L1 block with hash=%s - %w", blkHash, err) + return nil, fmt.Errorf("unable to fetch L1 head- %w", err) } - canonAtSameHeight, err := r.ethClient.BlockByNumber(blk.Number()) + blk, err := r.ethClient.HeaderByHash(blkHash) if err != nil { - return nil, fmt.Errorf("unable to fetch L1 block at height=%d - %w", blk.Number(), err) + return nil, fmt.Errorf("unable to fetch L1 block with hash=%s - %w", blkHash, err) } - if blk.Hash() != canonAtSameHeight.Hash() { - return r.latestCanonAncestor(blk.ParentHash()) + + fork, err := gethutil.LCA(ctx, currentHead, blk, r) + if err != nil { + return nil, fmt.Errorf("unable to calculate LCA - %w", err) } - return blk, nil + return fork, nil } // GetTenRelevantTransactions processes logs in their natural order without grouping by transaction hash. -func (r *DataService) GetTenRelevantTransactions(block *common.L1Block) (*common.ProcessedL1Data, error) { +func (r *DataService) GetTenRelevantTransactions(block *types.Header) (*common.ProcessedL1Data, error) { processed := &common.ProcessedL1Data{ - BlockHeader: block.Header(), + BlockHeader: block, Events: []common.L1Event{}, } @@ -192,7 +202,8 @@ func (r *DataService) GetTenRelevantTransactions(block *common.L1Block) (*common case crosschain.NetworkSecretRespondedID: processed.AddEvent(common.SecretResponseTx, txData) default: - r.logger.Warn("Unknown log topic", "topic", l.Topics[0], "txHash", l.TxHash) + // there are known events that we don't care about here + r.logger.Debug("Unknown log topic", "topic", l.Topics[0], "txHash", l.TxHash) } } @@ -200,7 +211,7 @@ func (r *DataService) GetTenRelevantTransactions(block *common.L1Block) (*common } // fetchMessageBusMgmtContractLogs retrieves all logs from management contract and message bus addresses -func (r *DataService) fetchMessageBusMgmtContractLogs(block *common.L1Block) ([]types.Log, error) { +func (r *DataService) fetchMessageBusMgmtContractLogs(block *types.Header) ([]types.Log, error) { blkHash := block.Hash() var allAddresses []gethcommon.Address allAddresses = append(allAddresses, r.contractAddresses[MgmtContract]...) @@ -284,30 +295,34 @@ func (r *DataService) streamLiveBlocks() { liveStream, streamSub := r.resetLiveStream() for r.running.Load() { select { - case header := <-liveStream: - r.head = header.Hash() - block, err := r.ethClient.BlockByHash(header.Hash()) - if err != nil { - r.logger.Error("Error fetching new block", log.BlockHashKey, header.Hash(), - log.BlockHeightKey, header.Number, log.ErrKey, err) - continue - } + case blockHeader := <-liveStream: + r.head = blockHeader.Hash() for _, handler := range r.blockSubscribers.Subscribers() { - go handler.HandleBlock(block) + go handler.HandleBlock(blockHeader) } case <-time.After(_timeoutNoBlocks): - r.logger.Warn("no new blocks received since timeout", "timeout", _timeoutNoBlocks) + r.logger.Warn("no new blocks received since timeout. Reconnecting..", "timeout", _timeoutNoBlocks) + if streamSub != nil { + streamSub.Unsubscribe() + } + if liveStream != nil { + close(liveStream) + } // reset stream to ensure it has not died liveStream, streamSub = r.resetLiveStream() } } - + r.logger.Info("block streaming stopped") if streamSub != nil { streamSub.Unsubscribe() } + if liveStream != nil { + close(liveStream) + } } func (r *DataService) resetLiveStream() (chan *types.Header, ethereum.Subscription) { + r.logger.Info("reconnecting to L1 new Heads") err := retry.Do(func() error { if !r.running.Load() { // break out of the loop if repository has stopped @@ -325,11 +340,14 @@ func (r *DataService) resetLiveStream() (chan *types.Header, ethereum.Subscripti r.logger.Warn("unable to reconnect to L1", log.ErrKey, err) return nil, nil } - return r.ethClient.BlockListener() + + ch, s := r.ethClient.BlockListener() + r.logger.Info("successfully reconnected to L1 new Heads") + return ch, s } -func (r *DataService) FetchBlockByHeight(height *big.Int) (*types.Block, error) { - return r.ethClient.BlockByNumber(height) +func (r *DataService) FetchBlockByHeight(height *big.Int) (*types.Header, error) { + return r.ethClient.HeaderByNumber(height) } // getEnclaveIdFromLog gets the enclave ID from the log topic diff --git a/go/host/l1/publisher.go b/go/host/l1/publisher.go index c7d38bec1..223d660b1 100644 --- a/go/host/l1/publisher.go +++ b/go/host/l1/publisher.go @@ -8,6 +8,8 @@ import ( "sync" "time" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ten-protocol/go-ten/contracts/generated/ManagementContract" "github.com/ten-protocol/go-ten/go/common/errutil" "github.com/ten-protocol/go-ten/go/common/stopcontrol" @@ -176,7 +178,7 @@ func (p *Publisher) InitializeSecret(attestation *common.AttestationReport, encS func (p *Publisher) RequestSecret(attestation *common.AttestationReport) (gethcommon.Hash, error) { encodedAttestation, err := common.EncodeAttestation(attestation) if err != nil { - return gethcommon.Hash{}, errors.Wrap(err, "could not encode attestation") + return gethutil.EmptyHash, errors.Wrap(err, "could not encode attestation") } l1tx := &common.L1RequestSecretTx{ Attestation: encodedAttestation, @@ -197,7 +199,7 @@ func (p *Publisher) RequestSecret(attestation *common.AttestationReport) (gethco // we wait until the secret req transaction has succeeded before we start polling for the secret err = p.publishTransaction(requestSecretTx) if err != nil { - return gethcommon.Hash{}, err + return gethutil.EmptyHash, err } return l1Head.Hash(), nil diff --git a/go/host/l1/statemachine.go b/go/host/l1/statemachine.go index 438336a59..8e4f630dc 100644 --- a/go/host/l1/statemachine.go +++ b/go/host/l1/statemachine.go @@ -5,6 +5,8 @@ import ( "errors" "math/big" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ethereum/go-ethereum/accounts/abi/bind" gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" @@ -61,7 +63,7 @@ func NewCrossChainStateMachine( ) CrossChainStateMachine { return &crossChainStateMachine{ latestRollup: RollupInfo{ - ForkUID: gethcommon.Hash{}, + ForkUID: gethutil.EmptyHash, Number: 0, }, rollupHistory: make(map[RollupNumber]RollupInfo), diff --git a/go/host/storage/hostdb/block_test.go b/go/host/storage/hostdb/block_test.go index fb098c6c2..e127883aa 100644 --- a/go/host/storage/hostdb/block_test.go +++ b/go/host/storage/hostdb/block_test.go @@ -77,7 +77,7 @@ func TestAddBlockWithForeignKeyConstraint(t *testing.T) { dbtx, _ = db.NewDBTransaction() // add rollup referencing block - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } diff --git a/go/host/storage/hostdb/rollup.go b/go/host/storage/hostdb/rollup.go index a1fdd1b85..bc996ffef 100644 --- a/go/host/storage/hostdb/rollup.go +++ b/go/host/storage/hostdb/rollup.go @@ -5,6 +5,8 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" "github.com/pkg/errors" "github.com/ten-protocol/go-ten/go/common" @@ -22,7 +24,7 @@ const ( ) // AddRollup adds a rollup to the DB -func AddRollup(dbtx *dbTransaction, statements *SQLStatements, rollup *common.ExtRollup, metadata *common.PublicRollupMetadata, block *common.L1Block) error { +func AddRollup(dbtx *dbTransaction, statements *SQLStatements, rollup *common.ExtRollup, metadata *common.PublicRollupMetadata, block *types.Header) error { extRollup, err := rlp.EncodeToBytes(rollup) if err != nil { return fmt.Errorf("could not encode rollup: %w", err) diff --git a/go/host/storage/hostdb/rollup_test.go b/go/host/storage/hostdb/rollup_test.go index d7bb16727..ff869092e 100644 --- a/go/host/storage/hostdb/rollup_test.go +++ b/go/host/storage/hostdb/rollup_test.go @@ -28,7 +28,7 @@ func TestCanStoreAndRetrieveRollup(t *testing.T) { } dbtx.Write() dbtx, _ = db.NewDBTransaction() - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -68,7 +68,7 @@ func TestGetRollupByBlockHash(t *testing.T) { } dbtx.Write() dbtx, _ = db.NewDBTransaction() - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup, &metadata, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -100,7 +100,7 @@ func TestGetLatestRollup(t *testing.T) { } dbtx.Write() dbtx, _ = db.NewDBTransaction() - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -111,7 +111,7 @@ func TestGetLatestRollup(t *testing.T) { rollup2LastSeq := int64(batchNumber + 10) metadata2 := createRollupMetadata(rollup2FirstSeq) rollup2 := createRollup(rollup2LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block.Header()) if err != nil { t.Errorf("could not store rollup 2. Cause: %s", err) } @@ -145,7 +145,7 @@ func TestGetRollupBySeqNo(t *testing.T) { } dbtx.Write() dbtx, _ = db.NewDBTransaction() - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -156,7 +156,7 @@ func TestGetRollupBySeqNo(t *testing.T) { rollup2LastSeq := int64(batchNumber + 10) // 787 metadata2 := createRollupMetadata(rollup2FirstSeq) rollup2 := createRollup(rollup2LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block.Header()) if err != nil { t.Errorf("could not store rollup 2. Cause: %s", err) } @@ -200,7 +200,7 @@ func TestGetRollupListing(t *testing.T) { } dbtx.Write() dbtx, _ = db.NewDBTransaction() - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -209,7 +209,7 @@ func TestGetRollupListing(t *testing.T) { rollup2LastSeq := int64(batchNumber + 10) metadata2 := createRollupMetadata(rollup2FirstSeq) rollup2 := createRollup(rollup2LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block.Header()) if err != nil { t.Errorf("could not store rollup 2. Cause: %s", err) } @@ -218,7 +218,7 @@ func TestGetRollupListing(t *testing.T) { rollup3LastSeq := int64(batchNumber + 20) metadata3 := createRollupMetadata(rollup3FirstSeq) rollup3 := createRollup(rollup3LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup3, &metadata3, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup3, &metadata3, block.Header()) dbtx.Write() if err != nil { t.Errorf("could not store rollup 3. Cause: %s", err) @@ -303,7 +303,7 @@ func TestGetRollupByHash(t *testing.T) { } dbtx.Write() dbtx, _ = db.NewDBTransaction() - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -312,7 +312,7 @@ func TestGetRollupByHash(t *testing.T) { rollup2LastSeq := int64(batchNumber + 10) metadata2 := createRollupMetadata(rollup2FirstSeq) rollup2 := createRollup(rollup2LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block.Header()) if err != nil { t.Errorf("could not store rollup 2. Cause: %s", err) } @@ -377,7 +377,7 @@ func TestGetRollupBatches(t *testing.T) { rollup1LastSeq := int64(batchNumber + 1) metadata1 := createRollupMetadata(rollup1FirstSeq) rollup1 := createRollup(rollup1LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup1, &metadata1, block.Header()) if err != nil { t.Errorf("could not store rollup. Cause: %s", err) } @@ -386,7 +386,7 @@ func TestGetRollupBatches(t *testing.T) { rollup2LastSeq := int64(batchNumber + 3) metadata2 := createRollupMetadata(rollup2FirstSeq) rollup2 := createRollup(rollup2LastSeq) - err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block) + err = AddRollup(dbtx, db.GetSQLStatement(), &rollup2, &metadata2, block.Header()) if err != nil { t.Errorf("could not store rollup 2. Cause: %s", err) } diff --git a/go/host/storage/interfaces.go b/go/host/storage/interfaces.go index 7abbf4fc9..a218f3af8 100644 --- a/go/host/storage/interfaces.go +++ b/go/host/storage/interfaces.go @@ -58,7 +58,7 @@ type BlockResolver interface { // AddBlock stores block data containing rollups in the host DB AddBlock(b *types.Header) error // AddRollup stores a rollup in the host DB - AddRollup(rollup *common.ExtRollup, metadata *common.PublicRollupMetadata, block *common.L1Block) error + AddRollup(rollup *common.ExtRollup, metadata *common.PublicRollupMetadata, block *types.Header) error // FetchLatestRollupHeader returns the head `RollupHeader` FetchLatestRollupHeader() (*common.RollupHeader, error) // FetchRollupListing returns a paginated list of rollups diff --git a/go/host/storage/storage.go b/go/host/storage/storage.go index fe896e755..44a68dd2b 100644 --- a/go/host/storage/storage.go +++ b/go/host/storage/storage.go @@ -52,7 +52,7 @@ func (s *storageImpl) AddBatch(batch *common.ExtBatch) error { return nil } -func (s *storageImpl) AddRollup(rollup *common.ExtRollup, metadata *common.PublicRollupMetadata, block *common.L1Block) error { +func (s *storageImpl) AddRollup(rollup *common.ExtRollup, metadata *common.PublicRollupMetadata, block *types.Header) error { // Check if the Header is already stored _, err := hostdb.GetRollupHeader(s.db, rollup.Header.Hash()) if err == nil { diff --git a/integration/common/testlog/testlog.go b/integration/common/testlog/testlog.go index 9d12e2ab3..248d1b91f 100644 --- a/integration/common/testlog/testlog.go +++ b/integration/common/testlog/testlog.go @@ -6,8 +6,6 @@ import ( "os" "time" - "github.com/ten-protocol/go-ten/go/common/log" - "github.com/ten-protocol/go-ten/lib/gethfork/debug" gethlog "github.com/ethereum/go-ethereum/log" @@ -53,7 +51,7 @@ func Setup(cfg *Cfg) *os.File { panic(err) } - testlog = gethlog.New(log.CmpKey, log.TestLogCmp) + testlog = gethlog.New() return f } @@ -63,5 +61,5 @@ func SetupSysOut() { if err != nil { panic(err) } - testlog = gethlog.New(log.CmpKey, log.TestLogCmp) + testlog = gethlog.New() } diff --git a/integration/contractdeployer/contract_deployer_test.go b/integration/contractdeployer/contract_deployer_test.go index 30d2e0079..6328c072c 100644 --- a/integration/contractdeployer/contract_deployer_test.go +++ b/integration/contractdeployer/contract_deployer_test.go @@ -137,7 +137,7 @@ func creatTenNetwork(t *testing.T, startPort int) { wallets := params.NewSimWallets(1, numberOfNodes, integration.EthereumChainID, integration.TenChainID) simParams := params.SimParams{ NumberOfNodes: numberOfNodes, - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, MgmtContractLib: ethereummock.NewMgmtContractLibMock(), ERC20ContractLib: ethereummock.NewERC20ContractLibMock(), Wallets: wallets, diff --git a/integration/datagenerator/rollup.go b/integration/datagenerator/rollup.go index 36d6e8b8c..7f17c4e06 100644 --- a/integration/datagenerator/rollup.go +++ b/integration/datagenerator/rollup.go @@ -8,7 +8,7 @@ import ( // RandomRollup - block is needed in order to pass the smart contract check // when submitting cross chain messages. -func RandomRollup(_ *types.Block) common.ExtRollup { +func RandomRollup(_ *types.Header) common.ExtRollup { extRollup := common.ExtRollup{ Header: &common.RollupHeader{}, } diff --git a/integration/eth2network/config.yml b/integration/eth2network/config.yml index 210e3c1ea..a20da1453 100644 --- a/integration/eth2network/config.yml +++ b/integration/eth2network/config.yml @@ -28,8 +28,8 @@ DENEB_FORK_VERSION: 0x20000093 ELECTRA_FORK_VERSION: 0x20000094 # Time parameters -SECONDS_PER_SLOT: 12 -SLOTS_PER_EPOCH: 6 +SECONDS_PER_SLOT: 2 +SLOTS_PER_EPOCH: 3 # Deposit contract DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242 \ No newline at end of file diff --git a/integration/ethereummock/db.go b/integration/ethereummock/db.go index 4a034fa38..252795742 100644 --- a/integration/ethereummock/db.go +++ b/integration/ethereummock/db.go @@ -52,7 +52,7 @@ func (n *blockResolverInMem) StoreBlock(_ context.Context, block *types.Block, _ return nil } -func (n *blockResolverInMem) FetchBlock(_ context.Context, hash common.L1BlockHash) (*types.Block, error) { +func (n *blockResolverInMem) FetchFullBlock(_ context.Context, hash common.L1BlockHash) (*types.Block, error) { n.m.RLock() defer n.m.RUnlock() block, f := n.blockCache[hash] @@ -63,6 +63,17 @@ func (n *blockResolverInMem) FetchBlock(_ context.Context, hash common.L1BlockHa return block, nil } +func (n *blockResolverInMem) FetchBlock(_ context.Context, hash common.L1BlockHash) (*types.Header, error) { + n.m.RLock() + defer n.m.RUnlock() + block, f := n.blockCache[hash] + + if !f { + return nil, errutil.ErrNotFound + } + return block.Header(), nil +} + func (n *blockResolverInMem) FetchHeadBlock(_ context.Context) (*types.Block, error) { n.m.RLock() defer n.m.RUnlock() @@ -79,16 +90,16 @@ func (n *blockResolverInMem) FetchHeadBlock(_ context.Context) (*types.Block, er return max, nil } -func (n *blockResolverInMem) ParentBlock(ctx context.Context, b *types.Block) (*types.Block, error) { - return n.FetchBlock(ctx, b.Header().ParentHash) +func (n *blockResolverInMem) ParentBlock(ctx context.Context, b *types.Header) (*types.Block, error) { + return n.FetchFullBlock(ctx, b.ParentHash) } -func (n *blockResolverInMem) IsAncestor(ctx context.Context, block *types.Block, maybeAncestor *types.Block) bool { +func (n *blockResolverInMem) IsAncestor(ctx context.Context, block *types.Header, maybeAncestor *types.Header) bool { if bytes.Equal(maybeAncestor.Hash().Bytes(), block.Hash().Bytes()) { return true } - if maybeAncestor.NumberU64() >= block.NumberU64() { + if maybeAncestor.Number.Uint64() >= block.Number.Uint64() { return false } @@ -97,10 +108,10 @@ func (n *blockResolverInMem) IsAncestor(ctx context.Context, block *types.Block, return false } - return n.IsAncestor(ctx, p, maybeAncestor) + return n.IsAncestor(ctx, p.Header(), maybeAncestor) } -func (n *blockResolverInMem) IsBlockAncestor(ctx context.Context, block *types.Block, maybeAncestor common.L1BlockHash) bool { +func (n *blockResolverInMem) IsBlockAncestor(ctx context.Context, block *types.Header, maybeAncestor common.L1BlockHash) bool { if bytes.Equal(maybeAncestor.Bytes(), block.Hash().Bytes()) { return true } @@ -109,13 +120,13 @@ func (n *blockResolverInMem) IsBlockAncestor(ctx context.Context, block *types.B return true } - if block.NumberU64() == common.L1GenesisHeight { + if block.Number.Uint64() == common.L1GenesisHeight { return false } - resolvedBlock, err := n.FetchBlock(ctx, maybeAncestor) + resolvedBlock, err := n.FetchFullBlock(ctx, maybeAncestor) if err == nil { - if resolvedBlock.NumberU64() >= block.NumberU64() { + if resolvedBlock.NumberU64() >= block.Number.Uint64() { return false } } @@ -126,7 +137,7 @@ func (n *blockResolverInMem) IsBlockAncestor(ctx context.Context, block *types.B return false } - return n.IsBlockAncestor(ctx, p, maybeAncestor) + return n.IsBlockAncestor(ctx, p.Header(), maybeAncestor) } // The cache of included transactions @@ -177,7 +188,7 @@ func (m *Node) removeCommittedTransactions( break } - p, err := resolver.FetchBlock(ctx, b.ParentHash()) + p, err := resolver.FetchFullBlock(ctx, b.ParentHash()) if err != nil { m.logger.Crit("Could not retrieve parent block.", log.ErrKey, err) } diff --git a/integration/ethereummock/gethutil.go b/integration/ethereummock/gethutil.go deleted file mode 100644 index ac22b5f81..000000000 --- a/integration/ethereummock/gethutil.go +++ /dev/null @@ -1,67 +0,0 @@ -package ethereummock - -import ( - "context" - "fmt" - - gethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ten-protocol/go-ten/go/common" -) - -// Utilities for working with geth structures - -// EmptyHash is useful for comparisons to check if hash has been set -var EmptyHash = gethcommon.Hash{} - -// LCA - returns the latest common ancestor of the 2 blocks or an error if no common ancestor is found -// it also returns the blocks that became canonical, and the once that are now the fork -func LCA(ctx context.Context, newCanonical *types.Block, oldCanonical *types.Block, resolver *blockResolverInMem) (*common.ChainFork, error) { - b, cp, ncp, err := internalLCA(ctx, newCanonical, oldCanonical, resolver, []common.L1BlockHash{}, []common.L1BlockHash{}) - if err != nil { - return nil, fmt.Errorf("could not calculate LCA. Cause: %w", err) - } - return &common.ChainFork{ - NewCanonical: newCanonical.Header(), - OldCanonical: oldCanonical.Header(), - CommonAncestor: b.Header(), - CanonicalPath: cp, - NonCanonicalPath: ncp, - }, err -} - -func internalLCA(ctx context.Context, newCanonical *types.Block, oldCanonical *types.Block, resolver *blockResolverInMem, canonicalPath []common.L1BlockHash, nonCanonicalPath []common.L1BlockHash) (*types.Block, []common.L1BlockHash, []common.L1BlockHash, error) { - if newCanonical.NumberU64() == common.L1GenesisHeight || oldCanonical.NumberU64() == common.L1GenesisHeight { - return newCanonical, canonicalPath, nonCanonicalPath, nil - } - if newCanonical.Hash() == oldCanonical.Hash() { - // this is where we reach the common ancestor, which we add to the canonical path - return newCanonical, append(canonicalPath, newCanonical.Hash()), nonCanonicalPath, nil - } - if newCanonical.NumberU64() > oldCanonical.NumberU64() { - p, err := resolver.FetchBlock(ctx, newCanonical.ParentHash()) - if err != nil { - return nil, nil, nil, fmt.Errorf("could not retrieve parent block %s. Cause: %w", newCanonical.ParentHash(), err) - } - - return internalLCA(ctx, p, oldCanonical, resolver, append(canonicalPath, newCanonical.Hash()), nonCanonicalPath) - } - if oldCanonical.NumberU64() > newCanonical.NumberU64() { - p, err := resolver.FetchBlock(ctx, oldCanonical.ParentHash()) - if err != nil { - return nil, nil, nil, fmt.Errorf("could not retrieve parent block %s. Cause: %w", oldCanonical.ParentHash(), err) - } - - return internalLCA(ctx, newCanonical, p, resolver, canonicalPath, append(nonCanonicalPath, oldCanonical.Hash())) - } - parentBlockA, err := resolver.FetchBlock(ctx, newCanonical.ParentHash()) - if err != nil { - return nil, nil, nil, fmt.Errorf("could not retrieve parent block %s. Cause: %w", newCanonical.ParentHash(), err) - } - parentBlockB, err := resolver.FetchBlock(ctx, oldCanonical.ParentHash()) - if err != nil { - return nil, nil, nil, fmt.Errorf("could not retrieve parent block %s. Cause: %w", oldCanonical.ParentHash(), err) - } - - return internalLCA(ctx, parentBlockA, parentBlockB, resolver, append(canonicalPath, newCanonical.Hash()), append(nonCanonicalPath, oldCanonical.Hash())) -} diff --git a/integration/ethereummock/mock_l1_network.go b/integration/ethereummock/mock_l1_network.go index 5c35d2fc1..b475d28d6 100644 --- a/integration/ethereummock/mock_l1_network.go +++ b/integration/ethereummock/mock_l1_network.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ten-protocol/go-ten/go/common/async" "github.com/ten-protocol/go-ten/go/common/log" @@ -44,7 +46,7 @@ func NewMockEthNetwork(avgBlockDuration time.Duration, avgLatency time.Duration, } // BroadcastBlock broadcast a block to the l1 nodes -func (n *MockEthNetwork) BroadcastBlock(b common.EncodedL1Block, p common.EncodedL1Block) { +func (n *MockEthNetwork) BroadcastBlock(b EncodedL1Block, p EncodedL1Block) { bl, _ := b.DecodeBlock() for _, m := range n.AllNodes { if m.Info().L2ID != n.CurrentNode.Info().L2ID { @@ -95,21 +97,21 @@ func printBlock(b *types.Block, m *Node) string { if err != nil { testlog.Logger().Crit("failed to decode rollup") } - txs = append(txs, fmt.Sprintf("r_%d(nonce=%d)", common.ShortHash(r.Hash()), tx.Nonce())) + txs = append(txs, fmt.Sprintf("r_%s(nonce=%d)", r.Hash(), tx.Nonce())) case *common.L1DepositTx: - var to uint64 + var to gethcommon.Address if l1Tx.To != nil { - to = common.ShortAddress(*l1Tx.To) + to = *l1Tx.To } - txs = append(txs, fmt.Sprintf("deposit(%d=%d)", to, l1Tx.Amount)) + txs = append(txs, fmt.Sprintf("deposit(%s=%d)", to, l1Tx.Amount)) } } - p, err := m.BlockResolver.FetchBlock(context.Background(), b.ParentHash()) + p, err := m.BlockResolver.FetchFullBlock(context.Background(), b.ParentHash()) if err != nil { testlog.Logger().Crit("Should not happen. Could not retrieve parent", log.ErrKey, err) } - return fmt.Sprintf(" create b_%d(Height=%d, RollupNonce=%d)[parent=b_%d]. Txs: %v", - common.ShortHash(b.Hash()), b.NumberU64(), common.ShortNonce(b.Header().Nonce), common.ShortHash(p.Hash()), txs) + return fmt.Sprintf(" create b_%s(Height=%d, RollupNonce=%s)[parent=b_%s]. Txs: %v", + b.Hash(), b.NumberU64(), b.Header().Nonce, p.Hash(), txs) } diff --git a/integration/ethereummock/node.go b/integration/ethereummock/node.go index d97f968c9..1b805d4c1 100644 --- a/integration/ethereummock/node.go +++ b/integration/ethereummock/node.go @@ -10,6 +10,8 @@ import ( "sync/atomic" "time" + "github.com/ten-protocol/go-ten/go/common/gethutil" + "github.com/ten-protocol/go-ten/go/common/log" "github.com/ethereum/go-ethereum/crypto/kzg4844" @@ -36,16 +38,18 @@ import ( "github.com/ten-protocol/go-ten/go/ethadapter/mgmtcontractlib" ) -const SecondsPerSlot = uint64(12) +type ( + Latency func() time.Duration +) type L1Network interface { // BroadcastBlock - send the block and the parent to make sure there are no gaps - BroadcastBlock(b common.EncodedL1Block, p common.EncodedL1Block) + BroadcastBlock(b EncodedL1Block, p EncodedL1Block) BroadcastTx(tx *types.Transaction) } type MiningConfig struct { - PowTime common.Latency + PowTime Latency LogFile string L1BeaconPort int } @@ -84,12 +88,10 @@ type Node struct { p2pCh chan *types.Block // this is where blocks received from peers are dropped miningCh chan *types.Block // this is where blocks created by the mining setup of the current node are dropped - canonicalCh chan *types.Block // this is where the main processing routine drops blocks that are canonical + canonicalCh chan *types.Header // this is where the main processing routine drops blocks that are canonical mempoolCh chan *types.Transaction // where l1 transactions to be published in the next block are added // internal - headInCh chan bool - headOutCh chan *types.Block erc20ContractLib erc20contractlib.ERC20ContractLib mgmtContractLib mgmtcontractlib.MgmtContractLib @@ -178,7 +180,7 @@ func (m *Node) TransactionByHash(hash gethcommon.Hash) (*types.Transaction, bool } } - blk, err = m.BlockResolver.FetchBlock(context.Background(), blk.ParentHash()) + blk, err = m.BlockResolver.FetchFullBlock(context.Background(), blk.ParentHash()) if err != nil { return nil, false, fmt.Errorf("could not retrieve parent block. Cause: %w", err) } @@ -226,16 +228,17 @@ func (m *Node) FetchLastBatchSeqNo(gethcommon.Address) (*big.Int, error) { return nil, err } - for currentBlock := startingBlock; currentBlock.NumberU64() != 0; { - currentBlock, err = m.BlockByHash(currentBlock.Header().ParentHash) + for currentBlock := startingBlock; currentBlock.Number.Uint64() != 0; { + cb, err := m.BlockByHash(currentBlock.ParentHash) if err != nil { m.logger.Error("Error fetching block by hash", "error", err) break } - rollup := m.getRollupFromBlock(currentBlock) + rollup := m.getRollupFromBlock(cb) if rollup != nil { return big.NewInt(int64(rollup.Header.LastBatchSeqNo)), nil } + currentBlock = cb.Header() } // the first batch is number 1 return big.NewInt(int64(common.L2GenesisSeqNo)), nil @@ -266,11 +269,13 @@ func (m *Node) BlockNumber() (uint64, error) { return blk.NumberU64(), nil } -func (m *Node) BlockByNumber(n *big.Int) (*types.Block, error) { +func (m *Node) HeaderByNumber(n *big.Int) (*types.Header, error) { + if n == nil { + return m.FetchHeadBlock() + } if n.Int64() == 0 { - return MockGenesisBlock, nil + return MockGenesisBlock.Header(), nil } - // TODO this should be a method in the resolver blk, err := m.BlockResolver.FetchHeadBlock(context.Background()) if err != nil { if errors.Is(err, errutil.ErrNotFound) { @@ -280,10 +285,10 @@ func (m *Node) BlockByNumber(n *big.Int) (*types.Block, error) { } for !bytes.Equal(blk.ParentHash().Bytes(), (common.L1BlockHash{}).Bytes()) { if blk.NumberU64() == n.Uint64() { - return blk, nil + return blk.Header(), nil } - blk, err = m.BlockResolver.FetchBlock(context.Background(), blk.ParentHash()) + blk, err = m.BlockResolver.FetchFullBlock(context.Background(), blk.ParentHash()) if err != nil { return nil, fmt.Errorf("could not retrieve parent for block in chain. Cause: %w", err) } @@ -291,20 +296,28 @@ func (m *Node) BlockByNumber(n *big.Int) (*types.Block, error) { return nil, ethereum.NotFound } +func (m *Node) HeaderByHash(id gethcommon.Hash) (*types.Header, error) { + blk, err := m.BlockResolver.FetchFullBlock(context.Background(), id) + if err != nil { + return nil, fmt.Errorf("block could not be retrieved. Cause: %w", err) + } + return blk.Header(), nil +} + func (m *Node) BlockByHash(id gethcommon.Hash) (*types.Block, error) { - blk, err := m.BlockResolver.FetchBlock(context.Background(), id) + blk, err := m.BlockResolver.FetchFullBlock(context.Background(), id) if err != nil { return nil, fmt.Errorf("block could not be retrieved. Cause: %w", err) } return blk, nil } -func (m *Node) FetchHeadBlock() (*types.Block, error) { +func (m *Node) FetchHeadBlock() (*types.Header, error) { block, err := m.BlockResolver.FetchHeadBlock(context.Background()) if err != nil { return nil, fmt.Errorf("could not retrieve head block. Cause: %w", err) } - return block, nil + return block.Header(), nil } func (m *Node) Info() ethadapter.Info { @@ -313,7 +326,7 @@ func (m *Node) Info() ethadapter.Info { } } -func (m *Node) IsBlockAncestor(block *types.Block, proof common.L1BlockHash) bool { +func (m *Node) IsBlockAncestor(block *types.Header, proof common.L1BlockHash) bool { return m.BlockResolver.IsBlockAncestor(context.Background(), block, proof) } @@ -387,12 +400,12 @@ func (m *Node) Start() { if err != nil { m.logger.Crit("Failed to store block") } - head := m.setHead(MockGenesisBlock) + head := m.setHead(MockGenesisBlock.Header()) for { select { case p2pb := <-m.p2pCh: // Received from peers - _, err := m.BlockResolver.FetchBlock(context.Background(), p2pb.Hash()) + _, err := m.BlockResolver.FetchFullBlock(context.Background(), p2pb.Hash()) // only process blocks if they haven't been processed before if err != nil { if errors.Is(err, errutil.ErrNotFound) { @@ -405,70 +418,68 @@ func (m *Node) Start() { case mb := <-m.miningCh: // Received from the local mining head = m.processBlock(mb, head) if bytes.Equal(head.Hash().Bytes(), mb.Hash().Bytes()) { // Only broadcast if it's the new head - p, err := m.BlockResolver.FetchBlock(context.Background(), mb.ParentHash()) + p, err := m.BlockResolver.FetchFullBlock(context.Background(), mb.ParentHash()) if err != nil { panic(fmt.Errorf("could not retrieve parent. Cause: %w", err)) } - encodedBlock, err := common.EncodeBlock(mb) + encodedBlock, err := EncodeBlock(mb) if err != nil { panic(fmt.Errorf("could not encode block. Cause: %w", err)) } - encodedParentBlock, err := common.EncodeBlock(p) + encodedParentBlock, err := EncodeBlock(p) if err != nil { panic(fmt.Errorf("could not encode parent block. Cause: %w", err)) } m.Network.BroadcastBlock(encodedBlock, encodedParentBlock) } - case <-m.headInCh: - m.headOutCh <- head case <-m.exitCh: return } } } -func (m *Node) processBlock(b *types.Block, head *types.Block) *types.Block { +func (m *Node) processBlock(b *types.Block, head *types.Header) *types.Header { err := m.BlockResolver.StoreBlock(context.Background(), b, nil) if err != nil { m.logger.Crit("Failed to store block. Cause: %w", err) } - _, err = m.BlockResolver.FetchBlock(context.Background(), b.Header().ParentHash) + _, err = m.BlockResolver.FetchFullBlock(context.Background(), b.Header().ParentHash) // only proceed if the parent is available if err != nil { if errors.Is(err, errutil.ErrNotFound) { - m.logger.Info(fmt.Sprintf("Parent block not found=b_%d", common.ShortHash(b.Header().ParentHash))) + m.logger.Info(fmt.Sprintf("Parent block not found=b_%s", b.Header().ParentHash)) return head } m.logger.Crit("Could not fetch block parent. Cause: %w", err) } // Ignore superseded blocks - if b.NumberU64() <= head.NumberU64() { + if b.NumberU64() <= head.Number.Uint64() { return head } // Check for Reorgs - if !m.BlockResolver.IsAncestor(context.Background(), b, head) { + if !m.BlockResolver.IsAncestor(context.Background(), b.Header(), head) { m.stats.L1Reorg(m.l2ID) - fork, err := LCA(context.Background(), head, b, m.BlockResolver) + fork, err := gethutil.LCA(context.Background(), head, b.Header(), m.BlockResolver) if err != nil { m.logger.Error("Should not happen.", log.ErrKey, err) return head } m.logger.Info( - fmt.Sprintf("L1Reorg new=b_%d(%d), old=b_%d(%d), fork=b_%d(%d)", common.ShortHash(b.Hash()), b.NumberU64(), common.ShortHash(head.Hash()), head.NumberU64(), common.ShortHash(fork.CommonAncestor.Hash()), fork.CommonAncestor.Number.Uint64())) - return m.setFork(m.BlocksBetween(fork.CommonAncestor, b)) + fmt.Sprintf("L1Reorg new=b_%s(%d), old=b_%s(%d), fork=b_%s(%d)", b.Hash(), b.NumberU64(), head.Hash(), head.Number.Uint64(), fork.CommonAncestor.Hash(), fork.CommonAncestor.Number.Uint64())) + return m.setFork(m.BlocksBetween(fork.CommonAncestor, b.Header())) } - if b.NumberU64() > (head.NumberU64() + 1) { + if b.NumberU64() > (head.Number.Uint64() + 1) { m.logger.Error("Should not happen. Blocks are skewed") } - return m.setHead(b) + return m.setHead(b.Header()) } // Notifies the Miner to start mining on the new block and the aggregator to produce rollups -func (m *Node) setHead(b *types.Block) *types.Block { +func (m *Node) setHead(b *types.Header) *types.Header { if atomic.LoadInt32(m.interrupt) == 1 { return b } @@ -485,7 +496,7 @@ func (m *Node) setHead(b *types.Block) *types.Block { return b } -func (m *Node) setFork(blocks []*types.Block) *types.Block { +func (m *Node) setFork(blocks []*types.Header) *types.Header { head := blocks[len(blocks)-1] if atomic.LoadInt32(m.interrupt) == 1 { return head @@ -506,7 +517,7 @@ func (m *Node) setFork(blocks []*types.Block) *types.Block { // P2PReceiveBlock is called by counterparties when there is a block to broadcast // All it does is drop the blocks in a channel for processing. -func (m *Node) P2PReceiveBlock(b common.EncodedL1Block, p common.EncodedL1Block) { +func (m *Node) P2PReceiveBlock(b EncodedL1Block, p EncodedL1Block) { if atomic.LoadInt32(m.interrupt) == 1 { return } @@ -537,8 +548,12 @@ func (m *Node) startMining() { case tx := <-m.mempoolCh: mempool = append(mempool, tx) - case canonicalBlock := <-m.canonicalCh: + case canonicalBlockHeader := <-m.canonicalCh: // A new canonical block was found. Start a new round based on that block. + canonicalBlock, err := m.BlockResolver.FetchFullBlock(context.Background(), canonicalBlockHeader.Hash()) + if err != nil { + panic(fmt.Errorf("could not fetch block. Cause: %w", err)) + } // remove transactions that are already considered committed mempool = m.removeCommittedTransactions(context.Background(), canonicalBlock, mempool, m.BlockResolver, m.db) @@ -590,25 +605,25 @@ func (m *Node) Stop() { m.exitCh <- true } -func (m *Node) BlocksBetween(blockA *types.Header, blockB *types.Block) []*types.Block { +func (m *Node) BlocksBetween(blockA *types.Header, blockB *types.Header) []*types.Header { if bytes.Equal(blockA.Hash().Bytes(), blockB.Hash().Bytes()) { - return []*types.Block{blockB} + return []*types.Header{blockB} } - blocks := make([]*types.Block, 0) + blocks := make([]*types.Header, 0) tempBlock := blockB - var err error for { blocks = append(blocks, tempBlock) if bytes.Equal(tempBlock.Hash().Bytes(), blockA.Hash().Bytes()) { break } - tempBlock, err = m.BlockResolver.FetchBlock(context.Background(), tempBlock.ParentHash()) + tb, err := m.BlockResolver.FetchFullBlock(context.Background(), tempBlock.ParentHash) if err != nil { panic(fmt.Errorf("could not retrieve parent block. Cause: %w", err)) } + tempBlock = tb.Header() } n := len(blocks) - result := make([]*types.Block, n) + result := make([]*types.Header, n) for i, block := range blocks { result[n-i-1] = block } @@ -687,10 +702,8 @@ func NewMiner( interrupt: new(int32), p2pCh: make(chan *types.Block), miningCh: make(chan *types.Block), - canonicalCh: make(chan *types.Block), + canonicalCh: make(chan *types.Header), mempoolCh: make(chan *types.Transaction), - headInCh: make(chan bool), - headOutCh: make(chan *types.Block), erc20ContractLib: NewERC20ContractLibMock(), mgmtContractLib: NewMgmtContractLibMock(), logger: logger, @@ -714,11 +727,13 @@ func (sub *mockSubscription) Unsubscribe() { sub.node.RemoveSubscription(sub.id) } -func (sub *mockSubscription) publish(b *types.Block) { - sub.headCh <- b.Header() +func (sub *mockSubscription) publish(b *types.Header) { + if sub.headCh != nil { + sub.headCh <- b + } } -func (sub *mockSubscription) publishAll(blocks []*types.Block) { +func (sub *mockSubscription) publishAll(blocks []*types.Header) { for _, b := range blocks { sub.publish(b) } diff --git a/integration/ethereummock/utils.go b/integration/ethereummock/utils.go index 3bad98064..dcd0ae769 100644 --- a/integration/ethereummock/utils.go +++ b/integration/ethereummock/utils.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ten-protocol/go-ten/go/common" "github.com/ethereum/go-ethereum/core/types" @@ -25,7 +27,7 @@ func allIncludedTransactions(b *types.Block, r *blockResolverInMem, db TxDB) map return makeMap(b.Transactions()) } newMap := make(map[common.TxHash]*types.Transaction) - p, err := r.FetchBlock(context.Background(), b.ParentHash()) + p, err := r.FetchFullBlock(context.Background(), b.ParentHash()) if err != nil { panic(fmt.Errorf("should not happen. Could not retrieve parent. Cause: %w", err)) } @@ -56,3 +58,22 @@ func makeMap(txs types.Transactions) map[common.TxHash]*types.Transaction { } return m } + +// EncodedL1Block the encoded version of an L1 block. +type EncodedL1Block []byte + +func EncodeBlock(b *types.Block) (EncodedL1Block, error) { + encoded, err := rlp.EncodeToBytes(b) + if err != nil { + return nil, fmt.Errorf("could not encode block to bytes. Cause: %w", err) + } + return encoded, nil +} + +func (eb EncodedL1Block) DecodeBlock() (*types.Block, error) { + b := types.Block{} + if err := rlp.DecodeBytes(eb, &b); err != nil { + return nil, fmt.Errorf("could not decode block from bytes. Cause: %w", err) + } + return &b, nil +} diff --git a/integration/faucet/faucet_test.go b/integration/faucet/faucet_test.go index 5245877d0..b02789eab 100644 --- a/integration/faucet/faucet_test.go +++ b/integration/faucet/faucet_test.go @@ -101,7 +101,7 @@ func createObscuroNetwork(t *testing.T, startPort int) { wallets := params.NewSimWallets(1, numberOfNodes, integration.EthereumChainID, integration.TenChainID) simParams := params.SimParams{ NumberOfNodes: numberOfNodes, - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, MgmtContractLib: ethereummock.NewMgmtContractLibMock(), ERC20ContractLib: ethereummock.NewERC20ContractLibMock(), Wallets: wallets, diff --git a/integration/simulation/devnetwork/config.go b/integration/simulation/devnetwork/config.go index 248c4b2ce..cee681081 100644 --- a/integration/simulation/devnetwork/config.go +++ b/integration/simulation/devnetwork/config.go @@ -74,7 +74,7 @@ func LocalDevNetwork(tenConfigOpts ...TenConfigOption) *InMemDevNetwork { l1Config := &L1Config{ PortStart: integration.TestPorts.NetworkTestsPort, NumNodes: tenConfig.NumNodes, // we'll have 1 L1 node per L2 node - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, } l1Network := NewGethNetwork(nodeOpL1Wallets, l1Config) diff --git a/integration/simulation/output_stats.go b/integration/simulation/output_stats.go index 441388f89..cb48e731b 100644 --- a/integration/simulation/output_stats.go +++ b/integration/simulation/output_stats.go @@ -80,8 +80,12 @@ func (o *OutputStats) countBlockChain() { } // iterate the L1 Blocks and get the rollups - for block, _ := l1Node.FetchHeadBlock(); block != nil && !bytes.Equal(block.Hash().Bytes(), (common.L1BlockHash{}).Bytes()); block, _ = l1Node.BlockByHash(block.ParentHash()) { - o.incrementStats(block, l1Node) + for block, _ := l1Node.FetchHeadBlock(); block != nil && !bytes.Equal(block.Hash().Bytes(), (common.L1BlockHash{}).Bytes()); block, _ = l1Node.HeaderByHash(block.ParentHash) { + b, err := l1Node.BlockByHash(block.Hash()) + if err != nil { + panic(err) + } + o.incrementStats(b, l1Node) } } diff --git a/integration/simulation/simulation.go b/integration/simulation/simulation.go index 4ce3f4c32..97c1973f0 100644 --- a/integration/simulation/simulation.go +++ b/integration/simulation/simulation.go @@ -52,7 +52,7 @@ type Simulation struct { // Start executes the simulation given all the Params. Injects transactions. func (s *Simulation) Start() { - testlog.Logger().Info(fmt.Sprintf("Genesis block: b_%d.", common.ShortHash(ethereummock.MockGenesisBlock.Hash()))) + testlog.Logger().Info(fmt.Sprintf("Genesis block: b_%s.", ethereummock.MockGenesisBlock.Hash())) s.ctx = context.Background() // use injected context for graceful shutdowns fmt.Printf("Waiting for TEN genesis on L1\n") @@ -132,7 +132,11 @@ func (s *Simulation) waitForTenGenesisOnL1() { panic(fmt.Errorf("could not fetch head block. Cause: %w", err)) } if err == nil { - for _, b := range client.BlocksBetween(ethereummock.MockGenesisBlock.Header(), head) { + for _, h := range client.BlocksBetween(ethereummock.MockGenesisBlock.Header(), head) { + b, err := client.BlockByHash(h.Hash()) + if err != nil { + panic(err) + } for _, tx := range b.Transactions() { t := s.Params.MgmtContractLib.DecodeTx(tx) if t == nil { diff --git a/integration/simulation/simulation_full_network_test.go b/integration/simulation/simulation_full_network_test.go index 2323bf2bb..d5a58b59d 100644 --- a/integration/simulation/simulation_full_network_test.go +++ b/integration/simulation/simulation_full_network_test.go @@ -24,7 +24,7 @@ func TestFullNetworkMonteCarloSimulation(t *testing.T) { simParams := ¶ms.SimParams{ NumberOfNodes: numberOfNodes, - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, SimulationTime: 120 * time.Second, L1EfficiencyThreshold: 0.2, Wallets: wallets, diff --git a/integration/simulation/simulation_geth_in_mem_test.go b/integration/simulation/simulation_geth_in_mem_test.go index c7a8ad8fe..cb891f404 100644 --- a/integration/simulation/simulation_geth_in_mem_test.go +++ b/integration/simulation/simulation_geth_in_mem_test.go @@ -29,7 +29,7 @@ func TestGethSimulation(t *testing.T) { simParams := ¶ms.SimParams{ NumberOfNodes: numberOfNodes, - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, SimulationTime: 35 * time.Second, L1EfficiencyThreshold: 0.2, Wallets: wallets, diff --git a/integration/simulation/utils.go b/integration/simulation/utils.go index 9445b9c7b..7b9829d04 100644 --- a/integration/simulation/utils.go +++ b/integration/simulation/utils.go @@ -119,7 +119,7 @@ func findRollupDups(list []*common.ExtRollup) map[common.L2RollupHash]int { for u, i := range elementCount { if i > 1 { dups[u] = i - fmt.Printf("Dup: r_%d\n", common.ShortHash(u)) + fmt.Printf("Dup: r_%s\n", u.Hex()) } } return dups diff --git a/integration/simulation/validate_chain.go b/integration/simulation/validate_chain.go index 4b061e1cc..625d16e46 100644 --- a/integration/simulation/validate_chain.go +++ b/integration/simulation/validate_chain.go @@ -176,13 +176,13 @@ func checkBlockchainOfEthereumNode(t *testing.T, node ethadapter.EthClient, minH if err != nil { t.Errorf("Node %d: Could not find head block. Cause: %s", nodeIdx, err) } - height := head.NumberU64() + height := head.Number.Uint64() if height < minHeight { t.Errorf("Node %d: There were only %d blocks mined. Expected at least: %d.", nodeIdx, height, minHeight) } - deposits, rollups, _, blockCount, _, rollupReceipts := ExtractDataFromEthereumChain(ethereummock.MockGenesisBlock, head, node, s, nodeIdx) + deposits, rollups, _, blockCount, _, rollupReceipts := ExtractDataFromEthereumChain(ethereummock.MockGenesisBlock.Header(), head, node, s, nodeIdx) s.Stats.TotalL1Blocks = uint64(blockCount) checkCollectedL1Fees(t, node, s, nodeIdx, rollupReceipts) @@ -247,21 +247,19 @@ func checkRollups(t *testing.T, _ *Simulation, nodeIdx int, rollups []*common.Ex // ExtractDataFromEthereumChain returns the deposits, rollups, total amount deposited and length of the blockchain // between the start block and the end block. -func ExtractDataFromEthereumChain( - startBlock *types.Block, - endBlock *types.Block, - node ethadapter.EthClient, - s *Simulation, - nodeIdx int, -) ([]gethcommon.Hash, []*common.ExtRollup, *big.Int, int, uint64, types.Receipts) { +func ExtractDataFromEthereumChain(startBlock *types.Header, endBlock *types.Header, node ethadapter.EthClient, s *Simulation, nodeIdx int) ([]gethcommon.Hash, []*common.ExtRollup, *big.Int, int, uint64, types.Receipts) { deposits := make([]gethcommon.Hash, 0) rollups := make([]*common.ExtRollup, 0) rollupReceipts := make(types.Receipts, 0) totalDeposited := big.NewInt(0) - blockchain := node.BlocksBetween(startBlock.Header(), endBlock) + blockchain := node.BlocksBetween(startBlock, endBlock) successfulDeposits := uint64(0) - for _, block := range blockchain { + for _, header := range blockchain { + block, err := node.BlockByHash(header.Hash()) + if err != nil { + panic(err) + } for _, tx := range block.Transactions() { t := s.Params.ERC20ContractLib.DecodeTx(tx) if t == nil { diff --git a/integration/tengateway/tengateway_test.go b/integration/tengateway/tengateway_test.go index 87ea7e4ee..93324a655 100644 --- a/integration/tengateway/tengateway_test.go +++ b/integration/tengateway/tengateway_test.go @@ -969,7 +969,7 @@ func createTenNetwork(t *testing.T, startPort int) { wallets := params.NewSimWallets(1, numberOfNodes, integration.EthereumChainID, integration.TenChainID) simParams := params.SimParams{ NumberOfNodes: numberOfNodes, - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, MgmtContractLib: ethereummock.NewMgmtContractLibMock(), ERC20ContractLib: ethereummock.NewERC20ContractLibMock(), Wallets: wallets, diff --git a/integration/tenscan/tenscan_test.go b/integration/tenscan/tenscan_test.go index 9f3bd040b..4d595a148 100644 --- a/integration/tenscan/tenscan_test.go +++ b/integration/tenscan/tenscan_test.go @@ -300,7 +300,7 @@ func createTenNetwork(t *testing.T, startPort int) { wallets := params.NewSimWallets(1, 1, integration.EthereumChainID, integration.TenChainID) simParams := params.SimParams{ NumberOfNodes: 1, - AvgBlockDuration: 1 * time.Second, + AvgBlockDuration: 2 * time.Second, MgmtContractLib: ethereummock.NewMgmtContractLibMock(), ERC20ContractLib: ethereummock.NewERC20ContractLibMock(), Wallets: wallets, From f383afa79a93ff74e4f75fcbbabf2cc8a643b5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Mon, 13 Jan 2025 17:36:00 +0100 Subject: [PATCH 05/10] Fix Segmentation Fault in UnauthenticatedTenRPCCall in audit (#2243) --- tools/walletextension/rpcapi/utils.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/walletextension/rpcapi/utils.go b/tools/walletextension/rpcapi/utils.go index 99f4d879b..4df536bfc 100644 --- a/tools/walletextension/rpcapi/utils.go +++ b/tools/walletextension/rpcapi/utils.go @@ -64,7 +64,7 @@ func UnauthenticatedTenRPCCall[R any](ctx context.Context, w *services.Services, res, err := cache.WithCache(w.RPCResponsesCache, cfg, generateCacheKey(cacheArgs), func() (*R, error) { return services.WithPlainRPCConnection(ctx, w.BackendRPC, func(client *rpc.Client) (*R, error) { - var resp *R + var resp *R = new(R) var err error // wrap the context with a timeout to prevent long executions @@ -75,7 +75,13 @@ func UnauthenticatedTenRPCCall[R any](ctx context.Context, w *services.Services, return resp, err }) }) - audit(w, "RPC call. method=%s args=%v result=%s error=%s time=%d", method, args, res, err, time.Since(requestStartTime).Milliseconds()) + + if err != nil { + audit(w, "RPC call failed. method=%s args=%v error=%+v time=%d", method, args, err, time.Since(requestStartTime).Milliseconds()) + return nil, err + } + + audit(w, "RPC call succeeded. method=%s args=%v result=%+v time=%d", method, args, res, time.Since(requestStartTime).Milliseconds()) return res, err } From c7e8f8a4adaafcb2ec87b46a4d37cceec6debf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Mon, 13 Jan 2025 17:36:20 +0100 Subject: [PATCH 06/10] Collect metrics from the gateway (#2171) --- tools/walletextension/metrics/metrics.go | 189 ++++++++++++++++++ tools/walletextension/rpcapi/utils.go | 2 + .../services/wallet_extension.go | 9 +- .../database/cosmosdb/metrics_storage.go | 133 ++++++++++++ tools/walletextension/storage/storage.go | 8 + .../walletextension_container.go | 21 +- 6 files changed, 360 insertions(+), 2 deletions(-) create mode 100644 tools/walletextension/metrics/metrics.go create mode 100644 tools/walletextension/storage/database/cosmosdb/metrics_storage.go diff --git a/tools/walletextension/metrics/metrics.go b/tools/walletextension/metrics/metrics.go new file mode 100644 index 000000000..e79dae8cd --- /dev/null +++ b/tools/walletextension/metrics/metrics.go @@ -0,0 +1,189 @@ +package metrics + +import ( + "crypto/sha256" + "encoding/hex" + "log" + "sync" + "sync/atomic" + "time" + + "github.com/ten-protocol/go-ten/tools/walletextension/storage/database/cosmosdb" +) + +const ( + // Persistence intervals (how often metrics are saved to CosmosDB) + MetricsPersistInterval = 10 * time.Minute + + // Cleanup intervals (how often inactive users are cleaned up) + InactiveUserCleanupInterval = 1 * time.Hour + + // Activity thresholds + UserInactivityThreshold = 30 * 24 * time.Hour // 30 days + MonthlyActiveUserWindow = 30 * 24 * time.Hour // 30 days +) + +// Metrics interface defines the metrics operations +type Metrics interface { + RecordNewUser() + RecordAccountRegistered() + RecordUserActivity(anonymousID string) + GetTotalUsers() uint64 + GetTotalAccountsRegistered() uint64 + GetMonthlyActiveUsers() int + Stop() +} + +type MetricsTracker struct { + totalUsers atomic.Uint64 + accountsRegistered atomic.Uint64 + activeUsers map[string]time.Time // key is double-hashed userID + activeUserLock sync.RWMutex + storage *cosmosdb.MetricsStorageCosmosDB + persistTicker *time.Ticker +} + +func NewMetricsTracker(storage *cosmosdb.MetricsStorageCosmosDB) Metrics { + mt := &MetricsTracker{ + activeUsers: make(map[string]time.Time), + storage: storage, + persistTicker: time.NewTicker(MetricsPersistInterval), + } + + // Load existing metrics + if metrics, err := storage.LoadMetrics(); err == nil { + mt.totalUsers.Store(metrics.TotalUsers) + mt.accountsRegistered.Store(metrics.AccountsRegistered) + + mt.activeUserLock.Lock() + for hashedUserID, timestamp := range metrics.ActiveUsers { + if t, err := time.Parse(time.RFC3339, timestamp); err == nil { + mt.activeUsers[hashedUserID] = t + } + } + mt.activeUserLock.Unlock() + } + + // Start cleanup routine for inactive users + go mt.cleanupInactiveUsers() + go mt.persistMetrics() + + return mt +} + +// hashUserID creates a double-hashed version of the userID +func (mt *MetricsTracker) hashUserID(userID []byte) string { + // First hash + firstHash := sha256.Sum256(userID) + // Second hash + secondHash := sha256.Sum256(firstHash[:]) + return hex.EncodeToString(secondHash[:]) +} + +func (mt *MetricsTracker) RecordNewUser() { + mt.totalUsers.Add(1) +} + +// RecordAccountRegistered increments the total number of registered accounts +func (mt *MetricsTracker) RecordAccountRegistered() { + mt.accountsRegistered.Add(1) +} + +// RecordUserActivity updates the last activity timestamp for a user +func (mt *MetricsTracker) RecordUserActivity(anonymousID string) { + hashedUserID := mt.hashUserID([]byte(anonymousID)) + + mt.activeUserLock.Lock() + mt.activeUsers[hashedUserID] = time.Now() + mt.activeUserLock.Unlock() +} + +// GetTotalUsers returns the total number of registered users +func (mt *MetricsTracker) GetTotalUsers() uint64 { + return mt.totalUsers.Load() +} + +// GetTotalAccountsRegistered returns the total number of registered accounts +func (mt *MetricsTracker) GetTotalAccountsRegistered() uint64 { + return mt.accountsRegistered.Load() +} + +// GetMonthlyActiveUsers returns the number of users active in the last 30 days +func (mt *MetricsTracker) GetMonthlyActiveUsers() int { + mt.activeUserLock.RLock() + defer mt.activeUserLock.RUnlock() + + count := 0 + activeThreshold := time.Now().Add(-MonthlyActiveUserWindow) + + for _, lastActive := range mt.activeUsers { + if lastActive.After(activeThreshold) { + count++ + } + } + return count +} + +// persistMetrics periodically saves metrics to CosmosDB +func (mt *MetricsTracker) persistMetrics() { + for range mt.persistTicker.C { + mt.saveMetrics() + } +} + +func (mt *MetricsTracker) saveMetrics() { + mt.activeUserLock.RLock() + activeUsersMap := make(map[string]string) + for hashedUserID, timestamp := range mt.activeUsers { + activeUsersMap[hashedUserID] = timestamp.UTC().Format(time.RFC3339) + } + mt.activeUserLock.RUnlock() + + metrics := &cosmosdb.MetricsDocument{ + ID: cosmosdb.METRICS_DOC_ID, + TotalUsers: mt.totalUsers.Load(), + AccountsRegistered: mt.accountsRegistered.Load(), + ActiveUsers: activeUsersMap, + } + + if err := mt.storage.SaveMetrics(metrics); err != nil { + // Either log the error properly or return it + log.Printf("Failed to persist metrics: %v", err) + } +} + +func (mt *MetricsTracker) cleanupInactiveUsers() { + ticker := time.NewTicker(InactiveUserCleanupInterval) + for range ticker.C { + mt.activeUserLock.Lock() + inactiveThreshold := time.Now().Add(-UserInactivityThreshold) + + for userID, lastActive := range mt.activeUsers { + if lastActive.Before(inactiveThreshold) { + delete(mt.activeUsers, userID) + } + } + mt.activeUserLock.Unlock() + } +} + +// Stop cleanly stops the metrics tracker +func (mt *MetricsTracker) Stop() { + mt.persistTicker.Stop() + mt.saveMetrics() // Final save before stopping +} + +// NoOpMetricsTracker implements Metrics interface but does nothing +type NoOpMetricsTracker struct{} + +func NewNoOpMetricsTracker() Metrics { + return &NoOpMetricsTracker{} +} + +func (mt *NoOpMetricsTracker) RecordNewUser() {} +func (mt *NoOpMetricsTracker) RecordAccountRegistered() {} +func (mt *NoOpMetricsTracker) RecordUserActivity(string) {} +func (mt *NoOpMetricsTracker) GetTotalUsers() uint64 { return 0 } +func (mt *NoOpMetricsTracker) GetTotalAccountsRegistered() uint64 { return 0 } +func (mt *NoOpMetricsTracker) GetMonthlyActiveUsers() int { return 0 } +func (mt *NoOpMetricsTracker) Stop() {} diff --git a/tools/walletextension/rpcapi/utils.go b/tools/walletextension/rpcapi/utils.go index 4df536bfc..e453b96d3 100644 --- a/tools/walletextension/rpcapi/utils.go +++ b/tools/walletextension/rpcapi/utils.go @@ -93,6 +93,8 @@ func ExecAuthRPC[R any](ctx context.Context, w *services.Services, cfg *AuthExec return nil, err } + w.MetricsTracker.RecordUserActivity(hexutils.BytesToHex(user.ID)) + rateLimitAllowed, requestUUID := w.RateLimiter.Allow(gethcommon.Address(user.ID)) defer w.RateLimiter.SetRequestEnd(gethcommon.Address(user.ID), requestUUID) if !rateLimitAllowed { diff --git a/tools/walletextension/services/wallet_extension.go b/tools/walletextension/services/wallet_extension.go index 98981963c..9b667a38f 100644 --- a/tools/walletextension/services/wallet_extension.go +++ b/tools/walletextension/services/wallet_extension.go @@ -22,6 +22,7 @@ import ( "github.com/status-im/keycard-go/hexutils" "github.com/ten-protocol/go-ten/tools/walletextension/cache" + "github.com/ten-protocol/go-ten/tools/walletextension/metrics" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -49,6 +50,7 @@ type Services struct { Config *common.Config NewHeadsService *subscriptioncommon.NewHeadsService cacheInvalidationCh chan *tencommon.BatchHeader + MetricsTracker metrics.Metrics } type NewHeadNotifier interface { @@ -58,7 +60,7 @@ type NewHeadNotifier interface { // number of rpc responses to cache const rpcResponseCacheSize = 1_000_000 -func NewServices(hostAddrHTTP string, hostAddrWS string, storage storage.UserStorage, stopControl *stopcontrol.StopControl, version string, logger gethlog.Logger, config *common.Config) *Services { +func NewServices(hostAddrHTTP string, hostAddrWS string, storage storage.UserStorage, stopControl *stopcontrol.StopControl, version string, logger gethlog.Logger, metricsTracker metrics.Metrics, config *common.Config) *Services { newGatewayCache, err := cache.NewCache(rpcResponseCacheSize, logger) if err != nil { logger.Error(fmt.Errorf("could not create cache. Cause: %w", err).Error()) @@ -80,6 +82,7 @@ func NewServices(hostAddrHTTP string, hostAddrWS string, storage storage.UserSto RateLimiter: rateLimiter, Config: config, cacheInvalidationCh: make(chan *tencommon.BatchHeader), + MetricsTracker: metricsTracker, } services.NewHeadsService = subscriptioncommon.NewNewHeadsService( @@ -185,6 +188,7 @@ func (w *Services) GenerateAndStoreNewUser() ([]byte, error) { w.Logger().Error(fmt.Sprintf("failed to save user to the database: %s", err)) return nil, err } + w.MetricsTracker.RecordNewUser() requestEndTime := time.Now() duration := requestEndTime.Sub(requestStartTime) @@ -194,6 +198,7 @@ func (w *Services) GenerateAndStoreNewUser() ([]byte, error) { // AddAddressToUser checks if a message is in correct format and if signature is valid. If all checks pass we save address and signature against userID func (w *Services) AddAddressToUser(userID []byte, address string, signature []byte, signatureType viewingkey.SignatureType) error { + w.MetricsTracker.RecordUserActivity(hexutils.BytesToHex(userID)) audit(w, "Adding address to user: %s, address: %s", hexutils.BytesToHex(userID), address) requestStartTime := time.Now() addressFromMessage := gethcommon.HexToAddress(address) @@ -213,6 +218,7 @@ func (w *Services) AddAddressToUser(userID []byte, address string, signature []b w.Logger().Error(fmt.Errorf("error while storing account (%s) for user (%s): %w", addressFromMessage.Hex(), userID, err).Error()) return err } + w.MetricsTracker.RecordAccountRegistered() audit(w, "Storing new address for user: %s, address: %s, duration: %d ", hexutils.BytesToHex(userID), address, time.Since(requestStartTime).Milliseconds()) return nil @@ -220,6 +226,7 @@ func (w *Services) AddAddressToUser(userID []byte, address string, signature []b // UserHasAccount checks if provided account exist in the database for given userID func (w *Services) UserHasAccount(userID []byte, address string) (bool, error) { + w.MetricsTracker.RecordUserActivity(hexutils.BytesToHex(userID)) audit(w, "Checking if user has account: %s, address: %s", hexutils.BytesToHex(userID), address) addressBytes, err := hex.DecodeString(address[2:]) // remove 0x prefix from address if err != nil { diff --git a/tools/walletextension/storage/database/cosmosdb/metrics_storage.go b/tools/walletextension/storage/database/cosmosdb/metrics_storage.go new file mode 100644 index 000000000..7537a8060 --- /dev/null +++ b/tools/walletextension/storage/database/cosmosdb/metrics_storage.go @@ -0,0 +1,133 @@ +package cosmosdb + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos" +) + +const ( + METRICS_CONTAINER_NAME = "metrics" + METRICS_DOC_ID = "global_metrics" +) + +type MetricsDocument struct { + ID string `json:"id"` + TotalUsers uint64 `json:"totalUsers"` + AccountsRegistered uint64 `json:"accountsRegistered"` + ActiveUsers map[string]string `json:"activeUsers"` // double-hashed userID -> ISO timestamp + ActiveUsersCount int `json:"activeUsersCount"` + LastUpdated string `json:"lastUpdated"` +} + +// MetricsStorageCosmosDB handles metrics persistence in CosmosDB +type MetricsStorageCosmosDB struct { + client *azcosmos.Client + metricsContainer *azcosmos.ContainerClient +} + +func NewMetricsStorage(connectionString string) (*MetricsStorageCosmosDB, error) { + client, err := azcosmos.NewClientFromConnectionString(connectionString, nil) + if err != nil { + return nil, fmt.Errorf("failed to create CosmosDB client: %w", err) + } + + ctx := context.Background() + + // Ensure database exists + _, err = client.CreateDatabase(ctx, azcosmos.DatabaseProperties{ID: DATABASE_NAME}, nil) + if err != nil && !strings.Contains(err.Error(), "Conflict") { + return nil, fmt.Errorf("failed to create database: %w", err) + } + + metricsContainer, err := client.NewContainer(DATABASE_NAME, METRICS_CONTAINER_NAME) + if err != nil { + return nil, fmt.Errorf("failed to get metrics container: %w", err) + } + + return &MetricsStorageCosmosDB{ + client: client, + metricsContainer: metricsContainer, + }, nil +} + +func (m *MetricsStorageCosmosDB) LoadMetrics() (*MetricsDocument, error) { + ctx := context.Background() + partitionKey := azcosmos.NewPartitionKeyString(METRICS_DOC_ID) + + response, err := m.metricsContainer.ReadItem(ctx, partitionKey, METRICS_DOC_ID, nil) + if err != nil { + if strings.Contains(err.Error(), "NotFound") { + // Initialize with empty metrics if not found + return &MetricsDocument{ + ID: METRICS_DOC_ID, + ActiveUsers: make(map[string]string), + }, nil + } + return nil, err + } + + var doc MetricsDocument + if err := json.Unmarshal(response.Value, &doc); err != nil { + return nil, err + } + return &doc, nil +} + +func (m *MetricsStorageCosmosDB) SaveMetrics(metrics *MetricsDocument) error { + ctx := context.Background() + partitionKey := azcosmos.NewPartitionKeyString(METRICS_DOC_ID) + + // Calculate active users count and clean up inactive users + activeThreshold := time.Now().Add(-30 * 24 * time.Hour) // 30 days + activeCount := 0 + activeUsersMap := make(map[string]string) + + for userID, timestampStr := range metrics.ActiveUsers { + if timestamp, err := time.Parse(time.RFC3339, timestampStr); err == nil { + if timestamp.After(activeThreshold) { + activeCount++ + activeUsersMap[userID] = timestampStr + } + } + } + + metrics.ActiveUsers = activeUsersMap // Only keep active users + metrics.ActiveUsersCount = activeCount + metrics.LastUpdated = time.Now().UTC().Format(time.RFC3339) + + docJSON, err := json.Marshal(metrics) + if err != nil { + return err + } + + _, err = m.metricsContainer.UpsertItem(ctx, partitionKey, docJSON, nil) + return err +} + +// NoOpMetricsStorage is a no-op implementation of metrics storage +type noOpMetricsStorage struct{} + +// MetricsStorage interface defines the metrics storage operations +type MetricsStorage interface { + LoadMetrics() (*MetricsDocument, error) + SaveMetrics(*MetricsDocument) error +} + +func NewNoOpMetricsStorage() MetricsStorage { + return &noOpMetricsStorage{} +} + +func (n *noOpMetricsStorage) LoadMetrics() (*MetricsDocument, error) { + return &MetricsDocument{ + ActiveUsers: make(map[string]string), + }, nil +} + +func (n *noOpMetricsStorage) SaveMetrics(*MetricsDocument) error { + return nil +} diff --git a/tools/walletextension/storage/storage.go b/tools/walletextension/storage/storage.go index ca39c628d..37375b049 100644 --- a/tools/walletextension/storage/storage.go +++ b/tools/walletextension/storage/storage.go @@ -40,3 +40,11 @@ func New(dbType, dbConnectionURL, dbPath string, randomKey []byte, logger gethlo return NewUserStorageWithCache(underlyingStorage, logger) } + +// NewMetricsStorage is a factory function to create a MetricsStorage instance +func NewMetricsStorage(dbType, dbConnectionURL string) (*cosmosdb.MetricsStorageCosmosDB, error) { + if dbType == "cosmosDB" { + return cosmosdb.NewMetricsStorage(dbConnectionURL) + } + return nil, nil // Return nil for other database types +} diff --git a/tools/walletextension/walletextension_container.go b/tools/walletextension/walletextension_container.go index a3dff0ba6..c7ac5f0de 100644 --- a/tools/walletextension/walletextension_container.go +++ b/tools/walletextension/walletextension_container.go @@ -6,6 +6,7 @@ import ( "os" "time" + "github.com/ten-protocol/go-ten/tools/walletextension/metrics" "github.com/ten-protocol/go-ten/tools/walletextension/services" "github.com/ten-protocol/go-ten/go/common/subscription" @@ -46,6 +47,19 @@ func NewContainerFromConfig(config wecommon.Config, logger gethlog.Logger) *Cont os.Exit(1) } + // Create metrics tracker + var metricsTracker metrics.Metrics + if config.DBType == "cosmosDB" { + metricsStorage, err := storage.NewMetricsStorage(config.DBType, config.DBConnectionURL) + if err != nil { + logger.Crit("unable to create metrics storage", log.ErrKey, err) + os.Exit(1) + } + metricsTracker = metrics.NewMetricsTracker(metricsStorage) + } else { + metricsTracker = metrics.NewNoOpMetricsTracker() + } + // start the database with the encryption key userStorage, err := storage.New(config.DBType, config.DBConnectionURL, config.DBPathOverride, encryptionKey, logger) if err != nil { @@ -60,7 +74,7 @@ func NewContainerFromConfig(config wecommon.Config, logger gethlog.Logger) *Cont } stopControl := stopcontrol.New() - walletExt := services.NewServices(hostRPCBindAddrHTTP, hostRPCBindAddrWS, userStorage, stopControl, version, logger, &config) + walletExt := services.NewServices(hostRPCBindAddrHTTP, hostRPCBindAddrWS, userStorage, stopControl, version, logger, metricsTracker, &config) cfg := &node.RPCConfig{ EnableHTTP: true, HTTPPort: config.WalletExtensionPortHTTP, @@ -145,6 +159,11 @@ func NewContainerFromConfig(config wecommon.Config, logger gethlog.Logger) *Cont }, }) + // Add metrics tracker to stop sequence + stopControl.OnStop(func() { + metricsTracker.Stop() + }) + return &Container{ stopControl: stopControl, rpcServer: rpcServer, From fb1e6c9b7c8daaff77544c0a948a2741a0c393b1 Mon Sep 17 00:00:00 2001 From: Matt <98158711+BedrockSquirrel@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:13:10 +0000 Subject: [PATCH 07/10] Backup sequencer: fix catchup issues (#2247) --- go/host/enclave/guardian.go | 4 ++-- integration/simulation/devnetwork/dev_network.go | 2 +- tools/walletextension/rpcapi/utils.go | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 18837ec2b..f13723cbc 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -440,8 +440,8 @@ func (g *Guardian) catchupWithL1() error { func (g *Guardian) catchupWithL2() error { // while we are behind the L2 head and still running: for g.running.Load() && g.state.GetStatus() == L2Catchup { - if g.hostData.IsSequencer { - return errors.New("l2 catchup is not supported for sequencer") + if g.hostData.IsSequencer && g.isActiveSequencer { + return errors.New("l2 catchup is not supported for active sequencer") } // request the next batch by sequence number (based on what the enclave has been fed so far) prevHead := g.state.GetEnclaveL2Head() diff --git a/integration/simulation/devnetwork/dev_network.go b/integration/simulation/devnetwork/dev_network.go index 2d5b5c62c..39d5cbdd1 100644 --- a/integration/simulation/devnetwork/dev_network.go +++ b/integration/simulation/devnetwork/dev_network.go @@ -157,7 +157,7 @@ func (s *InMemDevNetwork) Start() { s.startNodes() // sleep to allow the nodes to start - time.Sleep(15 * time.Second) + time.Sleep(30 * time.Second) // it takes a while for the secret exchanges etc. to sort themselves out seqClient, err := obsclient.Dial(s.SequencerRPCAddress()) if err != nil { diff --git a/tools/walletextension/rpcapi/utils.go b/tools/walletextension/rpcapi/utils.go index e453b96d3..2db656ab0 100644 --- a/tools/walletextension/rpcapi/utils.go +++ b/tools/walletextension/rpcapi/utils.go @@ -75,7 +75,6 @@ func UnauthenticatedTenRPCCall[R any](ctx context.Context, w *services.Services, return resp, err }) }) - if err != nil { audit(w, "RPC call failed. method=%s args=%v error=%+v time=%d", method, args, err, time.Since(requestStartTime).Milliseconds()) return nil, err From c82525db09b665fb2c60f8748aa5d80969e55802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Tue, 14 Jan 2025 15:01:34 +0100 Subject: [PATCH 08/10] add an option to disable caching in the gateway (#2246) --- tools/walletextension/cache/cache.go | 24 +++++++++++++++++++ tools/walletextension/common/config.go | 1 + tools/walletextension/main/cli.go | 6 +++++ .../services/wallet_extension.go | 16 +++++++++---- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/tools/walletextension/cache/cache.go b/tools/walletextension/cache/cache.go index ae82f905f..4e6f3329c 100644 --- a/tools/walletextension/cache/cache.go +++ b/tools/walletextension/cache/cache.go @@ -86,3 +86,27 @@ func WithCache[R any](cache Cache, cfg *Cfg, cacheKey []byte, onCacheMiss func() return result, err } + +type noOpCache struct{} + +func NewNoOpCache() Cache { + return &noOpCache{} +} + +func (c *noOpCache) EvictShortLiving() {} + +func (c *noOpCache) DisableShortLiving() {} + +func (c *noOpCache) IsEvicted(key []byte, originalTTL time.Duration) bool { + return false +} + +func (c *noOpCache) Set(key []byte, value any, ttl time.Duration) bool { + return false +} + +func (c *noOpCache) Get(key []byte) (value any, ok bool) { + return nil, false +} + +func (c *noOpCache) Remove(key []byte) {} diff --git a/tools/walletextension/common/config.go b/tools/walletextension/common/config.go index f3ebe71ef..5b6e5eb4a 100644 --- a/tools/walletextension/common/config.go +++ b/tools/walletextension/common/config.go @@ -30,4 +30,5 @@ type Config struct { EnableTLS bool TLSDomain string EncryptingCertificateEnabled bool + DisableCaching bool } diff --git a/tools/walletextension/main/cli.go b/tools/walletextension/main/cli.go index ae2cb34bf..10f1c11ee 100644 --- a/tools/walletextension/main/cli.go +++ b/tools/walletextension/main/cli.go @@ -92,6 +92,10 @@ const ( encryptingCertificateEnabledFlagName = "encryptingCertificateEnabled" encryptingCertificateEnabledFlagDefault = false encryptingCertificateEnabledFlagUsage = "Flag to enable encrypting certificate functionality. Default: false" + + disableCachingFlagName = "disableCaching" + disableCachingFlagDefault = false + disableCachingFlagUsage = "Flag to disable response caching in the gateway. Default: false" ) func parseCLIArgs() wecommon.Config { @@ -116,6 +120,7 @@ func parseCLIArgs() wecommon.Config { enableTLSFlag := flag.Bool(enableTLSFlagName, enableTLSFlagDefault, enableTLSFlagUsage) tlsDomainFlag := flag.String(tlsDomainFlagName, tlsDomainFlagDefault, tlsDomainFlagUsage) encryptingCertificateEnabled := flag.Bool(encryptingCertificateEnabledFlagName, encryptingCertificateEnabledFlagDefault, encryptingCertificateEnabledFlagUsage) + disableCaching := flag.Bool(disableCachingFlagName, disableCachingFlagDefault, disableCachingFlagUsage) flag.Parse() return wecommon.Config{ @@ -139,5 +144,6 @@ func parseCLIArgs() wecommon.Config { EnableTLS: *enableTLSFlag, TLSDomain: *tlsDomainFlag, EncryptingCertificateEnabled: *encryptingCertificateEnabled, + DisableCaching: *disableCaching, } } diff --git a/tools/walletextension/services/wallet_extension.go b/tools/walletextension/services/wallet_extension.go index 9b667a38f..b0a9f2302 100644 --- a/tools/walletextension/services/wallet_extension.go +++ b/tools/walletextension/services/wallet_extension.go @@ -61,10 +61,18 @@ type NewHeadNotifier interface { const rpcResponseCacheSize = 1_000_000 func NewServices(hostAddrHTTP string, hostAddrWS string, storage storage.UserStorage, stopControl *stopcontrol.StopControl, version string, logger gethlog.Logger, metricsTracker metrics.Metrics, config *common.Config) *Services { - newGatewayCache, err := cache.NewCache(rpcResponseCacheSize, logger) - if err != nil { - logger.Error(fmt.Errorf("could not create cache. Cause: %w", err).Error()) - panic(err) + var newGatewayCache cache.Cache + var err error + + if !config.DisableCaching { + newGatewayCache, err = cache.NewCache(rpcResponseCacheSize, logger) + if err != nil { + logger.Error(fmt.Errorf("could not create cache. Cause: %w", err).Error()) + panic(err) + } + } else { + // Create a no-op cache implementation when caching is disabled + newGatewayCache = cache.NewNoOpCache() } rateLimiter := ratelimiter.NewRateLimiter(config.RateLimitUserComputeTime, config.RateLimitWindow, uint32(config.RateLimitMaxConcurrentRequests), logger) From 1320a975c6754a16fc21ea50a80422fbdc572520 Mon Sep 17 00:00:00 2001 From: badgersrus <43809877+badgersrus@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:46:51 +0100 Subject: [PATCH 09/10] Management contract challenge period (#2245) * add challenge period to management contract --- .../workflows/manual-deploy-testnet-l2.yml | 34 ++++++ .../ManagementContract/ManagementContract.go | 56 +++++++++- .../scripts/delay/001_set_challenge_period.ts | 39 +++++++ .../src/management/ManagementContract.sol | 21 +++- testnet/launcher/l1challengeperiod/cmd/cli.go | 35 ++++++ .../l1challengeperiod/cmd/cli_flags.go | 24 ++++ .../launcher/l1challengeperiod/cmd/main.go | 40 +++++++ testnet/launcher/l1challengeperiod/config.go | 55 +++++++++ testnet/launcher/l1challengeperiod/docker.go | 105 ++++++++++++++++++ 9 files changed, 403 insertions(+), 6 deletions(-) create mode 100644 contracts/scripts/delay/001_set_challenge_period.ts create mode 100644 testnet/launcher/l1challengeperiod/cmd/cli.go create mode 100644 testnet/launcher/l1challengeperiod/cmd/cli_flags.go create mode 100644 testnet/launcher/l1challengeperiod/cmd/main.go create mode 100644 testnet/launcher/l1challengeperiod/config.go create mode 100644 testnet/launcher/l1challengeperiod/docker.go diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 0e42f82d6..5dabd8a4a 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -419,6 +419,40 @@ jobs: grant-sequencers.out retention-days: 7 + set-challenge-period: + needs: + - build + - check-obscuro-is-healthy + runs-on: ubuntu-latest + environment: + name: ${{ github.event.inputs.testnet_type }} + steps: + - uses: actions/checkout@v4 + + - name: 'Set challenge period on management contract' + id: setChallengePeriod + shell: bash + run: | + go run ./testnet/launcher/l1challengeperiod/cmd \ + -l1_http_url=${{ secrets.L1_HTTP_URL }} \ + -private_key=${{ secrets.ACCOUNT_PK_WORKER }} \ + -management_contract_addr=${{ needs.build.outputs.MGMT_CONTRACT_ADDR }} \ + -docker_image=${{ vars.L2_HARDHATDEPLOYER_DOCKER_BUILD_TAG }} \ + -l1_challenge_period=${{ vars.L1_CHALLENGE_PERIOD }} \ + echo "Setting challenge period to ${{ vars.L1_CHALLENGE_PERIOD }}" + + - name: 'Save challenge period container logs' + run: | + docker logs `docker ps -aqf "name=set-challenge-period"` > set-challenge-period.out 2>&1 + + - name: 'Upload challenge period container logs' + uses: actions/upload-artifact@v4 + with: + name: set-challenge-period + path: | + set-challenge-period.out + retention-days: 7 + deploy-l2-contracts: needs: - build diff --git a/contracts/generated/ManagementContract/ManagementContract.go b/contracts/generated/ManagementContract/ManagementContract.go index 633d46094..2d7004b1f 100644 --- a/contracts/generated/ManagementContract/ManagementContract.go +++ b/contracts/generated/ManagementContract/ManagementContract.go @@ -46,8 +46,8 @@ type StructsValueTransferMessage struct { // ManagementContractMetaData contains all meta data concerning the ManagementContract contract. var ManagementContractMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"ImportantContractAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"messageBusAddress\",\"type\":\"address\"}],\"name\":\"LogManagementContractCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"requestReport\",\"type\":\"string\"}],\"name\":\"NetworkSecretRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"}],\"name\":\"NetworkSecretResponded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"rollupHash\",\"type\":\"bytes32\"}],\"name\":\"RollupAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"enclaveID\",\"type\":\"address\"}],\"name\":\"SequencerEnclaveGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"enclaveID\",\"type\":\"address\"}],\"name\":\"SequencerEnclaveRevoked\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"r\",\"type\":\"tuple\"}],\"name\":\"AddRollup\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"Attested\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"}],\"internalType\":\"structStructs.ValueTransferMessage\",\"name\":\"_msg\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"ExtractNativeValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetImportantContractKeys\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"rollupHash\",\"type\":\"bytes32\"}],\"name\":\"GetRollupByHash\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"GetRollupByNumber\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"GetUniqueForkID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"GrantSequencerEnclave\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_enclaveID\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_initSecret\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_genesisAttestation\",\"type\":\"string\"}],\"name\":\"InitializeNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"IsSequencerEnclave\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IsWithdrawalAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"requestReport\",\"type\":\"string\"}],\"name\":\"RequestNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attesterID\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"requesterID\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"attesterSig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"responseSecret\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"verifyAttester\",\"type\":\"bool\"}],\"name\":\"RespondNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RetrieveAllBridgeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"RevokeSequencerEnclave\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"SetImportantContractAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_lastBatchHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"providedBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"crossChainHashes\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"rollupNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"forkID\",\"type\":\"bytes32\"}],\"name\":\"addCrossChainMessagesRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"importantContractAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"importantContractKeys\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"crossChainHashes\",\"type\":\"bytes[]\"}],\"name\":\"isBundleAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"isBundleSaved\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"isWithdrawalSpent\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBatchHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBatchSeqNo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"merkleMessageBus\",\"outputs\":[{\"internalType\":\"contractIMerkleTreeMessageBus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBus\",\"outputs\":[{\"internalType\":\"contractIMessageBus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x6080604052348015600f57600080fd5b50601733601b565b608c565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6154d28061009b6000396000f3fe608060405234801561001057600080fd5b50600436106101d95760003560e01c80638129fc1c11610104578063a1a227fa116100a2578063db5d91b111610071578063db5d91b114610475578063e34fbfc8146104a1578063e874eb20146104b4578063f2fde38b146104c757600080fd5b8063a1a227fa1461041f578063a4ab2faa1461043f578063a52f433c14610452578063d4fab8871461046257600080fd5b806384154826116100de578063841548261461039957806387059edb146103bc5780638da5cb5b146103cf57806398077e86146103ff57600080fd5b80638129fc1c1461035d57806381be5385146103655780638236a7ba1461037857600080fd5b8063476657381161017c5780636a30d26c1161014b5780636a30d26c146103255780636b9707d61461033a578063715018a61461034d578063728109961461035557600080fd5b806347665738146102cb5780635371a216146102de578063568699c8146102f157806368e103831461031257600080fd5b80632f0cb9e3116101b85780632f0cb9e3146102255780633e60a22f1461025557806343348b2f14610296578063440c953b146102c257600080fd5b80620ddd27146101de57806303e72e48146101fd578063073b6ef314610212575b600080fd5b6101e7600e5481565b6040516101f49190611ad4565b60405180910390f35b61021061020b366004611c0a565b6104da565b005b610210610220366004611d7f565b6105e2565b610248610233366004611e4d565b600c6020526000908152604090205460ff1681565b6040516101f49190611e74565b610289610263366004611e82565b80516020818301810180516003825292820191909301209152546001600160a01b031681565b6040516101f49190611ece565b6102486102a4366004611edc565b6001600160a01b031660009081526020819052604090205460ff1690565b6101e760055481565b6102106102d9366004611edc565b610864565b6102106102ec366004611f61565b610904565b6103046102ff366004611e4d565b610aa9565b6040516101f4929190612063565b610210610320366004612083565b610aff565b61032d610ba3565b6040516101f49190612186565b610210610348366004611edc565b610c7c565b610210610d0c565b610210610d20565b610210610da5565b6102106103733660046121ac565b610f80565b61038b610386366004611e4d565b61107b565b6040516101f49291906121e7565b6102486103a7366004611e4d565b600d6020526000908152604090205460ff1681565b61038b6103ca366004611e4d565b611163565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610289565b61041261040d366004611e4d565b6111da565b6040516101f491906121f5565b600a54610432906001600160a01b031681565b6040516101f49190612248565b61024861044d366004612256565b611286565b600454610100900460ff16610248565b6102106104703660046122a4565b611304565b610248610483366004611edc565b6001600160a01b031660009081526001602052604090205460ff1690565b6102106104af36600461234b565b61140c565b600b54610432906001600160a01b031681565b6102106104d5366004611edc565b611453565b6104e26114aa565b60006001600160a01b03166003836040516104fd91906123b5565b908152604051908190036020019020546001600160a01b03160361055957600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace016105578382612491565b505b8060038360405161056a91906123b5565b90815260405190819003602001812080546001600160a01b039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092179091557f17b2f9f5748931099ffee882b5b64f4a560b5c55da9b4f4e396dae3bb9f98cb5906105d69084908490612551565b60405180910390a15050565b6105ed8660ff612587565b43106106145760405162461bcd60e51b815260040161060b906125cc565b60405180910390fd5b8543036106335760405162461bcd60e51b815260040161060b90612636565b854060008190036106565760405162461bcd60e51b815260040161060b90612678565b8781146106755760405162461bcd60e51b815260040161060b906126ba565b60008381526008602052604090205482146106a25760405162461bcd60e51b815260040161060b906126fc565b60006107108a8a8a8a6040516020016106be9493929190612764565b6040516020818303038152906040528051906020012087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061151e92505050565b6001600160a01b03811660009081526001602052604090205490915060ff1661074b5760405162461bcd60e51b815260040161060b906127da565b600e8a90556000805b885181101561083e57600b5489516001600160a01b039091169063b6aed0cb908b9084908110610786576107866127ea565b60200260200101516107979061280a565b426040518363ffffffff1660e01b81526004016107b5929190612840565b600060405180830381600087803b1580156107cf57600080fd5b505af11580156107e3573d6000803e3d6000fd5b50505050818982815181106107fa576107fa6127ea565b602002602001015161080b9061280a565b60405160200161081c929190612840565b60408051601f1981840301815291905280516020909101209150600101610754565b506000908152600d60205260409020805460ff1916600117905550505050505050505050565b61086c6114aa565b6001600160a01b03811660009081526020819052604090205460ff166108a45760405162461bcd60e51b815260040161060b9061288d565b6001600160a01b038116600090815260016020819052604091829020805460ff19169091179055517ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e760936906108f9908390611ece565b60405180910390a150565b600b546040517fb201246f0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063b201246f906109539087908790879087906004016129b8565b60006040518083038186803b15801561096b57600080fd5b505afa15801561097f573d6000803e3d6000fd5b5050505060008460405160200161099691906129f1565b60408051601f1981840301815291815281516020928301206000818152600c90935291205490915060ff16156109de5760405162461bcd60e51b815260040161060b90612a31565b6001600c6000876040516020016109f591906129f1565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff191693151593909317909255600a546001600160a01b0316916399a3ad2191610a4e91908901908901611edc565b87604001356040518363ffffffff1660e01b8152600401610a70929190612a41565b600060405180830381600087803b158015610a8a57600080fd5b505af1158015610a9e573d6000803e3d6000fd5b505050505050505050565b604080516060808201835260008083526020830191909152918101829052600080610ad385611163565b9150915081610ae85760009590945092505050565b600094855260086020526040909420549492505050565b60045460ff1615610b225760405162461bcd60e51b815260040161060b90612aa7565b60048054600160ff1991821681179092556001600160a01b0387166000908152602081815260408083208054851686179055908490529081902080549092169092179055517ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093690610b94908790611ece565b60405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b82821015610c73578382906000526020600020018054610be6906123d5565b80601f0160208091040260200160405190810160405280929190818152602001828054610c12906123d5565b8015610c5f5780601f10610c3457610100808354040283529160200191610c5f565b820191906000526020600020905b815481529060010190602001808311610c4257829003601f168201915b505050505081526020019060010190610bc7565b50505050905090565b610c846114aa565b6001600160a01b03811660009081526001602052604090205460ff16610cbc5760405162461bcd60e51b815260040161060b90612ae9565b6001600160a01b03811660009081526001602052604090819020805460ff19169055517f0f279980343c7ca542fde9fa5396555068efb5cd560d9cf9c191aa2911079b47906108f9908390611ece565b610d146114aa565b610d1e600061154a565b565b610d286114aa565b600a546040517f36d2da900000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906336d2da9090610d71903390600401611ece565b600060405180830381600087803b158015610d8b57600080fd5b505af1158015610d9f573d6000803e3d6000fd5b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610df05750825b905060008267ffffffffffffffff166001148015610e0d5750303b155b905081158015610e1b575080155b15610e52576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610e8657845468ff00000000000000001916680100000000000000001785555b610e8f336115c8565b60006005556001600955604051610ea590611abf565b604051809103906000f080158015610ec1573d6000803e3d6000fd5b50600b80546001600160a01b039290921673ffffffffffffffffffffffffffffffffffffffff199283168117909155600a805490921681179091556040517fbd726cf82ac9c3260b1495107182e336e0654b25c10915648c0cc15b2bb72cbf91610f2a91611ece565b60405180910390a18315610f7957845468ff0000000000000000191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290610b9490600190612b14565b5050505050565b6000610fce8235610f946020850185612b22565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061151e92505050565b6001600160a01b03811660009081526020819052604090205490915060ff166110095760405162461bcd60e51b815260040161060b9061288d565b6001600160a01b03811660009081526001602052604090205460ff166110415760405162461bcd60e51b815260040161060b90612ae9565b61104a826115d9565b6040517fd6555bff8670bd3008dc064c30bb56d6ac7cb14ae801e36146fe4e7c6a504a58906105d690843590611ad4565b6040805160608082018352600080835260208084018390528385018290528582526006815284822085519384019095528454835260018501805492958694939092840191906110c9906123d5565b80601f01602080910402602001604051908101604052809291908181526020018280546110f5906123d5565b80156111425780601f1061111757610100808354040283529160200191611142565b820191906000526020600020905b81548152906001019060200180831161112557829003601f168201915b50505091835250506002919091015460209091015280519094149492505050565b604080516060808201835260008083526020830191909152918101829052600083815260076020526040812054908190036111c757505060408051606081018252600080825282516020818101855282825283015291810182905290939092509050565b6111d08161107b565b9250925050915091565b600281815481106111ea57600080fd5b906000526020600020016000915090508054611205906123d5565b80601f0160208091040260200160405190810160405280929190818152602001828054611231906123d5565b801561127e5780601f106112535761010080835404028352916020019161127e565b820191906000526020600020905b81548152906001019060200180831161126157829003601f168201915b505050505081565b600080805b83518110156112eb57818482815181106112a7576112a76127ea565b60200260200101516112b89061280a565b6040516020016112c9929190612840565b60408051601f198184030181529190528051602090910120915060010161128b565b506000908152600d602052604090205460ff1692915050565b6001600160a01b03851660009081526020819052604090205460ff168061133d5760405162461bcd60e51b815260040161060b90612bcf565b81156113b557600061137187878660405160200161135d93929190612c07565b60405160208183030381529060405261167d565b9050600061137f828761151e565b9050876001600160a01b0316816001600160a01b0316146113b25760405162461bcd60e51b815260040161060b90612c83565b50505b6001600160a01b03808616600081815260208190526040808220805460ff191660011790555191928916917fb869e23ebc7c717d76e345eee8ec282612603e45c44f7ae5494b197c8d9d1be19190a3505050505050565b336001600160a01b03167f0b0ecdedd12079aa2d6c5e0186026c711cb0c8d04f1b724ba5880fb6328d43018383604051611447929190612cb3565b60405180910390a25050565b61145b6114aa565b6001600160a01b03811661149e5760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161060b9190611ece565b6114a78161154a565b50565b336114dc7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b031614610d1e57336040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161060b9190611ece565b60008060008061152e86866116b8565b92509250925061153e8282611705565b50909150505b92915050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6115d061180b565b6114a781611872565b8035600090815260066020526040902081906115f58282612e28565b50506009546000908152600760205260409020813590819055611619600143612e32565b4060405160200161162b929190612840565b60408051601f19818403018152918152815160209283012060098054600090815260089094529183205580549161166183612e45565b9190505550600554816040013511156114a75760400135600555565b6000611689825161187a565b8260405160200161169b929190612e5e565b604051602081830303815290604052805190602001209050919050565b600080600083516041036116f25760208401516040850151606086015160001a6116e48882858561191b565b9550955095505050506116fe565b50508151600091506002905b9250925092565b600082600381111561171957611719612e9a565b03611722575050565b600182600381111561173657611736612e9a565b0361176d576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600282600381111561178157611781612e9a565b036117ba576040517ffce698f700000000000000000000000000000000000000000000000000000000815261060b908290600401611ad4565b60038260038111156117ce576117ce612e9a565b0361180757806040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260040161060b9190611ad4565b5050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16610d1e576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61145b61180b565b60606000611887836119dd565b600101905060008167ffffffffffffffff8111156118a7576118a7611ae2565b6040519080825280601f01601f1916602001820160405280156118d1576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846118db575b509392505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561195657506000915060039050826119d3565b60006001888888886040516000815260200160405260405161197b9493929190612eb9565b6020604051602081039080840390855afa15801561199d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166119c9575060009250600191508290506119d3565b9250600091508190505b9450945094915050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611a26577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611a52576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611a7057662386f26fc10000830492506010015b6305f5e1008310611a88576305f5e100830492506008015b6127108310611a9c57612710830492506004015b60648310611aae576064830492506002015b600a83106115445760010192915050565b6125ae80612eef83390190565b805b82525050565b602081016115448284611acc565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715611b1e57611b1e611ae2565b6040525050565b6000611b3060405190565b9050611b3c8282611af8565b919050565b600067ffffffffffffffff821115611b5b57611b5b611ae2565b601f19601f83011660200192915050565b82818337506000910152565b6000611b8b611b8684611b41565b611b25565b9050828152838383011115611ba257611ba2600080fd5b611bb0836020830184611b6c565b9392505050565b600082601f830112611bcb57611bcb600080fd5b611bb083833560208501611b78565b60006001600160a01b038216611544565b611bf481611bda565b81146114a757600080fd5b803561154481611beb565b60008060408385031215611c2057611c20600080fd5b823567ffffffffffffffff811115611c3a57611c3a600080fd5b611c4685828601611bb7565b925050611c568460208501611bff565b90509250929050565b80611bf4565b803561154481611c5f565b600067ffffffffffffffff821115611c8a57611c8a611ae2565b5060209081020190565b6000611ca2611b8684611c70565b83815290506020808201908402830185811115611cc157611cc1600080fd5b835b81811015611d0057803567ffffffffffffffff811115611ce557611ce5600080fd5b611cf188828801611bb7565b84525060209283019201611cc3565b5050509392505050565b600082601f830112611d1e57611d1e600080fd5b611bb083833560208501611c94565b60008083601f840112611d4257611d42600080fd5b50813567ffffffffffffffff811115611d5d57611d5d600080fd5b602083019150836001820283011115611d7857611d78600080fd5b9250929050565b60008060008060008060008060e0898b031215611d9e57611d9e600080fd5b611da88a8a611c65565b9750611db78a60208b01611c65565b9650611dc68a60408b01611c65565b9550606089013567ffffffffffffffff811115611de557611de5600080fd5b611df18b828c01611d0a565b955050608089013567ffffffffffffffff811115611e1157611e11600080fd5b611e1d8b828c01611d2d565b9450945050611e2f8a60a08b01611c65565b9150611e3e8a60c08b01611c65565b90509295985092959890939650565b600060208284031215611e6257611e62600080fd5b611bb08383611c65565b801515611ace565b602081016115448284611e6c565b600060208284031215611e9757611e97600080fd5b813567ffffffffffffffff811115611eb157611eb1600080fd5b611ebd84828501611bb7565b949350505050565b611ace81611bda565b602081016115448284611ec5565b600060208284031215611ef157611ef1600080fd5b611bb08383611bff565b600060808284031215611f1057611f10600080fd5b50919050565b60008083601f840112611f2b57611f2b600080fd5b50813567ffffffffffffffff811115611f4657611f46600080fd5b602083019150836020820283011115611d7857611d78600080fd5b60008060008060c08587031215611f7a57611f7a600080fd5b611f848686611efb565b9350608085013567ffffffffffffffff811115611fa357611fa3600080fd5b611faf87828801611f16565b9350935050611fc18660a08701611c65565b905092959194509250565b60005b83811015611fe7578181015183820152602001611fcf565b50506000910152565b6000611ffa825190565b808452602084019350612011818560208601611fcc565b601f01601f19169290920192915050565b805160009060608401906120368582611acc565b506020830151848203602086015261204e8282611ff0565b91505060408301516119136040860182611acc565b604081016120718285611acc565b8181036020830152611ebd8184612022565b60008060008060006060868803121561209e5761209e600080fd5b6120a88787611bff565b9450602086013567ffffffffffffffff8111156120c7576120c7600080fd5b6120d388828901611d2d565b9450945050604086013567ffffffffffffffff8111156120f5576120f5600080fd5b61210188828901611d2d565b92509250509295509295909350565b6000611bb08383611ff0565b60200190565b600061212c825190565b808452602084019350836020820285016121468560200190565b60005b8481101561217a57838303885281516121628482612110565b93505060208201602098909801979150600101612149565b50909695505050505050565b60208082528101611bb08184612122565b600060608284031215611f1057611f10600080fd5b6000602082840312156121c1576121c1600080fd5b813567ffffffffffffffff8111156121db576121db600080fd5b611ebd84828501612197565b604081016120718285611e6c565b60208082528101611bb08184611ff0565b60006115446001600160a01b03831661221d565b90565b6001600160a01b031690565b600061154482612206565b600061154482612229565b611ace81612234565b60208101611544828461223f565b60006020828403121561226b5761226b600080fd5b813567ffffffffffffffff81111561228557612285600080fd5b611ebd84828501611d0a565b801515611bf4565b803561154481612291565b600080600080600060a086880312156122bf576122bf600080fd5b6122c98787611bff565b94506122d88760208801611bff565b9350604086013567ffffffffffffffff8111156122f7576122f7600080fd5b61230388828901611bb7565b935050606086013567ffffffffffffffff81111561232357612323600080fd5b61232f88828901611bb7565b92505061233f8760808801612299565b90509295509295909350565b6000806020838503121561236157612361600080fd5b823567ffffffffffffffff81111561237b5761237b600080fd5b61238785828601611d2d565b92509250509250929050565b600061239d825190565b6123ab818560208601611fcc565b9290920192915050565b6115448183612393565b634e487b7160e01b600052602260045260246000fd5b6002810460018216806123e957607f821691505b602082108103611f1057611f106123bf565b600061154461221a8381565b612410836123fb565b815460001960089490940293841b1916921b91909117905550565b6000612438818484612407565b505050565b818110156118075761245060008261242b565b60010161243d565b601f821115612438576000818152602090206020601f8501048101602085101561247f5750805b610f796020601f86010483018261243d565b815167ffffffffffffffff8111156124ab576124ab611ae2565b6124b582546123d5565b6124c0828285612458565b506020601f8211600181146124f557600083156124dd5750848201515b600019600885021c1981166002850217855550610f79565b600084815260208120601f198516915b828110156125255787850151825560209485019460019092019101612505565b50848210156125425783870151600019601f87166008021c191681555b50505050600202600101905550565b604080825281016125628185611ff0565b9050611bb06020830184611ec5565b634e487b7160e01b600052601160045260246000fd5b8082018082111561154457611544612571565b60158152602081017f426c6f636b2062696e64696e6720746f6f206f6c6400000000000000000000008152905061211c565b602080825281016115448161259a565b60368152602081017f43616e6e6f742062696e6420746f2074686520626c6f636b207468617420697381527f206265696e672063757272656e746c79206d696e656400000000000000000000602082015290505b60400190565b60208082528101611544816125dc565b60128152602081017f556e6b6e6f776e20626c6f636b206861736800000000000000000000000000008152905061211c565b6020808252810161154481612646565b60168152602081017f426c6f636b2062696e64696e67206d69736d61746368000000000000000000008152905061211c565b6020808252810161154481612688565b600e8152602081017f496e76616c696420666f726b49440000000000000000000000000000000000008152905061211c565b60208082528101611544816126ca565b6000612716825190565b808452602084019350836020820285016127308560200190565b60005b8481101561217a578383038852815161274c8482612110565b93505060208201602098909801979150600101612733565b608081016127728287611acc565b61277f6020830186611acc565b61278c6040830185611acc565b818103606083015261279e818461270c565b9695505050505050565b60178152602081017f61646472657373206e6f7420612073657175656e6365720000000000000000008152905061211c565b60208082528101611544816127a8565b634e487b7160e01b600052603260045260246000fd5b6000611544825190565b6000612814825190565b6020830161282181612800565b9250506020811015611f10576000196020919091036008021b16919050565b6040810161284e8285611acc565b611bb06020830184611acc565b60168152602081017f656e636c6176654944206e6f74206174746573746564000000000000000000008152905061211c565b602080825281016115448161285b565b5060006115446020830183611bff565b5060006115446020830183611c65565b67ffffffffffffffff8116611bf4565b8035611544816128bd565b50600061154460208301836128cd565b67ffffffffffffffff8116611ace565b612902818061289d565b61290c8382611ec5565b5061291a602082018261289d565b6129276020840182611ec5565b5061293560408201826128ad565b6129426040840182611acc565b5061295060608201826128d8565b61243860608401826128e8565b82818337505050565b81835260208301925060007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156129a1576129a1600080fd5b6020830292506129b283858461295d565b50500190565b60c081016129c682876128f8565b81810360808301526129d9818587612966565b90506129e860a0830184611acc565b95945050505050565b6080810161154482846128f8565b60188152602081017f7769746864726177616c20616c7265616479207370656e7400000000000000008152905061211c565b60208082528101611544816129ff565b6040810161284e8285611ec5565b60228152602081017f6e6574776f726b2073656372657420616c726561647920696e697469616c697a81527f656400000000000000000000000000000000000000000000000000000000000060208201529050612630565b6020808252810161154481612a4f565b60198152602081017f656e636c6176654944206e6f7420612073657175656e636572000000000000008152905061211c565b6020808252810161154481612ab7565b600067ffffffffffffffff8216611544565b611ace81612af9565b602081016115448284612b0b565b6000808335601e1936859003018112612b3d57612b3d600080fd5b8301915050803567ffffffffffffffff811115612b5c57612b5c600080fd5b602082019150600181023603821315611d7857611d78600080fd5b60238152602081017f726573706f6e64696e67206174746573746572206973206e6f7420617474657381527f746564000000000000000000000000000000000000000000000000000000000060208201529050612630565b6020808252810161154481612b77565b60006115448260601b90565b600061154482612bdf565b611ace612c0282611bda565b612beb565b612c118185612bf6565b601401612c1e8184612bf6565b601401611ebd8183612393565b602c8152602081017f63616c63756c61746564206164647265737320616e642061747465737465724981527f4420646f6e74206d61746368000000000000000000000000000000000000000060208201529050612630565b6020808252810161154481612c2b565b818352602083019250612ca7828483611b6c565b50601f01601f19160190565b60208082528101611ebd818486612c93565b6000813561154481611c5f565b600081611544565b612ce382612cd2565b612cef61221a82612cd2565b8255505050565b8267ffffffffffffffff811115612d0f57612d0f611ae2565b612d1982546123d5565b612d24828285612458565b506000601f821160018114612d595760008315612d415750848201355b600019600885021c1981166002850217855550612db3565b600084815260209020601f19841690835b82811015612d8a5787850135825560209485019460019092019101612d6a565b5084821015612da7576000196008601f8716021c19878501351681555b50506001600284020184555b505050505050565b612438838383612cf6565b612dcf826123fb565b80612cef565b8180612de081612cc5565b9050612dec8184612cda565b5050612dfb6020830183612b22565b612e09818360018601612dbb565b50506040820180612e1982612cc5565b9050610d9f8160028501612dc6565b6118078282612dd5565b8181038181111561154457611544612571565b600060018201612e5757612e57612571565b5060010190565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152601a01612e8e8184612393565b9050611bb08183612393565b634e487b7160e01b600052602160045260246000fd5b60ff8116611ace565b60808101612ec78287611acc565b612ed46020830186612eb0565b612ee16040830185611acc565b6129e86060830184611acc56fe608060405234801561001057600080fd5b5061001a33610027565b610022610098565b61014a565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100e85760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101475780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b612455806101596000396000f3fe6080604052600436106101115760003560e01c80638da5cb5b116100a5578063b1454caa11610074578063b6aed0cb11610059578063b6aed0cb1461038b578063e138a8d2146103ab578063f2fde38b146103cb57610185565b8063b1454caa1461034b578063b201246f1461036b57610185565b80638da5cb5b146102a65780639730886d146102eb57806399a3ad211461030b578063ab53bddc1461032b57610185565b8063346633fb116100e1578063346633fb1461023e57806336d2da9014610251578063485cc95514610271578063715018a61461029157610185565b8062a1b815146101a65780630fcfbd11146101d15780630fe9188e146101f157806333a88c721461021157610185565b36610185576040517f346633fb000000000000000000000000000000000000000000000000000000008152309063346633fb90349061015690339083906004016111ea565b6000604051808303818588803b15801561016f57600080fd5b505af1158015610183573d6000803e3d6000fd5b005b60405162461bcd60e51b815260040161019d90611239565b60405180910390fd5b3480156101b257600080fd5b506101bb6103eb565b6040516101c89190611249565b60405180910390f35b3480156101dd57600080fd5b506101bb6101ec366004611272565b610477565b3480156101fd57600080fd5b5061018361020c3660046112c5565b6104d6565b34801561021d57600080fd5b5061023161022c366004611272565b61051c565b6040516101c891906112ec565b61018361024c36600461130e565b61056e565b34801561025d57600080fd5b5061018361026c366004611346565b6106bd565b34801561027d57600080fd5b5061018361028c366004611365565b61073c565b34801561029d57600080fd5b506101836108a7565b3480156102b257600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166040516101c89190611394565b3480156102f757600080fd5b506101836103063660046113a2565b6108bb565b34801561031757600080fd5b5061018361032636600461130e565b610a27565b34801561033757600080fd5b5061018361034636600461130e565b610aa7565b61035e61035936600461146b565b610b70565b6040516101c891906114f8565b34801561037757600080fd5b50610183610386366004611566565b610c7d565b34801561039757600080fd5b506101836103a63660046115d1565b610d7e565b3480156103b757600080fd5b506101836103c63660046115f1565b610dc4565b3480156103d757600080fd5b506101836103e6366004611346565b610f0f565b600354604080517f1a90a21900000000000000000000000000000000000000000000000000000000815290516000926001600160a01b031691631a90a2199160048083019260209291908290030181865afa15801561044e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104729190611679565b905090565b6000808260405160200161048b9190611837565b60408051601f198184030181529181528151602092830120600081815292839052912054909150806104cf5760405162461bcd60e51b815260040161019d90611886565b9392505050565b6104de610f66565b600081815260046020526040812054900361050b5760405162461bcd60e51b815260040161019d906118c8565b600090815260046020526040812055565b600080826040516020016105309190611837565b60408051601f19818403018152918152815160209283012060008181529283905291205490915080158015906105665750428111155b949350505050565b60003411801561057d57508034145b6105995760405162461bcd60e51b815260040161019d90611930565b60035434906001600160a01b03161561065d5760006105b66103eb565b9050803410156105d85760405162461bcd60e51b815260040161019d90611970565b6105e28134611996565b6003546040519193506000916001600160a01b039091169083908381818185875af1925050503d8060008114610634576040519150601f19603f3d011682016040523d82523d6000602084013e610639565b606091505b505090508061065a5760405162461bcd60e51b815260040161019d90611a01565b50505b600061066833610fda565b9050836001600160a01b0316336001600160a01b03167f50c536ac33a920f00755865b831d17bf4cff0b2e0345f65b16d52bfc004068b684846040516106af929190611a11565b60405180910390a350505050565b6106c5610f66565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610712576040519150601f19603f3d011682016040523d82523d6000602084013e610717565b606091505b50509050806107385760405162461bcd60e51b815260040161019d90611a5e565b5050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156107875750825b905060008267ffffffffffffffff1660011480156107a45750303b155b9050811580156107b2575080155b156107e9576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561081d57845468ff00000000000000001916680100000000000000001785555b61082687611038565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038816179055831561089e57845468ff0000000000000000191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061089590600190611a92565b60405180910390a15b50505050505050565b6108af610f66565b6108b96000611049565b565b60006108c8600130611aa0565b90506108fb7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806109225750336001600160a01b038216145b61093e5760405162461bcd60e51b815260040161019d90611af5565b600061094a8342611b05565b905060008460405160200161095f9190611837565b60408051601f198184030181529181528151602092830120600081815292839052912054909150156109a35760405162461bcd60e51b815260040161019d90611b70565b6000818152602081815260408220849055600191906109c490880188611346565b6001600160a01b0316815260208101919091526040016000908120906109f06080880160608901611b80565b63ffffffff1681526020808201929092526040016000908120805460018101825590825291902086916004020161089e8282611fbe565b610a2f610f66565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610a7c576040519150601f19603f3d011682016040523d82523d6000602084013e610a81565b606091505b5050905080610aa25760405162461bcd60e51b815260040161019d90611a5e565b505050565b6000610ab4600130611aa0565b9050610ae77f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610b0e5750336001600160a01b038216145b610b2a5760405162461bcd60e51b815260040161019d90611af5565b826001600160a01b03167fcd9850463422a7449c406a036e35e5edb6fbe35a64c9f12a2354be98a750c0d383604051610b639190611249565b60405180910390a2505050565b6003546000906001600160a01b031615610c26576000610b8e6103eb565b905080341015610bb05760405162461bcd60e51b815260040161019d90612020565b6003546040516000916001600160a01b03169083908381818185875af1925050503d8060008114610bfd576040519150601f19603f3d011682016040523d82523d6000602084013e610c02565b606091505b5050905080610c235760405162461bcd60e51b815260040161019d90611a01565b50505b610c2f33610fda565b90507fb93c37389233beb85a3a726c3f15c2d15533ee74cb602f20f490dfffef77593733828888888888604051610c6c9796959493929190612030565b60405180910390a195945050505050565b6000818152600460205260408120549003610caa5760405162461bcd60e51b815260040161019d906120eb565b600081815260046020526040902054421015610cd85760405162461bcd60e51b815260040161019d90612137565b600084604051602001610ceb91906121bc565b60405160208183030381529060405280519060200120604051602001610d1191906121fc565b604051602081830303815290604052805190602001209050610d5b84848484604051602001610d40919061221b565b604051602081830303815290604052805190602001206110c7565b610d775760405162461bcd60e51b815260040161019d90612285565b5050505050565b610d86610f66565b60008281526004602052604090205415610db25760405162461bcd60e51b815260040161019d906122ed565b60009182526004602052604090912055565b6000818152600460205260408120549003610df15760405162461bcd60e51b815260040161019d906120eb565b600081815260046020526040902054421015610e1f5760405162461bcd60e51b815260040161019d90612137565b6000610e2e6020860186611346565b610e3e60408701602088016122fd565b610e4e6060880160408901611b80565b610e5e6080890160608a01611b80565b610e6b60808a018a611cd7565b610e7b60c08c0160a08d0161231c565b604051602001610e919796959493929190612030565b604051602081830303815290604052805190602001209050600081604051602001610ebc919061236d565b604051602081830303815290604052805190602001209050610eeb85858584604051602001610d40919061221b565b610f075760405162461bcd60e51b815260040161019d906123d5565b505050505050565b610f17610f66565b6001600160a01b038116610f5a5760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161019d9190611394565b610f6381611049565b50565b33610f987f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146108b957336040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161019d9190611394565b6001600160a01b0381166000908152600260205260408120805467ffffffffffffffff16916001919061100d83856123e5565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550919050565b6110406110df565b610f6381611146565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000826110d586868561114e565b1495945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166108b9576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f176110df565b600081815b848110156111875761117d8287878481811061117157611171612409565b90506020020135611190565b9150600101611153565b50949350505050565b60008183106111ac5760008281526020849052604090206111bb565b60008381526020839052604090205b90505b92915050565b60006001600160a01b0382166111be565b6111de816111c4565b82525050565b806111de565b604081016111f882856111d5565b6104cf60208301846111e4565b600b8152602081017f756e737570706f72746564000000000000000000000000000000000000000000815290505b60200190565b602080825281016111be81611205565b602081016111be82846111e4565b600060c0828403121561126c5761126c600080fd5b50919050565b60006020828403121561128757611287600080fd5b813567ffffffffffffffff8111156112a1576112a1600080fd5b61056684828501611257565b805b8114610f6357600080fd5b80356111be816112ad565b6000602082840312156112da576112da600080fd5b6111bb83836112ba565b8015156111de565b602081016111be82846112e4565b6112af816111c4565b80356111be816112fa565b6000806040838503121561132457611324600080fd5b61132e8484611303565b915061133d84602085016112ba565b90509250929050565b60006020828403121561135b5761135b600080fd5b6111bb8383611303565b6000806040838503121561137b5761137b600080fd5b6113858484611303565b915061133d8460208501611303565b602081016111be82846111d5565b600080604083850312156113b8576113b8600080fd5b823567ffffffffffffffff8111156113d2576113d2600080fd5b6113de85828601611257565b92505061133d84602085016112ba565b63ffffffff81166112af565b80356111be816113ee565b60008083601f84011261141a5761141a600080fd5b50813567ffffffffffffffff81111561143557611435600080fd5b60208301915083600182028301111561145057611450600080fd5b9250929050565b60ff81166112af565b80356111be81611457565b60008060008060006080868803121561148657611486600080fd5b61149087876113fa565b945061149f87602088016113fa565b9350604086013567ffffffffffffffff8111156114be576114be600080fd5b6114ca88828901611405565b93509350506114dc8760608801611460565b90509295509295909350565b67ffffffffffffffff81166111de565b602081016111be82846114e8565b60006080828403121561126c5761126c600080fd5b60008083601f84011261153057611530600080fd5b50813567ffffffffffffffff81111561154b5761154b600080fd5b60208301915083602082028301111561145057611450600080fd5b60008060008060c0858703121561157f5761157f600080fd5b6115898686611506565b9350608085013567ffffffffffffffff8111156115a8576115a8600080fd5b6115b48782880161151b565b93509350506115c68660a087016112ba565b905092959194509250565b600080604083850312156115e7576115e7600080fd5b61132e84846112ba565b6000806000806060858703121561160a5761160a600080fd5b843567ffffffffffffffff81111561162457611624600080fd5b61163087828801611257565b945050602085013567ffffffffffffffff81111561165057611650600080fd5b61165c8782880161151b565b93509350506115c686604087016112ba565b80516111be816112ad565b60006020828403121561168e5761168e600080fd5b6111bb838361166e565b5060006111be6020830183611303565b67ffffffffffffffff81166112af565b80356111be816116a8565b5060006111be60208301836116b8565b5060006111be60208301836113fa565b63ffffffff81166111de565b6000808335601e193685900301811261170a5761170a600080fd5b830160208101925035905067ffffffffffffffff81111561172d5761172d600080fd5b3681900382131561145057611450600080fd5b82818337506000910152565b818352602083019250611760828483611740565b50601f01601f19160190565b5060006111be6020830183611460565b60ff81166111de565b600060c083016117958380611698565b61179f85826111d5565b506117ad60208401846116c3565b6117ba60208601826114e8565b506117c860408401846116d3565b6117d560408601826116e3565b506117e360608401846116d3565b6117f060608601826116e3565b506117fe60808401846116ef565b858303608087015261181183828461174c565b9250505061182260a084018461176c565b61182f60a086018261177c565b509392505050565b602080825281016111bb8184611785565b60218152602081017f54686973206d65737361676520776173206e65766572207375626d69747465648152601760f91b602082015290505b60400190565b602080825281016111be81611848565b601a8152602081017f537461746520726f6f7420646f6573206e6f742065786973742e00000000000081529050611233565b602080825281016111be81611896565b60308152602081017f417474656d7074696e6720746f2073656e642076616c756520776974686f757481527f2070726f766964696e672045746865720000000000000000000000000000000060208201529050611880565b602080825281016111be816118d8565b60208082527f496e73756666696369656e742066756e647320746f2073656e642076616c75659101908152611233565b602080825281016111be81611940565b634e487b7160e01b600052601160045260246000fd5b818103818111156111be576111be611980565b60248152602081017f4661696c656420746f2073656e64206665657320746f206665657320636f6e7481527f726163740000000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be816119a9565b60408101611a1f82856111e4565b6104cf60208301846114e8565b60148152602081017f6661696c65642073656e64696e672076616c756500000000000000000000000081529050611233565b602080825281016111be81611a2c565b60006111be82611a7c565b90565b67ffffffffffffffff1690565b6111de81611a6e565b602081016111be8284611a89565b6001600160a01b039182169190811690828203908111156111be576111be611980565b60118152602081017f4e6f74206f776e6572206f722073656c6600000000000000000000000000000081529050611233565b602080825281016111be81611ac3565b808201808211156111be576111be611980565b60218152602081017f4d657373616765207375626d6974746564206d6f7265207468616e206f6e636581527f210000000000000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81611b18565b600060208284031215611b9557611b95600080fd5b6111bb83836113fa565b600081356111be816112fa565b60006001600160a01b03835b81169019929092169190911792915050565b60006111be826111c4565b60006111be82611bca565b611be982611bd5565b611bf4818354611bac565b8255505050565b600081356111be816116a8565b60007bffffffffffffffff0000000000000000000000000000000000000000611bb88460a01b90565b60006111be67ffffffffffffffff8316611a7c565b611c4f82611c31565b611bf4818354611c08565b600081356111be816113ee565b60007fffffffff00000000000000000000000000000000000000000000000000000000611bb88460e01b90565b600063ffffffff82166111be565b611cab82611c94565b611bf4818354611c67565b600063ffffffff83611bb8565b611ccc82611c94565b611bf4818354611cb6565b6000808335601e1936859003018112611cf257611cf2600080fd5b8301915050803567ffffffffffffffff811115611d1157611d11600080fd5b60208201915060018102360382131561145057611450600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600281046001821680611d6c57607f821691505b60208210810361126c5761126c611d42565b60006111be611a798381565b611d9383611d7e565b815460001960089490940293841b1916921b91909117905550565b6000610aa2818484611d8a565b8181101561073857611dce600082611dae565b600101611dbb565b601f821115610aa2576000818152602090206020601f85010481016020851015611dfd5750805b610d776020601f860104830182611dbb565b8267ffffffffffffffff811115611e2857611e28611d2c565b611e328254611d58565b611e3d828285611dd6565b506000601f821160018114611e725760008315611e5a5750848201355b600019600885021c1981166002850217855550610f07565b600084815260209020601f19841690835b82811015611ea35787850135825560209485019460019092019101611e83565b5084821015611ec0576000196008601f8716021c19878501351681555b5050505060020260010190555050565b610aa2838383611e0f565b600081356111be81611457565b600060ff82166111be565b611efc82611ee8565b815460ff191660ff821617611bf4565b808280611f1881611b9f565b9050611f248184611be0565b50506020830180611f3482611bfb565b9050611f408184611c46565b50506040830180611f5082611c5a565b9050611f5c8184611ca2565b5050506060820180611f6d82611c5a565b9050611f7c8160018501611cc3565b5050611f8b6080830183611cd7565b611f99818360028601611ed0565b505060a0820180611fa982611edb565b9050611fb88160038501611ef3565b50505050565b6107388282611f0c565b60258152602081017f496e73756666696369656e742066756e647320746f207075626c697368206d6581527f737361676500000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81611fc8565b60c0810161203e828a6111d5565b61204b60208301896114e8565b61205860408301886116e3565b61206560608301876116e3565b818103608083015261207881858761174c565b905061208760a083018461177c565b98975050505050505050565b602a8152602081017f526f6f74206973206e6f74207075626c6973686564206f6e2074686973206d6581527f7373616765206275732e0000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81612093565b60218152602081017f526f6f74206973206e6f7420636f6e736964657265642066696e616c207965748152601760f91b60208201529050611880565b602080825281016111be816120fb565b5060006111be60208301836112ba565b6121618180611698565b61216b83826111d5565b506121796020820182611698565b61218660208401826111d5565b506121946040820182612147565b6121a160408401826111e4565b506121af60608201826116c3565b610aa260608401826114e8565b608081016111be8284612157565b60018152602081017f760000000000000000000000000000000000000000000000000000000000000081529050611233565b6040808252810161220c816121ca565b90506111be60208301846111e4565b61222581836111e4565b602001919050565b60338152602081017f496e76616c696420696e636c7573696f6e2070726f6f6620666f722076616c7581527f65207472616e73666572206d6573736167652e0000000000000000000000000060208201529050611880565b602080825281016111be8161222d565b60258152602081017f526f6f7420616c726561647920616464656420746f20746865206d657373616781527f652062757300000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81612295565b60006020828403121561231257612312600080fd5b6111bb83836116b8565b60006020828403121561233157612331600080fd5b6111bb8383611460565b60018152602081017f6d0000000000000000000000000000000000000000000000000000000000000081529050611233565b6040808252810161220c8161233b565b60308152602081017f496e76616c696420696e636c7573696f6e2070726f6f6620666f722063726f7381527f7320636861696e206d6573736167652e0000000000000000000000000000000060208201529050611880565b602080825281016111be8161237d565b67ffffffffffffffff9182169190811690828201908111156111be576111be611980565b634e487b7160e01b600052603260045260246000fdfea26469706673582212209046d260e6ecf02a9b545045265133ebd2a8a091d8cfe42d8fe9829451348f2664736f6c634300081c0033a26469706673582212206e103cacd124a8fe27302bed1a8f438aeb426147a4772aa9bf577e6fe456dce864736f6c634300081c0033", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"ImportantContractAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"messageBusAddress\",\"type\":\"address\"}],\"name\":\"LogManagementContractCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"requestReport\",\"type\":\"string\"}],\"name\":\"NetworkSecretRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"}],\"name\":\"NetworkSecretResponded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"rollupHash\",\"type\":\"bytes32\"}],\"name\":\"RollupAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"enclaveID\",\"type\":\"address\"}],\"name\":\"SequencerEnclaveGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"enclaveID\",\"type\":\"address\"}],\"name\":\"SequencerEnclaveRevoked\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"r\",\"type\":\"tuple\"}],\"name\":\"AddRollup\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"Attested\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"}],\"internalType\":\"structStructs.ValueTransferMessage\",\"name\":\"_msg\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"ExtractNativeValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetChallengePeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetImportantContractKeys\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"rollupHash\",\"type\":\"bytes32\"}],\"name\":\"GetRollupByHash\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"GetRollupByNumber\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"GetUniqueForkID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"GrantSequencerEnclave\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_enclaveID\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_initSecret\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_genesisAttestation\",\"type\":\"string\"}],\"name\":\"InitializeNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"IsSequencerEnclave\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IsWithdrawalAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"requestReport\",\"type\":\"string\"}],\"name\":\"RequestNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attesterID\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"requesterID\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"attesterSig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"responseSecret\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"verifyAttester\",\"type\":\"bool\"}],\"name\":\"RespondNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RetrieveAllBridgeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"RevokeSequencerEnclave\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_delay\",\"type\":\"uint256\"}],\"name\":\"SetChallengePeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"SetImportantContractAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_lastBatchHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"providedBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"crossChainHashes\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"rollupNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"forkID\",\"type\":\"bytes32\"}],\"name\":\"addCrossChainMessagesRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"importantContractAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"importantContractKeys\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"crossChainHashes\",\"type\":\"bytes[]\"}],\"name\":\"isBundleAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"isBundleSaved\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"isWithdrawalSpent\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBatchHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBatchSeqNo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"merkleMessageBus\",\"outputs\":[{\"internalType\":\"contractIMerkleTreeMessageBus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBus\",\"outputs\":[{\"internalType\":\"contractIMessageBus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6080604052348015600f57600080fd5b50601733601b565b608c565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61551c8061009b6000396000f3fe608060405234801561001057600080fd5b50600436106101ef5760003560e01c8063728109961161010f578063a1a227fa116100a2578063db5d91b111610071578063db5d91b1146104a6578063e34fbfc8146104d2578063e874eb20146104e5578063f2fde38b146104f857600080fd5b8063a1a227fa14610450578063a4ab2faa14610470578063a52f433c14610483578063d4fab8871461049357600080fd5b806384154826116100de57806384154826146103ca57806387059edb146103ed5780638da5cb5b1461040057806398077e861461043057600080fd5b806372810996146103865780638129fc1c1461038e57806381be5385146103965780638236a7ba146103a957600080fd5b8063476657381161018757806368e103831161015657806368e10383146103435780636a30d26c146103565780636b9707d61461036b578063715018a61461037e57600080fd5b806347665738146102e95780635024621f146102fc5780635371a2161461030f578063568699c81461032257600080fd5b80632f0cb9e3116101c35780632f0cb9e3146102435780633e60a22f1461027357806343348b2f146102b4578063440c953b146102e057600080fd5b80620ddd27146101f457806303e72e4814610213578063073b6ef3146102285780631aca00ab1461023b575b600080fd5b6101fd600e5481565b60405161020a9190611b1e565b60405180910390f35b610226610221366004611c54565b61050b565b005b610226610236366004611dc9565b610613565b600f546101fd565b610266610251366004611e97565b600c6020526000908152604090205460ff1681565b60405161020a9190611ebe565b6102a7610281366004611ecc565b80516020818301810180516003825292820191909301209152546001600160a01b031681565b60405161020a9190611f18565b6102666102c2366004611f26565b6001600160a01b031660009081526020819052604090205460ff1690565b6101fd60055481565b6102266102f7366004611f26565b6108a1565b61022661030a366004611e97565b610941565b61022661031d366004611fab565b61094e565b610335610330366004611e97565b610af3565b60405161020a9291906120ad565b6102266103513660046120cd565b610b49565b61035e610bed565b60405161020a91906121d0565b610226610379366004611f26565b610cc6565b610226610d56565b610226610d6a565b610226610def565b6102266103a43660046121f6565b610fca565b6103bc6103b7366004611e97565b6110c5565b60405161020a929190612231565b6102666103d8366004611e97565b600d6020526000908152604090205460ff1681565b6103bc6103fb366004611e97565b6111ad565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166102a7565b61044361043e366004611e97565b611224565b60405161020a919061223f565b600a54610463906001600160a01b031681565b60405161020a9190612292565b61026661047e3660046122a0565b6112d0565b600454610100900460ff16610266565b6102266104a13660046122ee565b61134e565b6102666104b4366004611f26565b6001600160a01b031660009081526001602052604090205460ff1690565b6102266104e0366004612395565b611456565b600b54610463906001600160a01b031681565b610226610506366004611f26565b61149d565b6105136114f4565b60006001600160a01b031660038360405161052e91906123ff565b908152604051908190036020019020546001600160a01b03160361058a57600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0161058883826124db565b505b8060038360405161059b91906123ff565b90815260405190819003602001812080546001600160a01b039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092179091557f17b2f9f5748931099ffee882b5b64f4a560b5c55da9b4f4e396dae3bb9f98cb590610607908490849061259b565b60405180910390a15050565b61061e8660ff6125d1565b43106106455760405162461bcd60e51b815260040161063c90612616565b60405180910390fd5b8543036106645760405162461bcd60e51b815260040161063c90612680565b854060008190036106875760405162461bcd60e51b815260040161063c906126c2565b8781146106a65760405162461bcd60e51b815260040161063c90612704565b60008381526008602052604090205482146106d35760405162461bcd60e51b815260040161063c90612746565b60006107418a8a8a8a6040516020016106ef94939291906127ae565b6040516020818303038152906040528051906020012087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061156892505050565b6001600160a01b03811660009081526001602052604090205490915060ff1661077c5760405162461bcd60e51b815260040161063c90612824565b600e8a90556000805b885181101561087b57600b5489516001600160a01b039091169063b6aed0cb908b90849081106107b7576107b7612834565b60200260200101516107c890612854565b600f546107d590426125d1565b6040518363ffffffff1660e01b81526004016107f292919061288a565b600060405180830381600087803b15801561080c57600080fd5b505af1158015610820573d6000803e3d6000fd5b505050508189828151811061083757610837612834565b602002602001015161084890612854565b60405160200161085992919061288a565b60408051601f1981840301815291905280516020909101209150600101610785565b506000908152600d60205260409020805460ff1916600117905550505050505050505050565b6108a96114f4565b6001600160a01b03811660009081526020819052604090205460ff166108e15760405162461bcd60e51b815260040161063c906128d7565b6001600160a01b038116600090815260016020819052604091829020805460ff19169091179055517ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093690610936908390611f18565b60405180910390a150565b6109496114f4565b600f55565b600b546040517fb201246f0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063b201246f9061099d908790879087908790600401612a02565b60006040518083038186803b1580156109b557600080fd5b505afa1580156109c9573d6000803e3d6000fd5b505050506000846040516020016109e09190612a3b565b60408051601f1981840301815291815281516020928301206000818152600c90935291205490915060ff1615610a285760405162461bcd60e51b815260040161063c90612a7b565b6001600c600087604051602001610a3f9190612a3b565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff191693151593909317909255600a546001600160a01b0316916399a3ad2191610a9891908901908901611f26565b87604001356040518363ffffffff1660e01b8152600401610aba929190612a8b565b600060405180830381600087803b158015610ad457600080fd5b505af1158015610ae8573d6000803e3d6000fd5b505050505050505050565b604080516060808201835260008083526020830191909152918101829052600080610b1d856111ad565b9150915081610b325760009590945092505050565b600094855260086020526040909420549492505050565b60045460ff1615610b6c5760405162461bcd60e51b815260040161063c90612af1565b60048054600160ff1991821681179092556001600160a01b0387166000908152602081815260408083208054851686179055908490529081902080549092169092179055517ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093690610bde908790611f18565b60405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b82821015610cbd578382906000526020600020018054610c309061241f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c5c9061241f565b8015610ca95780601f10610c7e57610100808354040283529160200191610ca9565b820191906000526020600020905b815481529060010190602001808311610c8c57829003601f168201915b505050505081526020019060010190610c11565b50505050905090565b610cce6114f4565b6001600160a01b03811660009081526001602052604090205460ff16610d065760405162461bcd60e51b815260040161063c90612b33565b6001600160a01b03811660009081526001602052604090819020805460ff19169055517f0f279980343c7ca542fde9fa5396555068efb5cd560d9cf9c191aa2911079b4790610936908390611f18565b610d5e6114f4565b610d686000611594565b565b610d726114f4565b600a546040517f36d2da900000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906336d2da9090610dbb903390600401611f18565b600060405180830381600087803b158015610dd557600080fd5b505af1158015610de9573d6000803e3d6000fd5b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610e3a5750825b905060008267ffffffffffffffff166001148015610e575750303b155b905081158015610e65575080155b15610e9c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610ed057845468ff00000000000000001916680100000000000000001785555b610ed933611612565b60006005556001600955604051610eef90611b09565b604051809103906000f080158015610f0b573d6000803e3d6000fd5b50600b80546001600160a01b039290921673ffffffffffffffffffffffffffffffffffffffff199283168117909155600a805490921681179091556040517fbd726cf82ac9c3260b1495107182e336e0654b25c10915648c0cc15b2bb72cbf91610f7491611f18565b60405180910390a18315610fc357845468ff0000000000000000191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290610bde90600190612b5e565b5050505050565b60006110188235610fde6020850185612b6c565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061156892505050565b6001600160a01b03811660009081526020819052604090205490915060ff166110535760405162461bcd60e51b815260040161063c906128d7565b6001600160a01b03811660009081526001602052604090205460ff1661108b5760405162461bcd60e51b815260040161063c90612b33565b61109482611623565b6040517fd6555bff8670bd3008dc064c30bb56d6ac7cb14ae801e36146fe4e7c6a504a589061060790843590611b1e565b6040805160608082018352600080835260208084018390528385018290528582526006815284822085519384019095528454835260018501805492958694939092840191906111139061241f565b80601f016020809104026020016040519081016040528092919081815260200182805461113f9061241f565b801561118c5780601f106111615761010080835404028352916020019161118c565b820191906000526020600020905b81548152906001019060200180831161116f57829003601f168201915b50505091835250506002919091015460209091015280519094149492505050565b6040805160608082018352600080835260208301919091529181018290526000838152600760205260408120549081900361121157505060408051606081018252600080825282516020818101855282825283015291810182905290939092509050565b61121a816110c5565b9250925050915091565b6002818154811061123457600080fd5b90600052602060002001600091509050805461124f9061241f565b80601f016020809104026020016040519081016040528092919081815260200182805461127b9061241f565b80156112c85780601f1061129d576101008083540402835291602001916112c8565b820191906000526020600020905b8154815290600101906020018083116112ab57829003601f168201915b505050505081565b600080805b835181101561133557818482815181106112f1576112f1612834565b602002602001015161130290612854565b60405160200161131392919061288a565b60408051601f19818403018152919052805160209091012091506001016112d5565b506000908152600d602052604090205460ff1692915050565b6001600160a01b03851660009081526020819052604090205460ff16806113875760405162461bcd60e51b815260040161063c90612c19565b81156113ff5760006113bb8787866040516020016113a793929190612c51565b6040516020818303038152906040526116c7565b905060006113c98287611568565b9050876001600160a01b0316816001600160a01b0316146113fc5760405162461bcd60e51b815260040161063c90612ccd565b50505b6001600160a01b03808616600081815260208190526040808220805460ff191660011790555191928916917fb869e23ebc7c717d76e345eee8ec282612603e45c44f7ae5494b197c8d9d1be19190a3505050505050565b336001600160a01b03167f0b0ecdedd12079aa2d6c5e0186026c711cb0c8d04f1b724ba5880fb6328d43018383604051611491929190612cfd565b60405180910390a25050565b6114a56114f4565b6001600160a01b0381166114e85760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161063c9190611f18565b6114f181611594565b50565b336115267f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b031614610d6857336040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161063c9190611f18565b6000806000806115788686611702565b925092509250611588828261174f565b50909150505b92915050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61161a611855565b6114f1816118bc565b80356000908152600660205260409020819061163f8282612e72565b50506009546000908152600760205260409020813590819055611663600143612e7c565b4060405160200161167592919061288a565b60408051601f1981840301815291815281516020928301206009805460009081526008909452918320558054916116ab83612e8f565b9190505550600554816040013511156114f15760400135600555565b60006116d382516118c4565b826040516020016116e5929190612ea8565b604051602081830303815290604052805190602001209050919050565b6000806000835160410361173c5760208401516040850151606086015160001a61172e88828585611965565b955095509550505050611748565b50508151600091506002905b9250925092565b600082600381111561176357611763612ee4565b0361176c575050565b600182600381111561178057611780612ee4565b036117b7576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156117cb576117cb612ee4565b03611804576040517ffce698f700000000000000000000000000000000000000000000000000000000815261063c908290600401611b1e565b600382600381111561181857611818612ee4565b0361185157806040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260040161063c9190611b1e565b5050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16610d68576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114a5611855565b606060006118d183611a27565b600101905060008167ffffffffffffffff8111156118f1576118f1611b2c565b6040519080825280601f01601f19166020018201604052801561191b576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084611925575b509392505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156119a05750600091506003905082611a1d565b6000600188888888604051600081526020016040526040516119c59493929190612f03565b6020604051602081039080840390855afa1580156119e7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611a1357506000925060019150829050611a1d565b9250600091508190505b9450945094915050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611a70577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310611a9c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611aba57662386f26fc10000830492506010015b6305f5e1008310611ad2576305f5e100830492506008015b6127108310611ae657612710830492506004015b60648310611af8576064830492506002015b600a831061158e5760010192915050565b6125ae80612f3983390190565b805b82525050565b6020810161158e8284611b16565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715611b6857611b68611b2c565b6040525050565b6000611b7a60405190565b9050611b868282611b42565b919050565b600067ffffffffffffffff821115611ba557611ba5611b2c565b601f19601f83011660200192915050565b82818337506000910152565b6000611bd5611bd084611b8b565b611b6f565b9050828152838383011115611bec57611bec600080fd5b611bfa836020830184611bb6565b9392505050565b600082601f830112611c1557611c15600080fd5b611bfa83833560208501611bc2565b60006001600160a01b03821661158e565b611c3e81611c24565b81146114f157600080fd5b803561158e81611c35565b60008060408385031215611c6a57611c6a600080fd5b823567ffffffffffffffff811115611c8457611c84600080fd5b611c9085828601611c01565b925050611ca08460208501611c49565b90509250929050565b80611c3e565b803561158e81611ca9565b600067ffffffffffffffff821115611cd457611cd4611b2c565b5060209081020190565b6000611cec611bd084611cba565b83815290506020808201908402830185811115611d0b57611d0b600080fd5b835b81811015611d4a57803567ffffffffffffffff811115611d2f57611d2f600080fd5b611d3b88828801611c01565b84525060209283019201611d0d565b5050509392505050565b600082601f830112611d6857611d68600080fd5b611bfa83833560208501611cde565b60008083601f840112611d8c57611d8c600080fd5b50813567ffffffffffffffff811115611da757611da7600080fd5b602083019150836001820283011115611dc257611dc2600080fd5b9250929050565b60008060008060008060008060e0898b031215611de857611de8600080fd5b611df28a8a611caf565b9750611e018a60208b01611caf565b9650611e108a60408b01611caf565b9550606089013567ffffffffffffffff811115611e2f57611e2f600080fd5b611e3b8b828c01611d54565b955050608089013567ffffffffffffffff811115611e5b57611e5b600080fd5b611e678b828c01611d77565b9450945050611e798a60a08b01611caf565b9150611e888a60c08b01611caf565b90509295985092959890939650565b600060208284031215611eac57611eac600080fd5b611bfa8383611caf565b801515611b18565b6020810161158e8284611eb6565b600060208284031215611ee157611ee1600080fd5b813567ffffffffffffffff811115611efb57611efb600080fd5b611f0784828501611c01565b949350505050565b611b1881611c24565b6020810161158e8284611f0f565b600060208284031215611f3b57611f3b600080fd5b611bfa8383611c49565b600060808284031215611f5a57611f5a600080fd5b50919050565b60008083601f840112611f7557611f75600080fd5b50813567ffffffffffffffff811115611f9057611f90600080fd5b602083019150836020820283011115611dc257611dc2600080fd5b60008060008060c08587031215611fc457611fc4600080fd5b611fce8686611f45565b9350608085013567ffffffffffffffff811115611fed57611fed600080fd5b611ff987828801611f60565b935093505061200b8660a08701611caf565b905092959194509250565b60005b83811015612031578181015183820152602001612019565b50506000910152565b6000612044825190565b80845260208401935061205b818560208601612016565b601f01601f19169290920192915050565b805160009060608401906120808582611b16565b5060208301518482036020860152612098828261203a565b915050604083015161195d6040860182611b16565b604081016120bb8285611b16565b8181036020830152611f07818461206c565b6000806000806000606086880312156120e8576120e8600080fd5b6120f28787611c49565b9450602086013567ffffffffffffffff81111561211157612111600080fd5b61211d88828901611d77565b9450945050604086013567ffffffffffffffff81111561213f5761213f600080fd5b61214b88828901611d77565b92509250509295509295909350565b6000611bfa838361203a565b60200190565b6000612176825190565b808452602084019350836020820285016121908560200190565b60005b848110156121c457838303885281516121ac848261215a565b93505060208201602098909801979150600101612193565b50909695505050505050565b60208082528101611bfa818461216c565b600060608284031215611f5a57611f5a600080fd5b60006020828403121561220b5761220b600080fd5b813567ffffffffffffffff81111561222557612225600080fd5b611f07848285016121e1565b604081016120bb8285611eb6565b60208082528101611bfa818461203a565b600061158e6001600160a01b038316612267565b90565b6001600160a01b031690565b600061158e82612250565b600061158e82612273565b611b188161227e565b6020810161158e8284612289565b6000602082840312156122b5576122b5600080fd5b813567ffffffffffffffff8111156122cf576122cf600080fd5b611f0784828501611d54565b801515611c3e565b803561158e816122db565b600080600080600060a0868803121561230957612309600080fd5b6123138787611c49565b94506123228760208801611c49565b9350604086013567ffffffffffffffff81111561234157612341600080fd5b61234d88828901611c01565b935050606086013567ffffffffffffffff81111561236d5761236d600080fd5b61237988828901611c01565b92505061238987608088016122e3565b90509295509295909350565b600080602083850312156123ab576123ab600080fd5b823567ffffffffffffffff8111156123c5576123c5600080fd5b6123d185828601611d77565b92509250509250929050565b60006123e7825190565b6123f5818560208601612016565b9290920192915050565b61158e81836123dd565b634e487b7160e01b600052602260045260246000fd5b60028104600182168061243357607f821691505b602082108103611f5a57611f5a612409565b600061158e6122648381565b61245a83612445565b815460001960089490940293841b1916921b91909117905550565b6000612482818484612451565b505050565b818110156118515761249a600082612475565b600101612487565b601f821115612482576000818152602090206020601f850104810160208510156124c95750805b610fc36020601f860104830182612487565b815167ffffffffffffffff8111156124f5576124f5611b2c565b6124ff825461241f565b61250a8282856124a2565b506020601f82116001811461253f57600083156125275750848201515b600019600885021c1981166002850217855550610fc3565b600084815260208120601f198516915b8281101561256f578785015182556020948501946001909201910161254f565b508482101561258c5783870151600019601f87166008021c191681555b50505050600202600101905550565b604080825281016125ac818561203a565b9050611bfa6020830184611f0f565b634e487b7160e01b600052601160045260246000fd5b8082018082111561158e5761158e6125bb565b60158152602081017f426c6f636b2062696e64696e6720746f6f206f6c64000000000000000000000081529050612166565b6020808252810161158e816125e4565b60368152602081017f43616e6e6f742062696e6420746f2074686520626c6f636b207468617420697381527f206265696e672063757272656e746c79206d696e656400000000000000000000602082015290505b60400190565b6020808252810161158e81612626565b60128152602081017f556e6b6e6f776e20626c6f636b2068617368000000000000000000000000000081529050612166565b6020808252810161158e81612690565b60168152602081017f426c6f636b2062696e64696e67206d69736d617463680000000000000000000081529050612166565b6020808252810161158e816126d2565b600e8152602081017f496e76616c696420666f726b494400000000000000000000000000000000000081529050612166565b6020808252810161158e81612714565b6000612760825190565b8084526020840193508360208202850161277a8560200190565b60005b848110156121c45783830388528151612796848261215a565b9350506020820160209890980197915060010161277d565b608081016127bc8287611b16565b6127c96020830186611b16565b6127d66040830185611b16565b81810360608301526127e88184612756565b9695505050505050565b60178152602081017f61646472657373206e6f7420612073657175656e63657200000000000000000081529050612166565b6020808252810161158e816127f2565b634e487b7160e01b600052603260045260246000fd5b600061158e825190565b600061285e825190565b6020830161286b8161284a565b9250506020811015611f5a576000196020919091036008021b16919050565b604081016128988285611b16565b611bfa6020830184611b16565b60168152602081017f656e636c6176654944206e6f742061747465737465640000000000000000000081529050612166565b6020808252810161158e816128a5565b50600061158e6020830183611c49565b50600061158e6020830183611caf565b67ffffffffffffffff8116611c3e565b803561158e81612907565b50600061158e6020830183612917565b67ffffffffffffffff8116611b18565b61294c81806128e7565b6129568382611f0f565b5061296460208201826128e7565b6129716020840182611f0f565b5061297f60408201826128f7565b61298c6040840182611b16565b5061299a6060820182612922565b6124826060840182612932565b82818337505050565b81835260208301925060007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156129eb576129eb600080fd5b6020830292506129fc8385846129a7565b50500190565b60c08101612a108287612942565b8181036080830152612a238185876129b0565b9050612a3260a0830184611b16565b95945050505050565b6080810161158e8284612942565b60188152602081017f7769746864726177616c20616c7265616479207370656e74000000000000000081529050612166565b6020808252810161158e81612a49565b604081016128988285611f0f565b60228152602081017f6e6574776f726b2073656372657420616c726561647920696e697469616c697a81527f65640000000000000000000000000000000000000000000000000000000000006020820152905061267a565b6020808252810161158e81612a99565b60198152602081017f656e636c6176654944206e6f7420612073657175656e6365720000000000000081529050612166565b6020808252810161158e81612b01565b600067ffffffffffffffff821661158e565b611b1881612b43565b6020810161158e8284612b55565b6000808335601e1936859003018112612b8757612b87600080fd5b8301915050803567ffffffffffffffff811115612ba657612ba6600080fd5b602082019150600181023603821315611dc257611dc2600080fd5b60238152602081017f726573706f6e64696e67206174746573746572206973206e6f7420617474657381527f74656400000000000000000000000000000000000000000000000000000000006020820152905061267a565b6020808252810161158e81612bc1565b600061158e8260601b90565b600061158e82612c29565b611b18612c4c82611c24565b612c35565b612c5b8185612c40565b601401612c688184612c40565b601401611f0781836123dd565b602c8152602081017f63616c63756c61746564206164647265737320616e642061747465737465724981527f4420646f6e74206d6174636800000000000000000000000000000000000000006020820152905061267a565b6020808252810161158e81612c75565b818352602083019250612cf1828483611bb6565b50601f01601f19160190565b60208082528101611f07818486612cdd565b6000813561158e81611ca9565b60008161158e565b612d2d82612d1c565b612d3961226482612d1c565b8255505050565b8267ffffffffffffffff811115612d5957612d59611b2c565b612d63825461241f565b612d6e8282856124a2565b506000601f821160018114612da35760008315612d8b5750848201355b600019600885021c1981166002850217855550612dfd565b600084815260209020601f19841690835b82811015612dd45787850135825560209485019460019092019101612db4565b5084821015612df1576000196008601f8716021c19878501351681555b50506001600284020184555b505050505050565b612482838383612d40565b612e1982612445565b80612d39565b8180612e2a81612d0f565b9050612e368184612d24565b5050612e456020830183612b6c565b612e53818360018601612e05565b50506040820180612e6382612d0f565b9050610de98160028501612e10565b6118518282612e1f565b8181038181111561158e5761158e6125bb565b600060018201612ea157612ea16125bb565b5060010190565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152601a01612ed881846123dd565b9050611bfa81836123dd565b634e487b7160e01b600052602160045260246000fd5b60ff8116611b18565b60808101612f118287611b16565b612f1e6020830186612efa565b612f2b6040830185611b16565b612a326060830184611b1656fe608060405234801561001057600080fd5b5061001a33610027565b610022610098565b61014a565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100e85760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101475780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b612455806101596000396000f3fe6080604052600436106101115760003560e01c80638da5cb5b116100a5578063b1454caa11610074578063b6aed0cb11610059578063b6aed0cb1461038b578063e138a8d2146103ab578063f2fde38b146103cb57610185565b8063b1454caa1461034b578063b201246f1461036b57610185565b80638da5cb5b146102a65780639730886d146102eb57806399a3ad211461030b578063ab53bddc1461032b57610185565b8063346633fb116100e1578063346633fb1461023e57806336d2da9014610251578063485cc95514610271578063715018a61461029157610185565b8062a1b815146101a65780630fcfbd11146101d15780630fe9188e146101f157806333a88c721461021157610185565b36610185576040517f346633fb000000000000000000000000000000000000000000000000000000008152309063346633fb90349061015690339083906004016111ea565b6000604051808303818588803b15801561016f57600080fd5b505af1158015610183573d6000803e3d6000fd5b005b60405162461bcd60e51b815260040161019d90611239565b60405180910390fd5b3480156101b257600080fd5b506101bb6103eb565b6040516101c89190611249565b60405180910390f35b3480156101dd57600080fd5b506101bb6101ec366004611272565b610477565b3480156101fd57600080fd5b5061018361020c3660046112c5565b6104d6565b34801561021d57600080fd5b5061023161022c366004611272565b61051c565b6040516101c891906112ec565b61018361024c36600461130e565b61056e565b34801561025d57600080fd5b5061018361026c366004611346565b6106bd565b34801561027d57600080fd5b5061018361028c366004611365565b61073c565b34801561029d57600080fd5b506101836108a7565b3480156102b257600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166040516101c89190611394565b3480156102f757600080fd5b506101836103063660046113a2565b6108bb565b34801561031757600080fd5b5061018361032636600461130e565b610a27565b34801561033757600080fd5b5061018361034636600461130e565b610aa7565b61035e61035936600461146b565b610b70565b6040516101c891906114f8565b34801561037757600080fd5b50610183610386366004611566565b610c7d565b34801561039757600080fd5b506101836103a63660046115d1565b610d7e565b3480156103b757600080fd5b506101836103c63660046115f1565b610dc4565b3480156103d757600080fd5b506101836103e6366004611346565b610f0f565b600354604080517f1a90a21900000000000000000000000000000000000000000000000000000000815290516000926001600160a01b031691631a90a2199160048083019260209291908290030181865afa15801561044e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104729190611679565b905090565b6000808260405160200161048b9190611837565b60408051601f198184030181529181528151602092830120600081815292839052912054909150806104cf5760405162461bcd60e51b815260040161019d90611886565b9392505050565b6104de610f66565b600081815260046020526040812054900361050b5760405162461bcd60e51b815260040161019d906118c8565b600090815260046020526040812055565b600080826040516020016105309190611837565b60408051601f19818403018152918152815160209283012060008181529283905291205490915080158015906105665750428111155b949350505050565b60003411801561057d57508034145b6105995760405162461bcd60e51b815260040161019d90611930565b60035434906001600160a01b03161561065d5760006105b66103eb565b9050803410156105d85760405162461bcd60e51b815260040161019d90611970565b6105e28134611996565b6003546040519193506000916001600160a01b039091169083908381818185875af1925050503d8060008114610634576040519150601f19603f3d011682016040523d82523d6000602084013e610639565b606091505b505090508061065a5760405162461bcd60e51b815260040161019d90611a01565b50505b600061066833610fda565b9050836001600160a01b0316336001600160a01b03167f50c536ac33a920f00755865b831d17bf4cff0b2e0345f65b16d52bfc004068b684846040516106af929190611a11565b60405180910390a350505050565b6106c5610f66565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610712576040519150601f19603f3d011682016040523d82523d6000602084013e610717565b606091505b50509050806107385760405162461bcd60e51b815260040161019d90611a5e565b5050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156107875750825b905060008267ffffffffffffffff1660011480156107a45750303b155b9050811580156107b2575080155b156107e9576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561081d57845468ff00000000000000001916680100000000000000001785555b61082687611038565b6003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038816179055831561089e57845468ff0000000000000000191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29061089590600190611a92565b60405180910390a15b50505050505050565b6108af610f66565b6108b96000611049565b565b60006108c8600130611aa0565b90506108fb7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806109225750336001600160a01b038216145b61093e5760405162461bcd60e51b815260040161019d90611af5565b600061094a8342611b05565b905060008460405160200161095f9190611837565b60408051601f198184030181529181528151602092830120600081815292839052912054909150156109a35760405162461bcd60e51b815260040161019d90611b70565b6000818152602081815260408220849055600191906109c490880188611346565b6001600160a01b0316815260208101919091526040016000908120906109f06080880160608901611b80565b63ffffffff1681526020808201929092526040016000908120805460018101825590825291902086916004020161089e8282611fbe565b610a2f610f66565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610a7c576040519150601f19603f3d011682016040523d82523d6000602084013e610a81565b606091505b5050905080610aa25760405162461bcd60e51b815260040161019d90611a5e565b505050565b6000610ab4600130611aa0565b9050610ae77f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610b0e5750336001600160a01b038216145b610b2a5760405162461bcd60e51b815260040161019d90611af5565b826001600160a01b03167fcd9850463422a7449c406a036e35e5edb6fbe35a64c9f12a2354be98a750c0d383604051610b639190611249565b60405180910390a2505050565b6003546000906001600160a01b031615610c26576000610b8e6103eb565b905080341015610bb05760405162461bcd60e51b815260040161019d90612020565b6003546040516000916001600160a01b03169083908381818185875af1925050503d8060008114610bfd576040519150601f19603f3d011682016040523d82523d6000602084013e610c02565b606091505b5050905080610c235760405162461bcd60e51b815260040161019d90611a01565b50505b610c2f33610fda565b90507fb93c37389233beb85a3a726c3f15c2d15533ee74cb602f20f490dfffef77593733828888888888604051610c6c9796959493929190612030565b60405180910390a195945050505050565b6000818152600460205260408120549003610caa5760405162461bcd60e51b815260040161019d906120eb565b600081815260046020526040902054421015610cd85760405162461bcd60e51b815260040161019d90612137565b600084604051602001610ceb91906121bc565b60405160208183030381529060405280519060200120604051602001610d1191906121fc565b604051602081830303815290604052805190602001209050610d5b84848484604051602001610d40919061221b565b604051602081830303815290604052805190602001206110c7565b610d775760405162461bcd60e51b815260040161019d90612285565b5050505050565b610d86610f66565b60008281526004602052604090205415610db25760405162461bcd60e51b815260040161019d906122ed565b60009182526004602052604090912055565b6000818152600460205260408120549003610df15760405162461bcd60e51b815260040161019d906120eb565b600081815260046020526040902054421015610e1f5760405162461bcd60e51b815260040161019d90612137565b6000610e2e6020860186611346565b610e3e60408701602088016122fd565b610e4e6060880160408901611b80565b610e5e6080890160608a01611b80565b610e6b60808a018a611cd7565b610e7b60c08c0160a08d0161231c565b604051602001610e919796959493929190612030565b604051602081830303815290604052805190602001209050600081604051602001610ebc919061236d565b604051602081830303815290604052805190602001209050610eeb85858584604051602001610d40919061221b565b610f075760405162461bcd60e51b815260040161019d906123d5565b505050505050565b610f17610f66565b6001600160a01b038116610f5a5760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161019d9190611394565b610f6381611049565b50565b33610f987f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146108b957336040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161019d9190611394565b6001600160a01b0381166000908152600260205260408120805467ffffffffffffffff16916001919061100d83856123e5565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550919050565b6110406110df565b610f6381611146565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000826110d586868561114e565b1495945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166108b9576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f176110df565b600081815b848110156111875761117d8287878481811061117157611171612409565b90506020020135611190565b9150600101611153565b50949350505050565b60008183106111ac5760008281526020849052604090206111bb565b60008381526020839052604090205b90505b92915050565b60006001600160a01b0382166111be565b6111de816111c4565b82525050565b806111de565b604081016111f882856111d5565b6104cf60208301846111e4565b600b8152602081017f756e737570706f72746564000000000000000000000000000000000000000000815290505b60200190565b602080825281016111be81611205565b602081016111be82846111e4565b600060c0828403121561126c5761126c600080fd5b50919050565b60006020828403121561128757611287600080fd5b813567ffffffffffffffff8111156112a1576112a1600080fd5b61056684828501611257565b805b8114610f6357600080fd5b80356111be816112ad565b6000602082840312156112da576112da600080fd5b6111bb83836112ba565b8015156111de565b602081016111be82846112e4565b6112af816111c4565b80356111be816112fa565b6000806040838503121561132457611324600080fd5b61132e8484611303565b915061133d84602085016112ba565b90509250929050565b60006020828403121561135b5761135b600080fd5b6111bb8383611303565b6000806040838503121561137b5761137b600080fd5b6113858484611303565b915061133d8460208501611303565b602081016111be82846111d5565b600080604083850312156113b8576113b8600080fd5b823567ffffffffffffffff8111156113d2576113d2600080fd5b6113de85828601611257565b92505061133d84602085016112ba565b63ffffffff81166112af565b80356111be816113ee565b60008083601f84011261141a5761141a600080fd5b50813567ffffffffffffffff81111561143557611435600080fd5b60208301915083600182028301111561145057611450600080fd5b9250929050565b60ff81166112af565b80356111be81611457565b60008060008060006080868803121561148657611486600080fd5b61149087876113fa565b945061149f87602088016113fa565b9350604086013567ffffffffffffffff8111156114be576114be600080fd5b6114ca88828901611405565b93509350506114dc8760608801611460565b90509295509295909350565b67ffffffffffffffff81166111de565b602081016111be82846114e8565b60006080828403121561126c5761126c600080fd5b60008083601f84011261153057611530600080fd5b50813567ffffffffffffffff81111561154b5761154b600080fd5b60208301915083602082028301111561145057611450600080fd5b60008060008060c0858703121561157f5761157f600080fd5b6115898686611506565b9350608085013567ffffffffffffffff8111156115a8576115a8600080fd5b6115b48782880161151b565b93509350506115c68660a087016112ba565b905092959194509250565b600080604083850312156115e7576115e7600080fd5b61132e84846112ba565b6000806000806060858703121561160a5761160a600080fd5b843567ffffffffffffffff81111561162457611624600080fd5b61163087828801611257565b945050602085013567ffffffffffffffff81111561165057611650600080fd5b61165c8782880161151b565b93509350506115c686604087016112ba565b80516111be816112ad565b60006020828403121561168e5761168e600080fd5b6111bb838361166e565b5060006111be6020830183611303565b67ffffffffffffffff81166112af565b80356111be816116a8565b5060006111be60208301836116b8565b5060006111be60208301836113fa565b63ffffffff81166111de565b6000808335601e193685900301811261170a5761170a600080fd5b830160208101925035905067ffffffffffffffff81111561172d5761172d600080fd5b3681900382131561145057611450600080fd5b82818337506000910152565b818352602083019250611760828483611740565b50601f01601f19160190565b5060006111be6020830183611460565b60ff81166111de565b600060c083016117958380611698565b61179f85826111d5565b506117ad60208401846116c3565b6117ba60208601826114e8565b506117c860408401846116d3565b6117d560408601826116e3565b506117e360608401846116d3565b6117f060608601826116e3565b506117fe60808401846116ef565b858303608087015261181183828461174c565b9250505061182260a084018461176c565b61182f60a086018261177c565b509392505050565b602080825281016111bb8184611785565b60218152602081017f54686973206d65737361676520776173206e65766572207375626d69747465648152601760f91b602082015290505b60400190565b602080825281016111be81611848565b601a8152602081017f537461746520726f6f7420646f6573206e6f742065786973742e00000000000081529050611233565b602080825281016111be81611896565b60308152602081017f417474656d7074696e6720746f2073656e642076616c756520776974686f757481527f2070726f766964696e672045746865720000000000000000000000000000000060208201529050611880565b602080825281016111be816118d8565b60208082527f496e73756666696369656e742066756e647320746f2073656e642076616c75659101908152611233565b602080825281016111be81611940565b634e487b7160e01b600052601160045260246000fd5b818103818111156111be576111be611980565b60248152602081017f4661696c656420746f2073656e64206665657320746f206665657320636f6e7481527f726163740000000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be816119a9565b60408101611a1f82856111e4565b6104cf60208301846114e8565b60148152602081017f6661696c65642073656e64696e672076616c756500000000000000000000000081529050611233565b602080825281016111be81611a2c565b60006111be82611a7c565b90565b67ffffffffffffffff1690565b6111de81611a6e565b602081016111be8284611a89565b6001600160a01b039182169190811690828203908111156111be576111be611980565b60118152602081017f4e6f74206f776e6572206f722073656c6600000000000000000000000000000081529050611233565b602080825281016111be81611ac3565b808201808211156111be576111be611980565b60218152602081017f4d657373616765207375626d6974746564206d6f7265207468616e206f6e636581527f210000000000000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81611b18565b600060208284031215611b9557611b95600080fd5b6111bb83836113fa565b600081356111be816112fa565b60006001600160a01b03835b81169019929092169190911792915050565b60006111be826111c4565b60006111be82611bca565b611be982611bd5565b611bf4818354611bac565b8255505050565b600081356111be816116a8565b60007bffffffffffffffff0000000000000000000000000000000000000000611bb88460a01b90565b60006111be67ffffffffffffffff8316611a7c565b611c4f82611c31565b611bf4818354611c08565b600081356111be816113ee565b60007fffffffff00000000000000000000000000000000000000000000000000000000611bb88460e01b90565b600063ffffffff82166111be565b611cab82611c94565b611bf4818354611c67565b600063ffffffff83611bb8565b611ccc82611c94565b611bf4818354611cb6565b6000808335601e1936859003018112611cf257611cf2600080fd5b8301915050803567ffffffffffffffff811115611d1157611d11600080fd5b60208201915060018102360382131561145057611450600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600281046001821680611d6c57607f821691505b60208210810361126c5761126c611d42565b60006111be611a798381565b611d9383611d7e565b815460001960089490940293841b1916921b91909117905550565b6000610aa2818484611d8a565b8181101561073857611dce600082611dae565b600101611dbb565b601f821115610aa2576000818152602090206020601f85010481016020851015611dfd5750805b610d776020601f860104830182611dbb565b8267ffffffffffffffff811115611e2857611e28611d2c565b611e328254611d58565b611e3d828285611dd6565b506000601f821160018114611e725760008315611e5a5750848201355b600019600885021c1981166002850217855550610f07565b600084815260209020601f19841690835b82811015611ea35787850135825560209485019460019092019101611e83565b5084821015611ec0576000196008601f8716021c19878501351681555b5050505060020260010190555050565b610aa2838383611e0f565b600081356111be81611457565b600060ff82166111be565b611efc82611ee8565b815460ff191660ff821617611bf4565b808280611f1881611b9f565b9050611f248184611be0565b50506020830180611f3482611bfb565b9050611f408184611c46565b50506040830180611f5082611c5a565b9050611f5c8184611ca2565b5050506060820180611f6d82611c5a565b9050611f7c8160018501611cc3565b5050611f8b6080830183611cd7565b611f99818360028601611ed0565b505060a0820180611fa982611edb565b9050611fb88160038501611ef3565b50505050565b6107388282611f0c565b60258152602081017f496e73756666696369656e742066756e647320746f207075626c697368206d6581527f737361676500000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81611fc8565b60c0810161203e828a6111d5565b61204b60208301896114e8565b61205860408301886116e3565b61206560608301876116e3565b818103608083015261207881858761174c565b905061208760a083018461177c565b98975050505050505050565b602a8152602081017f526f6f74206973206e6f74207075626c6973686564206f6e2074686973206d6581527f7373616765206275732e0000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81612093565b60218152602081017f526f6f74206973206e6f7420636f6e736964657265642066696e616c207965748152601760f91b60208201529050611880565b602080825281016111be816120fb565b5060006111be60208301836112ba565b6121618180611698565b61216b83826111d5565b506121796020820182611698565b61218660208401826111d5565b506121946040820182612147565b6121a160408401826111e4565b506121af60608201826116c3565b610aa260608401826114e8565b608081016111be8284612157565b60018152602081017f760000000000000000000000000000000000000000000000000000000000000081529050611233565b6040808252810161220c816121ca565b90506111be60208301846111e4565b61222581836111e4565b602001919050565b60338152602081017f496e76616c696420696e636c7573696f6e2070726f6f6620666f722076616c7581527f65207472616e73666572206d6573736167652e0000000000000000000000000060208201529050611880565b602080825281016111be8161222d565b60258152602081017f526f6f7420616c726561647920616464656420746f20746865206d657373616781527f652062757300000000000000000000000000000000000000000000000000000060208201529050611880565b602080825281016111be81612295565b60006020828403121561231257612312600080fd5b6111bb83836116b8565b60006020828403121561233157612331600080fd5b6111bb8383611460565b60018152602081017f6d0000000000000000000000000000000000000000000000000000000000000081529050611233565b6040808252810161220c8161233b565b60308152602081017f496e76616c696420696e636c7573696f6e2070726f6f6620666f722063726f7381527f7320636861696e206d6573736167652e0000000000000000000000000000000060208201529050611880565b602080825281016111be8161237d565b67ffffffffffffffff9182169190811690828201908111156111be576111be611980565b634e487b7160e01b600052603260045260246000fdfea26469706673582212209046d260e6ecf02a9b545045265133ebd2a8a091d8cfe42d8fe9829451348f2664736f6c634300081c0033a2646970667358221220101b62990bb77813fedaf26fccfbe1484c6f6ffffdafd582c8320a8b7f985f8464736f6c634300081c0033", } // ManagementContractABI is the input ABI used to generate the binding from. @@ -248,6 +248,37 @@ func (_ManagementContract *ManagementContractCallerSession) Attested(_addr commo return _ManagementContract.Contract.Attested(&_ManagementContract.CallOpts, _addr) } +// GetChallengePeriod is a free data retrieval call binding the contract method 0x1aca00ab. +// +// Solidity: function GetChallengePeriod() view returns(uint256) +func (_ManagementContract *ManagementContractCaller) GetChallengePeriod(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ManagementContract.contract.Call(opts, &out, "GetChallengePeriod") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChallengePeriod is a free data retrieval call binding the contract method 0x1aca00ab. +// +// Solidity: function GetChallengePeriod() view returns(uint256) +func (_ManagementContract *ManagementContractSession) GetChallengePeriod() (*big.Int, error) { + return _ManagementContract.Contract.GetChallengePeriod(&_ManagementContract.CallOpts) +} + +// GetChallengePeriod is a free data retrieval call binding the contract method 0x1aca00ab. +// +// Solidity: function GetChallengePeriod() view returns(uint256) +func (_ManagementContract *ManagementContractCallerSession) GetChallengePeriod() (*big.Int, error) { + return _ManagementContract.Contract.GetChallengePeriod(&_ManagementContract.CallOpts) +} + // GetImportantContractKeys is a free data retrieval call binding the contract method 0x6a30d26c. // // Solidity: function GetImportantContractKeys() view returns(string[]) @@ -915,6 +946,27 @@ func (_ManagementContract *ManagementContractTransactorSession) RevokeSequencerE return _ManagementContract.Contract.RevokeSequencerEnclave(&_ManagementContract.TransactOpts, _addr) } +// SetChallengePeriod is a paid mutator transaction binding the contract method 0x5024621f. +// +// Solidity: function SetChallengePeriod(uint256 _delay) returns() +func (_ManagementContract *ManagementContractTransactor) SetChallengePeriod(opts *bind.TransactOpts, _delay *big.Int) (*types.Transaction, error) { + return _ManagementContract.contract.Transact(opts, "SetChallengePeriod", _delay) +} + +// SetChallengePeriod is a paid mutator transaction binding the contract method 0x5024621f. +// +// Solidity: function SetChallengePeriod(uint256 _delay) returns() +func (_ManagementContract *ManagementContractSession) SetChallengePeriod(_delay *big.Int) (*types.Transaction, error) { + return _ManagementContract.Contract.SetChallengePeriod(&_ManagementContract.TransactOpts, _delay) +} + +// SetChallengePeriod is a paid mutator transaction binding the contract method 0x5024621f. +// +// Solidity: function SetChallengePeriod(uint256 _delay) returns() +func (_ManagementContract *ManagementContractTransactorSession) SetChallengePeriod(_delay *big.Int) (*types.Transaction, error) { + return _ManagementContract.Contract.SetChallengePeriod(&_ManagementContract.TransactOpts, _delay) +} + // SetImportantContractAddress is a paid mutator transaction binding the contract method 0x03e72e48. // // Solidity: function SetImportantContractAddress(string key, address newAddress) returns() diff --git a/contracts/scripts/delay/001_set_challenge_period.ts b/contracts/scripts/delay/001_set_challenge_period.ts new file mode 100644 index 000000000..156884fbf --- /dev/null +++ b/contracts/scripts/delay/001_set_challenge_period.ts @@ -0,0 +1,39 @@ +import { ethers } from "hardhat"; +import { ManagementContract } from "../../typechain-types"; + +const setChallengePeriod = async function (mgmtContractAddr: string, challengPeriod: number) { + const managementContract = await ethers.getContractAt( + "ManagementContract", + mgmtContractAddr + ) as ManagementContract; + + + console.log(`Setting challenge period to: ${challengPeriod}`); + const tx = await managementContract.SetChallengePeriod(BigInt(challengPeriod)); + await tx.wait(); + console.log(`Successfully set challenge period to: ${challengPeriod}`); + + const mgmtContractChallengePeriod = await managementContract.GetChallengePeriod(); + if (BigInt(challengPeriod) !== mgmtContractChallengePeriod) { + throw new Error(`Failed to set the challenge period to: ${challengPeriod}. Returned value is: ${mgmtContractChallengePeriod}`); + } +} + +const mgmtContractAddr = process.env.MGMT_CONTRACT_ADDRESS; +const challengePeriod = process.env.L1_CHALLENGE_PERIOD ? + Number(process.env.L1_CHALLENGE_PERIOD) : 0; + + +if (!mgmtContractAddr) { + console.error("Missing required environment variables: MGMT_CONTRACT_ADDRESS"); + process.exit(1); +} + +setChallengePeriod(mgmtContractAddr, challengePeriod) + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); + +export default setChallengePeriod; \ No newline at end of file diff --git a/contracts/src/management/ManagementContract.sol b/contracts/src/management/ManagementContract.sol index 8585ceee3..f22751fed 100644 --- a/contracts/src/management/ManagementContract.sol +++ b/contracts/src/management/ManagementContract.sol @@ -60,6 +60,8 @@ contract ManagementContract is Initializable, OwnableUpgradeable { bytes32 public lastBatchHash; + uint256 private challengePeriod; + function initialize() public initializer { __Ownable_init(msg.sender); lastBatchSeqNo = 0; @@ -118,7 +120,7 @@ contract ManagementContract is Initializable, OwnableUpgradeable { require(block.number < (blockNum + 255), "Block binding too old"); require(block.number != blockNum, "Cannot bind to the block that is being currently mined"); - bytes32 knownBlockHash = blockhash(blockNum); + bytes32 knownBlockHash = blockhash(blockNum); require(knownBlockHash != 0x0, "Unknown block hash"); require(knownBlockHash == providedBlockHash, "Block binding mismatch"); require(rollups.toUniqueForkID[rollupNumber] == forkID, "Invalid forkID"); @@ -131,14 +133,15 @@ contract ManagementContract is Initializable, OwnableUpgradeable { bytes32 bundleHash = bytes32(0); for(uint256 i = 0; i < crossChainHashes.length; i++) { - merkleMessageBus.addStateRoot(bytes32(crossChainHashes[i]), block.timestamp); //todo: change the activation time. + merkleMessageBus.addStateRoot( + bytes32(crossChainHashes[i]), block.timestamp + challengePeriod + ); bundleHash = keccak256(abi.encode(bundleHash, bytes32(crossChainHashes[i]))); } isBundleSaved[bundleHash] = true; } -// TODO: ensure challenge period is added on top of block timestamp. function pushCrossChainMessages(Structs.HeaderCrossChainData calldata crossChainData) internal { uint256 messagesLength = crossChainData.messages.length; for (uint256 i = 0; i < messagesLength; ++i) { @@ -263,4 +266,14 @@ contract ManagementContract is Initializable, OwnableUpgradeable { function GetImportantContractKeys() public view returns(string[] memory) { return importantContractKeys; } -} \ No newline at end of file + + // Return the challenge period delay for message bus root + function GetChallengePeriod() public view returns (uint256) { + return challengePeriod; + } + + // Sets the challenge period for message bus root (owner only) + function SetChallengePeriod(uint256 _delay) public onlyOwner { + challengePeriod = _delay; + } +} diff --git a/testnet/launcher/l1challengeperiod/cmd/cli.go b/testnet/launcher/l1challengeperiod/cmd/cli.go new file mode 100644 index 000000000..3302f7237 --- /dev/null +++ b/testnet/launcher/l1challengeperiod/cmd/cli.go @@ -0,0 +1,35 @@ +package main + +import ( + "flag" +) + +// L1ChallengePeriodConfigCLI represents the configurations needed to grant enclaves sequencer roles over CLI +type L1ChallengePeriodConfigCLI struct { + l1HTTPURL string + privateKey string + mgmtContractAddress string + dockerImage string + challengePeriod int +} + +// ParseConfigCLI returns a NodeConfigCLI based the cli params and defaults. +func ParseConfigCLI() *L1ChallengePeriodConfigCLI { + cfg := &L1ChallengePeriodConfigCLI{} + flagUsageMap := getFlagUsageMap() + + l1HTTPURL := flag.String(l1HTTPURLFlag, "http://eth2network:8025", flagUsageMap[l1HTTPURLFlag]) + privateKey := flag.String(privateKeyFlag, "", flagUsageMap[privateKeyFlag]) + mgmtContractAddress := flag.String(mgmtContractAddressFlag, "", flagUsageMap[mgmtContractAddressFlag]) + dockerImage := flag.String(dockerImageFlag, "testnetobscuronet.azurecr.io/obscuronet/hardhatdeployer:latest", flagUsageMap[dockerImageFlag]) + challengePeriod := flag.Int(challengePeriodFlag, 0, flagUsageMap[challengePeriodFlag]) + flag.Parse() + + cfg.l1HTTPURL = *l1HTTPURL + cfg.privateKey = *privateKey + cfg.mgmtContractAddress = *mgmtContractAddress + cfg.dockerImage = *dockerImage + cfg.challengePeriod = *challengePeriod + + return cfg +} diff --git a/testnet/launcher/l1challengeperiod/cmd/cli_flags.go b/testnet/launcher/l1challengeperiod/cmd/cli_flags.go new file mode 100644 index 000000000..06ff7b69a --- /dev/null +++ b/testnet/launcher/l1challengeperiod/cmd/cli_flags.go @@ -0,0 +1,24 @@ +package main + +// Flag names. +const ( + l1HTTPURLFlag = "l1_http_url" + privateKeyFlag = "private_key" + mgmtContractAddressFlag = "management_contract_addr" + dockerImageFlag = "docker_image" + contractsEnvFileFlag = "contracts_env_file" + challengePeriodFlag = "l1_challenge_period" +) + +// Returns a map of the flag usages. +// While we could just use constants instead of a map, this approach allows us to test that all the expected flags are defined. +func getFlagUsageMap() map[string]string { + return map[string]string{ + l1HTTPURLFlag: "Layer 1 network http RPC addr", + privateKeyFlag: "L1 and L2 private key used in the node", + mgmtContractAddressFlag: "L1 management contract address", + dockerImageFlag: "Docker image to run", + contractsEnvFileFlag: "If set, it will write the contract addresses to the file", + challengePeriodFlag: "L1 delay when setting message bus root for the challenge period", + } +} diff --git a/testnet/launcher/l1challengeperiod/cmd/main.go b/testnet/launcher/l1challengeperiod/cmd/main.go new file mode 100644 index 000000000..2bfde1263 --- /dev/null +++ b/testnet/launcher/l1challengeperiod/cmd/main.go @@ -0,0 +1,40 @@ +package main + +import ( + "fmt" + "os" + + l1cp "github.com/ten-protocol/go-ten/testnet/launcher/l1challengeperiod" +) + +func main() { + cliConfig := ParseConfigCLI() + + l1challengeperiod, err := l1cp.NewSetChallengePeriod( + l1cp.NewChallengePeriodConfig( + l1cp.WithL1HTTPURL(cliConfig.l1HTTPURL), + l1cp.WithPrivateKey(cliConfig.privateKey), + l1cp.WithDockerImage(cliConfig.dockerImage), + l1cp.WithMgmtContractAddress(cliConfig.mgmtContractAddress), + l1cp.WithChallengePeriod(cliConfig.challengePeriod), + ), + ) + if err != nil { + fmt.Println("unable to configure l1 contract deployer - %w", err) + os.Exit(1) + } + + err = l1challengeperiod.Start() + if err != nil { + fmt.Println("unable to start l1 contract deployer - %w", err) + os.Exit(1) + } + + err = l1challengeperiod.WaitForFinish() + if err != nil { + fmt.Println("unexpected error waiting for set challenge period script to finish - %w", err) + os.Exit(1) + } + fmt.Println("L1 challenge period was successfully set...") + os.Exit(0) +} diff --git a/testnet/launcher/l1challengeperiod/config.go b/testnet/launcher/l1challengeperiod/config.go new file mode 100644 index 000000000..b75ae5ba3 --- /dev/null +++ b/testnet/launcher/l1challengeperiod/config.go @@ -0,0 +1,55 @@ +package l1grantsequencers + +// Option is a function that applies configs to a Config Object +type Option = func(c *Config) + +// Config holds the properties that configure the package +type Config struct { + l1HTTPURL string + privateKey string + mgmtContractAddress string + dockerImage string + challengePeriod int + + // debugEnabled bool +} + +func NewChallengePeriodConfig(opts ...Option) *Config { + defaultConfig := &Config{} + + for _, opt := range opts { + opt(defaultConfig) + } + + return defaultConfig +} + +func WithL1HTTPURL(s string) Option { + return func(c *Config) { + c.l1HTTPURL = s + } +} + +func WithPrivateKey(s string) Option { + return func(c *Config) { + c.privateKey = s + } +} + +func WithMgmtContractAddress(s string) Option { + return func(c *Config) { + c.mgmtContractAddress = s + } +} + +func WithDockerImage(s string) Option { + return func(c *Config) { + c.dockerImage = s + } +} + +func WithChallengePeriod(i int) Option { + return func(c *Config) { + c.challengePeriod = i + } +} diff --git a/testnet/launcher/l1challengeperiod/docker.go b/testnet/launcher/l1challengeperiod/docker.go new file mode 100644 index 000000000..6c3bf7d91 --- /dev/null +++ b/testnet/launcher/l1challengeperiod/docker.go @@ -0,0 +1,105 @@ +package l1grantsequencers + +import ( + "bytes" + "context" + "fmt" + "io" + "strconv" + "time" + + "github.com/docker/docker/api/types" + "github.com/docker/docker/client" + "github.com/ten-protocol/go-ten/go/common/docker" +) + +type SetChallengePeriod struct { + cfg *Config + containerID string +} + +func NewSetChallengePeriod(cfg *Config) (*SetChallengePeriod, error) { + return &SetChallengePeriod{ + cfg: cfg, + }, nil +} + +func (s *SetChallengePeriod) Start() error { + var err error + cmds := []string{ + "npx", + "hardhat", + "run", + "--network", + "layer1", + "scripts/delay/001_set_challenge_period.ts", + } + + envs := map[string]string{ + "NETWORK_JSON": fmt.Sprintf(`{ + "layer1": { + "url": "%s", + "live": false, + "saveDeployments": true, + "accounts": [ "%s" ] + } + }`, s.cfg.l1HTTPURL, s.cfg.privateKey), + "MGMT_CONTRACT_ADDRESS": s.cfg.mgmtContractAddress, + "L1_CHALLENGE_PERIOD": strconv.Itoa(s.cfg.challengePeriod), + } + + containerID, err := docker.StartNewContainer( + "set-challenge-period", + s.cfg.dockerImage, + cmds, + nil, + envs, + nil, + nil, + false, + ) + if err != nil { + return err + } + s.containerID = containerID + return nil +} + +func (s *SetChallengePeriod) WaitForFinish() error { + cli, err := client.NewClientWithOpts(client.FromEnv) + if err != nil { + return fmt.Errorf("failed to create docker client: %w", err) + } + defer cli.Close() + + // make sure the container has finished execution + err = docker.WaitForContainerToFinish(s.containerID, 15*time.Minute) + if err != nil { + fmt.Println("Error waiting for container to finish: ", err) + s.PrintLogs(cli) + return err + } + + return nil +} + +func (s *SetChallengePeriod) PrintLogs(cli *client.Client) { + logsOptions := types.ContainerLogsOptions{ + ShowStdout: true, + ShowStderr: true, + } + + // Read the container logs + out, err := cli.ContainerLogs(context.Background(), s.containerID, logsOptions) + if err != nil { + fmt.Printf("Error printing out container %s logs... %v\n", s.containerID, err) + } + defer out.Close() + + var buf bytes.Buffer + _, err = io.Copy(&buf, out) + if err != nil { + fmt.Printf("Error getting logs for container %s\n", s.containerID) + } + fmt.Println(buf.String()) +} From f3a950cb1d3bd88256e94533b4f64c554261593a Mon Sep 17 00:00:00 2001 From: badgersrus <43809877+badgersrus@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:17:13 +0100 Subject: [PATCH 10/10] Prevent multiple blobs/ rollups in the same tx (#2249) * prevent multiple rollups appearing in the same tx --- go/enclave/components/interfaces.go | 6 +- go/enclave/components/rollup_consumer.go | 71 ++++++++++++++---------- go/enclave/enclave_admin_service.go | 7 ++- 3 files changed, 52 insertions(+), 32 deletions(-) diff --git a/go/enclave/components/interfaces.go b/go/enclave/components/interfaces.go index 464e431b3..75d0f835f 100644 --- a/go/enclave/components/interfaces.go +++ b/go/enclave/components/interfaces.go @@ -153,7 +153,9 @@ type RollupProducer interface { } type RollupConsumer interface { - // ProcessBlobsInBlock - extracts the blob hashes from the block's transactions and builds the blob hashes from the blobs, + // ProcessRollups - extracts the blob hashes from the block's transactions and builds the blob hashes from the blobs, // compares this with the hashes seen in the block. - ProcessBlobsInBlock(ctx context.Context, processed *common.ProcessedL1Data) error + ProcessRollups(ctx context.Context, rollups []*common.ExtRollup) error + // GetRollupsFromL1Data - + GetRollupsFromL1Data(processed *common.ProcessedL1Data) ([]*common.ExtRollup, error) } diff --git a/go/enclave/components/rollup_consumer.go b/go/enclave/components/rollup_consumer.go index c27507dd0..c75c8444d 100644 --- a/go/enclave/components/rollup_consumer.go +++ b/go/enclave/components/rollup_consumer.go @@ -48,30 +48,9 @@ func NewRollupConsumer( } } -// ProcessBlobsInBlock - processes the blobs in a block, extracts the rollups, verifies the rollups and stores them -func (rc *rollupConsumerImpl) ProcessBlobsInBlock(ctx context.Context, processed *common.ProcessedL1Data) error { - defer core.LogMethodDuration(rc.logger, measure.NewStopwatch(), "Rollup consumer processed blobs", log.BlockHashKey, processed.BlockHeader.Hash()) - - block := processed.BlockHeader - rollups, err := rc.extractAndVerifyRollups(processed) - if err != nil { - rc.logger.Error("Failed to extract rollups from block", log.BlockHashKey, block.Hash(), log.ErrKey, err) - return err - } - if len(rollups) == 0 { - rc.logger.Trace("No rollups found in block", log.BlockHashKey, block.Hash()) - return nil - } - - rollups, err = rc.getSignedRollup(rollups) - if err != nil { - return err - } - - if len(rollups) > 1 { - // todo - we need to sort this out - rc.logger.Warn(fmt.Sprintf("Multiple rollups %d in block %s", len(rollups), block.Hash())) - } +// ProcessRollups - processes the rollups found in the block, verifies the rollups and stores them +func (rc *rollupConsumerImpl) ProcessRollups(ctx context.Context, rollups []*common.ExtRollup) error { + defer core.LogMethodDuration(rc.logger, measure.NewStopwatch(), "Rollup consumer processed blobs") for _, rollup := range rollups { l1CompressionBlock, err := rc.storage.FetchBlock(ctx, rollup.Header.CompressionL1Head) @@ -103,6 +82,33 @@ func (rc *rollupConsumerImpl) ProcessBlobsInBlock(ctx context.Context, processed return nil } +// GetRollupsFromL1Data - extracts the rollups from the processed L1 data and checks sequencer signature on them +func (rc *rollupConsumerImpl) GetRollupsFromL1Data(processed *common.ProcessedL1Data) ([]*common.ExtRollup, error) { + defer core.LogMethodDuration(rc.logger, measure.NewStopwatch(), "Rollup consumer get rollups from L1 data", log.BlockHashKey, processed.BlockHeader.Hash()) + + block := processed.BlockHeader + rollups, err := rc.extractAndVerifyRollups(processed) + if err != nil { + rc.logger.Error("Failed to extract rollups from block", log.BlockHashKey, block.Hash(), log.ErrKey, err) + return nil, err // if multiple rollups are found with the same tx hash we will return here + } + if len(rollups) == 0 { + rc.logger.Trace("No rollups found in block", log.BlockHashKey, block.Hash()) + return nil, nil + } + + rollups, err = rc.getSignedRollup(rollups) + if err != nil { + return nil, err + } + + if len(rollups) > 0 { + // this is allowed as long as they come from unique transactions + rc.logger.Trace(fmt.Sprintf("Multiple rollups %d in block %s", len(rollups), block.Hash())) + } + return rollups, nil +} + func (rc *rollupConsumerImpl) getSignedRollup(rollups []*common.ExtRollup) ([]*common.ExtRollup, error) { signedRollup := make([]*common.ExtRollup, 0) @@ -117,11 +123,9 @@ func (rc *rollupConsumerImpl) getSignedRollup(rollups []*common.ExtRollup) ([]*c return signedRollup, nil } -// todo - when processing the rollup, instead of looking up batches one by one, compare the last sequence number from the db with the ones in the rollup -// extractAndVerifyRollups returns a list of the rollups published in this block -// It processes each transaction, attempting to extract and verify rollups -// If a transaction is not a rollup or fails verification, it's skipped -// The function only returns an error if there's a critical failure in rollup reconstruction +// extractAndVerifyRollups extracts rollups from L1 transactions in the processed block. +// It verifies blob hashes match the rollup hashes and ensures each transaction only contains one rollup. +// Returns an error if multiple rollups are found in the same transaction or if rollup reconstruction fails. func (rc *rollupConsumerImpl) extractAndVerifyRollups(processed *common.ProcessedL1Data) ([]*common.ExtRollup, error) { rollupTxs := processed.GetEvents(common.RollupTx) rollups := make([]*common.ExtRollup, 0, len(rollupTxs)) @@ -131,6 +135,8 @@ func (rc *rollupConsumerImpl) extractAndVerifyRollups(processed *common.Processe return nil, err } + txsSeen := make(map[gethcommon.Hash]bool) + for i, tx := range rollupTxs { t := rc.MgmtContractLib.DecodeTx(tx.Transaction) if t == nil { @@ -142,6 +148,12 @@ func (rc *rollupConsumerImpl) extractAndVerifyRollups(processed *common.Processe continue } + // prevent the case where someone pushes a blob to the same slot. multiple rollups can be found in a block, + // but they must come from unique transactions + if txsSeen[tx.Transaction.Hash()] { + return nil, fmt.Errorf("multiple rollups from same transaction: %s", tx.Transaction.Hash()) + } + if err := verifyBlobHashes(rollupHashes, blobHashes); err != nil { rc.logger.Warn(fmt.Sprintf("blob hashes in rollup at index %d do not match the rollup blob hashes. Cause: %s", i, err)) continue // Blob hashes don't match, skip this rollup @@ -155,6 +167,7 @@ func (rc *rollupConsumerImpl) extractAndVerifyRollups(processed *common.Processe } rollups = append(rollups, r) + txsSeen[tx.Transaction.Hash()] = true rc.logger.Info("Extracted rollup from block", log.RollupHashKey, r.Hash(), log.BlockHashKey, processed.BlockHeader.Hash()) } diff --git a/go/enclave/enclave_admin_service.go b/go/enclave/enclave_admin_service.go index 0a5bea6b6..7194c1869 100644 --- a/go/enclave/enclave_admin_service.go +++ b/go/enclave/enclave_admin_service.go @@ -467,6 +467,11 @@ func (e *enclaveAdminService) streamEventsForNewHeadBatch(ctx context.Context, b func (e *enclaveAdminService) ingestL1Block(ctx context.Context, processed *common.ProcessedL1Data) (*components.BlockIngestionType, error) { e.logger.Info("Start ingesting block", log.BlockHashKey, processed.BlockHeader.Hash()) + rollups, err := e.rollupConsumer.GetRollupsFromL1Data(processed) + if err != nil { + // early return before storing block if multiple rollups are found in the block + return nil, err + } ingestion, err := e.l1BlockProcessor.Process(ctx, processed) if err != nil { // only warn for unexpected errors @@ -478,7 +483,7 @@ func (e *enclaveAdminService) ingestL1Block(ctx context.Context, processed *comm return nil, err } - err = e.rollupConsumer.ProcessBlobsInBlock(ctx, processed) + err = e.rollupConsumer.ProcessRollups(ctx, rollups) if err != nil && !errors.Is(err, components.ErrDuplicateRollup) { e.logger.Error("Encountered error while processing l1 block rollups", log.ErrKey, err) // Unsure what to do here; block has been stored