diff --git a/.changeset/flat-bags-chew.md b/.changeset/flat-bags-chew.md new file mode 100644 index 0000000000000..99965900a00f5 --- /dev/null +++ b/.changeset/flat-bags-chew.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/gas-oracle': patch +--- + +Fix the gas oracle gas price prometheus metric diff --git a/.changeset/friendly-queens-rule.md b/.changeset/friendly-queens-rule.md new file mode 100644 index 0000000000000..8cc674b44ee2b --- /dev/null +++ b/.changeset/friendly-queens-rule.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/proxyd': patch +--- + +Add support for additional SSL certificates in Docker container diff --git a/.changeset/nice-steaks-hammer.md b/.changeset/nice-steaks-hammer.md new file mode 100644 index 0000000000000..3e5cb7f8f8b36 --- /dev/null +++ b/.changeset/nice-steaks-hammer.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/data-transport-layer': patch +--- + +Handle unprotected transactions diff --git a/.changeset/old-moons-invite.md b/.changeset/old-moons-invite.md new file mode 100644 index 0000000000000..897af9a3ff959 --- /dev/null +++ b/.changeset/old-moons-invite.md @@ -0,0 +1,6 @@ +--- +'@eth-optimism/integration-tests': patch +'@eth-optimism/l2geth': patch +--- + +Allow for unprotected transactions diff --git a/.changeset/poor-avocados-arrive.md b/.changeset/poor-avocados-arrive.md new file mode 100644 index 0000000000000..9e00a2d9c2916 --- /dev/null +++ b/.changeset/poor-avocados-arrive.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/core-utils': patch +--- + +Clean up the L1 => L2 address aliasing utilities diff --git a/.changeset/swift-ways-glow.md b/.changeset/swift-ways-glow.md new file mode 100644 index 0000000000000..b1cccc8af9f3d --- /dev/null +++ b/.changeset/swift-ways-glow.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/proxyd': minor +--- + +Updated metrics, support local rate limiter diff --git a/.github/workflows/batch-submitter.yml b/.github/workflows/batch-submitter.yml index fe07388215536..75cf632d4ede9 100644 --- a/.github/workflows/batch-submitter.yml +++ b/.github/workflows/batch-submitter.yml @@ -12,11 +12,6 @@ on: pull_request: paths: - 'go/batch-submitter/*' - branches: - - 'master' - - 'develop' - - '*rc' - - 'regenesis/*' workflow_dispatch: defaults: @@ -31,7 +26,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.16.x - name: Checkout code uses: actions/checkout@v2 @@ -40,4 +35,4 @@ jobs: run: make - name: Test - run: make test + run: make test diff --git a/.github/workflows/gas-oracle.yml b/.github/workflows/gas-oracle.yml index 394161b303b1a..e100243e7fee9 100644 --- a/.github/workflows/gas-oracle.yml +++ b/.github/workflows/gas-oracle.yml @@ -12,11 +12,6 @@ on: pull_request: paths: - 'go/gas-oracle/**' - branches: - - 'master' - - 'develop' - - '*rc' - - 'regenesis/*' workflow_dispatch: defaults: diff --git a/.github/workflows/geth.yml b/.github/workflows/geth.yml index 87f7399121d1f..6f38d47405bbc 100644 --- a/.github/workflows/geth.yml +++ b/.github/workflows/geth.yml @@ -1,6 +1,5 @@ name: geth unit tests - on: push: paths: @@ -13,11 +12,6 @@ on: pull_request: paths: - 'l2geth/**' - branches: - - 'master' - - 'develop' - - '*rc' - - 'regenesis/*' workflow_dispatch: defaults: diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 75b6f70cad115..d4f17c3adec75 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -13,11 +13,6 @@ on: paths: - 'go/gas-oracle/**' - 'go/batch-submitter/**' - branches: - - 'master' - - 'develop' - - '*rc' - - 'regenesis/*' jobs: golangci: name: lint diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9803ac8bcb051..6ce8310aa82e5 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -55,7 +55,7 @@ jobs: if: failure() uses: jwalton/gh-docker-logs@v1 with: - images: 'ethereumoptimism/hardhat,ops_deployer,ops_dtl,ethereumoptimism/l2geth,ethereumoptimism/message-relayer,ops_batch_submitter,ethereumoptimism/l2geth,ops_integration_tests' + images: 'ethereumoptimism/hardhat,ops_deployer,ops_dtl,ops_l2geth,ethereumoptimism/message-relayer,ops_batch_submitter,ops_replica,ops_integration_tests' dest: '/home/runner/logs' - name: Tar logs diff --git a/go/batch-submitter/Makefile b/go/batch-submitter/Makefile index 81fb7d69bc288..c656506d373c1 100644 --- a/go/batch-submitter/Makefile +++ b/go/batch-submitter/Makefile @@ -7,6 +7,9 @@ LDFLAGSSTRING +=-X main.GitDate=$(GITDATE) LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION) LDFLAGS := -ldflags "$(LDFLAGSSTRING)" +CTC_ABI_ARTIFACT := ../../packages/contracts/artifacts/contracts/L1/rollup/CanonicalTransactionChain.sol/CanonicalTransactionChain.json +SCC_ABI_ARTIFACT := ../../packages/contracts/artifacts/contracts/L1/rollup/StateCommitmentChain.sol/StateCommitmentChain.json + batch-submitter: env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/batch-submitter @@ -19,8 +22,45 @@ test: lint: golangci-lint run ./... +bindings: bindings-ctc bindings-scc + +bindings-ctc: + $(eval temp := $(shell mktemp)) + + cat $(CTC_ABI_ARTIFACT) \ + | jq -r .bytecode > $(temp) + + cat $(CTC_ABI_ARTIFACT) \ + | jq .abi \ + | abigen --pkg ctc \ + --abi - \ + --out bindings/ctc/canonical_transaction_chain.go \ + --type CanonicalTransactionChain \ + --bin $(temp) + + rm $(temp) + +bindings-scc: + $(eval temp := $(shell mktemp)) + + cat $(SCC_ABI_ARTIFACT) \ + | jq -r .bytecode > $(temp) + + cat $(SCC_ABI_ARTIFACT) \ + | jq .abi \ + | abigen --pkg scc \ + --abi - \ + --out bindings/scc/state_commitment_chain.go \ + --type StateCommitmentChain \ + --bin $(temp) + + rm $(temp) + .PHONY: \ batch-submitter \ + bindings \ + bindings-ctc \ + bindings-scc \ clean \ test \ lint diff --git a/go/batch-submitter/bindings/ctc/canonical_transaction_chain.go b/go/batch-submitter/bindings/ctc/canonical_transaction_chain.go new file mode 100644 index 0000000000000..0162c735055df --- /dev/null +++ b/go/batch-submitter/bindings/ctc/canonical_transaction_chain.go @@ -0,0 +1,1522 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ctc + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Lib_OVMCodecQueueElement is an auto generated low-level Go binding around an user-defined struct. +type Lib_OVMCodecQueueElement struct { + TransactionHash [32]byte + Timestamp *big.Int + BlockNumber *big.Int +} + +// CanonicalTransactionChainMetaData contains all meta data concerning the CanonicalTransactionChain contract. +var CanonicalTransactionChainMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_maxTransactionGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l2GasDiscountDivisor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_enqueueGasCost\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"l2GasDiscountDivisor\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"enqueueGasCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"enqueueL2GasPrepaid\",\"type\":\"uint256\"}],\"name\":\"L2GasParamsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_startingQueueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numQueueElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"name\":\"QueueBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_startingQueueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numQueueElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"name\":\"SequencerBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_batchRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_batchSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_prevTotalElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"TransactionBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1TxOrigin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_queueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"TransactionEnqueued\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_ROLLUP_TX_SIZE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_ROLLUP_TX_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"appendSequencerBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batches\",\"outputs\":[{\"internalType\":\"contractIChainStorageContainer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"enqueue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enqueueGasCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enqueueL2GasPrepaid\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastBlockNumber\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastTimestamp\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNextQueueIndex\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumPendingQueueElements\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"getQueueElement\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint40\",\"name\":\"timestamp\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"blockNumber\",\"type\":\"uint40\"}],\"internalType\":\"structLib_OVMCodec.QueueElement\",\"name\":\"_element\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getQueueLength\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBatches\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalBatches\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalElements\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2GasDiscountDivisor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contractLib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxTransactionGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2GasDiscountDivisor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_enqueueGasCost\",\"type\":\"uint256\"}],\"name\":\"setGasParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b5060405162001a9838038062001a9883398101604081905261003191610072565b600080546001600160a01b0319166001600160a01b03861617905560048390556002829055600181905561006581836100bd565b600355506100ea92505050565b6000806000806080858703121561008857600080fd5b84516001600160a01b038116811461009f57600080fd5b60208601516040870151606090970151919890975090945092505050565b60008160001904831182151516156100e557634e487b7160e01b600052601160045260246000fd5b500290565b61199e80620000fa6000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c8063876ed5cb116100cd578063d0f8934411610081578063e654b1fb11610066578063e654b1fb146102c0578063edcc4a45146102c9578063f722b41a146102dc57600080fd5b8063d0f89344146102b0578063e561dddc146102b857600080fd5b8063b8f77005116100b2578063b8f7700514610297578063ccf987c81461029f578063cfdf677e146102a857600080fd5b8063876ed5cb146102855780638d38c6c11461028e57600080fd5b80635ae6256d1161012457806378f4b2f21161010957806378f4b2f2146102645780637a167a8a1461026e5780637aa63a861461027d57600080fd5b80635ae6256d146102475780636fee07e01461024f57600080fd5b80632a7f18be116101555780632a7f18be146101d25780633789977014610216578063461a44781461023457600080fd5b80630b3dfa9714610171578063299ca4781461018d575b600080fd5b61017a60035481565b6040519081526020015b60405180910390f35b6000546101ad9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610184565b6101e56101e03660046113e5565b6102e4565b604080518251815260208084015164ffffffffff908116918301919091529282015190921690820152606001610184565b61021e610362565b60405164ffffffffff9091168152602001610184565b6101ad6102423660046114c1565b610376565b61021e610423565b61026261025d366004611537565b610437565b005b61017a620186a081565b60055464ffffffffff1661021e565b61017a610899565b61017a61c35081565b61017a60045481565b60065461021e565b61017a60025481565b6101ad6108b4565b6102626108dc565b61017a610df8565b61017a60015481565b6102626102d73660046115a4565b610e7f565b61021e611016565b604080516060810182526000808252602082018190529181019190915260068281548110610314576103146115c6565b6000918252602091829020604080516060810182526002909302909101805483526001015464ffffffffff808216948401949094526501000000000090049092169181019190915292915050565b60008061036d611032565b50949350505050565b600080546040517fbf40fac100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063bf40fac1906103cd908590600401611660565b60206040518083038186803b1580156103e557600080fd5b505afa1580156103f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041d919061167a565b92915050565b60008061042e611032565b95945050505050565b61c350815111156104cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f5472616e73616374696f6e20646174612073697a652065786365656473206d6160448201527f78696d756d20666f7220726f6c6c7570207472616e73616374696f6e2e00000060648201526084015b60405180910390fd5b600454821115610561576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f5472616e73616374696f6e20676173206c696d69742065786365656473206d6160448201527f78696d756d20666f7220726f6c6c7570207472616e73616374696f6e2e00000060648201526084016104c6565b620186a08210156105f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5472616e73616374696f6e20676173206c696d697420746f6f206c6f7720746f60448201527f20656e71756575652e000000000000000000000000000000000000000000000060648201526084016104c6565b6003548211156106dc5760006002546003548461061191906116c6565b61061b91906116dd565b905060005a90508181116106b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e73756666696369656e742067617320666f72204c322072617465206c696d60448201527f6974696e67206275726e2e00000000000000000000000000000000000000000060648201526084016104c6565b60005b825a6106c090846116c6565b10156106d857806106d081611718565b9150506106b4565b5050505b6000333214156106ed575033610706565b5033731111000000000000000000000000000000001111015b60008185858560405160200161071f9493929190611751565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012060608401835280845264ffffffffff42811692850192835243811693850193845260068054600181810183556000838152975160029092027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f81019290925594517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4090910180549651841665010000000000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090971691909316179490941790559154919350610825916116c6565b9050808673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f4b388aecf9fa6cc92253704e5975a6129a4f735bdbd99567df4ed0094ee4ceb58888426040516108899392919061179a565b60405180910390a4505050505050565b6000806108a4611032565b50505064ffffffffff1692915050565b60006108d760405180606001604052806021815260200161194860219139610376565b905090565b60043560d81c60093560e890811c90600c35901c6108f8610899565b8364ffffffffff161461098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f41637475616c20626174636820737461727420696e64657820646f6573206e6f60448201527f74206d6174636820657870656374656420737461727420696e6465782e00000060648201526084016104c6565b6109cb6040518060400160405280600d81526020017f4f564d5f53657175656e63657200000000000000000000000000000000000000815250610376565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c6564206279207460448201527f68652053657175656e6365722e0000000000000000000000000000000000000060648201526084016104c6565b6000610a9762ffffff831660106117c3565b610aa290600f611800565b905064ffffffffff8116361015610b3b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4e6f7420656e6f756768204261746368436f6e74657874732070726f7669646560448201527f642e00000000000000000000000000000000000000000000000000000000000060648201526084016104c6565b6005546040805160808101825260008082526020820181905291810182905260608101829052909164ffffffffff169060005b8562ffffff168163ffffffff161015610bcc576000610b928263ffffffff166110ed565b8051909350839150610ba49086611818565b9450826020015184610bb69190611840565b9350508080610bc490611860565b915050610b6e565b5060065464ffffffffff83161115610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f417474656d7074656420746f20617070656e64206d6f726520656c656d656e7460448201527f73207468616e2061726520617661696c61626c6520696e20746865207175657560648201527f652e000000000000000000000000000000000000000000000000000000000000608482015260a4016104c6565b6000610c9d8462ffffff8916611884565b63ffffffff169050600080836020015160001415610cc657505060408201516060830151610d37565b60006006610cd56001886118a9565b64ffffffffff1681548110610cec57610cec6115c6565b6000918252602091829020604080516060810182526002909302909101805483526001015464ffffffffff808216948401859052650100000000009091041691018190529093509150505b610d5b610d456001436116c6565b408a62ffffff168564ffffffffff168585611174565b7f602f1aeac0ca2e7a13e281a9ef0ad7838542712ce16780fa2ecffd351f05f899610d8684876118a9565b84610d8f610899565b6040805164ffffffffff94851681529390921660208401529082015260600160405180910390a15050600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000001664ffffffffff949094169390931790925550505050505050565b6000610e026108b4565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d791906118c7565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d919061167a565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f6e6c792063616c6c61626c6520627920746865204275726e2041646d696e2e60448201526064016104c6565b60018190556002829055610fc581836117c3565b60038190556002546001546040805192835260208301919091528101919091527fc6ed75e96b8b18b71edc1a6e82a9d677f8268c774a262c624eeb2cf0a8b3e07e9060600160405180910390a15050565b6005546006546000916108d79164ffffffffff909116906118a9565b60008060008060006110426108b4565b73ffffffffffffffffffffffffffffffffffffffff1663ccf8f9696040518163ffffffff1660e01b815260040160206040518083038186803b15801561108757600080fd5b505afa15801561109b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bf91906118e0565b64ffffffffff602882901c811697605083901c82169750607883901c8216965060a09290921c169350915050565b6111186040518060800160405280600081526020016000815260200160008152602001600081525090565b60006111256010846117c3565b61113090600f611800565b60408051608081018252823560e890811c82526003840135901c6020820152600683013560d890811c92820192909252600b90920135901c60608201529392505050565b600061117e6108b4565b905060008061118b611032565b50509150915060006040518060a001604052808573ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b1580156111e457600080fd5b505afa1580156111f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121c91906118c7565b81526020018a81526020018981526020018464ffffffffff16815260200160405180602001604052806000815250815250905080600001517f127186556e7be68c7e31263195225b4de02820707889540969f62c05cf73525e82602001518360400151846060015185608001516040516112999493929190611922565b60405180910390a260006112ac8261139f565b905060006112e78360400151866112c39190611840565b6112cd8b87611840565b602890811b9190911760508b901b1760788a901b17901b90565b6040517f2015276c000000000000000000000000000000000000000000000000000000008152600481018490527fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000008216602482015290915073ffffffffffffffffffffffffffffffffffffffff871690632015276c90604401600060405180830381600087803b15801561137a57600080fd5b505af115801561138e573d6000803e3d6000fd5b505050505050505050505050505050565b600081602001518260400151836060015184608001516040516020016113c89493929190611922565b604051602081830303815290604052805190602001209050919050565b6000602082840312156113f757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115611448576114486113fe565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561148e5761148e6113fe565b816040528093508581528686860111156114a757600080fd5b858560208301376000602087830101525050509392505050565b6000602082840312156114d357600080fd5b813567ffffffffffffffff8111156114ea57600080fd5b8201601f810184136114fb57600080fd5b61150a8482356020840161142d565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461153457600080fd5b50565b60008060006060848603121561154c57600080fd5b833561155781611512565b925060208401359150604084013567ffffffffffffffff81111561157a57600080fd5b8401601f8101861361158b57600080fd5b61159a8682356020840161142d565b9150509250925092565b600080604083850312156115b757600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815180845260005b8181101561161b576020818501810151868301820152016115ff565b8181111561162d576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061167360208301846115f5565b9392505050565b60006020828403121561168c57600080fd5b815161167381611512565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156116d8576116d8611697565b500390565b600082611713577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561174a5761174a611697565b5060010190565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152508360408301526080606083015261179060808301846115f5565b9695505050505050565b8381526060602082015260006117b360608301856115f5565b9050826040830152949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156117fb576117fb611697565b500290565b6000821982111561181357611813611697565b500190565b600063ffffffff80831681851680830382111561183757611837611697565b01949350505050565b600064ffffffffff80831681851680830382111561183757611837611697565b600063ffffffff8083168181141561187a5761187a611697565b6001019392505050565b600063ffffffff838116908316818110156118a1576118a1611697565b039392505050565b600064ffffffffff838116908316818110156118a1576118a1611697565b6000602082840312156118d957600080fd5b5051919050565b6000602082840312156118f257600080fd5b81517fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000008116811461167357600080fd5b84815283602082015282604082015260806060820152600061179060808301846115f556fe436861696e53746f72616765436f6e7461696e65722d4354432d62617463686573a2646970667358221220e14033f9f98984edb3353943a45655d112afab7b0a7aa8401f8826506d85b00164736f6c63430008090033", +} + +// CanonicalTransactionChainABI is the input ABI used to generate the binding from. +// Deprecated: Use CanonicalTransactionChainMetaData.ABI instead. +var CanonicalTransactionChainABI = CanonicalTransactionChainMetaData.ABI + +// CanonicalTransactionChainBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use CanonicalTransactionChainMetaData.Bin instead. +var CanonicalTransactionChainBin = CanonicalTransactionChainMetaData.Bin + +// DeployCanonicalTransactionChain deploys a new Ethereum contract, binding an instance of CanonicalTransactionChain to it. +func DeployCanonicalTransactionChain(auth *bind.TransactOpts, backend bind.ContractBackend, _libAddressManager common.Address, _maxTransactionGasLimit *big.Int, _l2GasDiscountDivisor *big.Int, _enqueueGasCost *big.Int) (common.Address, *types.Transaction, *CanonicalTransactionChain, error) { + parsed, err := CanonicalTransactionChainMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(CanonicalTransactionChainBin), backend, _libAddressManager, _maxTransactionGasLimit, _l2GasDiscountDivisor, _enqueueGasCost) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &CanonicalTransactionChain{CanonicalTransactionChainCaller: CanonicalTransactionChainCaller{contract: contract}, CanonicalTransactionChainTransactor: CanonicalTransactionChainTransactor{contract: contract}, CanonicalTransactionChainFilterer: CanonicalTransactionChainFilterer{contract: contract}}, nil +} + +// CanonicalTransactionChain is an auto generated Go binding around an Ethereum contract. +type CanonicalTransactionChain struct { + CanonicalTransactionChainCaller // Read-only binding to the contract + CanonicalTransactionChainTransactor // Write-only binding to the contract + CanonicalTransactionChainFilterer // Log filterer for contract events +} + +// CanonicalTransactionChainCaller is an auto generated read-only Go binding around an Ethereum contract. +type CanonicalTransactionChainCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CanonicalTransactionChainTransactor is an auto generated write-only Go binding around an Ethereum contract. +type CanonicalTransactionChainTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CanonicalTransactionChainFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type CanonicalTransactionChainFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// CanonicalTransactionChainSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type CanonicalTransactionChainSession struct { + Contract *CanonicalTransactionChain // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CanonicalTransactionChainCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type CanonicalTransactionChainCallerSession struct { + Contract *CanonicalTransactionChainCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// CanonicalTransactionChainTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type CanonicalTransactionChainTransactorSession struct { + Contract *CanonicalTransactionChainTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// CanonicalTransactionChainRaw is an auto generated low-level Go binding around an Ethereum contract. +type CanonicalTransactionChainRaw struct { + Contract *CanonicalTransactionChain // Generic contract binding to access the raw methods on +} + +// CanonicalTransactionChainCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type CanonicalTransactionChainCallerRaw struct { + Contract *CanonicalTransactionChainCaller // Generic read-only contract binding to access the raw methods on +} + +// CanonicalTransactionChainTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type CanonicalTransactionChainTransactorRaw struct { + Contract *CanonicalTransactionChainTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewCanonicalTransactionChain creates a new instance of CanonicalTransactionChain, bound to a specific deployed contract. +func NewCanonicalTransactionChain(address common.Address, backend bind.ContractBackend) (*CanonicalTransactionChain, error) { + contract, err := bindCanonicalTransactionChain(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &CanonicalTransactionChain{CanonicalTransactionChainCaller: CanonicalTransactionChainCaller{contract: contract}, CanonicalTransactionChainTransactor: CanonicalTransactionChainTransactor{contract: contract}, CanonicalTransactionChainFilterer: CanonicalTransactionChainFilterer{contract: contract}}, nil +} + +// NewCanonicalTransactionChainCaller creates a new read-only instance of CanonicalTransactionChain, bound to a specific deployed contract. +func NewCanonicalTransactionChainCaller(address common.Address, caller bind.ContractCaller) (*CanonicalTransactionChainCaller, error) { + contract, err := bindCanonicalTransactionChain(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &CanonicalTransactionChainCaller{contract: contract}, nil +} + +// NewCanonicalTransactionChainTransactor creates a new write-only instance of CanonicalTransactionChain, bound to a specific deployed contract. +func NewCanonicalTransactionChainTransactor(address common.Address, transactor bind.ContractTransactor) (*CanonicalTransactionChainTransactor, error) { + contract, err := bindCanonicalTransactionChain(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &CanonicalTransactionChainTransactor{contract: contract}, nil +} + +// NewCanonicalTransactionChainFilterer creates a new log filterer instance of CanonicalTransactionChain, bound to a specific deployed contract. +func NewCanonicalTransactionChainFilterer(address common.Address, filterer bind.ContractFilterer) (*CanonicalTransactionChainFilterer, error) { + contract, err := bindCanonicalTransactionChain(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &CanonicalTransactionChainFilterer{contract: contract}, nil +} + +// bindCanonicalTransactionChain binds a generic wrapper to an already deployed contract. +func bindCanonicalTransactionChain(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(CanonicalTransactionChainABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_CanonicalTransactionChain *CanonicalTransactionChainRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CanonicalTransactionChain.Contract.CanonicalTransactionChainCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_CanonicalTransactionChain *CanonicalTransactionChainRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.CanonicalTransactionChainTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_CanonicalTransactionChain *CanonicalTransactionChainRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.CanonicalTransactionChainTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _CanonicalTransactionChain.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.contract.Transact(opts, method, params...) +} + +// MAXROLLUPTXSIZE is a free data retrieval call binding the contract method 0x876ed5cb. +// +// Solidity: function MAX_ROLLUP_TX_SIZE() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) MAXROLLUPTXSIZE(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "MAX_ROLLUP_TX_SIZE") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXROLLUPTXSIZE is a free data retrieval call binding the contract method 0x876ed5cb. +// +// Solidity: function MAX_ROLLUP_TX_SIZE() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) MAXROLLUPTXSIZE() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.MAXROLLUPTXSIZE(&_CanonicalTransactionChain.CallOpts) +} + +// MAXROLLUPTXSIZE is a free data retrieval call binding the contract method 0x876ed5cb. +// +// Solidity: function MAX_ROLLUP_TX_SIZE() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) MAXROLLUPTXSIZE() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.MAXROLLUPTXSIZE(&_CanonicalTransactionChain.CallOpts) +} + +// MINROLLUPTXGAS is a free data retrieval call binding the contract method 0x78f4b2f2. +// +// Solidity: function MIN_ROLLUP_TX_GAS() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) MINROLLUPTXGAS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "MIN_ROLLUP_TX_GAS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINROLLUPTXGAS is a free data retrieval call binding the contract method 0x78f4b2f2. +// +// Solidity: function MIN_ROLLUP_TX_GAS() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) MINROLLUPTXGAS() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.MINROLLUPTXGAS(&_CanonicalTransactionChain.CallOpts) +} + +// MINROLLUPTXGAS is a free data retrieval call binding the contract method 0x78f4b2f2. +// +// Solidity: function MIN_ROLLUP_TX_GAS() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) MINROLLUPTXGAS() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.MINROLLUPTXGAS(&_CanonicalTransactionChain.CallOpts) +} + +// Batches is a free data retrieval call binding the contract method 0xcfdf677e. +// +// Solidity: function batches() view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) Batches(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "batches") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Batches is a free data retrieval call binding the contract method 0xcfdf677e. +// +// Solidity: function batches() view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) Batches() (common.Address, error) { + return _CanonicalTransactionChain.Contract.Batches(&_CanonicalTransactionChain.CallOpts) +} + +// Batches is a free data retrieval call binding the contract method 0xcfdf677e. +// +// Solidity: function batches() view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) Batches() (common.Address, error) { + return _CanonicalTransactionChain.Contract.Batches(&_CanonicalTransactionChain.CallOpts) +} + +// EnqueueGasCost is a free data retrieval call binding the contract method 0xe654b1fb. +// +// Solidity: function enqueueGasCost() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) EnqueueGasCost(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "enqueueGasCost") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EnqueueGasCost is a free data retrieval call binding the contract method 0xe654b1fb. +// +// Solidity: function enqueueGasCost() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) EnqueueGasCost() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.EnqueueGasCost(&_CanonicalTransactionChain.CallOpts) +} + +// EnqueueGasCost is a free data retrieval call binding the contract method 0xe654b1fb. +// +// Solidity: function enqueueGasCost() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) EnqueueGasCost() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.EnqueueGasCost(&_CanonicalTransactionChain.CallOpts) +} + +// EnqueueL2GasPrepaid is a free data retrieval call binding the contract method 0x0b3dfa97. +// +// Solidity: function enqueueL2GasPrepaid() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) EnqueueL2GasPrepaid(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "enqueueL2GasPrepaid") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EnqueueL2GasPrepaid is a free data retrieval call binding the contract method 0x0b3dfa97. +// +// Solidity: function enqueueL2GasPrepaid() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) EnqueueL2GasPrepaid() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.EnqueueL2GasPrepaid(&_CanonicalTransactionChain.CallOpts) +} + +// EnqueueL2GasPrepaid is a free data retrieval call binding the contract method 0x0b3dfa97. +// +// Solidity: function enqueueL2GasPrepaid() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) EnqueueL2GasPrepaid() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.EnqueueL2GasPrepaid(&_CanonicalTransactionChain.CallOpts) +} + +// GetLastBlockNumber is a free data retrieval call binding the contract method 0x5ae6256d. +// +// Solidity: function getLastBlockNumber() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetLastBlockNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getLastBlockNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetLastBlockNumber is a free data retrieval call binding the contract method 0x5ae6256d. +// +// Solidity: function getLastBlockNumber() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetLastBlockNumber() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetLastBlockNumber(&_CanonicalTransactionChain.CallOpts) +} + +// GetLastBlockNumber is a free data retrieval call binding the contract method 0x5ae6256d. +// +// Solidity: function getLastBlockNumber() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetLastBlockNumber() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetLastBlockNumber(&_CanonicalTransactionChain.CallOpts) +} + +// GetLastTimestamp is a free data retrieval call binding the contract method 0x37899770. +// +// Solidity: function getLastTimestamp() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetLastTimestamp(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getLastTimestamp") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetLastTimestamp is a free data retrieval call binding the contract method 0x37899770. +// +// Solidity: function getLastTimestamp() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetLastTimestamp() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetLastTimestamp(&_CanonicalTransactionChain.CallOpts) +} + +// GetLastTimestamp is a free data retrieval call binding the contract method 0x37899770. +// +// Solidity: function getLastTimestamp() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetLastTimestamp() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetLastTimestamp(&_CanonicalTransactionChain.CallOpts) +} + +// GetNextQueueIndex is a free data retrieval call binding the contract method 0x7a167a8a. +// +// Solidity: function getNextQueueIndex() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetNextQueueIndex(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getNextQueueIndex") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNextQueueIndex is a free data retrieval call binding the contract method 0x7a167a8a. +// +// Solidity: function getNextQueueIndex() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetNextQueueIndex() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetNextQueueIndex(&_CanonicalTransactionChain.CallOpts) +} + +// GetNextQueueIndex is a free data retrieval call binding the contract method 0x7a167a8a. +// +// Solidity: function getNextQueueIndex() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetNextQueueIndex() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetNextQueueIndex(&_CanonicalTransactionChain.CallOpts) +} + +// GetNumPendingQueueElements is a free data retrieval call binding the contract method 0xf722b41a. +// +// Solidity: function getNumPendingQueueElements() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetNumPendingQueueElements(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getNumPendingQueueElements") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNumPendingQueueElements is a free data retrieval call binding the contract method 0xf722b41a. +// +// Solidity: function getNumPendingQueueElements() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetNumPendingQueueElements() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetNumPendingQueueElements(&_CanonicalTransactionChain.CallOpts) +} + +// GetNumPendingQueueElements is a free data retrieval call binding the contract method 0xf722b41a. +// +// Solidity: function getNumPendingQueueElements() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetNumPendingQueueElements() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetNumPendingQueueElements(&_CanonicalTransactionChain.CallOpts) +} + +// GetQueueElement is a free data retrieval call binding the contract method 0x2a7f18be. +// +// Solidity: function getQueueElement(uint256 _index) view returns((bytes32,uint40,uint40) _element) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetQueueElement(opts *bind.CallOpts, _index *big.Int) (Lib_OVMCodecQueueElement, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getQueueElement", _index) + + if err != nil { + return *new(Lib_OVMCodecQueueElement), err + } + + out0 := *abi.ConvertType(out[0], new(Lib_OVMCodecQueueElement)).(*Lib_OVMCodecQueueElement) + + return out0, err + +} + +// GetQueueElement is a free data retrieval call binding the contract method 0x2a7f18be. +// +// Solidity: function getQueueElement(uint256 _index) view returns((bytes32,uint40,uint40) _element) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetQueueElement(_index *big.Int) (Lib_OVMCodecQueueElement, error) { + return _CanonicalTransactionChain.Contract.GetQueueElement(&_CanonicalTransactionChain.CallOpts, _index) +} + +// GetQueueElement is a free data retrieval call binding the contract method 0x2a7f18be. +// +// Solidity: function getQueueElement(uint256 _index) view returns((bytes32,uint40,uint40) _element) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetQueueElement(_index *big.Int) (Lib_OVMCodecQueueElement, error) { + return _CanonicalTransactionChain.Contract.GetQueueElement(&_CanonicalTransactionChain.CallOpts, _index) +} + +// GetQueueLength is a free data retrieval call binding the contract method 0xb8f77005. +// +// Solidity: function getQueueLength() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetQueueLength(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getQueueLength") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetQueueLength is a free data retrieval call binding the contract method 0xb8f77005. +// +// Solidity: function getQueueLength() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetQueueLength() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetQueueLength(&_CanonicalTransactionChain.CallOpts) +} + +// GetQueueLength is a free data retrieval call binding the contract method 0xb8f77005. +// +// Solidity: function getQueueLength() view returns(uint40) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetQueueLength() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetQueueLength(&_CanonicalTransactionChain.CallOpts) +} + +// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. +// +// Solidity: function getTotalBatches() view returns(uint256 _totalBatches) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetTotalBatches(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getTotalBatches") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. +// +// Solidity: function getTotalBatches() view returns(uint256 _totalBatches) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetTotalBatches() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetTotalBatches(&_CanonicalTransactionChain.CallOpts) +} + +// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. +// +// Solidity: function getTotalBatches() view returns(uint256 _totalBatches) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetTotalBatches() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetTotalBatches(&_CanonicalTransactionChain.CallOpts) +} + +// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. +// +// Solidity: function getTotalElements() view returns(uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) GetTotalElements(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "getTotalElements") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. +// +// Solidity: function getTotalElements() view returns(uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) GetTotalElements() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetTotalElements(&_CanonicalTransactionChain.CallOpts) +} + +// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. +// +// Solidity: function getTotalElements() view returns(uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) GetTotalElements() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.GetTotalElements(&_CanonicalTransactionChain.CallOpts) +} + +// L2GasDiscountDivisor is a free data retrieval call binding the contract method 0xccf987c8. +// +// Solidity: function l2GasDiscountDivisor() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) L2GasDiscountDivisor(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "l2GasDiscountDivisor") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// L2GasDiscountDivisor is a free data retrieval call binding the contract method 0xccf987c8. +// +// Solidity: function l2GasDiscountDivisor() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) L2GasDiscountDivisor() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.L2GasDiscountDivisor(&_CanonicalTransactionChain.CallOpts) +} + +// L2GasDiscountDivisor is a free data retrieval call binding the contract method 0xccf987c8. +// +// Solidity: function l2GasDiscountDivisor() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) L2GasDiscountDivisor() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.L2GasDiscountDivisor(&_CanonicalTransactionChain.CallOpts) +} + +// LibAddressManager is a free data retrieval call binding the contract method 0x299ca478. +// +// Solidity: function libAddressManager() view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) LibAddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "libAddressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// LibAddressManager is a free data retrieval call binding the contract method 0x299ca478. +// +// Solidity: function libAddressManager() view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) LibAddressManager() (common.Address, error) { + return _CanonicalTransactionChain.Contract.LibAddressManager(&_CanonicalTransactionChain.CallOpts) +} + +// LibAddressManager is a free data retrieval call binding the contract method 0x299ca478. +// +// Solidity: function libAddressManager() view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) LibAddressManager() (common.Address, error) { + return _CanonicalTransactionChain.Contract.LibAddressManager(&_CanonicalTransactionChain.CallOpts) +} + +// MaxTransactionGasLimit is a free data retrieval call binding the contract method 0x8d38c6c1. +// +// Solidity: function maxTransactionGasLimit() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) MaxTransactionGasLimit(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "maxTransactionGasLimit") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxTransactionGasLimit is a free data retrieval call binding the contract method 0x8d38c6c1. +// +// Solidity: function maxTransactionGasLimit() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) MaxTransactionGasLimit() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.MaxTransactionGasLimit(&_CanonicalTransactionChain.CallOpts) +} + +// MaxTransactionGasLimit is a free data retrieval call binding the contract method 0x8d38c6c1. +// +// Solidity: function maxTransactionGasLimit() view returns(uint256) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) MaxTransactionGasLimit() (*big.Int, error) { + return _CanonicalTransactionChain.Contract.MaxTransactionGasLimit(&_CanonicalTransactionChain.CallOpts) +} + +// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// +// Solidity: function resolve(string _name) view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainCaller) Resolve(opts *bind.CallOpts, _name string) (common.Address, error) { + var out []interface{} + err := _CanonicalTransactionChain.contract.Call(opts, &out, "resolve", _name) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// +// Solidity: function resolve(string _name) view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) Resolve(_name string) (common.Address, error) { + return _CanonicalTransactionChain.Contract.Resolve(&_CanonicalTransactionChain.CallOpts, _name) +} + +// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// +// Solidity: function resolve(string _name) view returns(address) +func (_CanonicalTransactionChain *CanonicalTransactionChainCallerSession) Resolve(_name string) (common.Address, error) { + return _CanonicalTransactionChain.Contract.Resolve(&_CanonicalTransactionChain.CallOpts, _name) +} + +// AppendSequencerBatch is a paid mutator transaction binding the contract method 0xd0f89344. +// +// Solidity: function appendSequencerBatch() returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactor) AppendSequencerBatch(opts *bind.TransactOpts) (*types.Transaction, error) { + return _CanonicalTransactionChain.contract.Transact(opts, "appendSequencerBatch") +} + +// AppendSequencerBatch is a paid mutator transaction binding the contract method 0xd0f89344. +// +// Solidity: function appendSequencerBatch() returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) AppendSequencerBatch() (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.AppendSequencerBatch(&_CanonicalTransactionChain.TransactOpts) +} + +// AppendSequencerBatch is a paid mutator transaction binding the contract method 0xd0f89344. +// +// Solidity: function appendSequencerBatch() returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactorSession) AppendSequencerBatch() (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.AppendSequencerBatch(&_CanonicalTransactionChain.TransactOpts) +} + +// Enqueue is a paid mutator transaction binding the contract method 0x6fee07e0. +// +// Solidity: function enqueue(address _target, uint256 _gasLimit, bytes _data) returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactor) Enqueue(opts *bind.TransactOpts, _target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { + return _CanonicalTransactionChain.contract.Transact(opts, "enqueue", _target, _gasLimit, _data) +} + +// Enqueue is a paid mutator transaction binding the contract method 0x6fee07e0. +// +// Solidity: function enqueue(address _target, uint256 _gasLimit, bytes _data) returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) Enqueue(_target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.Enqueue(&_CanonicalTransactionChain.TransactOpts, _target, _gasLimit, _data) +} + +// Enqueue is a paid mutator transaction binding the contract method 0x6fee07e0. +// +// Solidity: function enqueue(address _target, uint256 _gasLimit, bytes _data) returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactorSession) Enqueue(_target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.Enqueue(&_CanonicalTransactionChain.TransactOpts, _target, _gasLimit, _data) +} + +// SetGasParams is a paid mutator transaction binding the contract method 0xedcc4a45. +// +// Solidity: function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactor) SetGasParams(opts *bind.TransactOpts, _l2GasDiscountDivisor *big.Int, _enqueueGasCost *big.Int) (*types.Transaction, error) { + return _CanonicalTransactionChain.contract.Transact(opts, "setGasParams", _l2GasDiscountDivisor, _enqueueGasCost) +} + +// SetGasParams is a paid mutator transaction binding the contract method 0xedcc4a45. +// +// Solidity: function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainSession) SetGasParams(_l2GasDiscountDivisor *big.Int, _enqueueGasCost *big.Int) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.SetGasParams(&_CanonicalTransactionChain.TransactOpts, _l2GasDiscountDivisor, _enqueueGasCost) +} + +// SetGasParams is a paid mutator transaction binding the contract method 0xedcc4a45. +// +// Solidity: function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost) returns() +func (_CanonicalTransactionChain *CanonicalTransactionChainTransactorSession) SetGasParams(_l2GasDiscountDivisor *big.Int, _enqueueGasCost *big.Int) (*types.Transaction, error) { + return _CanonicalTransactionChain.Contract.SetGasParams(&_CanonicalTransactionChain.TransactOpts, _l2GasDiscountDivisor, _enqueueGasCost) +} + +// CanonicalTransactionChainL2GasParamsUpdatedIterator is returned from FilterL2GasParamsUpdated and is used to iterate over the raw logs and unpacked data for L2GasParamsUpdated events raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainL2GasParamsUpdatedIterator struct { + Event *CanonicalTransactionChainL2GasParamsUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CanonicalTransactionChainL2GasParamsUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainL2GasParamsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainL2GasParamsUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CanonicalTransactionChainL2GasParamsUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CanonicalTransactionChainL2GasParamsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CanonicalTransactionChainL2GasParamsUpdated represents a L2GasParamsUpdated event raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainL2GasParamsUpdated struct { + L2GasDiscountDivisor *big.Int + EnqueueGasCost *big.Int + EnqueueL2GasPrepaid *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterL2GasParamsUpdated is a free log retrieval operation binding the contract event 0xc6ed75e96b8b18b71edc1a6e82a9d677f8268c774a262c624eeb2cf0a8b3e07e. +// +// Solidity: event L2GasParamsUpdated(uint256 l2GasDiscountDivisor, uint256 enqueueGasCost, uint256 enqueueL2GasPrepaid) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) FilterL2GasParamsUpdated(opts *bind.FilterOpts) (*CanonicalTransactionChainL2GasParamsUpdatedIterator, error) { + + logs, sub, err := _CanonicalTransactionChain.contract.FilterLogs(opts, "L2GasParamsUpdated") + if err != nil { + return nil, err + } + return &CanonicalTransactionChainL2GasParamsUpdatedIterator{contract: _CanonicalTransactionChain.contract, event: "L2GasParamsUpdated", logs: logs, sub: sub}, nil +} + +// WatchL2GasParamsUpdated is a free log subscription operation binding the contract event 0xc6ed75e96b8b18b71edc1a6e82a9d677f8268c774a262c624eeb2cf0a8b3e07e. +// +// Solidity: event L2GasParamsUpdated(uint256 l2GasDiscountDivisor, uint256 enqueueGasCost, uint256 enqueueL2GasPrepaid) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) WatchL2GasParamsUpdated(opts *bind.WatchOpts, sink chan<- *CanonicalTransactionChainL2GasParamsUpdated) (event.Subscription, error) { + + logs, sub, err := _CanonicalTransactionChain.contract.WatchLogs(opts, "L2GasParamsUpdated") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CanonicalTransactionChainL2GasParamsUpdated) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "L2GasParamsUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseL2GasParamsUpdated is a log parse operation binding the contract event 0xc6ed75e96b8b18b71edc1a6e82a9d677f8268c774a262c624eeb2cf0a8b3e07e. +// +// Solidity: event L2GasParamsUpdated(uint256 l2GasDiscountDivisor, uint256 enqueueGasCost, uint256 enqueueL2GasPrepaid) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) ParseL2GasParamsUpdated(log types.Log) (*CanonicalTransactionChainL2GasParamsUpdated, error) { + event := new(CanonicalTransactionChainL2GasParamsUpdated) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "L2GasParamsUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CanonicalTransactionChainQueueBatchAppendedIterator is returned from FilterQueueBatchAppended and is used to iterate over the raw logs and unpacked data for QueueBatchAppended events raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainQueueBatchAppendedIterator struct { + Event *CanonicalTransactionChainQueueBatchAppended // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CanonicalTransactionChainQueueBatchAppendedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainQueueBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainQueueBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CanonicalTransactionChainQueueBatchAppendedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CanonicalTransactionChainQueueBatchAppendedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CanonicalTransactionChainQueueBatchAppended represents a QueueBatchAppended event raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainQueueBatchAppended struct { + StartingQueueIndex *big.Int + NumQueueElements *big.Int + TotalElements *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterQueueBatchAppended is a free log retrieval operation binding the contract event 0x64d7f508348c70dea42d5302a393987e4abc20e45954ab3f9d320207751956f0. +// +// Solidity: event QueueBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) FilterQueueBatchAppended(opts *bind.FilterOpts) (*CanonicalTransactionChainQueueBatchAppendedIterator, error) { + + logs, sub, err := _CanonicalTransactionChain.contract.FilterLogs(opts, "QueueBatchAppended") + if err != nil { + return nil, err + } + return &CanonicalTransactionChainQueueBatchAppendedIterator{contract: _CanonicalTransactionChain.contract, event: "QueueBatchAppended", logs: logs, sub: sub}, nil +} + +// WatchQueueBatchAppended is a free log subscription operation binding the contract event 0x64d7f508348c70dea42d5302a393987e4abc20e45954ab3f9d320207751956f0. +// +// Solidity: event QueueBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) WatchQueueBatchAppended(opts *bind.WatchOpts, sink chan<- *CanonicalTransactionChainQueueBatchAppended) (event.Subscription, error) { + + logs, sub, err := _CanonicalTransactionChain.contract.WatchLogs(opts, "QueueBatchAppended") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CanonicalTransactionChainQueueBatchAppended) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "QueueBatchAppended", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseQueueBatchAppended is a log parse operation binding the contract event 0x64d7f508348c70dea42d5302a393987e4abc20e45954ab3f9d320207751956f0. +// +// Solidity: event QueueBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) ParseQueueBatchAppended(log types.Log) (*CanonicalTransactionChainQueueBatchAppended, error) { + event := new(CanonicalTransactionChainQueueBatchAppended) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "QueueBatchAppended", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CanonicalTransactionChainSequencerBatchAppendedIterator is returned from FilterSequencerBatchAppended and is used to iterate over the raw logs and unpacked data for SequencerBatchAppended events raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainSequencerBatchAppendedIterator struct { + Event *CanonicalTransactionChainSequencerBatchAppended // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CanonicalTransactionChainSequencerBatchAppendedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainSequencerBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainSequencerBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CanonicalTransactionChainSequencerBatchAppendedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CanonicalTransactionChainSequencerBatchAppendedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CanonicalTransactionChainSequencerBatchAppended represents a SequencerBatchAppended event raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainSequencerBatchAppended struct { + StartingQueueIndex *big.Int + NumQueueElements *big.Int + TotalElements *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSequencerBatchAppended is a free log retrieval operation binding the contract event 0x602f1aeac0ca2e7a13e281a9ef0ad7838542712ce16780fa2ecffd351f05f899. +// +// Solidity: event SequencerBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) FilterSequencerBatchAppended(opts *bind.FilterOpts) (*CanonicalTransactionChainSequencerBatchAppendedIterator, error) { + + logs, sub, err := _CanonicalTransactionChain.contract.FilterLogs(opts, "SequencerBatchAppended") + if err != nil { + return nil, err + } + return &CanonicalTransactionChainSequencerBatchAppendedIterator{contract: _CanonicalTransactionChain.contract, event: "SequencerBatchAppended", logs: logs, sub: sub}, nil +} + +// WatchSequencerBatchAppended is a free log subscription operation binding the contract event 0x602f1aeac0ca2e7a13e281a9ef0ad7838542712ce16780fa2ecffd351f05f899. +// +// Solidity: event SequencerBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) WatchSequencerBatchAppended(opts *bind.WatchOpts, sink chan<- *CanonicalTransactionChainSequencerBatchAppended) (event.Subscription, error) { + + logs, sub, err := _CanonicalTransactionChain.contract.WatchLogs(opts, "SequencerBatchAppended") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CanonicalTransactionChainSequencerBatchAppended) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "SequencerBatchAppended", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSequencerBatchAppended is a log parse operation binding the contract event 0x602f1aeac0ca2e7a13e281a9ef0ad7838542712ce16780fa2ecffd351f05f899. +// +// Solidity: event SequencerBatchAppended(uint256 _startingQueueIndex, uint256 _numQueueElements, uint256 _totalElements) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) ParseSequencerBatchAppended(log types.Log) (*CanonicalTransactionChainSequencerBatchAppended, error) { + event := new(CanonicalTransactionChainSequencerBatchAppended) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "SequencerBatchAppended", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CanonicalTransactionChainTransactionBatchAppendedIterator is returned from FilterTransactionBatchAppended and is used to iterate over the raw logs and unpacked data for TransactionBatchAppended events raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainTransactionBatchAppendedIterator struct { + Event *CanonicalTransactionChainTransactionBatchAppended // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CanonicalTransactionChainTransactionBatchAppendedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainTransactionBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainTransactionBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CanonicalTransactionChainTransactionBatchAppendedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CanonicalTransactionChainTransactionBatchAppendedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CanonicalTransactionChainTransactionBatchAppended represents a TransactionBatchAppended event raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainTransactionBatchAppended struct { + BatchIndex *big.Int + BatchRoot [32]byte + BatchSize *big.Int + PrevTotalElements *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransactionBatchAppended is a free log retrieval operation binding the contract event 0x127186556e7be68c7e31263195225b4de02820707889540969f62c05cf73525e. +// +// Solidity: event TransactionBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) FilterTransactionBatchAppended(opts *bind.FilterOpts, _batchIndex []*big.Int) (*CanonicalTransactionChainTransactionBatchAppendedIterator, error) { + + var _batchIndexRule []interface{} + for _, _batchIndexItem := range _batchIndex { + _batchIndexRule = append(_batchIndexRule, _batchIndexItem) + } + + logs, sub, err := _CanonicalTransactionChain.contract.FilterLogs(opts, "TransactionBatchAppended", _batchIndexRule) + if err != nil { + return nil, err + } + return &CanonicalTransactionChainTransactionBatchAppendedIterator{contract: _CanonicalTransactionChain.contract, event: "TransactionBatchAppended", logs: logs, sub: sub}, nil +} + +// WatchTransactionBatchAppended is a free log subscription operation binding the contract event 0x127186556e7be68c7e31263195225b4de02820707889540969f62c05cf73525e. +// +// Solidity: event TransactionBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) WatchTransactionBatchAppended(opts *bind.WatchOpts, sink chan<- *CanonicalTransactionChainTransactionBatchAppended, _batchIndex []*big.Int) (event.Subscription, error) { + + var _batchIndexRule []interface{} + for _, _batchIndexItem := range _batchIndex { + _batchIndexRule = append(_batchIndexRule, _batchIndexItem) + } + + logs, sub, err := _CanonicalTransactionChain.contract.WatchLogs(opts, "TransactionBatchAppended", _batchIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CanonicalTransactionChainTransactionBatchAppended) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "TransactionBatchAppended", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransactionBatchAppended is a log parse operation binding the contract event 0x127186556e7be68c7e31263195225b4de02820707889540969f62c05cf73525e. +// +// Solidity: event TransactionBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) ParseTransactionBatchAppended(log types.Log) (*CanonicalTransactionChainTransactionBatchAppended, error) { + event := new(CanonicalTransactionChainTransactionBatchAppended) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "TransactionBatchAppended", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// CanonicalTransactionChainTransactionEnqueuedIterator is returned from FilterTransactionEnqueued and is used to iterate over the raw logs and unpacked data for TransactionEnqueued events raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainTransactionEnqueuedIterator struct { + Event *CanonicalTransactionChainTransactionEnqueued // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *CanonicalTransactionChainTransactionEnqueuedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainTransactionEnqueued) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(CanonicalTransactionChainTransactionEnqueued) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *CanonicalTransactionChainTransactionEnqueuedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *CanonicalTransactionChainTransactionEnqueuedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// CanonicalTransactionChainTransactionEnqueued represents a TransactionEnqueued event raised by the CanonicalTransactionChain contract. +type CanonicalTransactionChainTransactionEnqueued struct { + L1TxOrigin common.Address + Target common.Address + GasLimit *big.Int + Data []byte + QueueIndex *big.Int + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransactionEnqueued is a free log retrieval operation binding the contract event 0x4b388aecf9fa6cc92253704e5975a6129a4f735bdbd99567df4ed0094ee4ceb5. +// +// Solidity: event TransactionEnqueued(address indexed _l1TxOrigin, address indexed _target, uint256 _gasLimit, bytes _data, uint256 indexed _queueIndex, uint256 _timestamp) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) FilterTransactionEnqueued(opts *bind.FilterOpts, _l1TxOrigin []common.Address, _target []common.Address, _queueIndex []*big.Int) (*CanonicalTransactionChainTransactionEnqueuedIterator, error) { + + var _l1TxOriginRule []interface{} + for _, _l1TxOriginItem := range _l1TxOrigin { + _l1TxOriginRule = append(_l1TxOriginRule, _l1TxOriginItem) + } + var _targetRule []interface{} + for _, _targetItem := range _target { + _targetRule = append(_targetRule, _targetItem) + } + + var _queueIndexRule []interface{} + for _, _queueIndexItem := range _queueIndex { + _queueIndexRule = append(_queueIndexRule, _queueIndexItem) + } + + logs, sub, err := _CanonicalTransactionChain.contract.FilterLogs(opts, "TransactionEnqueued", _l1TxOriginRule, _targetRule, _queueIndexRule) + if err != nil { + return nil, err + } + return &CanonicalTransactionChainTransactionEnqueuedIterator{contract: _CanonicalTransactionChain.contract, event: "TransactionEnqueued", logs: logs, sub: sub}, nil +} + +// WatchTransactionEnqueued is a free log subscription operation binding the contract event 0x4b388aecf9fa6cc92253704e5975a6129a4f735bdbd99567df4ed0094ee4ceb5. +// +// Solidity: event TransactionEnqueued(address indexed _l1TxOrigin, address indexed _target, uint256 _gasLimit, bytes _data, uint256 indexed _queueIndex, uint256 _timestamp) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) WatchTransactionEnqueued(opts *bind.WatchOpts, sink chan<- *CanonicalTransactionChainTransactionEnqueued, _l1TxOrigin []common.Address, _target []common.Address, _queueIndex []*big.Int) (event.Subscription, error) { + + var _l1TxOriginRule []interface{} + for _, _l1TxOriginItem := range _l1TxOrigin { + _l1TxOriginRule = append(_l1TxOriginRule, _l1TxOriginItem) + } + var _targetRule []interface{} + for _, _targetItem := range _target { + _targetRule = append(_targetRule, _targetItem) + } + + var _queueIndexRule []interface{} + for _, _queueIndexItem := range _queueIndex { + _queueIndexRule = append(_queueIndexRule, _queueIndexItem) + } + + logs, sub, err := _CanonicalTransactionChain.contract.WatchLogs(opts, "TransactionEnqueued", _l1TxOriginRule, _targetRule, _queueIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(CanonicalTransactionChainTransactionEnqueued) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "TransactionEnqueued", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransactionEnqueued is a log parse operation binding the contract event 0x4b388aecf9fa6cc92253704e5975a6129a4f735bdbd99567df4ed0094ee4ceb5. +// +// Solidity: event TransactionEnqueued(address indexed _l1TxOrigin, address indexed _target, uint256 _gasLimit, bytes _data, uint256 indexed _queueIndex, uint256 _timestamp) +func (_CanonicalTransactionChain *CanonicalTransactionChainFilterer) ParseTransactionEnqueued(log types.Log) (*CanonicalTransactionChainTransactionEnqueued, error) { + event := new(CanonicalTransactionChainTransactionEnqueued) + if err := _CanonicalTransactionChain.contract.UnpackLog(event, "TransactionEnqueued", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/go/batch-submitter/bindings/scc/state_commitment_chain.go b/go/batch-submitter/bindings/scc/state_commitment_chain.go new file mode 100644 index 0000000000000..d4cc9d339598e --- /dev/null +++ b/go/batch-submitter/bindings/scc/state_commitment_chain.go @@ -0,0 +1,862 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package scc + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Lib_OVMCodecChainBatchHeader is an auto generated low-level Go binding around an user-defined struct. +type Lib_OVMCodecChainBatchHeader struct { + BatchIndex *big.Int + BatchRoot [32]byte + BatchSize *big.Int + PrevTotalElements *big.Int + ExtraData []byte +} + +// Lib_OVMCodecChainInclusionProof is an auto generated low-level Go binding around an user-defined struct. +type Lib_OVMCodecChainInclusionProof struct { + Index *big.Int + Siblings [][32]byte +} + +// StateCommitmentChainMetaData contains all meta data concerning the StateCommitmentChain contract. +var StateCommitmentChainMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fraudProofWindow\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_sequencerPublishWindow\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_batchRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_batchSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_prevTotalElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"StateBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_batchRoot\",\"type\":\"bytes32\"}],\"name\":\"StateBatchDeleted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"FRAUD_PROOF_WINDOW\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_PUBLISH_WINDOW\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"_batch\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"_shouldStartAtElement\",\"type\":\"uint256\"}],\"name\":\"appendStateBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batches\",\"outputs\":[{\"internalType\":\"contractIChainStorageContainer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"structLib_OVMCodec.ChainBatchHeader\",\"name\":\"_batchHeader\",\"type\":\"tuple\"}],\"name\":\"deleteStateBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastSequencerTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_lastSequencerTimestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBatches\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalBatches\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalElements\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"structLib_OVMCodec.ChainBatchHeader\",\"name\":\"_batchHeader\",\"type\":\"tuple\"}],\"name\":\"insideFraudProofWindow\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_inside\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contractLib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_element\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"batchRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"batchSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prevTotalElements\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"structLib_OVMCodec.ChainBatchHeader\",\"name\":\"_batchHeader\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"siblings\",\"type\":\"bytes32[]\"}],\"internalType\":\"structLib_OVMCodec.ChainInclusionProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyStateCommitment\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561001057600080fd5b506040516120bb3803806120bb83398101604081905261002f9161005b565b600080546001600160a01b0319166001600160a01b03949094169390931790925560015560025561009e565b60008060006060848603121561007057600080fd5b83516001600160a01b038116811461008757600080fd5b602085015160409095015190969495509392505050565b61200e806100ad6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638ca5cbb911610081578063c17b291b1161005b578063c17b291b146101bb578063cfdf677e146101c4578063e561dddc146101cc57600080fd5b80638ca5cbb9146101805780639418bddd14610195578063b8e189ac146101a857600080fd5b80637aa63a86116100b25780637aa63a86146101595780637ad168a01461016f57806381eb62ef1461017757600080fd5b8063299ca478146100d9578063461a4478146101235780634d69ee5714610136575b600080fd5b6000546100f99073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100f9610131366004611a1b565b6101d4565b610149610144366004611b8d565b610281565b604051901515815260200161011a565b610161610350565b60405190815260200161011a565b610161610369565b61016160025481565b61019361018e366004611c4a565b610382565b005b6101496101a3366004611c8f565b61075c565b6101936101b6366004611c8f565b610804565b61016160015481565b6100f96109c0565b6101616109e8565b600080546040517fbf40fac100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063bf40fac19061022b908590600401611d2f565b60206040518083038186803b15801561024357600080fd5b505afa158015610257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027b9190611d64565b92915050565b600061028c83610a6f565b6102dd5760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064015b60405180910390fd5b6102fa836020015185846000015185602001518760400151610b31565b6103465760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420696e636c7573696f6e2070726f6f662e000000000000000060448201526064016102d4565b5060019392505050565b60008061035b610d9f565b5064ffffffffff1692915050565b600080610374610d9f565b64ffffffffff169392505050565b61038a610350565b81146103fe5760405162461bcd60e51b815260206004820152603d60248201527f41637475616c20626174636820737461727420696e64657820646f6573206e6f60448201527f74206d6174636820657870656374656420737461727420696e6465782e00000060648201526084016102d4565b61043c6040518060400160405280600b81526020017f426f6e644d616e616765720000000000000000000000000000000000000000008152506101d4565b6040517f02ad4d2a00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff91909116906302ad4d2a9060240160206040518083038186803b1580156104a357600080fd5b505afa1580156104b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190611d81565b61054d5760405162461bcd60e51b815260206004820152602f60248201527f50726f706f73657220646f6573206e6f74206861766520656e6f75676820636f60448201527f6c6c61746572616c20706f73746564000000000000000000000000000000000060648201526084016102d4565b60008251116105c45760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f74207375626d697420616e20656d7074792073746174652062617460448201527f63682e000000000000000000000000000000000000000000000000000000000060648201526084016102d4565b6106026040518060400160405280601981526020017f43616e6f6e6963616c5472616e73616374696f6e436861696e000000000000008152506101d4565b73ffffffffffffffffffffffffffffffffffffffff16637aa63a866040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f9190611da3565b8251610689610350565b6106939190611deb565b111561072d5760405162461bcd60e51b815260206004820152604960248201527f4e756d626572206f6620737461746520726f6f74732063616e6e6f742065786360448201527f65656420746865206e756d626572206f662063616e6f6e6963616c207472616e60648201527f73616374696f6e732e0000000000000000000000000000000000000000000000608482015260a4016102d4565b6040805142602082015233818301528151808203830181526060909101909152610758908390610e43565b5050565b60008082608001518060200190518101906107779190611e03565b509050806107ed5760405162461bcd60e51b815260206004820152602560248201527f4261746368206865616465722074696d657374616d702063616e6e6f7420626560448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016102d4565b42600154826107fc9190611deb565b119392505050565b6108426040518060400160405280601181526020017f4f564d5f467261756456657269666965720000000000000000000000000000008152506101d4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108e25760405162461bcd60e51b815260206004820152603b60248201527f537461746520626174636865732063616e206f6e6c792062652064656c65746560448201527f6420627920746865204f564d5f467261756456657269666965722e000000000060648201526084016102d4565b6108eb81610a6f565b6109375760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064016102d4565b6109408161075c565b6109b4576040805162461bcd60e51b81526020600482015260248101919091527f537461746520626174636865732063616e206f6e6c792062652064656c65746560448201527f642077697468696e207468652066726175642070726f6f662077696e646f772e60648201526084016102d4565b6109bd816110e6565b50565b60006109e3604051806060016040528060218152602001611fb8602191396101d4565b905090565b60006109f26109c0565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3757600080fd5b505afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e39190611da3565b6000610a796109c0565b82516040517f9507d39a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9290921691639507d39a91610ad19160040190815260200190565b60206040518083038186803b158015610ae957600080fd5b505afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190611da3565b610b2a83611317565b1492915050565b6000808211610ba85760405162461bcd60e51b815260206004820152603760248201527f4c69625f4d65726b6c65547265653a20546f74616c206c6561766573206d757360448201527f742062652067726561746572207468616e207a65726f2e00000000000000000060648201526084016102d4565b818410610c1c5760405162461bcd60e51b8152602060048201526024808201527f4c69625f4d65726b6c65547265653a20496e646578206f7574206f6620626f7560448201527f6e64732e0000000000000000000000000000000000000000000000000000000060648201526084016102d4565b610c258261135d565b835114610cc05760405162461bcd60e51b815260206004820152604d60248201527f4c69625f4d65726b6c65547265653a20546f74616c207369626c696e6773206460448201527f6f6573206e6f7420636f72726563746c7920636f72726573706f6e6420746f2060648201527f746f74616c206c65617665732e00000000000000000000000000000000000000608482015260a4016102d4565b8460005b8451811015610d92578560011660011415610d2b57848181518110610ceb57610ceb611e33565b602002602001015182604051602001610d0e929190918252602082015260400190565b604051602081830303815290604052805190602001209150610d79565b81858281518110610d3e57610d3e611e33565b6020026020010151604051602001610d60929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b60019590951c9480610d8a81611e62565b915050610cc4565b5090951495945050505050565b6000806000610dac6109c0565b73ffffffffffffffffffffffffffffffffffffffff1663ccf8f9696040518163ffffffff1660e01b815260040160206040518083038186803b158015610df157600080fd5b505afa158015610e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e299190611e9b565b64ffffffffff602882901c169460509190911c9350915050565b6000610e836040518060400160405280600c81526020017f4f564d5f50726f706f73657200000000000000000000000000000000000000008152506101d4565b9050600080610e90610d9f565b90925090503373ffffffffffffffffffffffffffffffffffffffff84161415610eba575042610f69565b426002548264ffffffffff16610ed09190611deb565b10610f695760405162461bcd60e51b815260206004820152604360248201527f43616e6e6f74207075626c69736820737461746520726f6f747320776974686960448201527f6e207468652073657175656e636572207075626c69636174696f6e2077696e6460648201527f6f772e0000000000000000000000000000000000000000000000000000000000608482015260a4016102d4565b60006040518060a00160405280610f7e6109e8565b8152602001610f8c88611443565b8152602001875181526020018464ffffffffff16815260200186815250905080600001517f16be4c5129a4e03cf3350262e181dc02ddfb4a6008d925368c0899fcd97ca9c58260200151836040015184606001518560800151604051610ff59493929190611edd565b60405180910390a26110056109c0565b73ffffffffffffffffffffffffffffffffffffffff16632015276c61102983611317565b61104e846040015185606001516110409190611deb565b602887811b91909117901b90565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000166024820152604401600060405180830381600087803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b50505050505050505050565b6110ee6109c0565b73ffffffffffffffffffffffffffffffffffffffff16631f7b6d326040518163ffffffff1660e01b815260040160206040518083038186803b15801561113357600080fd5b505afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190611da3565b8151106111ba5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420626174636820696e6465782e00000000000000000000000060448201526064016102d4565b6111c381610a6f565b61120f5760405162461bcd60e51b815260206004820152601560248201527f496e76616c6964206261746368206865616465722e000000000000000000000060448201526064016102d4565b6112176109c0565b8151606083015173ffffffffffffffffffffffffffffffffffffffff929092169163167fd681919060281b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092527fffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000166024820152604401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b5050505080600001517f8747b69ce8fdb31c3b9b0a67bd8049ad8c1a69ea417b69b12174068abd9cbd64826020015160405161130c91815260200190565b60405180910390a250565b600081602001518260400151836060015184608001516040516020016113409493929190611edd565b604051602081830303815290604052805190602001209050919050565b60008082116113d45760405162461bcd60e51b815260206004820152603060248201527f4c69625f4d65726b6c65547265653a2043616e6e6f7420636f6d70757465206360448201527f65696c286c6f675f3229206f6620302e0000000000000000000000000000000060648201526084016102d4565b81600114156113e557506000919050565b81600060805b600181106114235780611401600180831b611f0c565b901b83161561141b576114148183611deb565b92811c9291505b60011c6113eb565b506001811b841461143c57611439600182611deb565b90505b9392505050565b6000808251116114bb5760405162461bcd60e51b815260206004820152603460248201527f4c69625f4d65726b6c65547265653a204d7573742070726f766964652061742060448201527f6c65617374206f6e65206c65616620686173682e00000000000000000000000060648201526084016102d4565b8151600114156114e757816000815181106114d8576114d8611e33565b60200260200101519050919050565b60408051610200810182527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56381527f633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d60208201527f890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d818301527f3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd86060808301919091527fecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da60808301527fdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da560a08301527f617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d760c08301527f292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead60e08301527fe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e106101008301527f7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f826101208301527fe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e836365166101408301527f3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c6101608301527fad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e6101808301527fa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab6101a08301527f4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c8626101c08301527f2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf106101e083015282518381529081018352909160009190602082018180368337505085519192506000918291508180805b60018411156118fd57611798600285611f52565b91506117a5600285611f66565b600114905060005b82811015611851578a6117c1826002611f7a565b815181106117d1576117d1611e33565b602002602001015196508a8160026117e99190611f7a565b6117f4906001611deb565b8151811061180457611804611e33565b6020026020010151955086602089015285604089015287805190602001208b828151811061183457611834611e33565b60209081029190910101528061184981611e62565b9150506117ad565b5080156118cd5789611864600186611f0c565b8151811061187457611874611e33565b6020026020010151955087836010811061189057611890611e33565b602002015160001b945085602088015284604088015286805190602001208a83815181106118c0576118c0611e33565b6020026020010181815250505b806118d95760006118dc565b60015b6118e99060ff1683611deb565b9350826118f581611e62565b935050611784565b8960008151811061191057611910611e33565b602002602001015198505050505050505050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561199d5761199d611927565b604052919050565b600067ffffffffffffffff8311156119bf576119bf611927565b6119f060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601611956565b9050828152838383011115611a0457600080fd5b828260208301376000602084830101529392505050565b600060208284031215611a2d57600080fd5b813567ffffffffffffffff811115611a4457600080fd5b8201601f81018413611a5557600080fd5b611a64848235602084016119a5565b949350505050565b600060a08284031215611a7e57600080fd5b60405160a0810167ffffffffffffffff8282108183111715611aa257611aa2611927565b81604052829350843583526020850135602084015260408501356040840152606085013560608401526080850135915080821115611adf57600080fd5b508301601f81018513611af157600080fd5b611b00858235602084016119a5565b6080830152505092915050565b600082601f830112611b1e57600080fd5b8135602067ffffffffffffffff821115611b3a57611b3a611927565b8160051b611b49828201611956565b9283528481018201928281019087851115611b6357600080fd5b83870192505b84831015611b8257823582529183019190830190611b69565b979650505050505050565b600080600060608486031215611ba257600080fd5b83359250602084013567ffffffffffffffff80821115611bc157600080fd5b611bcd87838801611a6c565b93506040860135915080821115611be357600080fd5b9085019060408288031215611bf757600080fd5b604051604081018181108382111715611c1257611c12611927565b60405282358152602083013582811115611c2b57600080fd5b611c3789828601611b0d565b6020830152508093505050509250925092565b60008060408385031215611c5d57600080fd5b823567ffffffffffffffff811115611c7457600080fd5b611c8085828601611b0d565b95602094909401359450505050565b600060208284031215611ca157600080fd5b813567ffffffffffffffff811115611cb857600080fd5b611a6484828501611a6c565b6000815180845260005b81811015611cea57602081850181015186830182015201611cce565b81811115611cfc576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061143c6020830184611cc4565b73ffffffffffffffffffffffffffffffffffffffff811681146109bd57600080fd5b600060208284031215611d7657600080fd5b815161143c81611d42565b600060208284031215611d9357600080fd5b8151801515811461143c57600080fd5b600060208284031215611db557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115611dfe57611dfe611dbc565b500190565b60008060408385031215611e1657600080fd5b825191506020830151611e2881611d42565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611e9457611e94611dbc565b5060010190565b600060208284031215611ead57600080fd5b81517fffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000008116811461143c57600080fd5b848152836020820152826040820152608060608201526000611f026080830184611cc4565b9695505050505050565b600082821015611f1e57611f1e611dbc565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611f6157611f61611f23565b500490565b600082611f7557611f75611f23565b500690565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611fb257611fb2611dbc565b50029056fe436861696e53746f72616765436f6e7461696e65722d5343432d62617463686573a2646970667358221220b90af2e50ed0ae8720c8f74ce116bfe826a8d329baa23dec8c3f69958740528964736f6c63430008090033", +} + +// StateCommitmentChainABI is the input ABI used to generate the binding from. +// Deprecated: Use StateCommitmentChainMetaData.ABI instead. +var StateCommitmentChainABI = StateCommitmentChainMetaData.ABI + +// StateCommitmentChainBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use StateCommitmentChainMetaData.Bin instead. +var StateCommitmentChainBin = StateCommitmentChainMetaData.Bin + +// DeployStateCommitmentChain deploys a new Ethereum contract, binding an instance of StateCommitmentChain to it. +func DeployStateCommitmentChain(auth *bind.TransactOpts, backend bind.ContractBackend, _libAddressManager common.Address, _fraudProofWindow *big.Int, _sequencerPublishWindow *big.Int) (common.Address, *types.Transaction, *StateCommitmentChain, error) { + parsed, err := StateCommitmentChainMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StateCommitmentChainBin), backend, _libAddressManager, _fraudProofWindow, _sequencerPublishWindow) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &StateCommitmentChain{StateCommitmentChainCaller: StateCommitmentChainCaller{contract: contract}, StateCommitmentChainTransactor: StateCommitmentChainTransactor{contract: contract}, StateCommitmentChainFilterer: StateCommitmentChainFilterer{contract: contract}}, nil +} + +// StateCommitmentChain is an auto generated Go binding around an Ethereum contract. +type StateCommitmentChain struct { + StateCommitmentChainCaller // Read-only binding to the contract + StateCommitmentChainTransactor // Write-only binding to the contract + StateCommitmentChainFilterer // Log filterer for contract events +} + +// StateCommitmentChainCaller is an auto generated read-only Go binding around an Ethereum contract. +type StateCommitmentChainCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StateCommitmentChainTransactor is an auto generated write-only Go binding around an Ethereum contract. +type StateCommitmentChainTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StateCommitmentChainFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type StateCommitmentChainFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StateCommitmentChainSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type StateCommitmentChainSession struct { + Contract *StateCommitmentChain // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StateCommitmentChainCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type StateCommitmentChainCallerSession struct { + Contract *StateCommitmentChainCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// StateCommitmentChainTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type StateCommitmentChainTransactorSession struct { + Contract *StateCommitmentChainTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StateCommitmentChainRaw is an auto generated low-level Go binding around an Ethereum contract. +type StateCommitmentChainRaw struct { + Contract *StateCommitmentChain // Generic contract binding to access the raw methods on +} + +// StateCommitmentChainCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type StateCommitmentChainCallerRaw struct { + Contract *StateCommitmentChainCaller // Generic read-only contract binding to access the raw methods on +} + +// StateCommitmentChainTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type StateCommitmentChainTransactorRaw struct { + Contract *StateCommitmentChainTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewStateCommitmentChain creates a new instance of StateCommitmentChain, bound to a specific deployed contract. +func NewStateCommitmentChain(address common.Address, backend bind.ContractBackend) (*StateCommitmentChain, error) { + contract, err := bindStateCommitmentChain(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &StateCommitmentChain{StateCommitmentChainCaller: StateCommitmentChainCaller{contract: contract}, StateCommitmentChainTransactor: StateCommitmentChainTransactor{contract: contract}, StateCommitmentChainFilterer: StateCommitmentChainFilterer{contract: contract}}, nil +} + +// NewStateCommitmentChainCaller creates a new read-only instance of StateCommitmentChain, bound to a specific deployed contract. +func NewStateCommitmentChainCaller(address common.Address, caller bind.ContractCaller) (*StateCommitmentChainCaller, error) { + contract, err := bindStateCommitmentChain(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &StateCommitmentChainCaller{contract: contract}, nil +} + +// NewStateCommitmentChainTransactor creates a new write-only instance of StateCommitmentChain, bound to a specific deployed contract. +func NewStateCommitmentChainTransactor(address common.Address, transactor bind.ContractTransactor) (*StateCommitmentChainTransactor, error) { + contract, err := bindStateCommitmentChain(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &StateCommitmentChainTransactor{contract: contract}, nil +} + +// NewStateCommitmentChainFilterer creates a new log filterer instance of StateCommitmentChain, bound to a specific deployed contract. +func NewStateCommitmentChainFilterer(address common.Address, filterer bind.ContractFilterer) (*StateCommitmentChainFilterer, error) { + contract, err := bindStateCommitmentChain(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &StateCommitmentChainFilterer{contract: contract}, nil +} + +// bindStateCommitmentChain binds a generic wrapper to an already deployed contract. +func bindStateCommitmentChain(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(StateCommitmentChainABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StateCommitmentChain *StateCommitmentChainRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StateCommitmentChain.Contract.StateCommitmentChainCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StateCommitmentChain *StateCommitmentChainRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.StateCommitmentChainTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StateCommitmentChain *StateCommitmentChainRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.StateCommitmentChainTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_StateCommitmentChain *StateCommitmentChainCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StateCommitmentChain.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_StateCommitmentChain *StateCommitmentChainTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StateCommitmentChain *StateCommitmentChainTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.contract.Transact(opts, method, params...) +} + +// FRAUDPROOFWINDOW is a free data retrieval call binding the contract method 0xc17b291b. +// +// Solidity: function FRAUD_PROOF_WINDOW() view returns(uint256) +func (_StateCommitmentChain *StateCommitmentChainCaller) FRAUDPROOFWINDOW(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "FRAUD_PROOF_WINDOW") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// FRAUDPROOFWINDOW is a free data retrieval call binding the contract method 0xc17b291b. +// +// Solidity: function FRAUD_PROOF_WINDOW() view returns(uint256) +func (_StateCommitmentChain *StateCommitmentChainSession) FRAUDPROOFWINDOW() (*big.Int, error) { + return _StateCommitmentChain.Contract.FRAUDPROOFWINDOW(&_StateCommitmentChain.CallOpts) +} + +// FRAUDPROOFWINDOW is a free data retrieval call binding the contract method 0xc17b291b. +// +// Solidity: function FRAUD_PROOF_WINDOW() view returns(uint256) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) FRAUDPROOFWINDOW() (*big.Int, error) { + return _StateCommitmentChain.Contract.FRAUDPROOFWINDOW(&_StateCommitmentChain.CallOpts) +} + +// SEQUENCERPUBLISHWINDOW is a free data retrieval call binding the contract method 0x81eb62ef. +// +// Solidity: function SEQUENCER_PUBLISH_WINDOW() view returns(uint256) +func (_StateCommitmentChain *StateCommitmentChainCaller) SEQUENCERPUBLISHWINDOW(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "SEQUENCER_PUBLISH_WINDOW") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SEQUENCERPUBLISHWINDOW is a free data retrieval call binding the contract method 0x81eb62ef. +// +// Solidity: function SEQUENCER_PUBLISH_WINDOW() view returns(uint256) +func (_StateCommitmentChain *StateCommitmentChainSession) SEQUENCERPUBLISHWINDOW() (*big.Int, error) { + return _StateCommitmentChain.Contract.SEQUENCERPUBLISHWINDOW(&_StateCommitmentChain.CallOpts) +} + +// SEQUENCERPUBLISHWINDOW is a free data retrieval call binding the contract method 0x81eb62ef. +// +// Solidity: function SEQUENCER_PUBLISH_WINDOW() view returns(uint256) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) SEQUENCERPUBLISHWINDOW() (*big.Int, error) { + return _StateCommitmentChain.Contract.SEQUENCERPUBLISHWINDOW(&_StateCommitmentChain.CallOpts) +} + +// Batches is a free data retrieval call binding the contract method 0xcfdf677e. +// +// Solidity: function batches() view returns(address) +func (_StateCommitmentChain *StateCommitmentChainCaller) Batches(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "batches") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Batches is a free data retrieval call binding the contract method 0xcfdf677e. +// +// Solidity: function batches() view returns(address) +func (_StateCommitmentChain *StateCommitmentChainSession) Batches() (common.Address, error) { + return _StateCommitmentChain.Contract.Batches(&_StateCommitmentChain.CallOpts) +} + +// Batches is a free data retrieval call binding the contract method 0xcfdf677e. +// +// Solidity: function batches() view returns(address) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) Batches() (common.Address, error) { + return _StateCommitmentChain.Contract.Batches(&_StateCommitmentChain.CallOpts) +} + +// GetLastSequencerTimestamp is a free data retrieval call binding the contract method 0x7ad168a0. +// +// Solidity: function getLastSequencerTimestamp() view returns(uint256 _lastSequencerTimestamp) +func (_StateCommitmentChain *StateCommitmentChainCaller) GetLastSequencerTimestamp(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "getLastSequencerTimestamp") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetLastSequencerTimestamp is a free data retrieval call binding the contract method 0x7ad168a0. +// +// Solidity: function getLastSequencerTimestamp() view returns(uint256 _lastSequencerTimestamp) +func (_StateCommitmentChain *StateCommitmentChainSession) GetLastSequencerTimestamp() (*big.Int, error) { + return _StateCommitmentChain.Contract.GetLastSequencerTimestamp(&_StateCommitmentChain.CallOpts) +} + +// GetLastSequencerTimestamp is a free data retrieval call binding the contract method 0x7ad168a0. +// +// Solidity: function getLastSequencerTimestamp() view returns(uint256 _lastSequencerTimestamp) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) GetLastSequencerTimestamp() (*big.Int, error) { + return _StateCommitmentChain.Contract.GetLastSequencerTimestamp(&_StateCommitmentChain.CallOpts) +} + +// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. +// +// Solidity: function getTotalBatches() view returns(uint256 _totalBatches) +func (_StateCommitmentChain *StateCommitmentChainCaller) GetTotalBatches(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "getTotalBatches") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. +// +// Solidity: function getTotalBatches() view returns(uint256 _totalBatches) +func (_StateCommitmentChain *StateCommitmentChainSession) GetTotalBatches() (*big.Int, error) { + return _StateCommitmentChain.Contract.GetTotalBatches(&_StateCommitmentChain.CallOpts) +} + +// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. +// +// Solidity: function getTotalBatches() view returns(uint256 _totalBatches) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) GetTotalBatches() (*big.Int, error) { + return _StateCommitmentChain.Contract.GetTotalBatches(&_StateCommitmentChain.CallOpts) +} + +// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. +// +// Solidity: function getTotalElements() view returns(uint256 _totalElements) +func (_StateCommitmentChain *StateCommitmentChainCaller) GetTotalElements(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "getTotalElements") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. +// +// Solidity: function getTotalElements() view returns(uint256 _totalElements) +func (_StateCommitmentChain *StateCommitmentChainSession) GetTotalElements() (*big.Int, error) { + return _StateCommitmentChain.Contract.GetTotalElements(&_StateCommitmentChain.CallOpts) +} + +// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. +// +// Solidity: function getTotalElements() view returns(uint256 _totalElements) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) GetTotalElements() (*big.Int, error) { + return _StateCommitmentChain.Contract.GetTotalElements(&_StateCommitmentChain.CallOpts) +} + +// InsideFraudProofWindow is a free data retrieval call binding the contract method 0x9418bddd. +// +// Solidity: function insideFraudProofWindow((uint256,bytes32,uint256,uint256,bytes) _batchHeader) view returns(bool _inside) +func (_StateCommitmentChain *StateCommitmentChainCaller) InsideFraudProofWindow(opts *bind.CallOpts, _batchHeader Lib_OVMCodecChainBatchHeader) (bool, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "insideFraudProofWindow", _batchHeader) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// InsideFraudProofWindow is a free data retrieval call binding the contract method 0x9418bddd. +// +// Solidity: function insideFraudProofWindow((uint256,bytes32,uint256,uint256,bytes) _batchHeader) view returns(bool _inside) +func (_StateCommitmentChain *StateCommitmentChainSession) InsideFraudProofWindow(_batchHeader Lib_OVMCodecChainBatchHeader) (bool, error) { + return _StateCommitmentChain.Contract.InsideFraudProofWindow(&_StateCommitmentChain.CallOpts, _batchHeader) +} + +// InsideFraudProofWindow is a free data retrieval call binding the contract method 0x9418bddd. +// +// Solidity: function insideFraudProofWindow((uint256,bytes32,uint256,uint256,bytes) _batchHeader) view returns(bool _inside) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) InsideFraudProofWindow(_batchHeader Lib_OVMCodecChainBatchHeader) (bool, error) { + return _StateCommitmentChain.Contract.InsideFraudProofWindow(&_StateCommitmentChain.CallOpts, _batchHeader) +} + +// LibAddressManager is a free data retrieval call binding the contract method 0x299ca478. +// +// Solidity: function libAddressManager() view returns(address) +func (_StateCommitmentChain *StateCommitmentChainCaller) LibAddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "libAddressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// LibAddressManager is a free data retrieval call binding the contract method 0x299ca478. +// +// Solidity: function libAddressManager() view returns(address) +func (_StateCommitmentChain *StateCommitmentChainSession) LibAddressManager() (common.Address, error) { + return _StateCommitmentChain.Contract.LibAddressManager(&_StateCommitmentChain.CallOpts) +} + +// LibAddressManager is a free data retrieval call binding the contract method 0x299ca478. +// +// Solidity: function libAddressManager() view returns(address) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) LibAddressManager() (common.Address, error) { + return _StateCommitmentChain.Contract.LibAddressManager(&_StateCommitmentChain.CallOpts) +} + +// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// +// Solidity: function resolve(string _name) view returns(address) +func (_StateCommitmentChain *StateCommitmentChainCaller) Resolve(opts *bind.CallOpts, _name string) (common.Address, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "resolve", _name) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// +// Solidity: function resolve(string _name) view returns(address) +func (_StateCommitmentChain *StateCommitmentChainSession) Resolve(_name string) (common.Address, error) { + return _StateCommitmentChain.Contract.Resolve(&_StateCommitmentChain.CallOpts, _name) +} + +// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// +// Solidity: function resolve(string _name) view returns(address) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) Resolve(_name string) (common.Address, error) { + return _StateCommitmentChain.Contract.Resolve(&_StateCommitmentChain.CallOpts, _name) +} + +// VerifyStateCommitment is a free data retrieval call binding the contract method 0x4d69ee57. +// +// Solidity: function verifyStateCommitment(bytes32 _element, (uint256,bytes32,uint256,uint256,bytes) _batchHeader, (uint256,bytes32[]) _proof) view returns(bool) +func (_StateCommitmentChain *StateCommitmentChainCaller) VerifyStateCommitment(opts *bind.CallOpts, _element [32]byte, _batchHeader Lib_OVMCodecChainBatchHeader, _proof Lib_OVMCodecChainInclusionProof) (bool, error) { + var out []interface{} + err := _StateCommitmentChain.contract.Call(opts, &out, "verifyStateCommitment", _element, _batchHeader, _proof) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// VerifyStateCommitment is a free data retrieval call binding the contract method 0x4d69ee57. +// +// Solidity: function verifyStateCommitment(bytes32 _element, (uint256,bytes32,uint256,uint256,bytes) _batchHeader, (uint256,bytes32[]) _proof) view returns(bool) +func (_StateCommitmentChain *StateCommitmentChainSession) VerifyStateCommitment(_element [32]byte, _batchHeader Lib_OVMCodecChainBatchHeader, _proof Lib_OVMCodecChainInclusionProof) (bool, error) { + return _StateCommitmentChain.Contract.VerifyStateCommitment(&_StateCommitmentChain.CallOpts, _element, _batchHeader, _proof) +} + +// VerifyStateCommitment is a free data retrieval call binding the contract method 0x4d69ee57. +// +// Solidity: function verifyStateCommitment(bytes32 _element, (uint256,bytes32,uint256,uint256,bytes) _batchHeader, (uint256,bytes32[]) _proof) view returns(bool) +func (_StateCommitmentChain *StateCommitmentChainCallerSession) VerifyStateCommitment(_element [32]byte, _batchHeader Lib_OVMCodecChainBatchHeader, _proof Lib_OVMCodecChainInclusionProof) (bool, error) { + return _StateCommitmentChain.Contract.VerifyStateCommitment(&_StateCommitmentChain.CallOpts, _element, _batchHeader, _proof) +} + +// AppendStateBatch is a paid mutator transaction binding the contract method 0x8ca5cbb9. +// +// Solidity: function appendStateBatch(bytes32[] _batch, uint256 _shouldStartAtElement) returns() +func (_StateCommitmentChain *StateCommitmentChainTransactor) AppendStateBatch(opts *bind.TransactOpts, _batch [][32]byte, _shouldStartAtElement *big.Int) (*types.Transaction, error) { + return _StateCommitmentChain.contract.Transact(opts, "appendStateBatch", _batch, _shouldStartAtElement) +} + +// AppendStateBatch is a paid mutator transaction binding the contract method 0x8ca5cbb9. +// +// Solidity: function appendStateBatch(bytes32[] _batch, uint256 _shouldStartAtElement) returns() +func (_StateCommitmentChain *StateCommitmentChainSession) AppendStateBatch(_batch [][32]byte, _shouldStartAtElement *big.Int) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.AppendStateBatch(&_StateCommitmentChain.TransactOpts, _batch, _shouldStartAtElement) +} + +// AppendStateBatch is a paid mutator transaction binding the contract method 0x8ca5cbb9. +// +// Solidity: function appendStateBatch(bytes32[] _batch, uint256 _shouldStartAtElement) returns() +func (_StateCommitmentChain *StateCommitmentChainTransactorSession) AppendStateBatch(_batch [][32]byte, _shouldStartAtElement *big.Int) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.AppendStateBatch(&_StateCommitmentChain.TransactOpts, _batch, _shouldStartAtElement) +} + +// DeleteStateBatch is a paid mutator transaction binding the contract method 0xb8e189ac. +// +// Solidity: function deleteStateBatch((uint256,bytes32,uint256,uint256,bytes) _batchHeader) returns() +func (_StateCommitmentChain *StateCommitmentChainTransactor) DeleteStateBatch(opts *bind.TransactOpts, _batchHeader Lib_OVMCodecChainBatchHeader) (*types.Transaction, error) { + return _StateCommitmentChain.contract.Transact(opts, "deleteStateBatch", _batchHeader) +} + +// DeleteStateBatch is a paid mutator transaction binding the contract method 0xb8e189ac. +// +// Solidity: function deleteStateBatch((uint256,bytes32,uint256,uint256,bytes) _batchHeader) returns() +func (_StateCommitmentChain *StateCommitmentChainSession) DeleteStateBatch(_batchHeader Lib_OVMCodecChainBatchHeader) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.DeleteStateBatch(&_StateCommitmentChain.TransactOpts, _batchHeader) +} + +// DeleteStateBatch is a paid mutator transaction binding the contract method 0xb8e189ac. +// +// Solidity: function deleteStateBatch((uint256,bytes32,uint256,uint256,bytes) _batchHeader) returns() +func (_StateCommitmentChain *StateCommitmentChainTransactorSession) DeleteStateBatch(_batchHeader Lib_OVMCodecChainBatchHeader) (*types.Transaction, error) { + return _StateCommitmentChain.Contract.DeleteStateBatch(&_StateCommitmentChain.TransactOpts, _batchHeader) +} + +// StateCommitmentChainStateBatchAppendedIterator is returned from FilterStateBatchAppended and is used to iterate over the raw logs and unpacked data for StateBatchAppended events raised by the StateCommitmentChain contract. +type StateCommitmentChainStateBatchAppendedIterator struct { + Event *StateCommitmentChainStateBatchAppended // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *StateCommitmentChainStateBatchAppendedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StateCommitmentChainStateBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StateCommitmentChainStateBatchAppended) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StateCommitmentChainStateBatchAppendedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StateCommitmentChainStateBatchAppendedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StateCommitmentChainStateBatchAppended represents a StateBatchAppended event raised by the StateCommitmentChain contract. +type StateCommitmentChainStateBatchAppended struct { + BatchIndex *big.Int + BatchRoot [32]byte + BatchSize *big.Int + PrevTotalElements *big.Int + ExtraData []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStateBatchAppended is a free log retrieval operation binding the contract event 0x16be4c5129a4e03cf3350262e181dc02ddfb4a6008d925368c0899fcd97ca9c5. +// +// Solidity: event StateBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData) +func (_StateCommitmentChain *StateCommitmentChainFilterer) FilterStateBatchAppended(opts *bind.FilterOpts, _batchIndex []*big.Int) (*StateCommitmentChainStateBatchAppendedIterator, error) { + + var _batchIndexRule []interface{} + for _, _batchIndexItem := range _batchIndex { + _batchIndexRule = append(_batchIndexRule, _batchIndexItem) + } + + logs, sub, err := _StateCommitmentChain.contract.FilterLogs(opts, "StateBatchAppended", _batchIndexRule) + if err != nil { + return nil, err + } + return &StateCommitmentChainStateBatchAppendedIterator{contract: _StateCommitmentChain.contract, event: "StateBatchAppended", logs: logs, sub: sub}, nil +} + +// WatchStateBatchAppended is a free log subscription operation binding the contract event 0x16be4c5129a4e03cf3350262e181dc02ddfb4a6008d925368c0899fcd97ca9c5. +// +// Solidity: event StateBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData) +func (_StateCommitmentChain *StateCommitmentChainFilterer) WatchStateBatchAppended(opts *bind.WatchOpts, sink chan<- *StateCommitmentChainStateBatchAppended, _batchIndex []*big.Int) (event.Subscription, error) { + + var _batchIndexRule []interface{} + for _, _batchIndexItem := range _batchIndex { + _batchIndexRule = append(_batchIndexRule, _batchIndexItem) + } + + logs, sub, err := _StateCommitmentChain.contract.WatchLogs(opts, "StateBatchAppended", _batchIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StateCommitmentChainStateBatchAppended) + if err := _StateCommitmentChain.contract.UnpackLog(event, "StateBatchAppended", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStateBatchAppended is a log parse operation binding the contract event 0x16be4c5129a4e03cf3350262e181dc02ddfb4a6008d925368c0899fcd97ca9c5. +// +// Solidity: event StateBatchAppended(uint256 indexed _batchIndex, bytes32 _batchRoot, uint256 _batchSize, uint256 _prevTotalElements, bytes _extraData) +func (_StateCommitmentChain *StateCommitmentChainFilterer) ParseStateBatchAppended(log types.Log) (*StateCommitmentChainStateBatchAppended, error) { + event := new(StateCommitmentChainStateBatchAppended) + if err := _StateCommitmentChain.contract.UnpackLog(event, "StateBatchAppended", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StateCommitmentChainStateBatchDeletedIterator is returned from FilterStateBatchDeleted and is used to iterate over the raw logs and unpacked data for StateBatchDeleted events raised by the StateCommitmentChain contract. +type StateCommitmentChainStateBatchDeletedIterator struct { + Event *StateCommitmentChainStateBatchDeleted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *StateCommitmentChainStateBatchDeletedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(StateCommitmentChainStateBatchDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(StateCommitmentChainStateBatchDeleted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *StateCommitmentChainStateBatchDeletedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StateCommitmentChainStateBatchDeletedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StateCommitmentChainStateBatchDeleted represents a StateBatchDeleted event raised by the StateCommitmentChain contract. +type StateCommitmentChainStateBatchDeleted struct { + BatchIndex *big.Int + BatchRoot [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStateBatchDeleted is a free log retrieval operation binding the contract event 0x8747b69ce8fdb31c3b9b0a67bd8049ad8c1a69ea417b69b12174068abd9cbd64. +// +// Solidity: event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot) +func (_StateCommitmentChain *StateCommitmentChainFilterer) FilterStateBatchDeleted(opts *bind.FilterOpts, _batchIndex []*big.Int) (*StateCommitmentChainStateBatchDeletedIterator, error) { + + var _batchIndexRule []interface{} + for _, _batchIndexItem := range _batchIndex { + _batchIndexRule = append(_batchIndexRule, _batchIndexItem) + } + + logs, sub, err := _StateCommitmentChain.contract.FilterLogs(opts, "StateBatchDeleted", _batchIndexRule) + if err != nil { + return nil, err + } + return &StateCommitmentChainStateBatchDeletedIterator{contract: _StateCommitmentChain.contract, event: "StateBatchDeleted", logs: logs, sub: sub}, nil +} + +// WatchStateBatchDeleted is a free log subscription operation binding the contract event 0x8747b69ce8fdb31c3b9b0a67bd8049ad8c1a69ea417b69b12174068abd9cbd64. +// +// Solidity: event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot) +func (_StateCommitmentChain *StateCommitmentChainFilterer) WatchStateBatchDeleted(opts *bind.WatchOpts, sink chan<- *StateCommitmentChainStateBatchDeleted, _batchIndex []*big.Int) (event.Subscription, error) { + + var _batchIndexRule []interface{} + for _, _batchIndexItem := range _batchIndex { + _batchIndexRule = append(_batchIndexRule, _batchIndexItem) + } + + logs, sub, err := _StateCommitmentChain.contract.WatchLogs(opts, "StateBatchDeleted", _batchIndexRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(StateCommitmentChainStateBatchDeleted) + if err := _StateCommitmentChain.contract.UnpackLog(event, "StateBatchDeleted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStateBatchDeleted is a log parse operation binding the contract event 0x8747b69ce8fdb31c3b9b0a67bd8049ad8c1a69ea417b69b12174068abd9cbd64. +// +// Solidity: event StateBatchDeleted(uint256 indexed _batchIndex, bytes32 _batchRoot) +func (_StateCommitmentChain *StateCommitmentChainFilterer) ParseStateBatchDeleted(log types.Log) (*StateCommitmentChainStateBatchDeleted, error) { + event := new(StateCommitmentChainStateBatchDeleted) + if err := _StateCommitmentChain.contract.UnpackLog(event, "StateBatchDeleted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/go/batch-submitter/go.sum b/go/batch-submitter/go.sum index ac83abbce8231..e181efdb19c98 100644 --- a/go/batch-submitter/go.sum +++ b/go/batch-submitter/go.sum @@ -81,6 +81,7 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtE github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= diff --git a/go/gas-oracle/oracle/updater_interface.go b/go/gas-oracle/oracle/updater_interface.go index 6b53b3dedc7ea..99eb9c508a92d 100644 --- a/go/gas-oracle/oracle/updater_interface.go +++ b/go/gas-oracle/oracle/updater_interface.go @@ -19,7 +19,7 @@ import ( var ( txSendCounter = metrics.NewRegisteredCounter("tx/send", ometrics.DefaultRegistry) txNotSignificantCounter = metrics.NewRegisteredCounter("tx/not-significant", ometrics.DefaultRegistry) - gasPriceGauge = metrics.NewRegisteredGauge("gas-price", ometrics.DefaultRegistry) + gasPriceGauge = metrics.NewRegisteredGauge("gas_price", ometrics.DefaultRegistry) txConfTimer = metrics.NewRegisteredTimer("tx/confirmed", ometrics.DefaultRegistry) txSendTimer = metrics.NewRegisteredTimer("tx/send", ometrics.DefaultRegistry) ) diff --git a/go/proxyd/Dockerfile b/go/proxyd/Dockerfile index f7016f8edd632..7da41910f3c11 100644 --- a/go/proxyd/Dockerfile +++ b/go/proxyd/Dockerfile @@ -13,9 +13,17 @@ RUN make proxyd FROM alpine:3.14.2 +COPY ./go/proxyd/entrypoint.sh /bin/entrypoint.sh + +RUN apk update && \ + apk add ca-certificates && \ + chmod +x /bin/entrypoint.sh + EXPOSE 8080 VOLUME /etc/proxyd COPY --from=builder /app/bin/proxyd /bin/proxyd + +ENTRYPOINT ["/bin/entrypoint.sh"] CMD ["/bin/proxyd", "/etc/proxyd/proxyd.toml"] diff --git a/go/proxyd/README.md b/go/proxyd/README.md index 5c9cb92861809..ff019ea7ebf29 100644 --- a/go/proxyd/README.md +++ b/go/proxyd/README.md @@ -21,3 +21,6 @@ See `metrics.go` for a list of all available metrics. The metrics port is configurable via the `metrics.port` and `metrics.host` keys in the config. +## Adding Backend SSL Certificates in Docker + +The Docker image runs on Alpine Linux. If you get SSL errors when connecting to a backend within Docker, you may need to add additional certificates to Alpine's certificate store. To do this, bind mount the certificate bundle into a file in `/usr/local/share/ca-certificates`. The `entrypoint.sh` script will then update the store with whatever is in the `ca-certificates` directory prior to starting `proxyd`. \ No newline at end of file diff --git a/go/proxyd/backend.go b/go/proxyd/backend.go index 8831a2b9395c6..7b1617b54669e 100644 --- a/go/proxyd/backend.go +++ b/go/proxyd/backend.go @@ -3,6 +3,7 @@ package proxyd import ( "bytes" "context" + "crypto/tls" "encoding/json" "errors" "fmt" @@ -14,6 +15,7 @@ import ( "math" "math/rand" "net/http" + "strconv" "time" ) @@ -24,36 +26,44 @@ const ( var ( ErrInvalidRequest = &RPCErr{ - Code: -32601, - Message: "invalid request", + Code: -32601, + Message: "invalid request", + HTTPErrorCode: 400, } ErrParseErr = &RPCErr{ - Code: -32700, - Message: "parse error", + Code: -32700, + Message: "parse error", + HTTPErrorCode: 400, } ErrInternal = &RPCErr{ - Code: JSONRPCErrorInternal, - Message: "internal error", + Code: JSONRPCErrorInternal, + Message: "internal error", + HTTPErrorCode: 500, } ErrMethodNotWhitelisted = &RPCErr{ - Code: JSONRPCErrorInternal - 1, - Message: "rpc method is not whitelisted", + Code: JSONRPCErrorInternal - 1, + Message: "rpc method is not whitelisted", + HTTPErrorCode: 403, } ErrBackendOffline = &RPCErr{ - Code: JSONRPCErrorInternal - 10, - Message: "backend offline", + Code: JSONRPCErrorInternal - 10, + Message: "backend offline", + HTTPErrorCode: 503, } ErrNoBackends = &RPCErr{ - Code: JSONRPCErrorInternal - 11, - Message: "no backends available for method", + Code: JSONRPCErrorInternal - 11, + Message: "no backends available for method", + HTTPErrorCode: 503, } ErrBackendOverCapacity = &RPCErr{ - Code: JSONRPCErrorInternal - 12, - Message: "backend is over capacity", + Code: JSONRPCErrorInternal - 12, + Message: "backend is over capacity", + HTTPErrorCode: 429, } ErrBackendBadResponse = &RPCErr{ - Code: JSONRPCErrorInternal - 13, - Message: "backend returned an invalid response", + Code: JSONRPCErrorInternal - 13, + Message: "backend returned an invalid response", + HTTPErrorCode: 500, } ) @@ -63,7 +73,7 @@ type Backend struct { wsURL string authUsername string authPassword string - redis Redis + rateLimiter RateLimiter client *http.Client dialer *websocket.Dialer maxRetries int @@ -118,18 +128,27 @@ func WithMaxWSConns(maxConns int) BackendOpt { } } +func WithTLSConfig(tlsConfig *tls.Config) BackendOpt { + return func(b *Backend) { + if b.client.Transport == nil { + b.client.Transport = &http.Transport{} + } + b.client.Transport.(*http.Transport).TLSClientConfig = tlsConfig + } +} + func NewBackend( name string, rpcURL string, wsURL string, - redis Redis, + rateLimiter RateLimiter, opts ...BackendOpt, ) *Backend { backend := &Backend{ Name: name, rpcURL: rpcURL, wsURL: wsURL, - redis: redis, + rateLimiter: rateLimiter, maxResponseSize: math.MaxInt64, client: &http.Client{ Timeout: 5 * time.Second, @@ -160,7 +179,7 @@ func (b *Backend) Forward(ctx context.Context, req *RPCReq) (*RPCRes, error) { for i := 0; i <= b.maxRetries; i++ { RecordRPCForward(ctx, b.Name, req.Method, RPCRequestSourceHTTP) respTimer := prometheus.NewTimer(rpcBackendRequestDurationSumm.WithLabelValues(b.Name, req.Method)) - res, err := b.doForward(req) + res, err := b.doForward(ctx, req) if err != nil { lastError = err log.Warn( @@ -179,6 +198,7 @@ func (b *Backend) Forward(ctx context.Context, req *RPCReq) (*RPCRes, error) { RecordRPCError(ctx, b.Name, req.Method, res.Error) log.Info( "backend responded with RPC error", + "backend", b.Name, "code", res.Error.Code, "msg", res.Error.Message, "req_id", GetReqID(ctx), @@ -187,6 +207,7 @@ func (b *Backend) Forward(ctx context.Context, req *RPCReq) (*RPCRes, error) { ) } else { log.Info("forwarded RPC request", + "backend", b.Name, "method", req.Method, "auth", GetAuthCtx(ctx), "req_id", GetReqID(ctx), @@ -210,7 +231,7 @@ func (b *Backend) ProxyWS(clientConn *websocket.Conn, methodWhitelist *StringSet backendConn, _, err := b.dialer.Dial(b.wsURL, nil) if err != nil { b.setOffline() - if err := b.redis.DecBackendWSConns(b.Name); err != nil { + if err := b.rateLimiter.DecBackendWSConns(b.Name); err != nil { log.Error("error decrementing backend ws conns", "name", b.Name, "err", err) } return nil, wrapErr(err, "error dialing backend") @@ -221,7 +242,7 @@ func (b *Backend) ProxyWS(clientConn *websocket.Conn, methodWhitelist *StringSet } func (b *Backend) Online() bool { - online, err := b.redis.IsBackendOnline(b.Name) + online, err := b.rateLimiter.IsBackendOnline(b.Name) if err != nil { log.Warn( "error getting backend availability, assuming it is offline", @@ -238,7 +259,7 @@ func (b *Backend) IsRateLimited() bool { return false } - usedLimit, err := b.redis.IncBackendRPS(b.Name) + usedLimit, err := b.rateLimiter.IncBackendRPS(b.Name) if err != nil { log.Error( "error getting backend used rate limit, assuming limit is exhausted", @@ -256,7 +277,7 @@ func (b *Backend) IsWSSaturated() bool { return false } - incremented, err := b.redis.IncBackendWSConns(b.Name, b.maxWSConns) + incremented, err := b.rateLimiter.IncBackendWSConns(b.Name, b.maxWSConns) if err != nil { log.Error( "error getting backend used ws conns, assuming limit is exhausted", @@ -270,7 +291,7 @@ func (b *Backend) IsWSSaturated() bool { } func (b *Backend) setOffline() { - err := b.redis.SetBackendOffline(b.Name, b.outOfServiceInterval) + err := b.rateLimiter.SetBackendOffline(b.Name, b.outOfServiceInterval) if err != nil { log.Warn( "error setting backend offline", @@ -280,7 +301,7 @@ func (b *Backend) setOffline() { } } -func (b *Backend) doForward(rpcReq *RPCReq) (*RPCRes, error) { +func (b *Backend) doForward(ctx context.Context, rpcReq *RPCReq) (*RPCRes, error) { body := mustMarshalJSON(rpcReq) httpReq, err := http.NewRequest("POST", b.rpcURL, bytes.NewReader(body)) @@ -299,6 +320,13 @@ func (b *Backend) doForward(rpcReq *RPCReq) (*RPCRes, error) { return nil, wrapErr(err, "error in backend request") } + rpcBackendHTTPResponseCodesTotal.WithLabelValues( + GetAuthCtx(ctx), + b.Name, + rpcReq.Method, + strconv.Itoa(httpRes.StatusCode), + ).Inc() + // Alchemy returns a 400 on bad JSONs, so handle that case if httpRes.StatusCode != 200 && httpRes.StatusCode != 400 { return nil, fmt.Errorf("response code %d", httpRes.StatusCode) @@ -315,6 +343,12 @@ func (b *Backend) doForward(rpcReq *RPCReq) (*RPCRes, error) { return nil, ErrBackendBadResponse } + // capture the HTTP status code in the response. this will only + // ever be 400 given the status check on line 318 above. + if httpRes.StatusCode != 200 { + res.Error.HTTPErrorCode = httpRes.StatusCode + } + return res, nil } @@ -556,7 +590,7 @@ func (w *WSProxier) backendPump(ctx context.Context, errC chan error) { func (w *WSProxier) close() { w.clientConn.Close() w.backendConn.Close() - if err := w.backend.redis.DecBackendWSConns(w.backend.Name); err != nil { + if err := w.backend.rateLimiter.DecBackendWSConns(w.backend.Name); err != nil { log.Error("error decrementing backend ws conns", "name", w.backend.Name, "err", err) } activeBackendWsConnsGauge.WithLabelValues(w.backend.Name).Dec() diff --git a/go/proxyd/config.go b/go/proxyd/config.go index 18a638d044460..c214275912b9b 100644 --- a/go/proxyd/config.go +++ b/go/proxyd/config.go @@ -31,13 +31,16 @@ type BackendConfig struct { RPCURL string `toml:"rpc_url"` WSURL string `toml:"ws_url"` MaxRPS int `toml:"max_rps"` - MaxWSConns int `toml:"max_ws_conns"` + MaxWSConns int `toml:"max_ws_conns"` + CAFile string `toml:"ca_file"` + ClientCertFile string `toml:"client_cert_file"` + ClientKeyFile string `toml:"client_key_file"` } type BackendsConfig map[string]*BackendConfig type BackendGroupConfig struct { - Backends []string `toml:"backends"` + Backends []string `toml:"backends"` } type BackendGroupsConfig map[string]*BackendGroupConfig diff --git a/go/proxyd/entrypoint.sh b/go/proxyd/entrypoint.sh new file mode 100644 index 0000000000000..ef83fa8e47d4f --- /dev/null +++ b/go/proxyd/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Updating CA certificates." +update-ca-certificates +echo "Running CMD." +exec "$@" \ No newline at end of file diff --git a/go/proxyd/example.config.toml b/go/proxyd/example.config.toml index 46cd4ef047812..a289756652926 100644 --- a/go/proxyd/example.config.toml +++ b/go/proxyd/example.config.toml @@ -52,6 +52,12 @@ username = "" password = "" max_rps = 3 max_ws_conns = 1 +# Path to a custom root CA. +ca_file = "" +# Path to a custom client cert file. +client_cert_file = "" +# Path to a custom client key file. +client_key_file = "" [backends.alchemy] # The URL to contact the backend at. diff --git a/go/proxyd/metrics.go b/go/proxyd/metrics.go index 4296676e38f05..18592d8ec4a15 100644 --- a/go/proxyd/metrics.go +++ b/go/proxyd/metrics.go @@ -38,6 +38,17 @@ var ( "source", }) + rpcBackendHTTPResponseCodesTotal = promauto.NewCounterVec(prometheus.CounterOpts{ + Namespace: MetricsNamespace, + Name: "rpc_backend_http_response_codes_total", + Help: "Count of total backend responses by HTTP status code.", + }, []string{ + "auth", + "backend_name", + "method_name", + "status_code", + }) + rpcErrorsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: MetricsNamespace, Name: "rpc_errors_total", @@ -101,6 +112,14 @@ var ( Help: "Count of total HTTP requests.", }) + httpResponseCodesTotal = promauto.NewCounterVec(prometheus.CounterOpts{ + Namespace: MetricsNamespace, + Name: "http_response_codes_total", + Help: "Count of total HTTP response codes.", + }, []string{ + "status_code", + }) + httpRequestDurationSumm = promauto.NewSummary(prometheus.SummaryOpts{ Namespace: MetricsNamespace, Name: "http_request_duration_seconds", diff --git a/go/proxyd/proxyd.go b/go/proxyd/proxyd.go index 950baf0748107..e757d0820c1e5 100644 --- a/go/proxyd/proxyd.go +++ b/go/proxyd/proxyd.go @@ -1,6 +1,7 @@ package proxyd import ( + "crypto/tls" "errors" "fmt" "github.com/ethereum/go-ethereum/log" @@ -29,9 +30,16 @@ func Start(config *Config) error { } } - redis, err := NewRedis(config.Redis.URL) - if err != nil { - return err + var lim RateLimiter + var err error + if config.Redis == nil { + log.Warn("redis is not configured, using local rate limiter") + lim = NewLocalRateLimiter() + } else { + lim, err = NewRedisRateLimiter(config.Redis.URL) + if err != nil { + return err + } } backendNames := make([]string, 0) @@ -68,7 +76,15 @@ func Start(config *Config) error { if cfg.Password != "" { opts = append(opts, WithBasicAuth(cfg.Username, cfg.Password)) } - back := NewBackend(name, cfg.RPCURL, cfg.WSURL, redis, opts...) + tlsConfig, err := configureBackendTLS(cfg) + if err != nil { + return err + } + if tlsConfig != nil { + log.Info("using custom TLS config for backend", "name", name) + opts = append(opts, WithTLSConfig(tlsConfig)) + } + back := NewBackend(name, cfg.RPCURL, cfg.WSURL, lim, opts...) backendNames = append(backendNames, name) backendsByName[name] = back log.Info("configured backend", "name", name, "rpc_url", cfg.RPCURL, "ws_url", cfg.WSURL) @@ -90,17 +106,17 @@ func Start(config *Config) error { backendGroups[bgName] = group } - var wsBackendGroup *BackendGroup - if config.WSBackendGroup != "" { - wsBackendGroup = backendGroups[config.WSBackendGroup] - if wsBackendGroup == nil { - return fmt.Errorf("ws backend group %s does not exist", config.WSBackendGroup) - } - } + var wsBackendGroup *BackendGroup + if config.WSBackendGroup != "" { + wsBackendGroup = backendGroups[config.WSBackendGroup] + if wsBackendGroup == nil { + return fmt.Errorf("ws backend group %s does not exist", config.WSBackendGroup) + } + } - if wsBackendGroup == nil && config.Server.WSPort != 0 { - return fmt.Errorf("a ws port was defined, but no ws group was defined") - } + if wsBackendGroup == nil && config.Server.WSPort != 0 { + return fmt.Errorf("a ws port was defined, but no ws group was defined") + } for _, bg := range config.RPCMethodMappings { if backendGroups[bg] == nil { @@ -152,7 +168,7 @@ func Start(config *Config) error { recvSig := <-sig log.Info("caught signal, shutting down", "signal", recvSig) srv.Shutdown() - if err := redis.FlushBackendWSConns(backendNames); err != nil { + if err := lim.FlushBackendWSConns(backendNames); err != nil { log.Error("error flushing backend ws conns", "err", err) } return nil @@ -161,3 +177,24 @@ func Start(config *Config) error { func secondsToDuration(seconds int) time.Duration { return time.Duration(seconds) * time.Second } + +func configureBackendTLS(cfg *BackendConfig) (*tls.Config, error) { + if cfg.CAFile == "" { + return nil, nil + } + + tlsConfig, err := CreateTLSClient(cfg.CAFile) + if err != nil { + return nil, err + } + + if cfg.ClientCertFile != "" && cfg.ClientKeyFile != "" { + cert, err := ParseKeyPair(cfg.ClientCertFile, cfg.ClientKeyFile) + if err != nil { + return nil, err + } + tlsConfig.Certificates = []tls.Certificate{cert} + } + + return tlsConfig, nil +} diff --git a/go/proxyd/redis.go b/go/proxyd/rate_limiter.go similarity index 64% rename from go/proxyd/redis.go rename to go/proxyd/rate_limiter.go index b88514d1a5a05..6954949c35e77 100644 --- a/go/proxyd/redis.go +++ b/go/proxyd/rate_limiter.go @@ -40,7 +40,7 @@ end return false ` -type Redis interface { +type RateLimiter interface { IsBackendOnline(name string) (bool, error) SetBackendOffline(name string, duration time.Duration) error IncBackendRPS(name string) (int, error) @@ -49,14 +49,14 @@ type Redis interface { FlushBackendWSConns(names []string) error } -type RedisImpl struct { +type RedisRateLimiter struct { rdb *redis.Client randID string touchKeys map[string]time.Duration tkMtx sync.Mutex } -func NewRedis(url string) (Redis, error) { +func NewRedisRateLimiter(url string) (RateLimiter, error) { opts, err := redis.ParseURL(url) if err != nil { return nil, err @@ -65,7 +65,7 @@ func NewRedis(url string) (Redis, error) { if err := rdb.Ping(context.Background()).Err(); err != nil { return nil, wrapErr(err, "error connecting to redis") } - out := &RedisImpl{ + out := &RedisRateLimiter{ rdb: rdb, randID: randStr(20), touchKeys: make(map[string]time.Duration), @@ -74,7 +74,7 @@ func NewRedis(url string) (Redis, error) { return out, nil } -func (r *RedisImpl) IsBackendOnline(name string) (bool, error) { +func (r *RedisRateLimiter) IsBackendOnline(name string) (bool, error) { exists, err := r.rdb.Exists(context.Background(), fmt.Sprintf("backend:%s:offline", name)).Result() if err != nil { RecordRedisError("IsBackendOnline") @@ -84,7 +84,7 @@ func (r *RedisImpl) IsBackendOnline(name string) (bool, error) { return exists == 0, nil } -func (r *RedisImpl) SetBackendOffline(name string, duration time.Duration) error { +func (r *RedisRateLimiter) SetBackendOffline(name string, duration time.Duration) error { err := r.rdb.SetEX( context.Background(), fmt.Sprintf("backend:%s:offline", name), @@ -98,7 +98,7 @@ func (r *RedisImpl) SetBackendOffline(name string, duration time.Duration) error return nil } -func (r *RedisImpl) IncBackendRPS(name string) (int, error) { +func (r *RedisRateLimiter) IncBackendRPS(name string) (int, error) { cmd := r.rdb.Eval( context.Background(), MaxRPSScript, @@ -112,7 +112,7 @@ func (r *RedisImpl) IncBackendRPS(name string) (int, error) { return rps, nil } -func (r *RedisImpl) IncBackendWSConns(name string, max int) (bool, error) { +func (r *RedisRateLimiter) IncBackendWSConns(name string, max int) (bool, error) { connsKey := fmt.Sprintf("proxy:%s:wsconns:%s", r.randID, name) r.tkMtx.Lock() r.touchKeys[connsKey] = 5 * time.Minute @@ -138,7 +138,7 @@ func (r *RedisImpl) IncBackendWSConns(name string, max int) (bool, error) { return incremented, nil } -func (r *RedisImpl) DecBackendWSConns(name string) error { +func (r *RedisRateLimiter) DecBackendWSConns(name string) error { connsKey := fmt.Sprintf("proxy:%s:wsconns:%s", r.randID, name) err := r.rdb.Decr(context.Background(), connsKey).Err() if err != nil { @@ -148,7 +148,7 @@ func (r *RedisImpl) DecBackendWSConns(name string) error { return nil } -func (r *RedisImpl) FlushBackendWSConns(names []string) error { +func (r *RedisRateLimiter) FlushBackendWSConns(names []string) error { ctx := context.Background() for _, name := range names { connsKey := fmt.Sprintf("proxy:%s:wsconns:%s", r.randID, name) @@ -168,7 +168,7 @@ func (r *RedisImpl) FlushBackendWSConns(names []string) error { return nil } -func (r *RedisImpl) touch() { +func (r *RedisRateLimiter) touch() { for { r.tkMtx.Lock() for key, dur := range r.touchKeys { @@ -182,6 +182,76 @@ func (r *RedisImpl) touch() { } } +type LocalRateLimiter struct { + deadBackends map[string]time.Time + backendRPS map[string]int + backendWSConns map[string]int + mtx sync.RWMutex +} + +func NewLocalRateLimiter() *LocalRateLimiter { + out := &LocalRateLimiter{ + deadBackends: make(map[string]time.Time), + backendRPS: make(map[string]int), + backendWSConns: make(map[string]int), + } + go out.clear() + return out +} + +func (l *LocalRateLimiter) IsBackendOnline(name string) (bool, error) { + l.mtx.RLock() + defer l.mtx.RUnlock() + return l.deadBackends[name].Before(time.Now()), nil +} + +func (l *LocalRateLimiter) SetBackendOffline(name string, duration time.Duration) error { + l.mtx.Lock() + defer l.mtx.Unlock() + l.deadBackends[name] = time.Now().Add(duration) + return nil +} + +func (l *LocalRateLimiter) IncBackendRPS(name string) (int, error) { + l.mtx.Lock() + defer l.mtx.Unlock() + l.backendRPS[name] += 1 + return l.backendRPS[name], nil +} + +func (l *LocalRateLimiter) IncBackendWSConns(name string, max int) (bool, error) { + l.mtx.Lock() + defer l.mtx.Unlock() + if l.backendWSConns[name] == max { + return false, nil + } + l.backendWSConns[name] += 1 + return true, nil +} + +func (l *LocalRateLimiter) DecBackendWSConns(name string) error { + l.mtx.Lock() + defer l.mtx.Unlock() + if l.backendWSConns[name] == 0 { + return nil + } + l.backendWSConns[name] -= 1 + return nil +} + +func (l *LocalRateLimiter) FlushBackendWSConns(names []string) error { + return nil +} + +func (l *LocalRateLimiter) clear() { + for { + time.Sleep(time.Second) + l.mtx.Lock() + l.backendRPS = make(map[string]int) + l.mtx.Unlock() + } +} + func randStr(l int) string { b := make([]byte, l) if _, err := rand.Read(b); err != nil { diff --git a/go/proxyd/rpc.go b/go/proxyd/rpc.go index a70b525d6abc8..6b79671b0708b 100644 --- a/go/proxyd/rpc.go +++ b/go/proxyd/rpc.go @@ -25,8 +25,9 @@ func (r *RPCRes) IsError() bool { } type RPCErr struct { - Code int `json:"code"` - Message string `json:"message"` + Code int `json:"code"` + Message string `json:"message"` + HTTPErrorCode int `json:"-"` } func (r *RPCErr) Error() string { diff --git a/go/proxyd/server.go b/go/proxyd/server.go index 6e9e70f190b9d..392add32640a5 100644 --- a/go/proxyd/server.go +++ b/go/proxyd/server.go @@ -12,6 +12,7 @@ import ( "github.com/rs/cors" "io" "net/http" + "strconv" "time" ) @@ -105,7 +106,12 @@ func (s *Server) HandleRPC(w http.ResponseWriter, r *http.Request) { return } - log.Info("received RPC request", "req_id", GetReqID(ctx), "auth", GetAuthCtx(ctx)) + log.Info( + "received RPC request", + "req_id", GetReqID(ctx), + "auth", GetAuthCtx(ctx), + "user_agent", r.Header.Get("user-agent"), + ) req, err := ParseRPCReq(io.LimitReader(r.Body, s.maxBodySize)) if err != nil { @@ -200,6 +206,7 @@ func (s *Server) populateContext(w http.ResponseWriter, r *http.Request) context // but someone sends in an auth key anyway if authorization != "" { log.Info("blocked authenticated request against unauthenticated proxy") + httpResponseCodesTotal.WithLabelValues("404").Inc() w.WriteHeader(404) return nil } @@ -212,6 +219,7 @@ func (s *Server) populateContext(w http.ResponseWriter, r *http.Request) context if authorization == "" || s.authenticatedPaths[authorization] == "" { log.Info("blocked unauthorized request", "authorization", authorization) + httpResponseCodesTotal.WithLabelValues("401").Inc() w.WriteHeader(401) return nil } @@ -225,21 +233,29 @@ func (s *Server) populateContext(w http.ResponseWriter, r *http.Request) context } func writeRPCError(w http.ResponseWriter, id *int, err error) { - enc := json.NewEncoder(w) - w.WriteHeader(200) - - var body *RPCRes + var res *RPCRes if r, ok := err.(*RPCErr); ok { - body = NewRPCErrorRes(id, r) + res = NewRPCErrorRes(id, r) } else { - body = NewRPCErrorRes(id, &RPCErr{ + res = NewRPCErrorRes(id, &RPCErr{ Code: JSONRPCErrorInternal, Message: "internal error", }) } - if err := enc.Encode(body); err != nil { - log.Error("error writing rpc error", "err", err) + writeRPCRes(w, res) +} + +func writeRPCRes(w http.ResponseWriter, res *RPCRes) { + statusCode := 200 + if res.IsError() && res.Error.HTTPErrorCode != 0 { + statusCode = res.Error.HTTPErrorCode + } + w.WriteHeader(statusCode) + enc := json.NewEncoder(w) + if err := enc.Encode(res); err != nil { + log.Error("error writing rpc response", "err", err) } + httpResponseCodesTotal.WithLabelValues(strconv.Itoa(statusCode)).Inc() } func instrumentedHdlr(h http.Handler) http.HandlerFunc { diff --git a/go/proxyd/tls.go b/go/proxyd/tls.go new file mode 100644 index 0000000000000..3aa26a9a42df5 --- /dev/null +++ b/go/proxyd/tls.go @@ -0,0 +1,33 @@ +package proxyd + +import ( + "crypto/tls" + "crypto/x509" + "errors" + "io/ioutil" +) + +func CreateTLSClient(ca string) (*tls.Config, error) { + pem, err := ioutil.ReadFile(ca) + if err != nil { + return nil, wrapErr(err, "error reading CA") + } + + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM(pem) + if !ok { + return nil, errors.New("error parsing TLS client cert") + } + + return &tls.Config{ + RootCAs: roots, + }, nil +} + +func ParseKeyPair(crt, key string) (tls.Certificate, error) { + cert, err := tls.LoadX509KeyPair(crt, key) + if err != nil { + return tls.Certificate{}, wrapErr(err, "error loading x509 key pair") + } + return cert, nil +} \ No newline at end of file diff --git a/integration-tests/package.json b/integration-tests/package.json index f0bed14fa2a11..584cee059a6cc 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -31,6 +31,7 @@ "@eth-optimism/contracts": "0.5.4", "@eth-optimism/core-utils": "0.7.2", "@eth-optimism/message-relayer": "0.2.4", + "@ethersproject/abstract-provider": "^5.5.1", "@ethersproject/providers": "^5.4.5", "@ethersproject/transactions": "^5.4.0", "@nomiclabs/hardhat-ethers": "^2.0.2", diff --git a/integration-tests/test/replica.spec.ts b/integration-tests/test/replica.spec.ts new file mode 100644 index 0000000000000..b4ea35b8b4a0f --- /dev/null +++ b/integration-tests/test/replica.spec.ts @@ -0,0 +1,75 @@ +import { OptimismEnv } from './shared/env' +import { + defaultTransactionFactory, + gasPriceForL2, + sleep, + isLiveNetwork, +} from './shared/utils' +import { expect } from 'chai' +import { TransactionReceipt } from '@ethersproject/abstract-provider' + +describe('Replica Tests', () => { + let env: OptimismEnv + + before(async () => { + env = await OptimismEnv.new() + }) + + describe('Matching blocks', () => { + if (isLiveNetwork()) { + console.log('Skipping replica tests on live network') + return + } + + it('should sync a transaction', async () => { + const tx = defaultTransactionFactory() + tx.gasPrice = await gasPriceForL2(env) + const result = await env.l2Wallet.sendTransaction(tx) + + let receipt: TransactionReceipt + while (!receipt) { + receipt = await env.replicaProvider.getTransactionReceipt(result.hash) + await sleep(200) + } + + const sequencerBlock = (await env.l2Provider.getBlock( + result.blockNumber + )) as any + + const replicaBlock = (await env.replicaProvider.getBlock( + result.blockNumber + )) as any + + expect(sequencerBlock.stateRoot).to.deep.eq(replicaBlock.stateRoot) + expect(sequencerBlock.hash).to.deep.eq(replicaBlock.hash) + }) + + it('sync an unprotected tx (eip155)', async () => { + const tx = { + ...defaultTransactionFactory(), + nonce: await env.l2Wallet.getTransactionCount(), + gasPrice: await gasPriceForL2(env), + chainId: null, // Disables EIP155 transaction signing. + } + const signed = await env.l2Wallet.signTransaction(tx) + const result = await env.l2Provider.sendTransaction(signed) + + let receipt: TransactionReceipt + while (!receipt) { + receipt = await env.replicaProvider.getTransactionReceipt(result.hash) + await sleep(200) + } + + const sequencerBlock = (await env.l2Provider.getBlock( + result.blockNumber + )) as any + + const replicaBlock = (await env.replicaProvider.getBlock( + result.blockNumber + )) as any + + expect(sequencerBlock.stateRoot).to.deep.eq(replicaBlock.stateRoot) + expect(sequencerBlock.hash).to.deep.eq(replicaBlock.hash) + }) + }) +}) diff --git a/integration-tests/test/rpc.spec.ts b/integration-tests/test/rpc.spec.ts index afaadd2a30750..240e87821c527 100644 --- a/integration-tests/test/rpc.spec.ts +++ b/integration-tests/test/rpc.spec.ts @@ -84,16 +84,19 @@ describe('Basic RPC tests', () => { ).to.be.rejectedWith('invalid transaction: invalid sender') }) - it('should not accept a transaction without a chain ID', async () => { + it('should accept a transaction without a chain ID', async () => { const tx = { ...defaultTransactionFactory(), + nonce: await wallet.getTransactionCount(), gasPrice: await gasPriceForL2(env), chainId: null, // Disables EIP155 transaction signing. } + const signed = await wallet.signTransaction(tx) + const response = await provider.sendTransaction(signed) - await expect( - provider.sendTransaction(await wallet.signTransaction(tx)) - ).to.be.rejectedWith('Cannot submit unprotected transaction') + expect(response.chainId).to.equal(0) + const v = response.v + expect(v === 27 || v === 28).to.be.true }) it('should accept a transaction with a value', async () => { diff --git a/integration-tests/test/shared/env.ts b/integration-tests/test/shared/env.ts index 2e2120397d3e0..bdfd02b3d0b12 100644 --- a/integration-tests/test/shared/env.ts +++ b/integration-tests/test/shared/env.ts @@ -10,6 +10,7 @@ import { getAddressManager, l1Provider, l2Provider, + replicaProvider, l1Wallet, l2Wallet, fundUser, @@ -52,6 +53,7 @@ export class OptimismEnv { // The providers l1Provider: providers.JsonRpcProvider l2Provider: providers.JsonRpcProvider + replicaProvider: providers.JsonRpcProvider constructor(args: any) { this.addressManager = args.addressManager @@ -67,6 +69,7 @@ export class OptimismEnv { this.l2Wallet = args.l2Wallet this.l1Provider = args.l1Provider this.l2Provider = args.l2Provider + this.replicaProvider = args.replicaProvider this.ctc = args.ctc this.scc = args.scc } @@ -126,6 +129,7 @@ export class OptimismEnv { l2Wallet, l1Provider, l2Provider, + replicaProvider, }) } diff --git a/integration-tests/test/shared/utils.ts b/integration-tests/test/shared/utils.ts index eef601c4cb3b1..82f1f68e3068c 100644 --- a/integration-tests/test/shared/utils.ts +++ b/integration-tests/test/shared/utils.ts @@ -55,13 +55,19 @@ const env = cleanEnv(process.env, { export const l1Provider = new providers.JsonRpcProvider(env.L1_URL) l1Provider.pollingInterval = env.L1_POLLING_INTERVAL -export const l2Provider = new providers.JsonRpcProvider(env.L2_URL) +export const l2Provider = injectL2Context( + new providers.JsonRpcProvider(env.L2_URL) +) l2Provider.pollingInterval = env.L2_POLLING_INTERVAL -export const verifierProvider = new providers.JsonRpcProvider(env.VERIFIER_URL) +export const verifierProvider = injectL2Context( + new providers.JsonRpcProvider(env.VERIFIER_URL) +) verifierProvider.pollingInterval = env.VERIFIER_POLLING_INTERVAL -export const replicaProvider = new providers.JsonRpcProvider(env.REPLICA_URL) +export const replicaProvider = injectL2Context( + new providers.JsonRpcProvider(env.REPLICA_URL) +) replicaProvider.pollingInterval = env.REPLICA_POLLING_INTERVAL // The sequencer private key which is funded on L1 diff --git a/l2geth/internal/ethapi/api.go b/l2geth/internal/ethapi/api.go index 198e259259530..7b6f1a27852df 100644 --- a/l2geth/internal/ethapi/api.go +++ b/l2geth/internal/ethapi/api.go @@ -1573,9 +1573,6 @@ func (args *SendTxArgs) toTransaction() *types.Transaction { // SubmitTransaction is a helper function that submits tx to txPool and logs a message. func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) { - if !tx.Protected() { - return common.Hash{}, errors.New("Cannot submit unprotected transaction") - } if err := b.SendTx(ctx, tx); err != nil { return common.Hash{}, err } diff --git a/l2geth/rollup/client.go b/l2geth/rollup/client.go index 7d6f046061f73..5370fbc209427 100644 --- a/l2geth/rollup/client.go +++ b/l2geth/rollup/client.go @@ -134,8 +134,8 @@ type RollupClient interface { // Client is an HTTP based RollupClient type Client struct { - client *resty.Client - signer *types.EIP155Signer + client *resty.Client + chainID *big.Int } // TransactionResponse represents the response from the remote server when @@ -166,11 +166,10 @@ func NewClient(url string, chainID *big.Int) *Client { } return nil }) - signer := types.NewEIP155Signer(chainID) return &Client{ - client: client, - signer: &signer, + client: client, + chainID: chainID, } } @@ -322,7 +321,7 @@ func (c *Client) GetLatestTransactionBatchIndex() (*uint64, error) { // batchedTransactionToTransaction converts a transaction into a // types.Transaction that can be consumed by the SyncService -func batchedTransactionToTransaction(res *transaction, signer *types.EIP155Signer) (*types.Transaction, error) { +func batchedTransactionToTransaction(res *transaction, chainID *big.Int) (*types.Transaction, error) { // `nil` transactions are not found if res == nil { return nil, errElementNotFound @@ -373,7 +372,15 @@ func batchedTransactionToTransaction(res *transaction, signer *types.EIP155Signe sig := make([]byte, crypto.SignatureLength) copy(sig[32-len(r):32], r) copy(sig[64-len(s):64], s) - sig[64] = byte(res.Decoded.Signature.V) + + var signer types.Signer + if res.Decoded.Signature.V == 27 || res.Decoded.Signature.V == 28 { + signer = types.HomesteadSigner{} + sig[64] = byte(res.Decoded.Signature.V - 27) + } else { + signer = types.NewEIP155Signer(chainID) + sig[64] = byte(res.Decoded.Signature.V) + } tx, err := tx.WithSignature(signer, sig[:]) if err != nil { @@ -431,7 +438,7 @@ func (c *Client) GetTransaction(index uint64, backend Backend) (*types.Transacti if !ok { return nil, fmt.Errorf("could not get tx with index %d", index) } - return batchedTransactionToTransaction(res.Transaction, c.signer) + return batchedTransactionToTransaction(res.Transaction, c.chainID) } // GetLatestTransaction will get the latest transaction, meaning the transaction @@ -452,7 +459,7 @@ func (c *Client) GetLatestTransaction(backend Backend) (*types.Transaction, erro return nil, errors.New("Cannot get latest transaction") } - return batchedTransactionToTransaction(res.Transaction, c.signer) + return batchedTransactionToTransaction(res.Transaction, c.chainID) } // GetEthContext will return the EthContext by block number @@ -564,7 +571,7 @@ func (c *Client) GetLatestTransactionBatch() (*Batch, []*types.Transaction, erro if !ok { return nil, nil, fmt.Errorf("Cannot parse transaction batch response") } - return parseTransactionBatchResponse(txBatch, c.signer) + return parseTransactionBatchResponse(txBatch, c.chainID) } // GetTransactionBatch will return the transaction batch by batch index @@ -584,19 +591,19 @@ func (c *Client) GetTransactionBatch(index uint64) (*Batch, []*types.Transaction if !ok { return nil, nil, fmt.Errorf("Cannot parse transaction batch response") } - return parseTransactionBatchResponse(txBatch, c.signer) + return parseTransactionBatchResponse(txBatch, c.chainID) } // parseTransactionBatchResponse will turn a TransactionBatchResponse into a // Batch and its corresponding types.Transactions -func parseTransactionBatchResponse(txBatch *TransactionBatchResponse, signer *types.EIP155Signer) (*Batch, []*types.Transaction, error) { +func parseTransactionBatchResponse(txBatch *TransactionBatchResponse, chainID *big.Int) (*Batch, []*types.Transaction, error) { if txBatch == nil || txBatch.Batch == nil { return nil, nil, errElementNotFound } batch := txBatch.Batch txs := make([]*types.Transaction, len(txBatch.Transactions)) for i, tx := range txBatch.Transactions { - transaction, err := batchedTransactionToTransaction(tx, signer) + transaction, err := batchedTransactionToTransaction(tx, chainID) if err != nil { return nil, nil, fmt.Errorf("Cannot parse transaction batch: %w", err) } diff --git a/ops/docker-compose-metrics.yml b/ops/docker-compose-metrics.yml index 4660245568116..eff9e76871c94 100644 --- a/ops/docker-compose-metrics.yml +++ b/ops/docker-compose-metrics.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.4" services: l2geth: @@ -51,4 +51,4 @@ volumes: influxdb_data: grafana_data: grafana_dashboards: - prometheus_data: \ No newline at end of file + prometheus_data: diff --git a/ops/docker-compose-nobuild.yml b/ops/docker-compose-nobuild.yml index 7db3ebac54a4b..128d706706c4c 100644 --- a/ops/docker-compose-nobuild.yml +++ b/ops/docker-compose-nobuild.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.4" services: l1_chain: image: ethereumoptimism/hardhat-node:${DOCKER_TAG:-prerelease-0.5.0-rc-7-ee217ce} diff --git a/ops/docker-compose-rpc-proxy.yml b/ops/docker-compose-rpc-proxy.yml index dccd31c1cb077..f7d3037dccfb4 100644 --- a/ops/docker-compose-rpc-proxy.yml +++ b/ops/docker-compose-rpc-proxy.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.4" services: rpc-proxy: depends_on: diff --git a/ops/docker-compose.yml b/ops/docker-compose.yml index ed6c69de460f6..6fb0c0b6a95b5 100644 --- a/ops/docker-compose.yml +++ b/ops/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.4" services: # this is a helper service used because there's no official hardhat image @@ -165,7 +165,7 @@ services: depends_on: - dtl deploy: - replicas: 0 + replicas: 1 build: context: .. dockerfile: ./ops/docker/Dockerfile.geth @@ -181,8 +181,8 @@ services: ETH1_CTC_DEPLOYMENT_HEIGHT: 8 RETRIES: 60 ports: - - ${L2GETH_HTTP_PORT:-8549}:8545 - - ${L2GETH_WS_PORT:-8550}:8546 + - ${REPLICA_HTTP_PORT:-8549}:8545 + - ${REPLICA_WS_PORT:-8550}:8546 integration_tests: deploy: @@ -195,6 +195,8 @@ services: environment: L1_URL: http://l1_chain:8545 L2_URL: http://l2geth:8545 + REPLICA_URL: http://replica:8545 + VERIFIER_URL: http://verifier:8545 URL: http://deployer:8081/addresses.json ENABLE_GAS_REPORT: 1 NO_NETWORK: 1 diff --git a/packages/contracts/package.json b/packages/contracts/package.json index f8697e919d823..40e008aa7534f 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -73,8 +73,8 @@ "@nomiclabs/hardhat-waffle": "^2.0.1", "@openzeppelin/contracts": "4.3.2", "@openzeppelin/contracts-upgradeable": "4.3.2", - "@typechain/ethers-v5": "^7.0.1", - "@typechain/hardhat": "^2.3.0", + "@typechain/ethers-v5": "^8.0.2", + "@typechain/hardhat": "^3.0.0", "@types/chai": "^4.2.18", "@types/lodash": "^4.14.168", "@types/mkdirp": "^1.0.1", @@ -117,7 +117,7 @@ "solidity-coverage": "^0.7.17", "ts-generator": "0.0.8", "ts-node": "^10.0.0", - "typechain": "^5.1.0", + "typechain": "^6.0.2", "typescript": "^4.3.5", "yargs": "^16.2.0" }, diff --git a/packages/core-utils/src/alias.ts b/packages/core-utils/src/alias.ts index ded2b3fb74cca..db39b8735134f 100644 --- a/packages/core-utils/src/alias.ts +++ b/packages/core-utils/src/alias.ts @@ -1,22 +1,21 @@ import { ethers } from 'ethers' +import { bnToAddress } from './bn' +// Constant representing the alias to apply to the msg.sender when a contract sends an L1 => L2 +// message. We need this aliasing scheme because a contract can be deployed to the same address +// on both L1 and L2 but with different bytecode (address is not dependent on bytecode when using +// the standard CREATE opcode). We want to treat L1 contracts as having a different address while +// still making it possible for L2 contracts to easily reverse the aliasing scheme and figure out +// the real address of the contract that sent the L1 => L2 message. export const L1_TO_L2_ALIAS_OFFSET = '0x1111000000000000000000000000000000001111' -export const bnToAddress = (bn: ethers.BigNumber | number): string => { - bn = ethers.BigNumber.from(bn) - if (bn.isNegative()) { - bn = ethers.BigNumber.from('0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') - .add(bn) - .add(1) - } - - const addr = bn.toHexString().slice(2).padStart(40, '0') - return ethers.utils.getAddress( - '0x' + addr.slice(addr.length - 40, addr.length) - ) -} - +/** + * Applies the L1 => L2 aliasing scheme to an address. + * + * @param address Address to apply the scheme to. + * @returns Address with the scheme applied. + */ export const applyL1ToL2Alias = (address: string): string => { if (!ethers.utils.isAddress(address)) { throw new Error(`not a valid address: ${address}`) @@ -25,6 +24,12 @@ export const applyL1ToL2Alias = (address: string): string => { return bnToAddress(ethers.BigNumber.from(address).add(L1_TO_L2_ALIAS_OFFSET)) } +/** + * Reverses the L1 => L2 aliasing scheme from an address. + * + * @param address Address to reverse the scheme from. + * @returns Alias with the scheme reversed. + */ export const undoL1ToL2Alias = (address: string): string => { if (!ethers.utils.isAddress(address)) { throw new Error(`not a valid address: ${address}`) diff --git a/packages/core-utils/src/bn.ts b/packages/core-utils/src/bn.ts new file mode 100644 index 0000000000000..a4de2b624278f --- /dev/null +++ b/packages/core-utils/src/bn.ts @@ -0,0 +1,37 @@ +import { ethers } from 'ethers' +import { remove0x, add0x } from './common/hex-strings' + +/** + * Converts an ethers BigNumber into an equivalent Ethereum address representation. + * + * @param bn BigNumber to convert to an address. + * @return BigNumber converted to an address, represented as a hex string. + */ +export const bnToAddress = (bn: ethers.BigNumber | number): string => { + // Coerce numbers into a BigNumber. + bn = ethers.BigNumber.from(bn) + + // Negative numbers are converted to addresses by adding MAX_ADDRESS + 1. + // TODO: Explain this in more detail, it's basically just matching the behavior of doing + // addr(uint256(addr) - some_number) in Solidity where some_number > uint256(addr). + if (bn.isNegative()) { + bn = ethers.BigNumber.from('0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') + .add(bn) + .add(1) + } + + // Convert to a hex string + let addr = bn.toHexString() + // Remove leading 0x so we can mutate the address a bit + addr = remove0x(addr) + // Make sure it's 40 characters (= 20 bytes) + addr = addr.padStart(40, '0') + // Only take the last 40 characters (= 20 bytes) + addr = addr.slice(addr.length - 40, addr.length) + // Add 0x again + addr = add0x(addr) + // Convert into a checksummed address + addr = ethers.utils.getAddress(addr) + + return addr +} diff --git a/packages/core-utils/src/events.ts b/packages/core-utils/src/events.ts deleted file mode 100644 index b0a2306a171bd..0000000000000 --- a/packages/core-utils/src/events.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { ethers } from 'ethers' - -export interface EventArgsAddressSet { - _name: string - _newAddress: string - _oldAddress: string -} - -export interface EventArgsTransactionEnqueued { - _l1TxOrigin: string - _target: string - _gasLimit: ethers.BigNumber - _data: string - _queueIndex: ethers.BigNumber - _timestamp: ethers.BigNumber -} - -export interface EventArgsTransactionBatchAppended { - _batchIndex: ethers.BigNumber - _batchRoot: string - _batchSize: ethers.BigNumber - _prevTotalElements: ethers.BigNumber - _extraData: string -} - -export interface EventArgsStateBatchAppended { - _batchIndex: ethers.BigNumber - _batchRoot: string - _batchSize: ethers.BigNumber - _prevTotalElements: ethers.BigNumber - _extraData: string -} - -export interface EventArgsSequencerBatchAppended { - _startingQueueIndex: ethers.BigNumber - _numQueueElements: ethers.BigNumber - _totalElements: ethers.BigNumber -} diff --git a/packages/core-utils/src/index.ts b/packages/core-utils/src/index.ts index 8c45e1cce066a..3604c7b622d79 100644 --- a/packages/core-utils/src/index.ts +++ b/packages/core-utils/src/index.ts @@ -2,10 +2,10 @@ export * from './coders' export * from './common' export * from './watcher' export * from './l2context' -export * from './events' export * from './batches' export * from './bcfg' export * from './fees' export * from './provider' export * from './alias' export * from './types' +export * from './bn' diff --git a/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts b/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts index 49a7243c97401..3c5a724a4b320 100644 --- a/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts +++ b/packages/data-transport-layer/src/services/l1-ingestion/handlers/sequencer-batch-appended.ts @@ -5,8 +5,8 @@ import { fromHexString, toHexString, toRpcHexString, - EventArgsSequencerBatchAppended, } from '@eth-optimism/core-utils' +import { SequencerBatchAppendedEvent } from '@eth-optimism/contracts/dist/types/CanonicalTransactionChain' /* Imports: Internal */ import { @@ -21,7 +21,7 @@ import { SEQUENCER_GAS_LIMIT, parseSignatureVParam } from '../../../utils' import { MissingElementError } from './errors' export const handleEventsSequencerBatchAppended: EventHandlerSet< - EventArgsSequencerBatchAppended, + SequencerBatchAppendedEvent, SequencerBatchAppendedExtraData, SequencerBatchAppendedParsedEvent > = { diff --git a/packages/data-transport-layer/src/services/l1-ingestion/handlers/state-batch-appended.ts b/packages/data-transport-layer/src/services/l1-ingestion/handlers/state-batch-appended.ts index 1822a73f0d793..c9249b8db6452 100644 --- a/packages/data-transport-layer/src/services/l1-ingestion/handlers/state-batch-appended.ts +++ b/packages/data-transport-layer/src/services/l1-ingestion/handlers/state-batch-appended.ts @@ -1,6 +1,6 @@ /* Imports: External */ +import { StateBatchAppendedEvent } from '@eth-optimism/contracts/dist/types/StateCommitmentChain' import { getContractFactory } from '@eth-optimism/contracts' -import { EventArgsStateBatchAppended } from '@eth-optimism/core-utils' import { BigNumber } from 'ethers' /* Imports: Internal */ @@ -14,7 +14,7 @@ import { import { MissingElementError } from './errors' export const handleEventsStateBatchAppended: EventHandlerSet< - EventArgsStateBatchAppended, + StateBatchAppendedEvent, StateBatchAppendedExtraData, StateBatchAppendedParsedEvent > = { diff --git a/packages/data-transport-layer/src/services/l1-ingestion/handlers/transaction-enqueued.ts b/packages/data-transport-layer/src/services/l1-ingestion/handlers/transaction-enqueued.ts index 415d65fa1ef62..7d60240986391 100644 --- a/packages/data-transport-layer/src/services/l1-ingestion/handlers/transaction-enqueued.ts +++ b/packages/data-transport-layer/src/services/l1-ingestion/handlers/transaction-enqueued.ts @@ -1,12 +1,13 @@ -import { EventArgsTransactionEnqueued } from '@eth-optimism/core-utils' +/* Imports: External */ +import { BigNumber } from 'ethers' +import { TransactionEnqueuedEvent } from '@eth-optimism/contracts/dist/types/CanonicalTransactionChain' /* Imports: Internal */ -import { BigNumber } from 'ethers' import { EnqueueEntry, EventHandlerSet } from '../../../types' import { MissingElementError } from './errors' export const handleEventsTransactionEnqueued: EventHandlerSet< - EventArgsTransactionEnqueued, + TransactionEnqueuedEvent, null, EnqueueEntry > = { diff --git a/packages/data-transport-layer/src/services/l1-ingestion/service.ts b/packages/data-transport-layer/src/services/l1-ingestion/service.ts index ae0295f94544a..fd5905fac4759 100644 --- a/packages/data-transport-layer/src/services/l1-ingestion/service.ts +++ b/packages/data-transport-layer/src/services/l1-ingestion/service.ts @@ -1,6 +1,7 @@ /* Imports: External */ import { fromHexString, FallbackProvider } from '@eth-optimism/core-utils' import { BaseService, Metrics } from '@eth-optimism/common-ts' +import { TypedEvent } from '@eth-optimism/contracts/dist/types/common' import { BaseProvider } from '@ethersproject/providers' import { LevelUp } from 'levelup' import { constants } from 'ethers' @@ -15,7 +16,7 @@ import { loadContract, validators, } from '../../utils' -import { TypedEthersEvent, EventHandlerSet } from '../../types' +import { EventHandlerSet } from '../../types' import { handleEventsTransactionEnqueued } from './handlers/transaction-enqueued' import { handleEventsSequencerBatchAppended } from './handlers/sequencer-batch-appended' import { handleEventsStateBatchAppended } from './handlers/state-batch-appended' @@ -389,9 +390,7 @@ export class L1IngestionService extends BaseService { for (const eventRange of eventRanges) { // Find all relevant events within the range. - const events: TypedEthersEvent[] = await this.state.contracts[ - contractName - ] + const events: TypedEvent[] = await this.state.contracts[contractName] .attach(eventRange.address) .queryFilter( this.state.contracts[contractName].filters[eventName](), diff --git a/packages/data-transport-layer/src/types/event-handler-types.ts b/packages/data-transport-layer/src/types/event-handler-types.ts index 4a099957ea8a8..71e016c4e7943 100644 --- a/packages/data-transport-layer/src/types/event-handler-types.ts +++ b/packages/data-transport-layer/src/types/event-handler-types.ts @@ -1,5 +1,6 @@ import { BaseProvider } from '@ethersproject/providers' -import { BigNumber, Event } from 'ethers' +import { BigNumber } from 'ethers' +import { TypedEvent } from '@eth-optimism/contracts/dist/types/common' import { TransportDB } from '../db/transport-db' import { @@ -9,29 +10,29 @@ import { StateRootEntry, } from './database-types' -export type TypedEthersEvent = Event & { - args: T -} - -export type GetExtraDataHandler = ( - event?: TypedEthersEvent, +export type GetExtraDataHandler = ( + event?: TEvent, l1RpcProvider?: BaseProvider ) => Promise -export type ParseEventHandler = ( - event: TypedEthersEvent, - extraData: TExtraData, - l2ChainId: number -) => TParsedEvent +export type ParseEventHandler< + TEvent extends TypedEvent, + TExtraData, + TParsedEvent +> = (event: TEvent, extraData: TExtraData, l2ChainId: number) => TParsedEvent export type StoreEventHandler = ( parsedEvent: TParsedEvent, db: TransportDB ) => Promise -export interface EventHandlerSet { - getExtraData: GetExtraDataHandler - parseEvent: ParseEventHandler +export interface EventHandlerSet< + TEvent extends TypedEvent, + TExtraData, + TParsedEvent +> { + getExtraData: GetExtraDataHandler + parseEvent: ParseEventHandler storeEvent: StoreEventHandler } diff --git a/packages/data-transport-layer/src/utils/eth-tx.ts b/packages/data-transport-layer/src/utils/eth-tx.ts index cce210d269098..025b5d19ddcb0 100644 --- a/packages/data-transport-layer/src/utils/eth-tx.ts +++ b/packages/data-transport-layer/src/utils/eth-tx.ts @@ -2,8 +2,14 @@ import { ethers } from 'ethers' export const parseSignatureVParam = ( - v: number | ethers.BigNumber, + v: number | ethers.BigNumber | string, chainId: number ): number => { - return ethers.BigNumber.from(v).toNumber() - 2 * chainId - 35 + v = ethers.BigNumber.from(v).toNumber() + // Handle unprotected transactions + if (v === 27 || v === 28) { + return v + } + // Handle EIP155 transactions + return v - 2 * chainId - 35 } diff --git a/yarn.lock b/yarn.lock index 5bd4b7e3bffd2..6dc5e631bf0a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2686,15 +2686,18 @@ dependencies: ethers "^5.0.2" -"@typechain/ethers-v5@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-7.0.1.tgz#f9ae60ae5bd9e8ea8a996f66244147e8e74034ae" - integrity sha512-mXEJ7LG0pOYO+MRPkHtbf30Ey9X2KAsU0wkeoVvjQIn7iAY6tB3k3s+82bbmJAUMyENbQ04RDOZit36CgSG6Gg== +"@typechain/ethers-v5@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-8.0.2.tgz#0f2cc0db1513cb02e3e78929139216b153c9d2c0" + integrity sha512-oRMA3X5UWrsUiNb/lFTusa8xBpw6CckOHAk7sZBHeDQh4tAp+ZU24wdwdURcOtPnagzdCv5Dvl1qlD038brf1A== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" -"@typechain/hardhat@^2.3.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-2.3.0.tgz#dc7f29281637b38b77c7c046ae82700703395d0f" - integrity sha512-zERrtNol86L4DX60ktnXxP7Cq8rSZHPaQvsChyiQQVuvVs2FTLm24Yi+MYnfsIdbUBIXZG7SxDWhtCF5I0tJNQ== +"@typechain/hardhat@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-3.0.0.tgz#a94396855506d42b98d6e7c09f87ca14180d6c64" + integrity sha512-FpnIIXkDXm54XCHI/Z2iOet7h1MrFSvZfuljX9Uzc6FEjEfb01Tuzu8ywe2iquD3g5JXqovgdv+M54L/2Z6jkg== dependencies: fs-extra "^9.1.0" @@ -15170,10 +15173,10 @@ typechain@^3.0.0: ts-essentials "^6.0.3" ts-generator "^0.1.1" -typechain@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-5.1.2.tgz#c8784d6155a8e69397ca47f438a3b4fb2aa939da" - integrity sha512-FuaCxJd7BD3ZAjVJoO+D6TnqKey3pQdsqOBsC83RKYWKli5BDhdf0TPkwfyjt20TUlZvOzJifz+lDwXsRkiSKA== +typechain@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-6.0.2.tgz#0a1d6328aa934dfd66c8941cd94c1d3491cc34f0" + integrity sha512-fphYQ2+r5z38eq02qr4KjgU9/Xdda8Cj+eV2QHSRXhDPyhEVv+ln9123iGjjDLEhGyROb3DQkbvjm3Dl0GtUeQ== dependencies: "@types/prettier" "^2.1.1" command-line-args "^4.0.7"