diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index ecbb900159..7b54c25cd1 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -249,7 +249,7 @@ jobs: -message_bus_contract_addr=${{needs.build.outputs.MSG_BUS_CONTRACT_ADDR}} \ -l1_start=${{needs.build.outputs.L1_START_HASH}} \ -private_key=${{ secrets[matrix.node_pk_lookup] }} \ - -sequencer_id=${{ vars.ACCOUNT_ADDR_NODE_0 }} \ + -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ -host_p2p_port=10000 \ -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ diff --git a/.github/workflows/manual-deploy-testnet-validator.yml b/.github/workflows/manual-deploy-testnet-validator.yml index 5256ae531d..cc2222787a 100644 --- a/.github/workflows/manual-deploy-testnet-validator.yml +++ b/.github/workflows/manual-deploy-testnet-validator.yml @@ -175,7 +175,7 @@ jobs: -message_bus_contract_addr=${{ github.event.inputs.MSG_BUS_CONTRACT_ADDR }} \ -l1_start=${{ github.event.inputs.L1_START_HASH }} \ -private_key=${{ secrets.ADD_NEW_NODE_PRIVATE_KEY }} \ - -sequencer_id=${{ vars.ACCOUNT_ADDR_NODE_0 }} \ + -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ -host_public_p2p_addr=obscuronode-${{ github.event.inputs.node_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ -host_p2p_port=10000 \ -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ diff --git a/.github/workflows/manual-upgrade-testnet-l2.yml b/.github/workflows/manual-upgrade-testnet-l2.yml index c925de4315..c63a697d24 100644 --- a/.github/workflows/manual-upgrade-testnet-l2.yml +++ b/.github/workflows/manual-upgrade-testnet-l2.yml @@ -166,7 +166,7 @@ jobs: -host_id=${{ vars[matrix.node_addr_lookup] }} \ -l1_ws_url=${{ secrets[matrix.node_l1_ws_lookup] }} \ -private_key=${{ secrets[matrix.node_pk_lookup] }} \ - -sequencer_id=${{ vars.ACCOUNT_ADDR_NODE_0 }} \ + -sequencer_addr=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ -host_p2p_port=10000 \ -enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ diff --git a/contracts/generated/ManagementContract/ManagementContract.go b/contracts/generated/ManagementContract/ManagementContract.go index 01a6b051d7..ee94ead234 100644 --- a/contracts/generated/ManagementContract/ManagementContract.go +++ b/contracts/generated/ManagementContract/ManagementContract.go @@ -53,8 +53,8 @@ type StructsMetaRollup 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\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"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\"},{\"internalType\":\"string\",\"name\":\"_rollupData\",\"type\":\"string\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"topic\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.CrossChainMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"}],\"internalType\":\"structStructs.HeaderCrossChainData\",\"name\":\"crossChainData\",\"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\":[],\"name\":\"GetHostAddresses\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"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\":\"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\":\"_hostAddress\",\"type\":\"string\"},{\"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\":\"string\",\"name\":\"hostAddress\",\"type\":\"string\"},{\"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\":\"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\":[],\"name\":\"lastBatchSeqNo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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: "0x608060405234801561001057600080fd5b5061001a3361001f565b610090565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6133aa8061009f6000396000f3fe60806040523480156200001157600080fd5b5060043610620001a15760003560e01c80637281099611620000e9578063a1a227fa1162000097578063db5d91b1116200006e578063db5d91b114620003c8578063e34fbfc814620003f7578063f2fde38b146200040c57600080fd5b8063a1a227fa146200038c578063a52f433c14620003a0578063bbd79e1514620003b157600080fd5b80638236a7ba11620000cc5780638236a7ba146200030e5780638da5cb5b146200033557806398077e86146200036657600080fd5b80637281099614620002fa5780638129fc1c146200030457600080fd5b8063440c953b11620001535780636a30d26c116200012a5780636a30d26c14620002cf5780636b9707d614620002d9578063715018a614620002f057600080fd5b8063440c953b14620002885780634766573814620002a157806359a9007114620002b857600080fd5b8063324ff8661162000188578063324ff86614620001d65780633e60a22f14620001f857806343348b2f146200024857600080fd5b806303e72e4814620001a65780632c77c81f14620001bf575b600080fd5b620001bd620001b73660046200185b565b62000423565b005b620001bd620001d0366004620018fb565b62000536565b620001e062000680565b604051620001ef9190620019f2565b60405180910390f35b6200022f6200020936600462001a58565b80516020818301810180516004825292820191909301209152546001600160a01b031681565b6040516001600160a01b039091168152602001620001ef565b620002776200025936600462001a99565b6001600160a01b031660009081526020819052604090205460ff1690565b6040519015158152602001620001ef565b6200029260065481565b604051908152602001620001ef565b620001bd620002b236600462001a99565b62000763565b620001bd620002c936600462001abe565b620007fe565b620001e062000914565b620001bd620002ea36600462001a99565b620009ee565b620001bd62000a83565b620001bd62000a9b565b620001bd62000b1f565b620003256200031f36600462001b6f565b62000cf2565b604051620001ef92919062001b89565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166200022f565b6200037d6200037736600462001b6f565b62000de2565b604051620001ef919062001bcf565b6008546200022f906001600160a01b031681565b600554610100900460ff1662000277565b620001bd620003c236600462001be4565b62000e97565b62000277620003d936600462001a99565b6001600160a01b031660009081526001602052604090205460ff1690565b620001bd6200040836600462001cb5565b5050565b620001bd6200041d36600462001a99565b6200106b565b6200042d620010c8565b60006001600160a01b03166004836040516200044a919062001cfb565b908152604051908190036020019020546001600160a01b031603620004a957600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01620004a7838262001da7565b505b80600483604051620004bc919062001cfb565b90815260405190819003602001812080546001600160a01b039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092179091557f17b2f9f5748931099ffee882b5b64f4a560b5c55da9b4f4e396dae3bb9f98cb5906200052a908490849062001e74565b60405180910390a15050565b60006200058885356200054d602088018862001ea1565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200113f92505050565b6001600160a01b03811660009081526020819052604090205490915060ff16620005f95760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f742061747465737465640000000000000000000060448201526064015b60405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff16620006635760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e636572000000000000006044820152606401620005f0565b6200066e856200116d565b6200067982620011a5565b5050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b828210156200075a578382906000526020600020018054620006c69062001d19565b80601f0160208091040260200160405190810160405280929190818152602001828054620006f49062001d19565b8015620007455780601f10620007195761010080835404028352916020019162000745565b820191906000526020600020905b8154815290600101906020018083116200072757829003601f168201915b505050505081526020019060010190620006a4565b50505050905090565b6200076d620010c8565b6001600160a01b03811660009081526020819052604090205460ff16620007d75760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f74206174746573746564000000000000000000006044820152606401620005f0565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b60055460ff1615620008795760405162461bcd60e51b815260206004820152602260248201527f6e6574776f726b2073656372657420616c726561647920696e697469616c697a60448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401620005f0565b60058054600160ff1991821681179092556001600160a01b03881660009081526020819052604081208054909216831790915560028054928301815590527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01620008e5848262001da7565b5050506001600160a01b039093166000908152600160208190526040909120805460ff19169091179055505050565b60606003805480602002602001604051908101604052809291908181526020016000905b828210156200075a5783829060005260206000200180546200095a9062001d19565b80601f0160208091040260200160405190810160405280929190818152602001828054620009889062001d19565b8015620009d95780601f10620009ad57610100808354040283529160200191620009d9565b820191906000526020600020905b815481529060010190602001808311620009bb57829003601f168201915b50505050508152602001906001019062000938565b620009f8620010c8565b6001600160a01b03811660009081526001602052604090205460ff1662000a625760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e636572000000000000006044820152606401620005f0565b6001600160a01b03166000908152600160205260409020805460ff19169055565b62000a8d620010c8565b62000a99600062001275565b565b62000aa5620010c8565b6008546040517f36d2da900000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116906336d2da9090602401600060405180830381600087803b15801562000b0457600080fd5b505af115801562000b19573d6000803e3d6000fd5b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801562000b6b5750825b905060008267ffffffffffffffff16600114801562000b895750303b155b90508115801562000b98575080155b1562000bd0576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff19166001178555831562000c0557845468ff00000000000000001916680100000000000000001785555b62000c1033620012f3565b600060065560405162000c239062001785565b604051809103906000f08015801562000c40573d6000803e3d6000fd5b506008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691821790556040519081527fbd726cf82ac9c3260b1495107182e336e0654b25c10915648c0cc15b2bb72cbf9060200160405180910390a183156200067957845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60408051606080820183526000808352602080840183905283850182905285825260078152848220855193840190955284548352600185018054929586949390928401919062000d429062001d19565b80601f016020809104026020016040519081016040528092919081815260200182805462000d709062001d19565b801562000dc15780601f1062000d955761010080835404028352916020019162000dc1565b820191906000526020600020905b81548152906001019060200180831162000da357829003601f168201915b50505091835250506002919091015460209091015280519094149492505050565b6003818154811062000df357600080fd5b90600052602060002001600091509050805462000e109062001d19565b80601f016020809104026020016040519081016040528092919081815260200182805462000e3e9062001d19565b801562000e8f5780601f1062000e635761010080835404028352916020019162000e8f565b820191906000526020600020905b81548152906001019060200180831162000e7157829003601f168201915b505050505081565b6001600160a01b03861660009081526020819052604090205460ff168062000f285760405162461bcd60e51b815260206004820152602360248201527f726573706f6e64696e67206174746573746572206973206e6f7420617474657360448201527f74656400000000000000000000000000000000000000000000000000000000006064820152608401620005f0565b81156200100157600062000f638888868860405160200162000f4e949392919062001eeb565b60405160208183030381529060405262001308565b9050600062000f7382886200113f565b9050886001600160a01b0316816001600160a01b03161462000ffe5760405162461bcd60e51b815260206004820152602c60248201527f63616c63756c61746564206164647265737320616e642061747465737465724960448201527f4420646f6e74206d6174636800000000000000000000000000000000000000006064820152608401620005f0565b50505b6001600160a01b0386166000908152602081905260408120805460ff191660019081179091556002805491820181559091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0162001061848262001da7565b5050505050505050565b62001075620010c8565b6001600160a01b038116620010ba576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401620005f0565b620010c58162001275565b50565b33620010fb7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161462000a99576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401620005f0565b60008060008062001151868662001347565b92509250925062001163828262001398565b5090949350505050565b8035600090815260076020526040902081906200118b828262001f4b565b505060065460408201351115620010c55760400135600655565b6000620011b382806200205b565b9050905060005b8181101562001270576008546001600160a01b0316639730886d620011e085806200205b565b84818110620011f357620011f3620020a8565b9050602002810190620012079190620020be565b60016040518363ffffffff1660e01b8152600401620012289291906200216e565b600060405180830381600087803b1580156200124357600080fd5b505af115801562001258573d6000803e3d6000fd5b5050505080620012689062002230565b9050620011ba565b505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b620012fd620014ae565b620010c58162001516565b600062001316825162001520565b826040516020016200132a92919062002258565b604051602081830303815290604052805190602001209050919050565b60008060008351604103620013855760208401516040850151606086015160001a6200137688828585620015c7565b95509550955050505062001391565b50508151600091506002905b9250925092565b6000826003811115620013af57620013af620022b7565b03620013b9575050565b6001826003811115620013d057620013d0620022b7565b0362001408576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156200141f576200141f620022b7565b036200145b576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401620005f0565b6003826003811115620014725762001472620022b7565b0362000408576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401620005f0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1662000a99576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62001075620014ae565b606060006200152f836200169b565b600101905060008167ffffffffffffffff81111562001552576200155262001793565b6040519080825280601f01601f1916602001820160405280156200157d576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846200158757509392505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562001604575060009150600390508262001691565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562001659573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116620016875750600092506001915082905062001691565b9250600091508190505b9450945094915050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310620016e5577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062001712576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200173157662386f26fc10000830492506010015b6305f5e10083106200174a576305f5e100830492506008015b61271083106200175f57612710830492506004015b6064831062001772576064830492506002015b600a83106200177f576001015b92915050565b6110a780620022ce83390190565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620017bb57600080fd5b813567ffffffffffffffff80821115620017d957620017d962001793565b604051601f8301601f19908116603f0116810190828211818310171562001804576200180462001793565b816040528381528660208588010111156200181e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b80356001600160a01b03811681146200185657600080fd5b919050565b600080604083850312156200186f57600080fd5b823567ffffffffffffffff8111156200188757600080fd5b6200189585828601620017a9565b925050620018a6602084016200183e565b90509250929050565b60008083601f840112620018c257600080fd5b50813567ffffffffffffffff811115620018db57600080fd5b602083019150836020828501011115620018f457600080fd5b9250929050565b600080600080606085870312156200191257600080fd5b843567ffffffffffffffff808211156200192b57600080fd5b90860190606082890312156200194057600080fd5b909450602086013590808211156200195757600080fd5b6200196588838901620018af565b909550935060408701359150808211156200197f57600080fd5b508501602081880312156200199357600080fd5b939692955090935050565b60005b83811015620019bb578181015183820152602001620019a1565b50506000910152565b60008151808452620019de8160208601602086016200199e565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101562001a4b57603f1988860301845262001a38858351620019c4565b9450928501929085019060010162001a19565b5092979650505050505050565b60006020828403121562001a6b57600080fd5b813567ffffffffffffffff81111562001a8357600080fd5b62001a9184828501620017a9565b949350505050565b60006020828403121562001aac57600080fd5b62001ab7826200183e565b9392505050565b6000806000806000806080878903121562001ad857600080fd5b62001ae3876200183e565b9550602087013567ffffffffffffffff8082111562001b0157600080fd5b62001b0f8a838b01620018af565b9097509550604089013591508082111562001b2957600080fd5b62001b378a838b01620017a9565b9450606089013591508082111562001b4e57600080fd5b5062001b5d89828a01620018af565b979a9699509497509295939492505050565b60006020828403121562001b8257600080fd5b5035919050565b821515815260406020820152815160408201526000602083015160608084015262001bb860a0840182620019c4565b905060408401516080840152809150509392505050565b60208152600062001ab76020830184620019c4565b60008060008060008060c0878903121562001bfe57600080fd5b62001c09876200183e565b955062001c19602088016200183e565b9450604087013567ffffffffffffffff8082111562001c3757600080fd5b62001c458a838b01620017a9565b9550606089013591508082111562001c5c57600080fd5b62001c6a8a838b01620017a9565b9450608089013591508082111562001c8157600080fd5b5062001c9089828a01620017a9565b92505060a0870135801515811462001ca757600080fd5b809150509295509295509295565b6000806020838503121562001cc957600080fd5b823567ffffffffffffffff81111562001ce157600080fd5b62001cef85828601620018af565b90969095509350505050565b6000825162001d0f8184602087016200199e565b9190910192915050565b600181811c9082168062001d2e57607f821691505b60208210810362001d4f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200127057600081815260208120601f850160051c8101602086101562001d7e5750805b601f850160051c820191505b8181101562001d9f5782815560010162001d8a565b505050505050565b815167ffffffffffffffff81111562001dc45762001dc462001793565b62001ddc8162001dd5845462001d19565b8462001d55565b602080601f83116001811462001e14576000841562001dfb5750858301515b600019600386901b1c1916600185901b17855562001d9f565b600085815260208120601f198616915b8281101562001e455788860151825594840194600190910190840162001e24565b508582101562001e645787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60408152600062001e896040830185620019c4565b90506001600160a01b03831660208301529392505050565b6000808335601e1984360301811262001eb957600080fd5b83018035915067ffffffffffffffff82111562001ed557600080fd5b602001915036819003821315620018f457600080fd5b60006bffffffffffffffffffffffff19808760601b168352808660601b16601484015250835162001f248160288501602088016200199e565b83519083019062001f3d8160288401602088016200199e565b016028019695505050505050565b813581556001808201602080850135601e1986360301811262001f6d57600080fd5b8501803567ffffffffffffffff81111562001f8757600080fd5b803603838301131562001f9957600080fd5b62001fb18162001faa865462001d19565b8662001d55565b6000601f82116001811462001fea576000831562001fd157508382018501355b600019600385901b1c1916600184901b17865562002046565b600086815260209020601f19841690835b828110156200201c5786850188013582559387019390890190870162001ffb565b50848210156200203c5760001960f88660031b161c198785880101351681555b50508683881b0186555b50505050505050604082013560028201555050565b6000808335601e198436030181126200207357600080fd5b83018035915067ffffffffffffffff8211156200208f57600080fd5b6020019150600581901b3603821315620018f457600080fd5b634e487b7160e01b600052603260045260246000fd5b6000823560be1983360301811262001d0f57600080fd5b803563ffffffff811681146200185657600080fd5b6000808335601e198436030181126200210257600080fd5b830160208101925035905067ffffffffffffffff8111156200212357600080fd5b803603821315620018f457600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b803560ff811681146200185657600080fd5b604081526001600160a01b0362002185846200183e565b1660408201526000602084013567ffffffffffffffff8116808214620021aa57600080fd5b60608401525063ffffffff620021c360408601620020d5565b166080830152620021d760608501620020d5565b63ffffffff1660a0830152620021f16080850185620020ea565b60c080850152620022086101008501828462002133565b9150506200221960a086016200215c565b60ff1660e084015260209092019290925292915050565b6000600182016200225157634e487b7160e01b600052601160045260246000fd5b5060010190565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152600083516200229281601a8501602088016200199e565b835190830190620022ab81601a8401602088016200199e565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610046565b50610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611002806100a56000396000f3fe6080604052600436106100b55760003560e01c80638da5cb5b1161006957806399a3ad211161004e57806399a3ad2114610269578063b1454caa14610289578063f2fde38b146102c257610129565b80638da5cb5b146102215780639730886d1461024957610129565b8063346633fb1161009a578063346633fb146101d957806336d2da90146101ec578063715018a61461020c57610129565b80630fcfbd111461017657806333a88c72146101a957610129565b36610129576040517f346633fb0000000000000000000000000000000000000000000000000000000081523360048201523460248201819052309163346633fb91906044016000604051808303818588803b15801561011357600080fd5b505af1158015610127573d6000803e3d6000fd5b005b60405162461bcd60e51b815260206004820152600b60248201527f756e737570706f7274656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b34801561018257600080fd5b50610196610191366004610945565b6102e2565b6040519081526020015b60405180910390f35b3480156101b557600080fd5b506101c96101c4366004610945565b610398565b60405190151581526020016101a0565b6101276101e736600461098f565b6103eb565b3480156101f857600080fd5b506101276102073660046109bb565b6104b7565b34801561021857600080fd5b50610127610566565b34801561022d57600080fd5b506000546040516001600160a01b0390911681526020016101a0565b34801561025557600080fd5b506101276102643660046109d8565b61057a565b34801561027557600080fd5b5061012761028436600461098f565b6106cc565b34801561029557600080fd5b506102a96102a4366004610a4e565b61077c565b60405167ffffffffffffffff90911681526020016101a0565b3480156102ce57600080fd5b506101276102dd3660046109bb565b6107d5565b600080826040516020016102f69190610b3a565b60408051601f19818403018152918152815160209283012060008181526001909352912054909150806103915760405162461bcd60e51b815260206004820152602160248201527f54686973206d65737361676520776173206e65766572207375626d697474656460448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015260840161016d565b9392505050565b600080826040516020016103ac9190610b3a565b60408051601f1981840301815291815281516020928301206000818152600190935291205490915080158015906103e35750428111155b949350505050565b6000341180156103fa57508034145b61046c5760405162461bcd60e51b815260206004820152603060248201527f417474656d7074696e6720746f2073656e642076616c756520776974686f757460448201527f2070726f766964696e6720457468657200000000000000000000000000000000606482015260840161016d565b604080513381526001600160a01b0384166020820152348183015290517ff1365f826a788d6c1a955db0eed5ba8642674219c4771f8c65918617511a15609181900360600190a15050565b6104bf61082c565b6000816001600160a01b03164760405160006040518083038185875af1925050503d806000811461050c576040519150601f19603f3d011682016040523d82523d6000602084013e610511565b606091505b50509050806105625760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c7565000000000000000000000000604482015260640161016d565b5050565b61056e61082c565b6105786000610872565b565b61058261082c565b600061058e8242610c3b565b90506000836040516020016105a39190610b3a565b60408051601f198184030181529181528151602092830120600081815260019093529120549091501561063e5760405162461bcd60e51b815260206004820152602160248201527f4d657373616765207375626d6974746564206d6f7265207468616e206f6e636560448201527f2100000000000000000000000000000000000000000000000000000000000000606482015260840161016d565b6000818152600160209081526040822084905560029190610661908701876109bb565b6001600160a01b03168152602081019190915260400160009081209061068d6080870160608801610c54565b63ffffffff168152602080820192909252604001600090812080546001810182559082529190208591600402016106c48282610e2a565b505050505050565b6106d461082c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610721576040519150601f19603f3d011682016040523d82523d6000602084013e610726565b606091505b50509050806107775760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c7565000000000000000000000000604482015260640161016d565b505050565b6000610787336108cf565b90507fb93c37389233beb85a3a726c3f15c2d15533ee74cb602f20f490dfffef775937338288888888886040516107c49796959493929190610f44565b60405180910390a195945050505050565b6107dd61082c565b6001600160a01b038116610820576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240161016d565b61082981610872565b50565b6000546001600160a01b03163314610578576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161016d565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166000908152600360205260408120805467ffffffffffffffff1691600191906109028385610fa4565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550919050565b600060c0828403121561093f57600080fd5b50919050565b60006020828403121561095757600080fd5b813567ffffffffffffffff81111561096e57600080fd5b6103e38482850161092d565b6001600160a01b038116811461082957600080fd5b600080604083850312156109a257600080fd5b82356109ad8161097a565b946020939093013593505050565b6000602082840312156109cd57600080fd5b81356103918161097a565b600080604083850312156109eb57600080fd5b823567ffffffffffffffff811115610a0257600080fd5b610a0e8582860161092d565b95602094909401359450505050565b63ffffffff8116811461082957600080fd5b60ff8116811461082957600080fd5b8035610a4981610a2f565b919050565b600080600080600060808688031215610a6657600080fd5b8535610a7181610a1d565b94506020860135610a8181610a1d565b9350604086013567ffffffffffffffff80821115610a9e57600080fd5b818801915088601f830112610ab257600080fd5b813581811115610ac157600080fd5b896020828501011115610ad357600080fd5b6020830195508094505050506060860135610aed81610a2f565b809150509295509295909350565b67ffffffffffffffff8116811461082957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260008235610b4b8161097a565b6001600160a01b0381166020840152506020830135610b6981610afb565b67ffffffffffffffff808216604085015260408501359150610b8a82610a1d565b63ffffffff808316606086015260608601359250610ba783610a1d565b80831660808601525060808501359150601e19853603018212610bc957600080fd5b6020918501918201913581811115610be057600080fd5b803603831315610bef57600080fd5b60c060a0860152610c0460e086018285610b11565b92505050610c1460a08501610a3e565b60ff811660c0850152509392505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c4e57610c4e610c25565b92915050565b600060208284031215610c6657600080fd5b813561039181610a1d565b60008135610c4e81610a1d565b6000808335601e19843603018112610c9557600080fd5b83018035915067ffffffffffffffff821115610cb057600080fd5b602001915036819003821315610cc557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680610cf657607f821691505b60208210810361093f57634e487b7160e01b600052602260045260246000fd5b601f82111561077757600081815260208120601f850160051c81016020861015610d3d5750805b601f850160051c820191505b818110156106c457828155600101610d49565b67ffffffffffffffff831115610d7457610d74610ccc565b610d8883610d828354610ce2565b83610d16565b6000601f841160018114610dbc5760008515610da45750838201355b600019600387901b1c1916600186901b178355610e16565b600083815260209020601f19861690835b82811015610ded5786850135825560209485019460019092019101610dcd565b5086821015610e0a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60008135610c4e81610a2f565b8135610e358161097a565b6001600160a01b038116905081548173ffffffffffffffffffffffffffffffffffffffff1982161783556020840135610e6d81610afb565b7bffffffffffffffff00000000000000000000000000000000000000008160a01b1690507fffffffff0000000000000000000000000000000000000000000000000000000081848285161717855560408601359250610ecb83610a1d565b921760e09190911b909116178155610f03610ee860608401610c71565b6001830163ffffffff821663ffffffff198254161781555050565b610f106080830183610c7e565b610f1e818360028601610d5c565b5050610562610f2f60a08401610e1d565b6003830160ff821660ff198254161781555050565b6001600160a01b038816815267ffffffffffffffff87166020820152600063ffffffff808816604084015280871660608401525060c06080830152610f8d60c083018587610b11565b905060ff831660a083015298975050505050505050565b67ffffffffffffffff818116838216019080821115610fc557610fc5610c25565b509291505056fea264697066735822122055bbe17521778f602b3eab0e1e16144809be200e76e1af574dfaadbe93774a6264736f6c63430008140033a2646970667358221220ec2b49324e96618d3b357759d174b2142ba9f45a7a75db67fed7662b2c94d98464736f6c63430008140033", + 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\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"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\"},{\"internalType\":\"string\",\"name\":\"_rollupData\",\"type\":\"string\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"topic\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.CrossChainMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"}],\"internalType\":\"structStructs.HeaderCrossChainData\",\"name\":\"crossChainData\",\"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\":[],\"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\":\"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\":\"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\":[],\"name\":\"lastBatchSeqNo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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: "0x608060405234801561001057600080fd5b5061001a3361001f565b610090565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6131bd8061009f6000396000f3fe60806040523480156200001157600080fd5b5060043610620001955760003560e01c80637281099611620000e9578063a1a227fa1162000097578063db5d91b1116200006e578063db5d91b114620003ad578063e34fbfc814620003dc578063f2fde38b14620003f157600080fd5b8063a1a227fa1462000371578063a52f433c1462000385578063d4fab887146200039657600080fd5b80638236a7ba11620000cc5780638236a7ba14620002f35780638da5cb5b146200031a57806398077e86146200034b57600080fd5b80637281099614620002df5780638129fc1c14620002e957600080fd5b80634766573811620001475780636a30d26c116200012a5780636a30d26c14620002a55780636b9707d614620002be578063715018a614620002d557600080fd5b806347665738146200027757806368e10383146200028e57600080fd5b80633e60a22f116200017c5780633e60a22f14620001ca57806343348b2f146200021e578063440c953b146200025e57600080fd5b806303e72e48146200019a5780632c77c81f14620001b3575b600080fd5b620001b1620001ab366004620016d3565b62000408565b005b620001b1620001c436600462001773565b6200051b565b62000201620001db36600462001816565b80516020818301810180516003825292820191909301209152546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6200024d6200022f36600462001857565b6001600160a01b031660009081526020819052604090205460ff1690565b604051901515815260200162000215565b6200026860055481565b60405190815260200162000215565b620001b16200028836600462001857565b62000665565b620001b16200029f3660046200187c565b62000700565b620002af620007c4565b6040516200021591906200195a565b620001b1620002cf36600462001857565b620008a7565b620001b16200093c565b620001b162000954565b620001b1620009d8565b6200030a62000304366004620019c0565b62000bab565b60405162000215929190620019da565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031662000201565b620003626200035c366004620019c0565b62000c9b565b60405162000215919062001a20565b60075462000201906001600160a01b031681565b600454610100900460ff166200024d565b620001b1620003a736600462001a35565b62000d50565b6200024d620003be36600462001857565b6001600160a01b031660009081526001602052604090205460ff1690565b620001b1620003ed36600462001ae0565b5050565b620001b16200040236600462001857565b62000ee3565b6200041262000f40565b60006001600160a01b03166003836040516200042f919062001b26565b908152604051908190036020019020546001600160a01b0316036200048e57600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace016200048c838262001bd2565b505b80600383604051620004a1919062001b26565b90815260405190819003602001812080546001600160a01b039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092179091557f17b2f9f5748931099ffee882b5b64f4a560b5c55da9b4f4e396dae3bb9f98cb5906200050f908490849062001c9f565b60405180910390a15050565b60006200056d853562000532602088018862001ccc565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525062000fb792505050565b6001600160a01b03811660009081526020819052604090205490915060ff16620005de5760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f742061747465737465640000000000000000000060448201526064015b60405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff16620006485760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e636572000000000000006044820152606401620005d5565b620006538562000fe5565b6200065e826200101d565b5050505050565b6200066f62000f40565b6001600160a01b03811660009081526020819052604090205460ff16620006d95760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f74206174746573746564000000000000000000006044820152606401620005d5565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b60045460ff16156200077b5760405162461bcd60e51b815260206004820152602260248201527f6e6574776f726b2073656372657420616c726561647920696e697469616c697a60448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401620005d5565b50506004805460ff1990811660019081179092556001600160a01b0390941660009081526020818152604080832080548816851790559083905290208054909416179092555050565b60606002805480602002602001604051908101604052809291908181526020016000905b828210156200089e5783829060005260206000200180546200080a9062001b44565b80601f0160208091040260200160405190810160405280929190818152602001828054620008389062001b44565b8015620008895780601f106200085d5761010080835404028352916020019162000889565b820191906000526020600020905b8154815290600101906020018083116200086b57829003601f168201915b505050505081526020019060010190620007e8565b50505050905090565b620008b162000f40565b6001600160a01b03811660009081526001602052604090205460ff166200091b5760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e636572000000000000006044820152606401620005d5565b6001600160a01b03166000908152600160205260409020805460ff19169055565b6200094662000f40565b620009526000620010ed565b565b6200095e62000f40565b6007546040517f36d2da900000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116906336d2da9090602401600060405180830381600087803b158015620009bd57600080fd5b505af1158015620009d2573d6000803e3d6000fd5b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801562000a245750825b905060008267ffffffffffffffff16600114801562000a425750303b155b90508115801562000a51575080155b1562000a89576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff19166001178555831562000abe57845468ff00000000000000001916680100000000000000001785555b62000ac9336200116b565b600060055560405162000adc90620015fd565b604051809103906000f08015801562000af9573d6000803e3d6000fd5b506007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691821790556040519081527fbd726cf82ac9c3260b1495107182e336e0654b25c10915648c0cc15b2bb72cbf9060200160405180910390a183156200065e57845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60408051606080820183526000808352602080840183905283850182905285825260068152848220855193840190955284548352600185018054929586949390928401919062000bfb9062001b44565b80601f016020809104026020016040519081016040528092919081815260200182805462000c299062001b44565b801562000c7a5780601f1062000c4e5761010080835404028352916020019162000c7a565b820191906000526020600020905b81548152906001019060200180831162000c5c57829003601f168201915b50505091835250506002919091015460209091015280519094149492505050565b6002818154811062000cac57600080fd5b90600052602060002001600091509050805462000cc99062001b44565b80601f016020809104026020016040519081016040528092919081815260200182805462000cf79062001b44565b801562000d485780601f1062000d1c5761010080835404028352916020019162000d48565b820191906000526020600020905b81548152906001019060200180831162000d2a57829003601f168201915b505050505081565b6001600160a01b03851660009081526020819052604090205460ff168062000de15760405162461bcd60e51b815260206004820152602360248201527f726573706f6e64696e67206174746573746572206973206e6f7420617474657360448201527f74656400000000000000000000000000000000000000000000000000000000006064820152608401620005d5565b811562000eb857600062000e1a87878660405160200162000e059392919062001d16565b60405160208183030381529060405262001180565b9050600062000e2a828762000fb7565b9050876001600160a01b0316816001600160a01b03161462000eb55760405162461bcd60e51b815260206004820152602c60248201527f63616c63756c61746564206164647265737320616e642061747465737465724960448201527f4420646f6e74206d6174636800000000000000000000000000000000000000006064820152608401620005d5565b50505b5050506001600160a01b039091166000908152602081905260409020805460ff191660011790555050565b62000eed62000f40565b6001600160a01b03811662000f32576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401620005d5565b62000f3d81620010ed565b50565b3362000f737f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161462000952576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401620005d5565b60008060008062000fc98686620011bf565b92509250925062000fdb828262001210565b5090949350505050565b80356000908152600660205260409020819062001003828262001d5e565b50506005546040820135111562000f3d5760400135600555565b60006200102b828062001e6e565b9050905060005b81811015620010e8576007546001600160a01b0316639730886d62001058858062001e6e565b848181106200106b576200106b62001ebb565b90506020028101906200107f919062001ed1565b60016040518363ffffffff1660e01b8152600401620010a092919062001f81565b600060405180830381600087803b158015620010bb57600080fd5b505af1158015620010d0573d6000803e3d6000fd5b5050505080620010e09062002043565b905062001032565b505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6200117562001326565b62000f3d816200138e565b60006200118e825162001398565b82604051602001620011a29291906200206b565b604051602081830303815290604052805190602001209050919050565b60008060008351604103620011fd5760208401516040850151606086015160001a620011ee888285856200143f565b95509550955050505062001209565b50508151600091506002905b9250925092565b6000826003811115620012275762001227620020ca565b0362001231575050565b6001826003811115620012485762001248620020ca565b0362001280576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826003811115620012975762001297620020ca565b03620012d3576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401620005d5565b6003826003811115620012ea57620012ea620020ca565b03620003ed576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401620005d5565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1662000952576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000eed62001326565b60606000620013a78362001513565b600101905060008167ffffffffffffffff811115620013ca57620013ca6200160b565b6040519080825280601f01601f191660200182016040528015620013f5576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084620013ff57509392505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156200147c575060009150600390508262001509565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015620014d1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116620014ff5750600092506001915082905062001509565b9250600091508190505b9450945094915050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106200155d577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106200158a576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310620015a957662386f26fc10000830492506010015b6305f5e1008310620015c2576305f5e100830492506008015b6127108310620015d757612710830492506004015b60648310620015ea576064830492506002015b600a8310620015f7576001015b92915050565b6110a780620020e183390190565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200163357600080fd5b813567ffffffffffffffff808211156200165157620016516200160b565b604051601f8301601f19908116603f011681019082821181831017156200167c576200167c6200160b565b816040528381528660208588010111156200169657600080fd5b836020870160208301376000602085830101528094505050505092915050565b80356001600160a01b0381168114620016ce57600080fd5b919050565b60008060408385031215620016e757600080fd5b823567ffffffffffffffff811115620016ff57600080fd5b6200170d8582860162001621565b9250506200171e60208401620016b6565b90509250929050565b60008083601f8401126200173a57600080fd5b50813567ffffffffffffffff8111156200175357600080fd5b6020830191508360208285010111156200176c57600080fd5b9250929050565b600080600080606085870312156200178a57600080fd5b843567ffffffffffffffff80821115620017a357600080fd5b9086019060608289031215620017b857600080fd5b90945060208601359080821115620017cf57600080fd5b620017dd8883890162001727565b90955093506040870135915080821115620017f757600080fd5b508501602081880312156200180b57600080fd5b939692955090935050565b6000602082840312156200182957600080fd5b813567ffffffffffffffff8111156200184157600080fd5b6200184f8482850162001621565b949350505050565b6000602082840312156200186a57600080fd5b6200187582620016b6565b9392505050565b6000806000806000606086880312156200189557600080fd5b620018a086620016b6565b9450602086013567ffffffffffffffff80821115620018be57600080fd5b620018cc89838a0162001727565b90965094506040880135915080821115620018e657600080fd5b50620018f58882890162001727565b969995985093965092949392505050565b60005b838110156200192357818101518382015260200162001909565b50506000910152565b600081518084526200194681602086016020860162001906565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015620019b357603f19888603018452620019a08583516200192c565b9450928501929085019060010162001981565b5092979650505050505050565b600060208284031215620019d357600080fd5b5035919050565b821515815260406020820152815160408201526000602083015160608084015262001a0960a08401826200192c565b905060408401516080840152809150509392505050565b6020815260006200187560208301846200192c565b600080600080600060a0868803121562001a4e57600080fd5b62001a5986620016b6565b945062001a6960208701620016b6565b9350604086013567ffffffffffffffff8082111562001a8757600080fd5b62001a9589838a0162001621565b9450606088013591508082111562001aac57600080fd5b5062001abb8882890162001621565b9250506080860135801515811462001ad257600080fd5b809150509295509295909350565b6000806020838503121562001af457600080fd5b823567ffffffffffffffff81111562001b0c57600080fd5b62001b1a8582860162001727565b90969095509350505050565b6000825162001b3a81846020870162001906565b9190910192915050565b600181811c9082168062001b5957607f821691505b60208210810362001b7a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620010e857600081815260208120601f850160051c8101602086101562001ba95750805b601f850160051c820191505b8181101562001bca5782815560010162001bb5565b505050505050565b815167ffffffffffffffff81111562001bef5762001bef6200160b565b62001c078162001c00845462001b44565b8462001b80565b602080601f83116001811462001c3f576000841562001c265750858301515b600019600386901b1c1916600185901b17855562001bca565b600085815260208120601f198616915b8281101562001c705788860151825594840194600190910190840162001c4f565b508582101562001c8f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60408152600062001cb460408301856200192c565b90506001600160a01b03831660208301529392505050565b6000808335601e1984360301811262001ce457600080fd5b83018035915067ffffffffffffffff82111562001d0057600080fd5b6020019150368190038213156200176c57600080fd5b60006bffffffffffffffffffffffff19808660601b168352808560601b16601484015250825162001d4f81602885016020870162001906565b91909101602801949350505050565b813581556001808201602080850135601e1986360301811262001d8057600080fd5b8501803567ffffffffffffffff81111562001d9a57600080fd5b803603838301131562001dac57600080fd5b62001dc48162001dbd865462001b44565b8662001b80565b6000601f82116001811462001dfd576000831562001de457508382018501355b600019600385901b1c1916600184901b17865562001e59565b600086815260209020601f19841690835b8281101562001e2f5786850188013582559387019390890190870162001e0e565b508482101562001e4f5760001960f88660031b161c198785880101351681555b50508683881b0186555b50505050505050604082013560028201555050565b6000808335601e1984360301811262001e8657600080fd5b83018035915067ffffffffffffffff82111562001ea257600080fd5b6020019150600581901b36038213156200176c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6000823560be1983360301811262001b3a57600080fd5b803563ffffffff81168114620016ce57600080fd5b6000808335601e1984360301811262001f1557600080fd5b830160208101925035905067ffffffffffffffff81111562001f3657600080fd5b8036038213156200176c57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b803560ff81168114620016ce57600080fd5b604081526001600160a01b0362001f9884620016b6565b1660408201526000602084013567ffffffffffffffff811680821462001fbd57600080fd5b60608401525063ffffffff62001fd66040860162001ee8565b16608083015262001fea6060850162001ee8565b63ffffffff1660a083015262002004608085018562001efd565b60c0808501526200201b6101008501828462001f46565b9150506200202c60a0860162001f6f565b60ff1660e084015260209092019290925292915050565b6000600182016200206457634e487b7160e01b600052601160045260246000fd5b5060010190565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351620020a581601a85016020880162001906565b835190830190620020be81601a84016020880162001906565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610046565b50610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611002806100a56000396000f3fe6080604052600436106100b55760003560e01c80638da5cb5b1161006957806399a3ad211161004e57806399a3ad2114610269578063b1454caa14610289578063f2fde38b146102c257610129565b80638da5cb5b146102215780639730886d1461024957610129565b8063346633fb1161009a578063346633fb146101d957806336d2da90146101ec578063715018a61461020c57610129565b80630fcfbd111461017657806333a88c72146101a957610129565b36610129576040517f346633fb0000000000000000000000000000000000000000000000000000000081523360048201523460248201819052309163346633fb91906044016000604051808303818588803b15801561011357600080fd5b505af1158015610127573d6000803e3d6000fd5b005b60405162461bcd60e51b815260206004820152600b60248201527f756e737570706f7274656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b34801561018257600080fd5b50610196610191366004610945565b6102e2565b6040519081526020015b60405180910390f35b3480156101b557600080fd5b506101c96101c4366004610945565b610398565b60405190151581526020016101a0565b6101276101e736600461098f565b6103eb565b3480156101f857600080fd5b506101276102073660046109bb565b6104b7565b34801561021857600080fd5b50610127610566565b34801561022d57600080fd5b506000546040516001600160a01b0390911681526020016101a0565b34801561025557600080fd5b506101276102643660046109d8565b61057a565b34801561027557600080fd5b5061012761028436600461098f565b6106cc565b34801561029557600080fd5b506102a96102a4366004610a4e565b61077c565b60405167ffffffffffffffff90911681526020016101a0565b3480156102ce57600080fd5b506101276102dd3660046109bb565b6107d5565b600080826040516020016102f69190610b3a565b60408051601f19818403018152918152815160209283012060008181526001909352912054909150806103915760405162461bcd60e51b815260206004820152602160248201527f54686973206d65737361676520776173206e65766572207375626d697474656460448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015260840161016d565b9392505050565b600080826040516020016103ac9190610b3a565b60408051601f1981840301815291815281516020928301206000818152600190935291205490915080158015906103e35750428111155b949350505050565b6000341180156103fa57508034145b61046c5760405162461bcd60e51b815260206004820152603060248201527f417474656d7074696e6720746f2073656e642076616c756520776974686f757460448201527f2070726f766964696e6720457468657200000000000000000000000000000000606482015260840161016d565b604080513381526001600160a01b0384166020820152348183015290517ff1365f826a788d6c1a955db0eed5ba8642674219c4771f8c65918617511a15609181900360600190a15050565b6104bf61082c565b6000816001600160a01b03164760405160006040518083038185875af1925050503d806000811461050c576040519150601f19603f3d011682016040523d82523d6000602084013e610511565b606091505b50509050806105625760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c7565000000000000000000000000604482015260640161016d565b5050565b61056e61082c565b6105786000610872565b565b61058261082c565b600061058e8242610c3b565b90506000836040516020016105a39190610b3a565b60408051601f198184030181529181528151602092830120600081815260019093529120549091501561063e5760405162461bcd60e51b815260206004820152602160248201527f4d657373616765207375626d6974746564206d6f7265207468616e206f6e636560448201527f2100000000000000000000000000000000000000000000000000000000000000606482015260840161016d565b6000818152600160209081526040822084905560029190610661908701876109bb565b6001600160a01b03168152602081019190915260400160009081209061068d6080870160608801610c54565b63ffffffff168152602080820192909252604001600090812080546001810182559082529190208591600402016106c48282610e2a565b505050505050565b6106d461082c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610721576040519150601f19603f3d011682016040523d82523d6000602084013e610726565b606091505b50509050806107775760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c7565000000000000000000000000604482015260640161016d565b505050565b6000610787336108cf565b90507fb93c37389233beb85a3a726c3f15c2d15533ee74cb602f20f490dfffef775937338288888888886040516107c49796959493929190610f44565b60405180910390a195945050505050565b6107dd61082c565b6001600160a01b038116610820576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240161016d565b61082981610872565b50565b6000546001600160a01b03163314610578576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161016d565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166000908152600360205260408120805467ffffffffffffffff1691600191906109028385610fa4565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550919050565b600060c0828403121561093f57600080fd5b50919050565b60006020828403121561095757600080fd5b813567ffffffffffffffff81111561096e57600080fd5b6103e38482850161092d565b6001600160a01b038116811461082957600080fd5b600080604083850312156109a257600080fd5b82356109ad8161097a565b946020939093013593505050565b6000602082840312156109cd57600080fd5b81356103918161097a565b600080604083850312156109eb57600080fd5b823567ffffffffffffffff811115610a0257600080fd5b610a0e8582860161092d565b95602094909401359450505050565b63ffffffff8116811461082957600080fd5b60ff8116811461082957600080fd5b8035610a4981610a2f565b919050565b600080600080600060808688031215610a6657600080fd5b8535610a7181610a1d565b94506020860135610a8181610a1d565b9350604086013567ffffffffffffffff80821115610a9e57600080fd5b818801915088601f830112610ab257600080fd5b813581811115610ac157600080fd5b896020828501011115610ad357600080fd5b6020830195508094505050506060860135610aed81610a2f565b809150509295509295909350565b67ffffffffffffffff8116811461082957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260008235610b4b8161097a565b6001600160a01b0381166020840152506020830135610b6981610afb565b67ffffffffffffffff808216604085015260408501359150610b8a82610a1d565b63ffffffff808316606086015260608601359250610ba783610a1d565b80831660808601525060808501359150601e19853603018212610bc957600080fd5b6020918501918201913581811115610be057600080fd5b803603831315610bef57600080fd5b60c060a0860152610c0460e086018285610b11565b92505050610c1460a08501610a3e565b60ff811660c0850152509392505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c4e57610c4e610c25565b92915050565b600060208284031215610c6657600080fd5b813561039181610a1d565b60008135610c4e81610a1d565b6000808335601e19843603018112610c9557600080fd5b83018035915067ffffffffffffffff821115610cb057600080fd5b602001915036819003821315610cc557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680610cf657607f821691505b60208210810361093f57634e487b7160e01b600052602260045260246000fd5b601f82111561077757600081815260208120601f850160051c81016020861015610d3d5750805b601f850160051c820191505b818110156106c457828155600101610d49565b67ffffffffffffffff831115610d7457610d74610ccc565b610d8883610d828354610ce2565b83610d16565b6000601f841160018114610dbc5760008515610da45750838201355b600019600387901b1c1916600186901b178355610e16565b600083815260209020601f19861690835b82811015610ded5786850135825560209485019460019092019101610dcd565b5086821015610e0a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60008135610c4e81610a2f565b8135610e358161097a565b6001600160a01b038116905081548173ffffffffffffffffffffffffffffffffffffffff1982161783556020840135610e6d81610afb565b7bffffffffffffffff00000000000000000000000000000000000000008160a01b1690507fffffffff0000000000000000000000000000000000000000000000000000000081848285161717855560408601359250610ecb83610a1d565b921760e09190911b909116178155610f03610ee860608401610c71565b6001830163ffffffff821663ffffffff198254161781555050565b610f106080830183610c7e565b610f1e818360028601610d5c565b5050610562610f2f60a08401610e1d565b6003830160ff821660ff198254161781555050565b6001600160a01b038816815267ffffffffffffffff87166020820152600063ffffffff808816604084015280871660608401525060c06080830152610f8d60c083018587610b11565b905060ff831660a083015298975050505050505050565b67ffffffffffffffff818116838216019080821115610fc557610fc5610c25565b509291505056fea264697066735822122055bbe17521778f602b3eab0e1e16144809be200e76e1af574dfaadbe93774a6264736f6c63430008140033a2646970667358221220988c97557f81218d102add918ac3bc9901a051f845bec5d8043436c3f645561a64736f6c63430008140033", } // ManagementContractABI is the input ABI used to generate the binding from. @@ -255,37 +255,6 @@ func (_ManagementContract *ManagementContractCallerSession) Attested(_addr commo return _ManagementContract.Contract.Attested(&_ManagementContract.CallOpts, _addr) } -// GetHostAddresses is a free data retrieval call binding the contract method 0x324ff866. -// -// Solidity: function GetHostAddresses() view returns(string[]) -func (_ManagementContract *ManagementContractCaller) GetHostAddresses(opts *bind.CallOpts) ([]string, error) { - var out []interface{} - err := _ManagementContract.contract.Call(opts, &out, "GetHostAddresses") - - if err != nil { - return *new([]string), err - } - - out0 := *abi.ConvertType(out[0], new([]string)).(*[]string) - - return out0, err - -} - -// GetHostAddresses is a free data retrieval call binding the contract method 0x324ff866. -// -// Solidity: function GetHostAddresses() view returns(string[]) -func (_ManagementContract *ManagementContractSession) GetHostAddresses() ([]string, error) { - return _ManagementContract.Contract.GetHostAddresses(&_ManagementContract.CallOpts) -} - -// GetHostAddresses is a free data retrieval call binding the contract method 0x324ff866. -// -// Solidity: function GetHostAddresses() view returns(string[]) -func (_ManagementContract *ManagementContractCallerSession) GetHostAddresses() ([]string, error) { - return _ManagementContract.Contract.GetHostAddresses(&_ManagementContract.CallOpts) -} - // GetImportantContractKeys is a free data retrieval call binding the contract method 0x6a30d26c. // // Solidity: function GetImportantContractKeys() view returns(string[]) @@ -608,25 +577,25 @@ func (_ManagementContract *ManagementContractTransactorSession) GrantSequencerEn return _ManagementContract.Contract.GrantSequencerEnclave(&_ManagementContract.TransactOpts, _addr) } -// InitializeNetworkSecret is a paid mutator transaction binding the contract method 0x59a90071. +// InitializeNetworkSecret is a paid mutator transaction binding the contract method 0x68e10383. // -// Solidity: function InitializeNetworkSecret(address _enclaveID, bytes _initSecret, string _hostAddress, string _genesisAttestation) returns() -func (_ManagementContract *ManagementContractTransactor) InitializeNetworkSecret(opts *bind.TransactOpts, _enclaveID common.Address, _initSecret []byte, _hostAddress string, _genesisAttestation string) (*types.Transaction, error) { - return _ManagementContract.contract.Transact(opts, "InitializeNetworkSecret", _enclaveID, _initSecret, _hostAddress, _genesisAttestation) +// Solidity: function InitializeNetworkSecret(address _enclaveID, bytes _initSecret, string _genesisAttestation) returns() +func (_ManagementContract *ManagementContractTransactor) InitializeNetworkSecret(opts *bind.TransactOpts, _enclaveID common.Address, _initSecret []byte, _genesisAttestation string) (*types.Transaction, error) { + return _ManagementContract.contract.Transact(opts, "InitializeNetworkSecret", _enclaveID, _initSecret, _genesisAttestation) } -// InitializeNetworkSecret is a paid mutator transaction binding the contract method 0x59a90071. +// InitializeNetworkSecret is a paid mutator transaction binding the contract method 0x68e10383. // -// Solidity: function InitializeNetworkSecret(address _enclaveID, bytes _initSecret, string _hostAddress, string _genesisAttestation) returns() -func (_ManagementContract *ManagementContractSession) InitializeNetworkSecret(_enclaveID common.Address, _initSecret []byte, _hostAddress string, _genesisAttestation string) (*types.Transaction, error) { - return _ManagementContract.Contract.InitializeNetworkSecret(&_ManagementContract.TransactOpts, _enclaveID, _initSecret, _hostAddress, _genesisAttestation) +// Solidity: function InitializeNetworkSecret(address _enclaveID, bytes _initSecret, string _genesisAttestation) returns() +func (_ManagementContract *ManagementContractSession) InitializeNetworkSecret(_enclaveID common.Address, _initSecret []byte, _genesisAttestation string) (*types.Transaction, error) { + return _ManagementContract.Contract.InitializeNetworkSecret(&_ManagementContract.TransactOpts, _enclaveID, _initSecret, _genesisAttestation) } -// InitializeNetworkSecret is a paid mutator transaction binding the contract method 0x59a90071. +// InitializeNetworkSecret is a paid mutator transaction binding the contract method 0x68e10383. // -// Solidity: function InitializeNetworkSecret(address _enclaveID, bytes _initSecret, string _hostAddress, string _genesisAttestation) returns() -func (_ManagementContract *ManagementContractTransactorSession) InitializeNetworkSecret(_enclaveID common.Address, _initSecret []byte, _hostAddress string, _genesisAttestation string) (*types.Transaction, error) { - return _ManagementContract.Contract.InitializeNetworkSecret(&_ManagementContract.TransactOpts, _enclaveID, _initSecret, _hostAddress, _genesisAttestation) +// Solidity: function InitializeNetworkSecret(address _enclaveID, bytes _initSecret, string _genesisAttestation) returns() +func (_ManagementContract *ManagementContractTransactorSession) InitializeNetworkSecret(_enclaveID common.Address, _initSecret []byte, _genesisAttestation string) (*types.Transaction, error) { + return _ManagementContract.Contract.InitializeNetworkSecret(&_ManagementContract.TransactOpts, _enclaveID, _initSecret, _genesisAttestation) } // RequestNetworkSecret is a paid mutator transaction binding the contract method 0xe34fbfc8. @@ -650,25 +619,25 @@ func (_ManagementContract *ManagementContractTransactorSession) RequestNetworkSe return _ManagementContract.Contract.RequestNetworkSecret(&_ManagementContract.TransactOpts, requestReport) } -// RespondNetworkSecret is a paid mutator transaction binding the contract method 0xbbd79e15. +// RespondNetworkSecret is a paid mutator transaction binding the contract method 0xd4fab887. // -// Solidity: function RespondNetworkSecret(address attesterID, address requesterID, bytes attesterSig, bytes responseSecret, string hostAddress, bool verifyAttester) returns() -func (_ManagementContract *ManagementContractTransactor) RespondNetworkSecret(opts *bind.TransactOpts, attesterID common.Address, requesterID common.Address, attesterSig []byte, responseSecret []byte, hostAddress string, verifyAttester bool) (*types.Transaction, error) { - return _ManagementContract.contract.Transact(opts, "RespondNetworkSecret", attesterID, requesterID, attesterSig, responseSecret, hostAddress, verifyAttester) +// Solidity: function RespondNetworkSecret(address attesterID, address requesterID, bytes attesterSig, bytes responseSecret, bool verifyAttester) returns() +func (_ManagementContract *ManagementContractTransactor) RespondNetworkSecret(opts *bind.TransactOpts, attesterID common.Address, requesterID common.Address, attesterSig []byte, responseSecret []byte, verifyAttester bool) (*types.Transaction, error) { + return _ManagementContract.contract.Transact(opts, "RespondNetworkSecret", attesterID, requesterID, attesterSig, responseSecret, verifyAttester) } -// RespondNetworkSecret is a paid mutator transaction binding the contract method 0xbbd79e15. +// RespondNetworkSecret is a paid mutator transaction binding the contract method 0xd4fab887. // -// Solidity: function RespondNetworkSecret(address attesterID, address requesterID, bytes attesterSig, bytes responseSecret, string hostAddress, bool verifyAttester) returns() -func (_ManagementContract *ManagementContractSession) RespondNetworkSecret(attesterID common.Address, requesterID common.Address, attesterSig []byte, responseSecret []byte, hostAddress string, verifyAttester bool) (*types.Transaction, error) { - return _ManagementContract.Contract.RespondNetworkSecret(&_ManagementContract.TransactOpts, attesterID, requesterID, attesterSig, responseSecret, hostAddress, verifyAttester) +// Solidity: function RespondNetworkSecret(address attesterID, address requesterID, bytes attesterSig, bytes responseSecret, bool verifyAttester) returns() +func (_ManagementContract *ManagementContractSession) RespondNetworkSecret(attesterID common.Address, requesterID common.Address, attesterSig []byte, responseSecret []byte, verifyAttester bool) (*types.Transaction, error) { + return _ManagementContract.Contract.RespondNetworkSecret(&_ManagementContract.TransactOpts, attesterID, requesterID, attesterSig, responseSecret, verifyAttester) } -// RespondNetworkSecret is a paid mutator transaction binding the contract method 0xbbd79e15. +// RespondNetworkSecret is a paid mutator transaction binding the contract method 0xd4fab887. // -// Solidity: function RespondNetworkSecret(address attesterID, address requesterID, bytes attesterSig, bytes responseSecret, string hostAddress, bool verifyAttester) returns() -func (_ManagementContract *ManagementContractTransactorSession) RespondNetworkSecret(attesterID common.Address, requesterID common.Address, attesterSig []byte, responseSecret []byte, hostAddress string, verifyAttester bool) (*types.Transaction, error) { - return _ManagementContract.Contract.RespondNetworkSecret(&_ManagementContract.TransactOpts, attesterID, requesterID, attesterSig, responseSecret, hostAddress, verifyAttester) +// Solidity: function RespondNetworkSecret(address attesterID, address requesterID, bytes attesterSig, bytes responseSecret, bool verifyAttester) returns() +func (_ManagementContract *ManagementContractTransactorSession) RespondNetworkSecret(attesterID common.Address, requesterID common.Address, attesterSig []byte, responseSecret []byte, verifyAttester bool) (*types.Transaction, error) { + return _ManagementContract.Contract.RespondNetworkSecret(&_ManagementContract.TransactOpts, attesterID, requesterID, attesterSig, responseSecret, verifyAttester) } // RetrieveAllBridgeFunds is a paid mutator transaction binding the contract method 0x72810996. diff --git a/contracts/src/management/ManagementContract.sol b/contracts/src/management/ManagementContract.sol index 7bd79b6798..24a80e2878 100644 --- a/contracts/src/management/ManagementContract.sol +++ b/contracts/src/management/ManagementContract.sol @@ -25,14 +25,12 @@ contract ManagementContract is Initializable, OwnableUpgradeable { // mapping of enclaveID to whether it is attested mapping(address => bool) private attested; + // mapping of enclaveID to whether it is permissioned as a sequencer enclave // note: the enclaveID which initialises the network secret is automatically permissioned as a sequencer. // Beyond that, the contract owner can grant and revoke sequencer status. mapping(address => bool) private sequencerEnclave; - // TODO - Revisit the decision to store the host addresses in the smart contract. - string[] private hostAddresses; // The addresses of all the Ten hosts on the network. - // In the near-term it is convenient to have an accessible source of truth for important contract addresses // TODO - this is probably not appropriate long term but currently useful for testnets. Look to remove. // We store the keys as well as the mapping for the key-value store for important contract addresses for convenience @@ -96,7 +94,7 @@ contract ManagementContract is Initializable, OwnableUpgradeable { // InitializeNetworkSecret kickstarts the network secret, can only be called once // solc-ignore-next-line unused-param - function InitializeNetworkSecret(address _enclaveID, bytes calldata _initSecret, string memory _hostAddress, string calldata _genesisAttestation) public { + function InitializeNetworkSecret(address _enclaveID, bytes calldata _initSecret, string calldata _genesisAttestation) public { require(!networkSecretInitialized, "network secret already initialized"); // network can no longer be initialized @@ -104,7 +102,6 @@ contract ManagementContract is Initializable, OwnableUpgradeable { // enclave is now on the list of attested enclaves (and its host address is published for p2p) attested[_enclaveID] = true; - hostAddresses.push(_hostAddress); // the enclave that starts the network with this call is implicitly a sequencer so doesn't need adding sequencerEnclave[_enclaveID] = true; @@ -119,7 +116,7 @@ contract ManagementContract is Initializable, OwnableUpgradeable { // and, if valid, will respond with the Network Secret // and mark the requesterID as attested // @param verifyAttester Whether to ask the attester to complete a challenge (signing a hash) to prove their identity. - function RespondNetworkSecret(address attesterID, address requesterID, bytes memory attesterSig, bytes memory responseSecret, string memory hostAddress, bool verifyAttester) public { + function RespondNetworkSecret(address attesterID, address requesterID, bytes memory attesterSig, bytes memory responseSecret, bool verifyAttester) public { // only attested enclaves can respond to Network Secret Requests bool isEnclAttested = attested[attesterID]; require(isEnclAttested, "responding attester is not attested"); @@ -130,7 +127,7 @@ contract ManagementContract is Initializable, OwnableUpgradeable { // signature = f(PubKey, PrivateKey, message) // address = f(signature, message) // valid if attesterID = address - bytes32 calculatedHashSigned = abi.encodePacked(attesterID, requesterID, hostAddress, responseSecret).toEthSignedMessageHash(); + bytes32 calculatedHashSigned = abi.encodePacked(attesterID, requesterID, responseSecret).toEthSignedMessageHash(); address recoveredAddrSignedCalculated = ECDSA.recover(calculatedHashSigned, attesterSig); require(recoveredAddrSignedCalculated == attesterID, "calculated address and attesterID dont match"); @@ -138,12 +135,6 @@ contract ManagementContract is Initializable, OwnableUpgradeable { // mark the requesterID enclave as an attested enclave and store its host address attested[requesterID] = true; - // TODO - Consider whether to remove duplicates. - hostAddresses.push(hostAddress); - } - - function GetHostAddresses() public view returns (string[] memory) { - return hostAddresses; } diff --git a/go/common/host/services.go b/go/common/host/services.go index 03f66011ec..8b76acf2f3 100644 --- a/go/common/host/services.go +++ b/go/common/host/services.go @@ -56,9 +56,6 @@ type P2P interface { // SubscribeForBatchRequests will register a handler to receive new batch requests from peers, returns unsubscribe func // todo (@matt) feels a bit weird to have this in this interface since it relates to serving data rather than receiving SubscribeForBatchRequests(handler P2PBatchRequestHandler) func() - - // RefreshPeerList notifies the P2P service that its peer list might be out-of-date and it should resync - RefreshPeerList() } // P2PBatchHandler is an interface for receiving new batches from the P2P network as they arrive @@ -111,8 +108,6 @@ type L1Publisher interface { // PublishSecretResponse will create and publish a secret response tx to the management contract - fire and forget we don't wait for receipt PublishSecretResponse(secretResponse *common.ProducedSecretResponse) error - FetchLatestPeersList() ([]string, error) - FetchLatestSeqNo() (*big.Int, error) // GetImportantContracts returns a (cached) record of addresses of the important network contracts diff --git a/go/common/query_types.go b/go/common/query_types.go index 5d16362d9e..910b1d5e2f 100644 --- a/go/common/query_types.go +++ b/go/common/query_types.go @@ -119,7 +119,6 @@ type PrivateCustomQueryListTransactions struct { type ObscuroNetworkInfo struct { ManagementContractAddress common.Address L1StartHash common.Hash - SequencerID common.Address MessageBusAddress common.Address L2MessageBusAddress common.Address ImportantContracts map[string]common.Address // map of contract name to address diff --git a/go/config/enclave_cli_flags.go b/go/config/enclave_cli_flags.go index d6c9c8f769..b357aca3f4 100644 --- a/go/config/enclave_cli_flags.go +++ b/go/config/enclave_cli_flags.go @@ -25,7 +25,6 @@ const ( ProfilerEnabledFlag = "profilerEnabled" MinGasPriceFlag = "minGasPrice" MessageBusAddressFlag = "messageBusAddress" - SequencerIDFlag = "sequencerID" ObscuroGenesisFlag = "obscuroGenesis" DebugNamespaceEnabledFlag = "debugNamespaceEnabled" MaxBatchSizeFlag = "maxBatchSize" @@ -51,7 +50,6 @@ var EnclaveFlags = map[string]*flag.TenFlag{ SQLiteDBPathFlag: flag.NewStringFlag(SQLiteDBPathFlag, "", "Filepath for the sqlite DB persistence file (can be empty if a throwaway file in /tmp/ is acceptable or if using InMemory DB or if using attestation/EdgelessDB)"), MinGasPriceFlag: flag.NewInt64Flag(MinGasPriceFlag, 1, "The minimum gas price for mining a transaction"), MessageBusAddressFlag: flag.NewStringFlag(MessageBusAddressFlag, "", "The address of the L1 message bus contract owned by the management contract."), - SequencerIDFlag: flag.NewStringFlag(SequencerIDFlag, "", "The 20 bytes of the address of the sequencer for this network"), MaxBatchSizeFlag: flag.NewUint64Flag(MaxBatchSizeFlag, 1024*55, "The maximum size a batch is allowed to reach uncompressed"), MaxRollupSizeFlag: flag.NewUint64Flag(MaxRollupSizeFlag, 1024*64, "The maximum size a rollup is allowed to reach"), L2BaseFeeFlag: flag.NewUint64Flag(L2BaseFeeFlag, params.InitialBaseFee, ""), diff --git a/go/config/enclave_config.go b/go/config/enclave_config.go index a181b7a695..ad1657fb47 100644 --- a/go/config/enclave_config.go +++ b/go/config/enclave_config.go @@ -52,8 +52,8 @@ type EnclaveConfig struct { MinGasPrice *big.Int // MessageBus L1 Address MessageBusAddress gethcommon.Address - // The identity of the sequencer for the network - SequencerID gethcommon.Address + // P2P address for validators to connect to the sequencer for live batch data + SequencerP2PAddress string // A json string that specifies the prefunded addresses at the genesis of the Obscuro network ObscuroGenesis string // Whether debug calls are available @@ -186,7 +186,6 @@ func newConfig(flags map[string]*flag.TenFlag) (*EnclaveConfig, error) { cfg.ProfilerEnabled = flags[ProfilerEnabledFlag].Bool() cfg.MinGasPrice = big.NewInt(flags[MinGasPriceFlag].Int64()) cfg.MessageBusAddress = gethcommon.HexToAddress(flags[MessageBusAddressFlag].String()) - cfg.SequencerID = gethcommon.HexToAddress(flags[SequencerIDFlag].String()) cfg.ObscuroGenesis = flags[ObscuroGenesisFlag].String() cfg.DebugNamespaceEnabled = flags[DebugNamespaceEnabledFlag].Bool() cfg.MaxBatchSize = flags[MaxBatchSizeFlag].Uint64() diff --git a/go/config/host_config.go b/go/config/host_config.go index cdb569e2d3..2faa21b638 100644 --- a/go/config/host_config.go +++ b/go/config/host_config.go @@ -45,6 +45,8 @@ type HostInputConfig struct { L1RPCTimeout time.Duration // Timeout duration for messaging between hosts. P2PConnectionTimeout time.Duration + // P2P address of network sequencer node + SequencerP2PAddress string // The rollup contract address on the L1 network ManagementContractAddress gethcommon.Address // The message bus contract address on the L1 network @@ -63,8 +65,6 @@ type HostInputConfig struct { ProfilerEnabled bool // L1StartHash is the hash of the L1 block we can start streaming from for all Obscuro state (e.g. management contract deployment block) L1StartHash gethcommon.Hash - // The ID of the obscuro sequencer node - SequencerID gethcommon.Address // MetricsEnabled defines whether the metrics are enabled or not MetricsEnabled bool @@ -127,7 +127,7 @@ func (p HostInputConfig) ToHostConfig() *HostConfig { ObscuroChainID: p.ObscuroChainID, ProfilerEnabled: p.ProfilerEnabled, L1StartHash: p.L1StartHash, - SequencerID: p.SequencerID, + SequencerP2PAddress: p.SequencerP2PAddress, ID: gethcommon.Address{}, MetricsEnabled: p.MetricsEnabled, MetricsHTTPPort: p.MetricsHTTPPort, @@ -155,8 +155,8 @@ type HostConfig struct { ObscuroChainID int64 // L1StartHash is the hash of the L1 block we can start streaming from for all Obscuro state (e.g. management contract deployment block) L1StartHash gethcommon.Hash - // The ID of the obscuro sequencer node - SequencerID gethcommon.Address + // The address of the sequencer node's P2P server + SequencerP2PAddress string // The rollup contract address on the L1 network ManagementContractAddress gethcommon.Address // The message bus contract address on the L1 network @@ -263,7 +263,7 @@ func DefaultHostParsedConfig() *HostInputConfig { ObscuroChainID: 443, ProfilerEnabled: false, L1StartHash: common.L1BlockHash{}, // this hash will not be found, host will log a warning and then stream from L1 genesis - SequencerID: gethcommon.BytesToAddress([]byte("")), + SequencerP2PAddress: "127.0.0.1:10000", MetricsEnabled: true, MetricsHTTPPort: 14000, UseInMemoryDB: true, diff --git a/go/enclave/components/sigverifier.go b/go/enclave/components/sigverifier.go index 4617f0a08c..d717237569 100644 --- a/go/enclave/components/sigverifier.go +++ b/go/enclave/components/sigverifier.go @@ -10,15 +10,13 @@ import ( ) type SignatureValidator struct { - SequencerID gethcommon.Address attestedKey *ecdsa.PublicKey storage storage.Storage } -func NewSignatureValidator(seqID gethcommon.Address, storage storage.Storage) (*SignatureValidator, error) { +func NewSignatureValidator(storage storage.Storage) (*SignatureValidator, error) { // todo (#718) - sequencer identities should be retrieved from the L1 management contract return &SignatureValidator{ - SequencerID: seqID, storage: storage, attestedKey: nil, }, nil diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 743c1a86ac..395c31c990 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -169,7 +169,7 @@ func NewEnclave( gasOracle := gas.NewGasOracle() blockProcessor := components.NewBlockProcessor(storage, crossChainProcessors, gasOracle, logger) batchExecutor := components.NewBatchExecutor(storage, *config, gethEncodingService, crossChainProcessors, genesis, gasOracle, chainConfig, config.GasBatchExecutionLimit, logger) - sigVerifier, err := components.NewSignatureValidator(config.SequencerID, storage) + sigVerifier, err := components.NewSignatureValidator(storage) registry := components.NewBatchRegistry(storage, logger) rProducer := components.NewRollupProducer(enclaveKey.EnclaveID(), storage, registry, logger) if err != nil { @@ -212,7 +212,7 @@ func NewEnclave( blockchain, ) } else { - service = nodetype.NewValidator(blockProcessor, batchExecutor, registry, rConsumer, chainConfig, config.SequencerID, storage, sigVerifier, mempool, logger) + service = nodetype.NewValidator(blockProcessor, batchExecutor, registry, rConsumer, chainConfig, storage, sigVerifier, mempool, logger) } chain := l2chain.NewChain( diff --git a/go/enclave/nodetype/validator.go b/go/enclave/nodetype/validator.go index a162a94706..b6872d388e 100644 --- a/go/enclave/nodetype/validator.go +++ b/go/enclave/nodetype/validator.go @@ -14,7 +14,6 @@ import ( "github.com/ten-protocol/go-ten/go/common/log" "github.com/ten-protocol/go-ten/go/enclave/storage" - gethcommon "github.com/ethereum/go-ethereum/common" gethlog "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ten-protocol/go-ten/go/common" @@ -30,7 +29,6 @@ type obsValidator struct { chainConfig *params.ChainConfig - sequencerID gethcommon.Address storage storage.Storage sigValidator *components.SignatureValidator mempool *txpool.TxPool @@ -38,7 +36,7 @@ type obsValidator struct { logger gethlog.Logger } -func NewValidator(consumer components.L1BlockProcessor, batchExecutor components.BatchExecutor, registry components.BatchRegistry, rollupConsumer components.RollupConsumer, chainConfig *params.ChainConfig, sequencerID gethcommon.Address, storage storage.Storage, sigValidator *components.SignatureValidator, mempool *txpool.TxPool, logger gethlog.Logger) ObsValidator { +func NewValidator(consumer components.L1BlockProcessor, batchExecutor components.BatchExecutor, registry components.BatchRegistry, rollupConsumer components.RollupConsumer, chainConfig *params.ChainConfig, storage storage.Storage, sigValidator *components.SignatureValidator, mempool *txpool.TxPool, logger gethlog.Logger) ObsValidator { startMempool(registry, mempool) return &obsValidator{ @@ -47,7 +45,6 @@ func NewValidator(consumer components.L1BlockProcessor, batchExecutor components batchRegistry: registry, rollupConsumer: rollupConsumer, chainConfig: chainConfig, - sequencerID: sequencerID, storage: storage, sigValidator: sigValidator, mempool: mempool, diff --git a/go/ethadapter/l1_transaction.go b/go/ethadapter/l1_transaction.go index 2602677907..c83cfa0cc9 100644 --- a/go/ethadapter/l1_transaction.go +++ b/go/ethadapter/l1_transaction.go @@ -30,7 +30,6 @@ type L1RespondSecretTx struct { RequesterID gethcommon.Address AttesterID gethcommon.Address AttesterSig []byte - HostAddress string } type L1SetImportantContractsTx struct { @@ -43,7 +42,6 @@ func (l *L1RespondSecretTx) Sign(privateKey *ecdsa.PrivateKey) *L1RespondSecretT var data []byte data = append(data, l.AttesterID.Bytes()...) data = append(data, l.RequesterID.Bytes()...) - data = append(data, l.HostAddress...) data = append(data, string(l.Secret)...) ethereumMessageHash := func(data []byte) []byte { @@ -71,6 +69,5 @@ type L1RequestSecretTx struct { type L1InitializeSecretTx struct { EnclaveID *gethcommon.Address InitialSecret []byte - HostAddress string Attestation common.EncodedAttestationReport } diff --git a/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go b/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go index 3eb1480587..0888192084 100644 --- a/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go +++ b/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go @@ -169,7 +169,6 @@ func (c *contractLibImpl) CreateRespondSecret(tx *ethadapter.L1RespondSecretTx, tx.RequesterID, tx.AttesterSig, tx.Secret, - tx.HostAddress, verifyAttester, ) if err != nil { @@ -186,7 +185,6 @@ func (c *contractLibImpl) CreateInitializeSecret(tx *ethadapter.L1InitializeSecr InitializeSecretMethod, tx.EnclaveID, tx.InitialSecret, - tx.HostAddress, base64EncodeToString(tx.Attestation), ) if err != nil { @@ -383,20 +381,10 @@ func (c *contractLibImpl) unpackRespondSecretTx(tx *types.Transaction, method *a c.logger.Crit("could not decode responseSecret data") } - hostAddressData, found := contractCallData["hostAddress"] - if !found { - c.logger.Crit("call data not found for hostAddress") - } - hostAddressString, ok := hostAddressData.(string) - if !ok { - c.logger.Crit("could not decode hostAddress data") - } - return ðadapter.L1RespondSecretTx{ AttesterID: attesterAddr, RequesterID: requesterAddr, Secret: responseSecretBytes[:], - HostAddress: hostAddressString, } } diff --git a/go/host/container/cli.go b/go/host/container/cli.go index 51af5b8cee..819a3f831e 100644 --- a/go/host/container/cli.go +++ b/go/host/container/cli.go @@ -41,7 +41,7 @@ type HostConfigToml struct { ObscuroChainID int64 ProfilerEnabled bool L1StartHash string - SequencerID string + SequencerP2PAddress string MetricsEnabled bool MetricsHTTPPort uint UseInMemoryDB bool @@ -83,7 +83,7 @@ func ParseConfig() (*config.HostInputConfig, error) { privateKeyStr := flag.String(privateKeyName, cfg.PrivateKeyString, flagUsageMap[privateKeyName]) profilerEnabled := flag.Bool(profilerEnabledName, cfg.ProfilerEnabled, flagUsageMap[profilerEnabledName]) l1StartHash := flag.String(l1StartHashName, cfg.L1StartHash.Hex(), flagUsageMap[l1StartHashName]) - sequencerID := flag.String(sequencerIDName, cfg.SequencerID.Hex(), flagUsageMap[sequencerIDName]) + sequencerP2PAddress := flag.String(sequencerP2PAddrName, cfg.SequencerP2PAddress, flagUsageMap[sequencerP2PAddrName]) metricsEnabled := flag.Bool(metricsEnabledName, cfg.MetricsEnabled, flagUsageMap[metricsEnabledName]) metricsHTPPPort := flag.Uint(metricsHTTPPortName, cfg.MetricsHTTPPort, flagUsageMap[metricsHTTPPortName]) useInMemoryDB := flag.Bool(useInMemoryDBName, cfg.UseInMemoryDB, flagUsageMap[useInMemoryDBName]) @@ -129,7 +129,7 @@ func ParseConfig() (*config.HostInputConfig, error) { cfg.ObscuroChainID = *obscuroChainID cfg.ProfilerEnabled = *profilerEnabled cfg.L1StartHash = gethcommon.HexToHash(*l1StartHash) - cfg.SequencerID = gethcommon.HexToAddress(*sequencerID) + cfg.SequencerP2PAddress = *sequencerP2PAddress cfg.MetricsEnabled = *metricsEnabled cfg.MetricsHTTPPort = *metricsHTPPPort cfg.UseInMemoryDB = *useInMemoryDB @@ -206,7 +206,7 @@ func fileBasedConfig(configPath string) (*config.HostInputConfig, error) { ObscuroChainID: tomlConfig.ObscuroChainID, ProfilerEnabled: tomlConfig.ProfilerEnabled, L1StartHash: gethcommon.HexToHash(tomlConfig.L1StartHash), - SequencerID: gethcommon.HexToAddress(tomlConfig.SequencerID), + SequencerP2PAddress: tomlConfig.SequencerP2PAddress, MetricsEnabled: tomlConfig.MetricsEnabled, MetricsHTTPPort: tomlConfig.MetricsHTTPPort, UseInMemoryDB: tomlConfig.UseInMemoryDB, diff --git a/go/host/container/cli_flags.go b/go/host/container/cli_flags.go index 72112609d4..8fe73f711a 100644 --- a/go/host/container/cli_flags.go +++ b/go/host/container/cli_flags.go @@ -25,7 +25,7 @@ const ( obscuroChainIDName = "obscuroChainID" profilerEnabledName = "profilerEnabled" l1StartHashName = "l1Start" - sequencerIDName = "sequencerID" + sequencerP2PAddrName = "sequencerP2PAddress" metricsEnabledName = "metricsEnabled" metricsHTTPPortName = "metricsHTTPPort" useInMemoryDBName = "useInMemoryDB" @@ -65,7 +65,7 @@ func getFlagUsageMap() map[string]string { obscuroChainIDName: "An integer representing the unique chain id of the Obscuro chain (default 443)", profilerEnabledName: "Runs a profiler instance (Defaults to false)", l1StartHashName: "The L1 block hash where the management contract was deployed", - sequencerIDName: "The ID of the sequencer", + sequencerP2PAddrName: "The P2P address of the sequencer", metricsEnabledName: "Whether the metrics are enabled (Defaults to true)", metricsHTTPPortName: "The port on which the metrics are served (Defaults to 0.0.0.0:14000)", useInMemoryDBName: "Whether the host will use an in-memory DB rather than persist data", diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index d67606e261..83fa49894e 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -327,8 +327,6 @@ func (g *Guardian) provideSecret() error { g.logger.Info("Secret received") g.state.OnSecretProvided() - // we're now ready to catch up with network, sync peer list - go g.sl.P2P().RefreshPeerList() return nil } @@ -459,11 +457,7 @@ func (g *Guardian) submitL1Block(block *common.L1Block, isLatest bool) (bool, er func (g *Guardian) processL1BlockTransactions(block *common.L1Block) { // if there are any secret responses in the block we should refresh our P2P list to re-sync with the network - secretRespTxs, rollupTxs, contractAddressTxs := g.sl.L1Publisher().ExtractObscuroRelevantTransactions(block) - if len(secretRespTxs) > 0 { - // new peers may have been granted access to the network, notify p2p service to refresh its peer list - go g.sl.P2P().RefreshPeerList() - } + _, rollupTxs, contractAddressTxs := g.sl.L1Publisher().ExtractObscuroRelevantTransactions(block) for _, rollup := range rollupTxs { r, err := common.DecodeRollup(rollup.Rollup) diff --git a/go/host/host.go b/go/host/host.go index 867140058b..14b83e5c37 100644 --- a/go/host/host.go +++ b/go/host/host.go @@ -233,7 +233,6 @@ func (h *host) ObscuroConfig() (*common.ObscuroNetworkInfo, error) { ManagementContractAddress: h.config.ManagementContractAddress, L1StartHash: h.config.L1StartHash, - SequencerID: h.config.SequencerID, MessageBusAddress: h.config.MessageBusAddress, L2MessageBusAddress: *h.l2MessageBusAddress, ImportantContracts: h.services.L1Publisher().GetImportantContracts(), diff --git a/go/host/l1/publisher.go b/go/host/l1/publisher.go index 939fe253d2..1c6159b08f 100644 --- a/go/host/l1/publisher.go +++ b/go/host/l1/publisher.go @@ -115,7 +115,6 @@ func (p *Publisher) InitializeSecret(attestation *common.AttestationReport, encS EnclaveID: &attestation.EnclaveID, Attestation: encodedAttestation, InitialSecret: encSecret, - HostAddress: p.hostData.P2PPublicAddress, } initialiseSecretTx := p.mgmtContractLib.CreateInitializeSecret(l1tx) // we block here until we confirm a successful receipt. It is important this is published before the initial rollup. @@ -157,7 +156,6 @@ func (p *Publisher) PublishSecretResponse(secretResponse *common.ProducedSecretR Secret: secretResponse.Secret, RequesterID: secretResponse.RequesterID, AttesterID: secretResponse.AttesterID, - HostAddress: secretResponse.HostAddress, } // todo (#1624) - l1tx.Sign(a.attestationPubKey) doesn't matter as the waitSecret will process a tx that was reverted respondSecretTx := p.mgmtContractLib.CreateRespondSecret(l1tx, false) @@ -237,37 +235,6 @@ func (p *Publisher) PublishRollup(producedRollup *common.ExtRollup) { } } -func (p *Publisher) FetchLatestPeersList() ([]string, error) { - msg, err := p.mgmtContractLib.GetHostAddressesMsg() - if err != nil { - return nil, err - } - response, err := p.ethClient.CallContract(msg) - if err != nil { - return nil, err - } - hostAddresses, err := p.mgmtContractLib.DecodeHostAddressesResponse(response) - if err != nil { - return nil, err - } - - // We remove any duplicate addresses and our own address from the retrieved peer list - var filteredHostAddresses []string - uniqueHostKeys := make(map[string]bool) // map to track addresses we've seen already - for _, hostAddress := range hostAddresses { - // We exclude our own address. - if hostAddress == p.hostData.P2PPublicAddress { - continue - } - if _, found := uniqueHostKeys[hostAddress]; !found { - uniqueHostKeys[hostAddress] = true - filteredHostAddresses = append(filteredHostAddresses, hostAddress) - } - } - - return filteredHostAddresses, nil -} - func (p *Publisher) GetImportantContracts() map[string]gethcommon.Address { p.importantAddressesMutex.RLock() defer p.importantAddressesMutex.RUnlock() diff --git a/go/host/p2p/p2p.go b/go/host/p2p/p2p.go index e18ce9069f..c804d9d0de 100644 --- a/go/host/p2p/p2p.go +++ b/go/host/p2p/p2p.go @@ -7,9 +7,9 @@ import ( "math/big" "net" "sync" - "sync/atomic" "time" + "github.com/ten-protocol/go-ten/go/common/stopcontrol" "github.com/ten-protocol/go-ten/go/enclave/core" "github.com/pkg/errors" @@ -33,11 +33,13 @@ const ( msgTypeTx msgType = iota msgTypeBatches msgTypeBatchRequest + msgTypeRegisterForBroadcasts ) var ( - _alertPeriod = 5 * time.Minute - errUnknownSequencer = errors.New("sequencer address not known") + _alertPeriod = 5 * time.Minute + _maxPeerFailures = 3 // peer removed from broadcast pool after this many failures + _maxWaitWithoutBroadcast = 2 * time.Minute // validators will re-register for broadcasts after this period of silence ) // A P2P message's type. @@ -62,12 +64,14 @@ func NewSocketP2PLayer(config *config.HostConfig, serviceLocator p2pServiceLocat txSubscribers: subscription.NewManager[host.P2PTxHandler](), batchReqHandlers: subscription.NewManager[host.P2PBatchRequestHandler](), - sl: serviceLocator, + stopControl: stopcontrol.New(), + sl: serviceLocator, isSequencer: config.NodeType == common.Sequencer, ourBindAddress: config.P2PBindAddress, ourPublicAddress: config.P2PPublicAddress, - peerAddresses: []string{}, + sequencerAddress: config.SequencerP2PAddress, + peerAddresses: make(map[string]int), p2pTimeout: config.P2PConnectionTimeout, peerAddressesMutex: sync.RWMutex{}, @@ -86,15 +90,15 @@ type Service struct { txSubscribers *subscription.Manager[host.P2PTxHandler] batchReqHandlers *subscription.Manager[host.P2PBatchRequestHandler] - listener net.Listener - running atomic.Bool // new connections won't be accepted if this is false + listener net.Listener + stopControl *stopcontrol.StopControl sl p2pServiceLocator isSequencer bool ourBindAddress string ourPublicAddress string - peerAddresses []string + peerAddresses map[string]int // map of peer addresses to the number of times they have failed to send a message p2pTimeout time.Duration peerTracker *peerTracker @@ -102,16 +106,11 @@ type Service struct { logger gethlog.Logger peerAddressesMutex sync.RWMutex isIncomingP2PDisabled bool + sequencerAddress string + lastReceivedBroadcast time.Time // if this gets stale then validators will re-register for broadcasts } func (p *Service) Start() error { - p.running.Store(true) - - if p.isIncomingP2PDisabled { - go p.RefreshPeerList() - return nil - } - // We listen for P2P connections. listener, err := net.Listen("tcp", p.ourBindAddress) if err != nil { @@ -124,15 +123,22 @@ func (p *Service) Start() error { go p.handleConnections() - // ensure we have re-synced the peer list from management contract after startup - go p.RefreshPeerList() + if !p.isSequencer { + // validators need to register with the sequencer for broadcasts + err := p.RegisterForBroadcasts() + if err != nil { + // just log the error, retry will happen in the EnsureSubscribedToSequencer goroutine + p.logger.Error("Failed to register for broadcasts", log.ErrKey, err) + } + go p.EnsureSubscribedToSequencer() + } return nil } func (p *Service) Stop() error { p.logger.Info("Shutting down P2P.") - p.running.Store(false) + p.stopControl.Stop() if p.listener != nil { // todo immediately shutting down the listener seems to impact other hosts shutdown process time.Sleep(time.Second) @@ -169,44 +175,12 @@ func (p *Service) SubscribeForBatchRequests(handler host.P2PBatchRequestHandler) return p.batchReqHandlers.Subscribe(handler) } -// RefreshPeerList - fetches the latest peer list from L1 and updates the peerAddresses. -// Note: this is designed to be run in a separate goroutine, it will retry a few times before giving up. -func (p *Service) RefreshPeerList() { - var newPeers []string - err := retry.Do(func() error { - if !p.running.Load() { - return retry.FailFast(fmt.Errorf("p2p service is stopped - abandoning peer list refresh")) - } - - var retryErr error - newPeers, retryErr = p.sl.L1Publisher().FetchLatestPeersList() - if retryErr != nil { - p.logger.Error("failed to fetch latest peer list from L1", log.ErrKey, retryErr) - return retryErr - } - return nil - }, retry.NewTimeoutStrategy(1*time.Minute, 5*time.Second)) - if err != nil { - p.logger.Error("unable to fetch latest peer list from L1", log.ErrKey, err) - return - } - - p.peerAddressesMutex.Lock() - defer p.peerAddressesMutex.Unlock() - p.logger.Info(fmt.Sprintf("Updated peer list - old: %s new: %s", p.peerAddresses, newPeers)) - p.peerAddresses = newPeers -} - func (p *Service) SendTxToSequencer(tx common.EncryptedTx) error { if p.isSequencer { return errors.New("sequencer cannot send tx to itself") } msg := message{Sender: p.ourPublicAddress, Type: msgTypeTx, Contents: tx} - sequencer, err := p.getSequencer() - if err != nil { - return fmt.Errorf("failed to find sequencer - %w", err) - } - return p.send(msg, sequencer) + return p.send(msg, p.getSequencer()) } func (p *Service) BroadcastBatches(batches []*common.ExtBatch) error { @@ -250,11 +224,7 @@ func (p *Service) RequestBatchesFromSequencer(fromSeqNo *big.Int) error { msg := message{Sender: p.ourPublicAddress, Type: msgTypeBatchRequest, Contents: encodedBatchRequest} // todo (#718) - allow missing batches to be requested from peers other than sequencer? - sequencer, err := p.getSequencer() - if err != nil { - return fmt.Errorf("failed to find sequencer - %w", err) - } - return p.send(msg, sequencer) + return p.send(msg, p.getSequencer()) } func (p *Service) RespondToBatchRequest(requestID string, batches []*common.ExtBatch) error { @@ -278,6 +248,20 @@ func (p *Service) RespondToBatchRequest(requestID string, batches []*common.ExtB return p.send(msg, requestID) } +// RegisterForBroadcasts - called by validators to register with the sequencer for broadcasts of batch data etc. +// Validators will call this again if they stop receiving broadcasts for a period of _maxWaitWithoutBroadcast +// Sequencer will evict validators from the broadcast pool if sending fails _maxPeerFailures times +func (p *Service) RegisterForBroadcasts() error { + if p.isIncomingP2PDisabled { + return fmt.Errorf("incoming P2P is disabled, can't register for broadcasts") + } + if p.isSequencer { + return errors.New("sequencer cannot register for broadcasts") + } + msg := message{Sender: p.ourPublicAddress, Type: msgTypeRegisterForBroadcasts} + return p.send(msg, p.getSequencer()) +} + // HealthCheck returns whether the p2p is considered healthy // Currently it considers itself unhealthy // if there's more than 100 failures on a given fail type @@ -306,10 +290,11 @@ func (p *Service) verifyHealth() error { // Listens for connections and handles them in a separate goroutine. func (p *Service) handleConnections() { - for p.running.Load() { + for !p.stopControl.IsStopping() { + // blocks here until a connection is made conn, err := p.listener.Accept() if err != nil { - if p.running.Load() { + if !p.stopControl.IsStopping() { p.logger.Debug("Could not form P2P connection", log.ErrKey, err) } return @@ -360,6 +345,7 @@ func (p *Service) handle(conn net.Conn) { break } // todo - check the batch signature + p.lastReceivedBroadcast = time.Now() for _, batchSubs := range p.batchSubscribers.Subscribers() { go batchSubs.HandleBatches(batchMsg.Batches, batchMsg.IsLive) } @@ -370,6 +356,15 @@ func (p *Service) handle(conn net.Conn) { } // this is an incoming request, p2p service is responsible for finding the response and returning it go p.handleBatchRequest(msg.Contents) + case msgTypeRegisterForBroadcasts: + if !p.isSequencer { + p.logger.Error("received register for broadcasts from peer, but not a sequencer node") + return + } + // add the peer to the list of peers + p.peerAddressesMutex.Lock() + p.peerAddresses[msg.Sender] = 0 + p.peerAddressesMutex.Unlock() } p.peerTracker.receivedPeerMsg(msg.Sender) } @@ -381,10 +376,12 @@ func (p *Service) broadcast(msg message) error { return fmt.Errorf("could not encode message to send to peers. Cause: %w", err) } - // clone current known addresses + // clone currently known addresses p.peerAddressesMutex.RLock() currentAddresses := make([]string, len(p.peerAddresses)) - copy(currentAddresses, p.peerAddresses) + for address := range p.peerAddresses { + currentAddresses = append(currentAddresses, address) + } p.peerAddressesMutex.RUnlock() for _, address := range currentAddresses { @@ -393,6 +390,23 @@ func (p *Service) broadcast(msg message) error { err := p.sendBytesWithRetry(closureAddr, msgEncoded) if err != nil { p.logger.Debug("Could not send message to peer", "peer", closureAddr, log.ErrKey, err) + + // record address failure + p.peerAddressesMutex.Lock() + // if address still exists, increment failure count + if _, ok := p.peerAddresses[closureAddr]; ok { + p.peerAddresses[closureAddr]++ + // if address has failed too many times, remove it + if p.peerAddresses[closureAddr] > _maxPeerFailures { + delete(p.peerAddresses, closureAddr) + } + } + p.peerAddressesMutex.Unlock() + } else { + // if message was sent successfully, reset failure count + p.peerAddressesMutex.Lock() + p.peerAddresses[closureAddr] = 0 + p.peerAddressesMutex.Unlock() } }() } @@ -453,16 +467,8 @@ func (p *Service) sendBytes(address string, tx []byte) error { return nil } -// Retrieves the sequencer's address. -// todo (#718) - use better method to identify the sequencer? -func (p *Service) getSequencer() (string, error) { - p.peerAddressesMutex.RLock() - defer p.peerAddressesMutex.RUnlock() - - if len(p.peerAddresses) == 0 { - return "", errUnknownSequencer - } - return p.peerAddresses[0], nil +func (p *Service) getSequencer() string { + return p.sequencerAddress } func (p *Service) handleBatchRequest(encodedBatchRequest common.EncodedBatchRequest) { @@ -478,3 +484,24 @@ func (p *Service) handleBatchRequest(encodedBatchRequest common.EncodedBatchRequ go requestHandler.HandleBatchRequest(batchRequest.Requester, batchRequest.FromSeqNo) } } + +// EnsureSubscribedToSequencer - validators need to register with the sequencer for broadcasts +// Note: this should be run **once** in a goroutine, it will re-request registration if we stop receiving broadcasts +func (p *Service) EnsureSubscribedToSequencer() { + // this continues to run until the host is stopped + for { + select { + case <-p.stopControl.Done(): + return // host is stopping + case <-time.After(_maxWaitWithoutBroadcast / 2): + if time.Since(p.lastReceivedBroadcast) > _maxWaitWithoutBroadcast { + p.logger.Info("No broadcast received from sequencer, re-registering.") + err := p.RegisterForBroadcasts() + if err != nil { + // just log the error, we'll retry on the next iteration + p.logger.Error("Failed to re-register for broadcasts", log.ErrKey, err) + } + } + } + } +} diff --git a/go/host/rpc/clientapi/client_api_obscuro.go b/go/host/rpc/clientapi/client_api_obscuro.go index 3762826fbe..64c969a313 100644 --- a/go/host/rpc/clientapi/client_api_obscuro.go +++ b/go/host/rpc/clientapi/client_api_obscuro.go @@ -37,7 +37,6 @@ func (api *ObscuroAPI) Config() (*ChecksumFormattedObscuroNetworkConfig, error) type ChecksumFormattedObscuroNetworkConfig struct { ManagementContractAddress gethcommon.AddressEIP55 L1StartHash gethcommon.Hash - SequencerID gethcommon.AddressEIP55 MessageBusAddress gethcommon.AddressEIP55 L2MessageBusAddress gethcommon.AddressEIP55 ImportantContracts map[string]gethcommon.AddressEIP55 // map of contract name to address @@ -51,7 +50,6 @@ func checksumFormatted(info *common.ObscuroNetworkInfo) *ChecksumFormattedObscur return &ChecksumFormattedObscuroNetworkConfig{ ManagementContractAddress: gethcommon.AddressEIP55(info.ManagementContractAddress), L1StartHash: info.L1StartHash, - SequencerID: gethcommon.AddressEIP55(info.SequencerID), MessageBusAddress: gethcommon.AddressEIP55(info.MessageBusAddress), L2MessageBusAddress: gethcommon.AddressEIP55(info.L2MessageBusAddress), ImportantContracts: importantContracts, diff --git a/go/node/cmd/cli.go b/go/node/cmd/cli.go index 83fdf0e716..c21e6bf1f0 100644 --- a/go/node/cmd/cli.go +++ b/go/node/cmd/cli.go @@ -29,7 +29,7 @@ type NodeConfigCLI struct { enclaveWSPort int privateKey string hostID string - sequencerID string + sequencerP2PAddr string managementContractAddr string messageBusContractAddr string l1Start string @@ -69,7 +69,7 @@ func ParseConfigCLI() *NodeConfigCLI { enclaveWSPort := flag.Int(enclaveWSPortFlag, 11001, flagUsageMap[enclaveWSPortFlag]) privateKey := flag.String(privateKeyFlag, "", flagUsageMap[privateKeyFlag]) hostID := flag.String(hostIDFlag, "", flagUsageMap[hostIDFlag]) - sequencerID := flag.String(sequencerIDFlag, "", flagUsageMap[sequencerIDFlag]) + sequencerP2PAddr := flag.String(sequencerP2PAddrFlag, "", flagUsageMap[sequencerP2PAddrFlag]) managementContractAddr := flag.String(managementContractAddrFlag, "", flagUsageMap[managementContractAddrFlag]) messageBusContractAddr := flag.String(messageBusContractAddrFlag, "", flagUsageMap[messageBusContractAddrFlag]) l1Start := flag.String(l1StartBlockFlag, "", flagUsageMap[l1StartBlockFlag]) @@ -99,7 +99,7 @@ func ParseConfigCLI() *NodeConfigCLI { cfg.enclaveWSPort = *enclaveWSPort cfg.privateKey = *privateKey cfg.hostID = *hostID - cfg.sequencerID = *sequencerID + cfg.sequencerP2PAddr = *sequencerP2PAddr cfg.managementContractAddr = *managementContractAddr cfg.messageBusContractAddr = *messageBusContractAddr cfg.l1Start = *l1Start diff --git a/go/node/cmd/cli_flags.go b/go/node/cmd/cli_flags.go index 2840fc0158..fffec345ae 100644 --- a/go/node/cmd/cli_flags.go +++ b/go/node/cmd/cli_flags.go @@ -18,7 +18,7 @@ const ( enclaveHTTPPortFlag = "enclave_http_port" enclaveWSPortFlag = "enclave_WS_port" privateKeyFlag = "private_key" - sequencerIDFlag = "sequencer_id" + sequencerP2PAddrFlag = "sequencer_addr" managementContractAddrFlag = "management_contract_addr" messageBusContractAddrFlag = "message_bus_contract_addr" l1StartBlockFlag = "l1_start" @@ -52,7 +52,7 @@ func getFlagUsageMap() map[string]string { enclaveHTTPPortFlag: "Enclave's http bound port", enclaveWSPortFlag: "Enclave's WS bound port", privateKeyFlag: "L1 and L2 private key used in the node", - sequencerIDFlag: "The 20 bytes of the address of the sequencer for this network", + sequencerP2PAddrFlag: "The address for the sequencer p2p server", managementContractAddrFlag: "The management contract address on the L1", messageBusContractAddrFlag: "The address of the L1 message bus contract owned by the management contract.", l1StartBlockFlag: "The block hash on the L1 where the management contract was deployed", diff --git a/go/node/cmd/main.go b/go/node/cmd/main.go index 1061a0ccc5..f3f0852cb7 100644 --- a/go/node/cmd/main.go +++ b/go/node/cmd/main.go @@ -24,7 +24,6 @@ func main() { node.WithEnclaveWSPort(cliConfig.enclaveWSPort), // 81 node.WithPrivateKey(cliConfig.privateKey), // "8ead642ca80dadb0f346a66cd6aa13e08a8ac7b5c6f7578d4bac96f5db01ac99" node.WithHostID(cliConfig.hostID), // "0x0654D8B60033144D567f25bF41baC1FB0D60F23B"), - node.WithSequencerID(cliConfig.sequencerID), // "0x0654D8B60033144D567f25bF41baC1FB0D60F23B"), node.WithManagementContractAddress(cliConfig.managementContractAddr), // "0xeDa66Cc53bd2f26896f6Ba6b736B1Ca325DE04eF"), node.WithMessageBusContractAddress(cliConfig.messageBusContractAddr), // "0xFD03804faCA2538F4633B3EBdfEfc38adafa259B"), node.WithL1Start(cliConfig.l1Start), diff --git a/go/node/config.go b/go/node/config.go index 7d0398c655..8187bed389 100644 --- a/go/node/config.go +++ b/go/node/config.go @@ -27,7 +27,7 @@ type Config struct { hostImage string nodeType string l1WSURL string - sequencerID string + sequencerP2PAddr string privateKey string hostP2PPort int hostID string @@ -83,7 +83,7 @@ func (c *Config) ToEnclaveConfig() *config.EnclaveConfig { cfg.MessageBusAddress = gethcommon.HexToAddress(c.messageBusContractAddress) cfg.ManagementContractAddress = gethcommon.HexToAddress(c.managementContractAddr) - cfg.SequencerID = gethcommon.HexToAddress(c.sequencerID) + cfg.SequencerP2PAddress = c.sequencerP2PAddr cfg.HostID = gethcommon.HexToAddress(c.hostID) cfg.HostAddress = fmt.Sprintf("127.0.0.1:%d", c.hostP2PPort) cfg.LogPath = testlog.LogFile() @@ -123,7 +123,7 @@ func (c *Config) ToHostConfig() *config.HostInputConfig { cfg.MetricsEnabled = false cfg.DebugNamespaceEnabled = c.debugNamespaceEnabled cfg.LogLevel = c.logLevel - cfg.SequencerID = gethcommon.HexToAddress(c.sequencerID) + cfg.SequencerP2PAddress = c.sequencerP2PAddr cfg.IsInboundP2PDisabled = c.isInboundP2PDisabled cfg.L1BlockTime = c.l1BlockTime cfg.L1ChainID = int64(c.l1ChainID) @@ -200,9 +200,9 @@ func WithManagementContractAddress(s string) Option { } } -func WithSequencerID(s string) Option { +func WithSequencerP2PAddr(s string) Option { return func(c *Config) { - c.sequencerID = s + c.sequencerP2PAddr = s } } diff --git a/go/node/docker_node.go b/go/node/docker_node.go index 8c2e39195b..cca9ad556d 100644 --- a/go/node/docker_node.go +++ b/go/node/docker_node.go @@ -99,7 +99,7 @@ func (d *DockerNode) startHost() error { "-managementContractAddress", d.cfg.managementContractAddr, "-messageBusContractAddress", d.cfg.messageBusContractAddress, "-l1Start", d.cfg.l1Start, - "-sequencerID", d.cfg.sequencerID, + "-sequencerP2PAddress", d.cfg.sequencerP2PAddr, "-privateKey", d.cfg.privateKey, "-clientRPCHost", "0.0.0.0", "-logPath", "sys_out", @@ -172,7 +172,6 @@ func (d *DockerNode) startEnclave() error { "-nodeType", d.cfg.nodeType, "-managementContractAddress", d.cfg.managementContractAddr, "-hostAddress", d.cfg.hostPublicP2PAddr, - "-sequencerID", d.cfg.sequencerID, "-messageBusAddress", d.cfg.messageBusContractAddress, "-profilerEnabled=false", "-useInMemoryDB=false", diff --git a/integration/common/constants.go b/integration/common/constants.go index e50ec3daf8..d786d7b40e 100644 --- a/integration/common/constants.go +++ b/integration/common/constants.go @@ -78,7 +78,6 @@ func DefaultEnclaveConfig() *config.EnclaveConfig { SqliteDBPath: "", ProfilerEnabled: false, MinGasPrice: big.NewInt(params.InitialBaseFee), - SequencerID: gethcommon.BytesToAddress([]byte("")), ObscuroGenesis: "", DebugNamespaceEnabled: false, MaxBatchSize: 1024 * 55, diff --git a/integration/simulation/devnetwork/config.go b/integration/simulation/devnetwork/config.go index 9f000f03c3..ded2b59190 100644 --- a/integration/simulation/devnetwork/config.go +++ b/integration/simulation/devnetwork/config.go @@ -5,7 +5,6 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ten-protocol/go-ten/go/enclave/genesis" "github.com/ten-protocol/go-ten/go/wallet" @@ -36,9 +35,7 @@ type TenConfig struct { TenGatewayEnabled bool NumSeqEnclaves int - // these are typically set based on the L1 network and wallet setup provided L1BlockTime time.Duration - SequencerID common.Address } func DefaultTenConfig() *TenConfig { @@ -78,7 +75,6 @@ func LocalDevNetwork(tenConfigOpts ...TenConfigOption) *InMemDevNetwork { func NewInMemDevNetwork(tenConfig *TenConfig, l1Network L1Network, nodeOpL1Wallets *params.SimWallets) *InMemDevNetwork { // update tenConfig references to be consistent with the L1 setup tenConfig.L1BlockTime = l1Network.GetBlockTime() - tenConfig.SequencerID = nodeOpL1Wallets.NodeWallets[0].Address() // sequencer wallet address is its ID for now return &InMemDevNetwork{ networkWallets: nodeOpL1Wallets, diff --git a/integration/simulation/devnetwork/node.go b/integration/simulation/devnetwork/node.go index cb938e95c0..9258f50f21 100644 --- a/integration/simulation/devnetwork/node.go +++ b/integration/simulation/devnetwork/node.go @@ -123,6 +123,7 @@ func (n *InMemNodeOperator) createHostContainer() *hostcontainer.HostContainer { p2pPort := n.config.PortStart + integration.DefaultHostP2pOffset + n.operatorIdx p2pAddr := fmt.Sprintf("%s:%d", network.Localhost, p2pPort) + seqP2PAddr := fmt.Sprintf("%s:%d", network.Localhost, n.config.PortStart+integration.DefaultHostP2pOffset) hostConfig := &config.HostConfig{ ID: n.l1Wallet.Address(), @@ -143,7 +144,7 @@ func (n *InMemNodeOperator) createHostContainer() *hostcontainer.HostContainer { L1ChainID: integration.EthereumChainID, ObscuroChainID: integration.TenChainID, L1StartHash: n.l1Data.TenStartBlock, - SequencerID: n.config.SequencerID, + SequencerP2PAddress: seqP2PAddr, // Can provide the postgres db host if testing against a local DB instance UseInMemoryDB: true, DebugNamespaceEnabled: true, @@ -195,7 +196,6 @@ func (n *InMemNodeOperator) createEnclaveContainer(idx int) *enclavecontainer.En } enclaveConfig := &config.EnclaveConfig{ HostID: n.l1Wallet.Address(), - SequencerID: n.config.SequencerID, HostAddress: hostAddr, Address: enclaveAddr, NodeType: enclaveType, diff --git a/integration/simulation/network/network_utils.go b/integration/simulation/network/network_utils.go index 3564cff4f0..57ca8d2fd1 100644 --- a/integration/simulation/network/network_utils.go +++ b/integration/simulation/network/network_utils.go @@ -70,7 +70,6 @@ func createInMemObscuroNode( HasClientRPCHTTP: false, P2PPublicAddress: fmt.Sprintf("%d", id), L1StartHash: l1StartBlk, - SequencerID: gethcommon.BigToAddress(big.NewInt(0)), ManagementContractAddress: *mgtContractAddress, MessageBusAddress: l1BusAddress, BatchInterval: batchInterval, @@ -80,7 +79,6 @@ func createInMemObscuroNode( } enclaveConfig := &config.EnclaveConfig{ - SequencerID: gethcommon.BigToAddress(big.NewInt(0)), HostID: hostConfig.ID, NodeType: nodeType, L1ChainID: integration.EthereumChainID, diff --git a/integration/simulation/network/socket.go b/integration/simulation/network/socket.go index 7831bfeab6..f3e1765e5e 100644 --- a/integration/simulation/network/socket.go +++ b/integration/simulation/network/socket.go @@ -94,7 +94,7 @@ func (n *networkOfSocketNodes) Create(simParams *params.SimParams, _ *stats.Stat node.WithGenesis(i == 0), node.WithHostID(hostAddress.String()), node.WithPrivateKey(privateKey), - node.WithSequencerID(seqHostAddress.String()), + node.WithSequencerP2PAddr(fmt.Sprintf("127.0.0.1:%d", simParams.StartPort+integration.DefaultHostP2pOffset)), node.WithEnclaveWSPort(simParams.StartPort+integration.DefaultEnclaveOffset+i), node.WithHostWSPort(simParams.StartPort+integration.DefaultHostRPCWSOffset+i), node.WithHostHTTPPort(simParams.StartPort+integration.DefaultHostRPCHTTPOffset+i), diff --git a/integration/smartcontract/smartcontracts_test.go b/integration/smartcontract/smartcontracts_test.go index 0b016390cb..4426836f20 100644 --- a/integration/smartcontract/smartcontracts_test.go +++ b/integration/smartcontract/smartcontracts_test.go @@ -1,7 +1,6 @@ package smartcontract import ( - "reflect" "testing" "time" @@ -107,7 +106,6 @@ func TestManagementContract(t *testing.T) { "attestedNodesCreateRollup": attestedNodesCreateRollup, "nonAttestedNodesCannotAttest": nonAttestedNodesCannotAttest, "newlyAttestedNodesCanAttest": newlyAttestedNodesCanAttest, - "attestedNodeHostAddressesAreStored": attestedNodeHostAddressesAreStored, } { t.Run(name, func(t *testing.T) { bytecode, err := constants.Bytecode() @@ -461,96 +459,3 @@ func newlyAttestedNodesCanAttest(t *testing.T, mgmtContractLib *debugMgmtContrac t.Error("expected agg to be attested") } } - -// attestedNodeHostAddressesAreStored agg A initializes the network, agg B becomes attested, agg C is rejected. Only A and B's host addresses are stored in the management contract -func attestedNodeHostAddressesAreStored(t *testing.T, mgmtContractLib *debugMgmtContractLib, w *debugWallet, client ethadapter.EthClient) { - aggAHostAddr := "aggAHostAddr" - aggBHostAddr := "aggBHostAddr" - - secretBytes := []byte("This is super random") - // crypto.GenerateKey will generate a PK that does not play along this test - aggAPrivateKey, err := crypto.ToECDSA(hexutil.MustDecode("0xc0083389f7a5925b662f8982080ced523bcc5e5dc33c6b1eaf11e288183e3c95")) - if err != nil { - t.Fatal(err) - } - aggAID := crypto.PubkeyToAddress(aggAPrivateKey.PublicKey) - - // the aggregator starts the network - txData := mgmtContractLib.CreateInitializeSecret( - ðadapter.L1InitializeSecretTx{ - EnclaveID: &aggAID, - InitialSecret: secretBytes, - HostAddress: aggAHostAddr, - }, - ) - - _, receipt, err := w.AwaitedSignAndSendTransaction(client, txData) - if err != nil { - t.Error(err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - t.Errorf("transaction should have succeeded, expected %d got %d", 1, receipt.Status) - } - - // agg b requests the secret - aggBPrivateKey, err := crypto.ToECDSA(hexutil.MustDecode("0x0d3de78eb7f26239a7ee32895a0b0898699ad3c4e5a910d0ffd65f707d2e63c4")) - if err != nil { - t.Fatal(err) - } - aggBID := crypto.PubkeyToAddress(aggBPrivateKey.PublicKey) - - txData = mgmtContractLib.CreateRequestSecret( - ðadapter.L1RequestSecretTx{ - Attestation: datagenerator.RandomBytes(10), - }, - ) - _, receipt, err = w.AwaitedSignAndSendTransaction(client, txData) - if err != nil { - t.Error(err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - t.Errorf("transaction should have succeeded, expected %d got %d", 1, receipt.Status) - } - - // agg C requests the secret - txData = mgmtContractLib.CreateRequestSecret( - ðadapter.L1RequestSecretTx{ - Attestation: datagenerator.RandomBytes(10), - }, - ) - - _, receipt, err = w.AwaitedSignAndSendTransaction(client, txData) - if err != nil { - t.Error(err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - t.Errorf("transaction should have succeeded, expected %d got %d", 1, receipt.Status) - } - - // Agg A only responds to Agg B request - txData = mgmtContractLib.CreateRespondSecret( - (ðadapter.L1RespondSecretTx{ - Secret: secretBytes, - RequesterID: aggBID, - AttesterID: aggAID, - HostAddress: aggBHostAddr, - }).Sign(aggAPrivateKey), - true, - ) - _, receipt, err = w.AwaitedSignAndSendTransaction(client, txData) - if err != nil { - t.Error(err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - t.Errorf("transaction should have succeeded, expected %d got %d", 1, receipt.Status) - } - - hostAddresses, err := mgmtContractLib.GenContract.GetHostAddresses(nil) - if err != nil { - t.Error(err) - } - expectedHostAddresses := []string{aggAHostAddr, aggBHostAddr} - if !reflect.DeepEqual(hostAddresses, expectedHostAddresses) { - t.Errorf("expected to find host addresses %s, found %s", expectedHostAddresses, hostAddresses) - } -} diff --git a/integration/tenscan/tenscan_test.go b/integration/tenscan/tenscan_test.go index 4024f55699..21d0d6f3e9 100644 --- a/integration/tenscan/tenscan_test.go +++ b/integration/tenscan/tenscan_test.go @@ -198,7 +198,6 @@ func TestTenscan(t *testing.T) { configFetchObj := configFetch{} err = json.Unmarshal(body, &configFetchObj) assert.NoError(t, err) - assert.NotEqual(t, configFetchObj.Item.SequencerID, gethcommon.Address{}) err = tenScanContainer.Stop() assert.NoError(t, err) diff --git a/testnet/launcher/docker.go b/testnet/launcher/docker.go index 8939b12af4..95f6bcfc81 100644 --- a/testnet/launcher/docker.go +++ b/testnet/launcher/docker.go @@ -56,7 +56,7 @@ func (t *Testnet) Start() error { node.WithHostPublicP2PAddr("sequencer-host:15000"), node.WithPrivateKey("8ead642ca80dadb0f346a66cd6aa13e08a8ac7b5c6f7578d4bac96f5db01ac99"), node.WithHostID("0x0654D8B60033144D567f25bF41baC1FB0D60F23B"), - node.WithSequencerID("0x0654D8B60033144D567f25bF41baC1FB0D60F23B"), + node.WithSequencerP2PAddr("sequencer-host:15000"), node.WithManagementContractAddress(networkConfig.ManagementContractAddress), node.WithMessageBusContractAddress(networkConfig.MessageBusAddress), node.WithL1Start(networkConfig.L1StartHash), @@ -96,7 +96,7 @@ func (t *Testnet) Start() error { node.WithHostPublicP2PAddr("validator-host:15010"), node.WithPrivateKey("ebca545772d6438bbbe1a16afbed455733eccf96157b52384f1722ea65ccfa89"), node.WithHostID("0x2f7fCaA34b38871560DaAD6Db4596860744e1e8A"), - node.WithSequencerID("0x0654D8B60033144D567f25bF41baC1FB0D60F23B"), + node.WithSequencerP2PAddr("sequencer-host:15000"), node.WithManagementContractAddress(networkConfig.ManagementContractAddress), node.WithMessageBusContractAddress(networkConfig.MessageBusAddress), node.WithL1Start(networkConfig.L1StartHash),