From a74a334dff8a445dc8716b5af60cc3e236e9c0b7 Mon Sep 17 00:00:00 2001 From: Kelvin Fichter Date: Mon, 8 Mar 2021 11:26:37 -0800 Subject: [PATCH] cleanup: minimize diff with 1.9.10 (#219) * Cleanup pass number 1 * Cleanup pass number 2 * Cleanup pass number 3 * Cleanup pass number 4 * Fix lint error * Remove unused contract bindings * Remove unused test json * Update cmd/utils/flags.go * Fixing build errors * Fix remaining lint errors --- .golangci.yml | 5 +- accounts/abi/bind/backends/simulated.go | 17 +- accounts/abi/bind/bind_test.go | 323 +++--- cmd/geth/retesteth.go | 2 +- cmd/utils/flags.go | 156 +-- .../addressmanager/Lib_AddressManager.go | 457 --------- .../addressresolver/Lib_AddressResolver.go | 216 ---- .../OVM_CanonicalTransactionChain.go | 963 ------------------ .../executionmanager/OVM_ExecutionManager.go | 216 ---- core/bench_test.go | 9 +- core/blockchain.go | 2 +- core/chain_makers_test.go | 126 +-- core/dao_test.go | 1 + core/genesis_test.go | 2 +- core/rawdb/accessors_indexes.go | 1 - core/rawdb/freezer_table_test.go | 12 - core/state/statedb.go | 6 +- core/state_processor.go | 1 - core/state_transition.go | 7 +- core/types/receipt_test.go | 4 +- core/types/transaction.go | 79 +- core/vm/interpreter.go | 7 +- interfaces.go | 13 +- internal/ethapi/api.go | 36 +- internal/ethapi/backend.go | 7 +- les/handler_test.go | 673 ++++++++++++ les/odr_test.go | 62 +- les/request_test.go | 50 +- miner/worker_test.go | 29 +- p2p/discv5/node_test.go | 6 +- rlp/decode.go | 1 - rpc/handler.go | 4 +- rpc/types.go | 4 +- signer/core/types.go | 5 +- tests/StateManagerABI.json | 275 ----- 35 files changed, 1133 insertions(+), 2644 deletions(-) delete mode 100644 contracts/addressmanager/Lib_AddressManager.go delete mode 100644 contracts/addressresolver/Lib_AddressResolver.go delete mode 100644 contracts/canonicaltransactionchain/OVM_CanonicalTransactionChain.go delete mode 100644 contracts/executionmanager/OVM_ExecutionManager.go create mode 100644 les/handler_test.go delete mode 100644 tests/StateManagerABI.json diff --git a/.golangci.yml b/.golangci.yml index 516deb16992a..d4ef7b002968 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,4 +47,7 @@ issues: - goconst - path: cmd/faucet/ linters: - - deadcode \ No newline at end of file + - deadcode + - path: core/chain_makers_test.go + linters: + - govet diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index ba4b7f3ada85..243491799533 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -592,14 +592,15 @@ type callmsg struct { ethereum.CallMsg } -func (m callmsg) From() common.Address { return m.CallMsg.From } -func (m callmsg) Nonce() uint64 { return 0 } -func (m callmsg) CheckNonce() bool { return false } -func (m callmsg) To() *common.Address { return m.CallMsg.To } -func (m callmsg) GasPrice() *big.Int { return m.CallMsg.GasPrice } -func (m callmsg) Gas() uint64 { return m.CallMsg.Gas } -func (m callmsg) Value() *big.Int { return m.CallMsg.Value } -func (m callmsg) Data() []byte { return m.CallMsg.Data } +func (m callmsg) From() common.Address { return m.CallMsg.From } +func (m callmsg) Nonce() uint64 { return 0 } +func (m callmsg) CheckNonce() bool { return false } +func (m callmsg) To() *common.Address { return m.CallMsg.To } +func (m callmsg) GasPrice() *big.Int { return m.CallMsg.GasPrice } +func (m callmsg) Gas() uint64 { return m.CallMsg.Gas } +func (m callmsg) Value() *big.Int { return m.CallMsg.Value } +func (m callmsg) Data() []byte { return m.CallMsg.Data } + func (m callmsg) L1MessageSender() *common.Address { return m.CallMsg.L1MessageSender } func (m callmsg) L1BlockNumber() *big.Int { return m.CallMsg.L1BlockNumber } func (m callmsg) QueueOrigin() *big.Int { return m.CallMsg.QueueOrigin } diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index c150e7c3f227..3eebad3c3965 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -486,40 +486,38 @@ var bindTests = []struct { []string{`6060604052606a8060106000396000f360606040523615601d5760e060020a6000350463fc9c8d3981146040575b605e6000805473ffffffffffffffffffffffffffffffffffffffff191633179055565b606060005473ffffffffffffffffffffffffffffffffffffffff1681565b005b6060908152602090f3`}, []string{`[{"constant":true,"inputs":[],"name":"caller","outputs":[{"name":"","type":"address"}],"type":"function"}]`}, ` - "fmt" - - // "math/big" + "math/big" - // "github.com/ethereum/go-ethereum/accounts/abi/bind" - // "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - // "github.com/ethereum/go-ethereum/core" - // "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" `, ` - fmt.Println("OVM breaks this... SKIPPING: CallFrom test. CALLER must be transpiled for this test to work properly.") - - // // Generate a new random account and a funded simulator - // key, _ := crypto.GenerateKey() - // auth := bind.NewKeyedTransactor(key) - - // sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}, 10000000) - // defer sim.Close() - - // // Deploy a default method invoker contract and execute its default method - // _, _, defaulter, err := DeployDefaulter(auth, sim) - // if err != nil { - // t.Fatalf("Failed to deploy defaulter contract: %v", err) - // } - // if _, err := (&DefaulterRaw{defaulter}).Transfer(auth); err != nil { - // t.Fatalf("Failed to invoke default method: %v", err) - // } - // sim.Commit() - - // if caller, err := defaulter.Caller(nil); err != nil { - // t.Fatalf("Failed to call address retriever: %v", err) - // } else if (caller != auth.From) { - // t.Fatalf("Address mismatch: have %v, want %v", caller, auth.From) - // } + t.Skip("OVM breaks this... SKIPPING: CallFrom test. CALLER must be transpiled for this test to work properly.") + + // Generate a new random account and a funded simulator + key, _ := crypto.GenerateKey() + auth := bind.NewKeyedTransactor(key) + + sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}, 10000000) + defer sim.Close() + + // Deploy a default method invoker contract and execute its default method + _, _, defaulter, err := DeployDefaulter(auth, sim) + if err != nil { + t.Fatalf("Failed to deploy defaulter contract: %v", err) + } + if _, err := (&DefaulterRaw{defaulter}).Transfer(auth); err != nil { + t.Fatalf("Failed to invoke default method: %v", err) + } + sim.Commit() + + if caller, err := defaulter.Caller(nil); err != nil { + t.Fatalf("Failed to call address retriever: %v", err) + } else if (caller != auth.From) { + t.Fatalf("Address mismatch: have %v, want %v", caller, auth.From) + } `, nil, nil, @@ -539,30 +537,29 @@ var bindTests = []struct { []string{`6060604052609f8060106000396000f3606060405260e060020a6000350463f97a60058114601a575b005b600060605260c0604052600d60809081527f4920646f6e27742065786973740000000000000000000000000000000000000060a052602060c0908152600d60e081905281906101009060a09080838184600060046012f15050815172ffffffffffffffffffffffffffffffffffffff1916909152505060405161012081900392509050f3`}, []string{`[{"constant":true,"inputs":[],"name":"String","outputs":[{"name":"","type":"string"}],"type":"function"}]`}, ` - "fmt" - // "github.com/ethereum/go-ethereum/accounts/abi/bind" - // "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - // "github.com/ethereum/go-ethereum/common" - // "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" `, ` - fmt.Println("OVM breaks this... SKIPPING: NonExistent contract test. This should be fixed & should pass if we returned the correct error messages.") - - // // Create a simulator and wrap a non-deployed contract - - // sim := backends.NewSimulatedBackend(core.GenesisAlloc{}, uint64(10000000000)) - // defer sim.Close() - - // nonexistent, err := NewNonExistent(common.Address{}, sim) - // if err != nil { - // t.Fatalf("Failed to access non-existent contract: %v", err) - // } - // // Ensure that contract calls fail with the appropriate error - // if res, err := nonexistent.String(nil); err == nil { - // t.Fatalf("Call succeeded on non-existent contract: %v", res) - // } else if (err != bind.ErrNoCode) { - // t.Fatalf("Error mismatch: have %v, want %v", err, bind.ErrNoCode) - // } + t.Skip("OVM breaks this... SKIPPING: NonExistent contract test. This should be fixed & should pass if we returned the correct error messages.") + + // Create a simulator and wrap a non-deployed contract + + sim := backends.NewSimulatedBackend(core.GenesisAlloc{}, uint64(10000000000)) + defer sim.Close() + + nonexistent, err := NewNonExistent(common.Address{}, sim) + if err != nil { + t.Fatalf("Failed to access non-existent contract: %v", err) + } + // Ensure that contract calls fail with the appropriate error + if res, err := nonexistent.String(nil); err == nil { + t.Fatalf("Call succeeded on non-existent contract: %v", res) + } else if (err != bind.ErrNoCode) { + t.Fatalf("Error mismatch: have %v, want %v", err, bind.ErrNoCode) + } `, nil, nil, @@ -637,45 +634,44 @@ var bindTests = []struct { `, []string{`6060604052346000575b6086806100176000396000f300606060405263ffffffff60e060020a60003504166349f8e98281146022575b6000565b34600057602c6055565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b335b905600a165627a7a72305820aef6b7685c0fa24ba6027e4870404a57df701473fe4107741805c19f5138417c0029`}, []string{`[{"constant":true,"inputs":[],"name":"callFrom","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}]`}, ` - "fmt" - // "math/big" + "math/big" - // "github.com/ethereum/go-ethereum/accounts/abi/bind" - // "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - // "github.com/ethereum/go-ethereum/common" - // "github.com/ethereum/go-ethereum/core" - // "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" `, ` - fmt.Println("OVM breaks this... SKIPPING: CallFrom test. CALLER must be transpiled for this test to work properly.") - - // // Generate a new random account and a funded simulator - // key, _ := crypto.GenerateKey() - // auth := bind.NewKeyedTransactor(key) - - // sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}, 10000000) - // defer sim.Close() - - // // Deploy a sender tester contract and execute a structured call on it - // _, _, callfrom, err := DeployCallFrom(auth, sim) - // if err != nil { - // t.Fatalf("Failed to deploy sender contract: %v", err) - // } - // sim.Commit() - - // if res, err := callfrom.CallFrom(nil); err != nil { - // t.Errorf("Failed to call constant function: %v", err) - // } else if res != (common.Address{}) { - // t.Errorf("Invalid address returned, want: %x, got: %x", (common.Address{}), res) - // } - - // for _, addr := range []common.Address{common.Address{}, common.Address{1}, common.Address{2}} { - // if res, err := callfrom.CallFrom(&bind.CallOpts{From: addr}); err != nil { - // t.Fatalf("Failed to call constant function: %v", err) - // } else if res != addr { - // t.Fatalf("Invalid address returned, want: %x, got: %x", addr, res) - // } - // } + t.Skip("OVM breaks this... SKIPPING: CallFrom test. CALLER must be transpiled for this test to work properly.") + + // Generate a new random account and a funded simulator + key, _ := crypto.GenerateKey() + auth := bind.NewKeyedTransactor(key) + + sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}, 10000000) + defer sim.Close() + + // Deploy a sender tester contract and execute a structured call on it + _, _, callfrom, err := DeployCallFrom(auth, sim) + if err != nil { + t.Fatalf("Failed to deploy sender contract: %v", err) + } + sim.Commit() + + if res, err := callfrom.CallFrom(nil); err != nil { + t.Errorf("Failed to call constant function: %v", err) + } else if res != (common.Address{}) { + t.Errorf("Invalid address returned, want: %x, got: %x", (common.Address{}), res) + } + + for _, addr := range []common.Address{common.Address{}, common.Address{1}, common.Address{2}} { + if res, err := callfrom.CallFrom(&bind.CallOpts{From: addr}); err != nil { + t.Fatalf("Failed to call constant function: %v", err) + } else if res != addr { + t.Fatalf("Invalid address returned, want: %x, got: %x", addr, res) + } + } `, nil, nil, @@ -1277,44 +1273,44 @@ var bindTests = []struct { `[{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"add","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]`, }, ` - "fmt" - // "math/big" + "math/big" - // "github.com/ethereum/go-ethereum/accounts/abi/bind" - // "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - // "github.com/ethereum/go-ethereum/core" - // "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" `, ` - fmt.Println("OVM breaks this... SKIPPING: UseLibrary test.") - // // Generate a new random account and a funded simulator - // key, _ := crypto.GenerateKey() - // auth := bind.NewKeyedTransactor(key) - - // sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}, 10000000) - // defer sim.Close() - - // //deploy the test contract - // _, _, testContract, err := DeployUseLibrary(auth, sim) - // if err != nil { - // t.Fatalf("Failed to deploy test contract: %v", err) - // } - - // // Finish deploy. - // sim.Commit() - - // // Check that the library contract has been deployed - // // by calling the contract's add function. - // res, err := testContract.Add(&bind.CallOpts{ - // From: auth.From, - // Pending: false, - // }, big.NewInt(1), big.NewInt(2)) - // if err != nil { - // t.Fatalf("Failed to call linked contract: %v", err) - // } - // if res.Cmp(big.NewInt(3)) != 0 { - // t.Fatalf("Add did not return the correct result: %d != %d", res, 3) - // } + t.Skip("OVM breaks this... SKIPPING: UseLibrary test.") + + // Generate a new random account and a funded simulator + key, _ := crypto.GenerateKey() + auth := bind.NewKeyedTransactor(key) + + sim := backends.NewSimulatedBackend(core.GenesisAlloc{auth.From: {Balance: big.NewInt(10000000000)}}, 10000000) + defer sim.Close() + + //deploy the test contract + _, _, testContract, err := DeployUseLibrary(auth, sim) + if err != nil { + t.Fatalf("Failed to deploy test contract: %v", err) + } + + // Finish deploy. + sim.Commit() + + // Check that the library contract has been deployed + // by calling the contract's add function. + res, err := testContract.Add(&bind.CallOpts{ + From: auth.From, + Pending: false, + }, big.NewInt(1), big.NewInt(2)) + if err != nil { + t.Fatalf("Failed to call linked contract: %v", err) + } + if res.Cmp(big.NewInt(3)) != 0 { + t.Fatalf("Add did not return the correct result: %d != %d", res, 3) + } `, nil, map[string]string{ @@ -1496,49 +1492,48 @@ var bindTests = []struct { `[]`, }, ` - "fmt" - // "math/big" + "math/big" - // "github.com/ethereum/go-ethereum/accounts/abi/bind" - // "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - // "github.com/ethereum/go-ethereum/crypto" - // "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/core" `, ` - fmt.Println("OVM breaks this... SKIPPING: MultiContracts test.") - - // key, _ := crypto.GenerateKey() - // addr := crypto.PubkeyToAddress(key.PublicKey) - - // // Deploy registrar contract - // sim := backends.NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: big.NewInt(1000000000)}}, 10000000) - // defer sim.Close() - - // transactOpts := bind.NewKeyedTransactor(key) - // _, _, c1, err := DeployContractOne(transactOpts, sim) - // if err != nil { - // t.Fatal("Failed to deploy contract") - // } - // sim.Commit() - // err = c1.Foo(nil, ExternalLibSharedStruct{ - // F1: big.NewInt(100), - // F2: [32]byte{0x01, 0x02, 0x03}, - // }) - // if err != nil { - // t.Fatal("Failed to invoke function") - // } - // _, _, c2, err := DeployContractTwo(transactOpts, sim) - // if err != nil { - // t.Fatal("Failed to deploy contract") - // } - // sim.Commit() - // err = c2.Bar(nil, ExternalLibSharedStruct{ - // F1: big.NewInt(100), - // F2: [32]byte{0x01, 0x02, 0x03}, - // }) - // if err != nil { - // t.Fatal("Failed to invoke function") - // } + t.Skip("OVM breaks this... SKIPPING: MultiContracts test.") + + key, _ := crypto.GenerateKey() + addr := crypto.PubkeyToAddress(key.PublicKey) + + // Deploy registrar contract + sim := backends.NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: big.NewInt(1000000000)}}, 10000000) + defer sim.Close() + + transactOpts := bind.NewKeyedTransactor(key) + _, _, c1, err := DeployContractOne(transactOpts, sim) + if err != nil { + t.Fatal("Failed to deploy contract") + } + sim.Commit() + err = c1.Foo(nil, ExternalLibSharedStruct{ + F1: big.NewInt(100), + F2: [32]byte{0x01, 0x02, 0x03}, + }) + if err != nil { + t.Fatal("Failed to invoke function") + } + _, _, c2, err := DeployContractTwo(transactOpts, sim) + if err != nil { + t.Fatal("Failed to deploy contract") + } + sim.Commit() + err = c2.Bar(nil, ExternalLibSharedStruct{ + F1: big.NewInt(100), + F2: [32]byte{0x01, 0x02, 0x03}, + }) + if err != nil { + t.Fatal("Failed to invoke function") + } `, nil, nil, diff --git a/cmd/geth/retesteth.go b/cmd/geth/retesteth.go index bd1c70b75a51..2c3f8be78d12 100644 --- a/cmd/geth/retesteth.go +++ b/cmd/geth/retesteth.go @@ -594,7 +594,7 @@ func (api *RetestethAPI) GetLogHash(ctx context.Context, txHash common.Hash) (co } func (api *RetestethAPI) BlockNumber(ctx context.Context) (uint64, error) { - //fmt.Printf("SubmissionNumber, response: %d\n", api.blockNumber) + //fmt.Printf("BlockNumber, response: %d\n", api.blockNumber) return api.blockNumber, nil } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 665a0b278382..d21638818b92 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -140,9 +140,10 @@ func printHelp(out io.Writer, templ string, data interface{}) { var ( // General settings DataDirFlag = DirectoryFlag{ - Name: "datadir", - Usage: "Data directory for the databases and keystore", - Value: DirectoryString(node.DefaultDataDir()), + Name: "datadir", + Usage: "Data directory for the databases and keystore", + Value: DirectoryString(node.DefaultDataDir()), + EnvVar: "DATADIR", } AncientFlag = DirectoryFlag{ @@ -154,8 +155,9 @@ var ( Usage: "Directory for the keystore (default = inside the datadir)", } NoUSBFlag = cli.BoolFlag{ - Name: "nousb", - Usage: "Disables monitoring for and managing USB hardware wallets", + Name: "nousb", + Usage: "Disables monitoring for and managing USB hardware wallets", + EnvVar: "NO_USB", } SmartCardDaemonPathFlag = cli.StringFlag{ @@ -164,9 +166,10 @@ var ( Value: pcsclite.PCSCDSockName, } NetworkIdFlag = cli.Uint64Flag{ - Name: "networkid", - Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)", - Value: eth.DefaultConfig.NetworkId, + Name: "networkid", + Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)", + Value: eth.DefaultConfig.NetworkId, + EnvVar: "NETWORK_ID", } ChainIdFlag = cli.Uint64Flag{ @@ -188,8 +191,9 @@ var ( Usage: "Görli network: pre-configured proof-of-authority test network", } DeveloperFlag = cli.BoolFlag{ - Name: "dev", - Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled", + Name: "dev", + Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled", + EnvVar: "DEV", } DeveloperPeriodFlag = cli.IntFlag{ @@ -232,9 +236,10 @@ var ( Value: &defaultSyncMode, } GCModeFlag = cli.StringFlag{ - Name: "gcmode", - Usage: `Blockchain garbage collection mode ("full", "archive")`, - Value: "full", + Name: "gcmode", + Usage: `Blockchain garbage collection mode ("full", "archive")`, + Value: "full", + EnvVar: "GCMODE", } LightKDFFlag = cli.BoolFlag{ @@ -384,10 +389,11 @@ var ( } // Performance tuning settings CacheFlag = cli.IntFlag{ - Name: "cache", - Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode)", + Name: "cache", + Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode)", + Value: 1024, + EnvVar: "CACHE", - Value: 1024, } CacheDatabaseFlag = cli.IntFlag{ Name: "cache.database", @@ -428,33 +434,38 @@ var ( Usage: "Comma separated HTTP URL list to notify of new work packages", } MinerGasTargetFlag = cli.Uint64Flag{ - Name: "miner.gastarget", - Usage: "Target gas floor for mined blocks", - Value: eth.DefaultConfig.Miner.GasFloor, + Name: "miner.gastarget", + Usage: "Target gas floor for mined blocks", + Value: eth.DefaultConfig.Miner.GasFloor, + EnvVar: "TARGET_GAS_LIMIT", } MinerLegacyGasTargetFlag = cli.Uint64Flag{ - Name: "targetgaslimit", - Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)", - Value: eth.DefaultConfig.Miner.GasFloor, + Name: "targetgaslimit", + Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)", + Value: eth.DefaultConfig.Miner.GasFloor, + EnvVar: "TARGET_GAS_LIMIT", } MinerGasLimitFlag = cli.Uint64Flag{ - Name: "miner.gaslimit", - Usage: "Target gas ceiling for mined blocks", - Value: eth.DefaultConfig.Miner.GasCeil, + Name: "miner.gaslimit", + Usage: "Target gas ceiling for mined blocks", + Value: eth.DefaultConfig.Miner.GasCeil, + EnvVar: "TARGET_GAS_LIMIT", } MinerGasPriceFlag = BigFlag{ - Name: "miner.gasprice", - Usage: "Minimum gas price for mining a transaction", - Value: big.NewInt(0), + Name: "miner.gasprice", + Usage: "Minimum gas price for mining a transaction", + Value: big.NewInt(0), + EnvVar: "GASPRICE", } MinerLegacyGasPriceFlag = BigFlag{ - Name: "gasprice", - Usage: "Minimum gas price for mining a transaction (deprecated, use --miner.gasprice)", - Value: big.NewInt(0), + Name: "gasprice", + Usage: "Minimum gas price for mining a transaction (deprecated, use --miner.gasprice)", + Value: big.NewInt(0), + EnvVar: "GASPRICE", } MinerEtherbaseFlag = cli.StringFlag{ @@ -527,8 +538,9 @@ var ( } // RPC settings IPCDisabledFlag = cli.BoolFlag{ - Name: "ipcdisable", - Usage: "Disable the IPC-RPC server", + Name: "ipcdisable", + Usage: "Disable the IPC-RPC server", + EnvVar: "IPC_DISABLE", } IPCPathFlag = DirectoryFlag{ @@ -536,67 +548,78 @@ var ( Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)", } RPCEnabledFlag = cli.BoolFlag{ - Name: "rpc", - Usage: "Enable the HTTP-RPC server", + Name: "rpc", + Usage: "Enable the HTTP-RPC server", + EnvVar: "RPC_ENABLE", } RPCListenAddrFlag = cli.StringFlag{ - Name: "rpcaddr", - Usage: "HTTP-RPC server listening interface", - Value: node.DefaultHTTPHost, + Name: "rpcaddr", + Usage: "HTTP-RPC server listening interface", + Value: node.DefaultHTTPHost, + EnvVar: "RPC_ADDR", } RPCPortFlag = cli.IntFlag{ - Name: "rpcport", - Usage: "HTTP-RPC server listening port", - Value: node.DefaultHTTPPort, + Name: "rpcport", + Usage: "HTTP-RPC server listening port", + Value: node.DefaultHTTPPort, + EnvVar: "RPC_PORT", } RPCCORSDomainFlag = cli.StringFlag{ - Name: "rpccorsdomain", - Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)", - Value: "", + Name: "rpccorsdomain", + Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)", + Value: "", + EnvVar: "RPC_CORS_DOMAIN", } RPCVirtualHostsFlag = cli.StringFlag{ - Name: "rpcvhosts", - Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.", - Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","), + Name: "rpcvhosts", + Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.", + Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","), + EnvVar: "RPC_VHOSTS", } RPCApiFlag = cli.StringFlag{ - Name: "rpcapi", - Usage: "API's offered over the HTTP-RPC interface", - Value: "", + Name: "rpcapi", + Usage: "API's offered over the HTTP-RPC interface", + Value: "", + EnvVar: "RPC_API", } WSEnabledFlag = cli.BoolFlag{ - Name: "ws", - Usage: "Enable the WS-RPC server", + Name: "ws", + Usage: "Enable the WS-RPC server", + EnvVar: "WS", } WSListenAddrFlag = cli.StringFlag{ - Name: "wsaddr", - Usage: "WS-RPC server listening interface", - Value: node.DefaultWSHost, + Name: "wsaddr", + Usage: "WS-RPC server listening interface", + Value: node.DefaultWSHost, + EnvVar: "WS_ADDR", } WSPortFlag = cli.IntFlag{ - Name: "wsport", - Usage: "WS-RPC server listening port", - Value: node.DefaultWSPort, + Name: "wsport", + Usage: "WS-RPC server listening port", + Value: node.DefaultWSPort, + EnvVar: "WS_PORT", } WSApiFlag = cli.StringFlag{ - Name: "wsapi", - Usage: "API's offered over the WS-RPC interface", - Value: "", + Name: "wsapi", + Usage: "API's offered over the WS-RPC interface", + Value: "", + EnvVar: "WS_API", } WSAllowedOriginsFlag = cli.StringFlag{ - Name: "wsorigins", - Usage: "Origins from which to accept websockets requests", - Value: "", + Name: "wsorigins", + Usage: "Origins from which to accept websockets requests", + Value: "", + EnvVar: "WS_ORIGINS", } GraphQLEnabledFlag = cli.BoolFlag{ @@ -677,8 +700,9 @@ var ( Value: "any", } NoDiscoverFlag = cli.BoolFlag{ - Name: "nodiscover", - Usage: "Disables the peer discovery mechanism (manual peer addition)", + Name: "nodiscover", + Usage: "Disables the peer discovery mechanism (manual peer addition)", + EnvVar: "NO_DISCOVER", } DiscoveryV5Flag = cli.BoolFlag{ diff --git a/contracts/addressmanager/Lib_AddressManager.go b/contracts/addressmanager/Lib_AddressManager.go deleted file mode 100644 index 37f75ee533e8..000000000000 --- a/contracts/addressmanager/Lib_AddressManager.go +++ /dev/null @@ -1,457 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package addressmanager - -import ( - "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 ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// LibAddressManagerABI is the input ABI used to generate the binding from. -const LibAddressManagerABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" - -// LibAddressManagerBin is the compiled bytecode used for deploying new contracts. -var LibAddressManagerBin = "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633178082556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a361056a806100696000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063715018a61461005c5780638da5cb5b146100665780639b2ea4bd1461008a578063bf40fac11461013b578063f2fde38b146101e1575b600080fd5b610064610207565b005b61006e6102b0565b604080516001600160a01b039092168252519081900360200190f35b610064600480360360408110156100a057600080fd5b8101906020810181356401000000008111156100bb57600080fd5b8201836020820111156100cd57600080fd5b803590602001918460018302840111640100000000831117156100ef57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506102bf9050565b61006e6004803603602081101561015157600080fd5b81019060208101813564010000000081111561016c57600080fd5b82018360208201111561017e57600080fd5b803590602001918460018302840111640100000000831117156101a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610362945050505050565b610064600480360360208110156101f757600080fd5b50356001600160a01b0316610391565b6000546001600160a01b03163314610266576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031681565b6000546001600160a01b0316331461031e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b806001600061032c85610490565b815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b60006001600061037184610490565b81526020810191909152604001600020546001600160a01b031692915050565b6000546001600160a01b031633146103f0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166104355760405162461bcd60e51b815260040180806020018281038252602d815260200180610508602d913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000816040516020018082805190602001908083835b602083106104c55780518252601f1990920191602091820191016104a6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905091905056fe4f776e61626c653a206e6577206f776e65722063616e6e6f7420626520746865207a65726f2061646472657373a26469706673582212204367ffc2e6671623708150e2d0cff4c12cf566722a26b4748555d789953e2d2264736f6c63430007000033" - -// DeployLibAddressManager deploys a new Ethereum contract, binding an instance of LibAddressManager to it. -func DeployLibAddressManager(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *LibAddressManager, error) { - parsed, err := abi.JSON(strings.NewReader(LibAddressManagerABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(LibAddressManagerBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &LibAddressManager{LibAddressManagerCaller: LibAddressManagerCaller{contract: contract}, LibAddressManagerTransactor: LibAddressManagerTransactor{contract: contract}, LibAddressManagerFilterer: LibAddressManagerFilterer{contract: contract}}, nil -} - -// LibAddressManager is an auto generated Go binding around an Ethereum contract. -type LibAddressManager struct { - LibAddressManagerCaller // Read-only binding to the contract - LibAddressManagerTransactor // Write-only binding to the contract - LibAddressManagerFilterer // Log filterer for contract events -} - -// LibAddressManagerCaller is an auto generated read-only Go binding around an Ethereum contract. -type LibAddressManagerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LibAddressManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type LibAddressManagerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LibAddressManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type LibAddressManagerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LibAddressManagerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type LibAddressManagerSession struct { - Contract *LibAddressManager // 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 -} - -// LibAddressManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type LibAddressManagerCallerSession struct { - Contract *LibAddressManagerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// LibAddressManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type LibAddressManagerTransactorSession struct { - Contract *LibAddressManagerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// LibAddressManagerRaw is an auto generated low-level Go binding around an Ethereum contract. -type LibAddressManagerRaw struct { - Contract *LibAddressManager // Generic contract binding to access the raw methods on -} - -// LibAddressManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type LibAddressManagerCallerRaw struct { - Contract *LibAddressManagerCaller // Generic read-only contract binding to access the raw methods on -} - -// LibAddressManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type LibAddressManagerTransactorRaw struct { - Contract *LibAddressManagerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewLibAddressManager creates a new instance of LibAddressManager, bound to a specific deployed contract. -func NewLibAddressManager(address common.Address, backend bind.ContractBackend) (*LibAddressManager, error) { - contract, err := bindLibAddressManager(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &LibAddressManager{LibAddressManagerCaller: LibAddressManagerCaller{contract: contract}, LibAddressManagerTransactor: LibAddressManagerTransactor{contract: contract}, LibAddressManagerFilterer: LibAddressManagerFilterer{contract: contract}}, nil -} - -// NewLibAddressManagerCaller creates a new read-only instance of LibAddressManager, bound to a specific deployed contract. -func NewLibAddressManagerCaller(address common.Address, caller bind.ContractCaller) (*LibAddressManagerCaller, error) { - contract, err := bindLibAddressManager(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &LibAddressManagerCaller{contract: contract}, nil -} - -// NewLibAddressManagerTransactor creates a new write-only instance of LibAddressManager, bound to a specific deployed contract. -func NewLibAddressManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*LibAddressManagerTransactor, error) { - contract, err := bindLibAddressManager(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &LibAddressManagerTransactor{contract: contract}, nil -} - -// NewLibAddressManagerFilterer creates a new log filterer instance of LibAddressManager, bound to a specific deployed contract. -func NewLibAddressManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*LibAddressManagerFilterer, error) { - contract, err := bindLibAddressManager(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &LibAddressManagerFilterer{contract: contract}, nil -} - -// bindLibAddressManager binds a generic wrapper to an already deployed contract. -func bindLibAddressManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(LibAddressManagerABI)) - 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 (_LibAddressManager *LibAddressManagerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _LibAddressManager.Contract.LibAddressManagerCaller.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 (_LibAddressManager *LibAddressManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LibAddressManager.Contract.LibAddressManagerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LibAddressManager *LibAddressManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LibAddressManager.Contract.LibAddressManagerTransactor.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 (_LibAddressManager *LibAddressManagerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _LibAddressManager.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 (_LibAddressManager *LibAddressManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LibAddressManager.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LibAddressManager *LibAddressManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LibAddressManager.Contract.contract.Transact(opts, method, params...) -} - -// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1. -// -// Solidity: function getAddress(string _name) constant returns(address) -func (_LibAddressManager *LibAddressManagerCaller) GetAddress(opts *bind.CallOpts, _name string) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _LibAddressManager.contract.Call(opts, out, "getAddress", _name) - return *ret0, err -} - -// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1. -// -// Solidity: function getAddress(string _name) constant returns(address) -func (_LibAddressManager *LibAddressManagerSession) GetAddress(_name string) (common.Address, error) { - return _LibAddressManager.Contract.GetAddress(&_LibAddressManager.CallOpts, _name) -} - -// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1. -// -// Solidity: function getAddress(string _name) constant returns(address) -func (_LibAddressManager *LibAddressManagerCallerSession) GetAddress(_name string) (common.Address, error) { - return _LibAddressManager.Contract.GetAddress(&_LibAddressManager.CallOpts, _name) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() constant returns(address) -func (_LibAddressManager *LibAddressManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _LibAddressManager.contract.Call(opts, out, "owner") - return *ret0, err -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() constant returns(address) -func (_LibAddressManager *LibAddressManagerSession) Owner() (common.Address, error) { - return _LibAddressManager.Contract.Owner(&_LibAddressManager.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() constant returns(address) -func (_LibAddressManager *LibAddressManagerCallerSession) Owner() (common.Address, error) { - return _LibAddressManager.Contract.Owner(&_LibAddressManager.CallOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_LibAddressManager *LibAddressManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LibAddressManager.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_LibAddressManager *LibAddressManagerSession) RenounceOwnership() (*types.Transaction, error) { - return _LibAddressManager.Contract.RenounceOwnership(&_LibAddressManager.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_LibAddressManager *LibAddressManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _LibAddressManager.Contract.RenounceOwnership(&_LibAddressManager.TransactOpts) -} - -// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. -// -// Solidity: function setAddress(string _name, address _address) returns() -func (_LibAddressManager *LibAddressManagerTransactor) SetAddress(opts *bind.TransactOpts, _name string, _address common.Address) (*types.Transaction, error) { - return _LibAddressManager.contract.Transact(opts, "setAddress", _name, _address) -} - -// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. -// -// Solidity: function setAddress(string _name, address _address) returns() -func (_LibAddressManager *LibAddressManagerSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) { - return _LibAddressManager.Contract.SetAddress(&_LibAddressManager.TransactOpts, _name, _address) -} - -// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd. -// -// Solidity: function setAddress(string _name, address _address) returns() -func (_LibAddressManager *LibAddressManagerTransactorSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) { - return _LibAddressManager.Contract.SetAddress(&_LibAddressManager.TransactOpts, _name, _address) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address _newOwner) returns() -func (_LibAddressManager *LibAddressManagerTransactor) TransferOwnership(opts *bind.TransactOpts, _newOwner common.Address) (*types.Transaction, error) { - return _LibAddressManager.contract.Transact(opts, "transferOwnership", _newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address _newOwner) returns() -func (_LibAddressManager *LibAddressManagerSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) { - return _LibAddressManager.Contract.TransferOwnership(&_LibAddressManager.TransactOpts, _newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address _newOwner) returns() -func (_LibAddressManager *LibAddressManagerTransactorSession) TransferOwnership(_newOwner common.Address) (*types.Transaction, error) { - return _LibAddressManager.Contract.TransferOwnership(&_LibAddressManager.TransactOpts, _newOwner) -} - -// LibAddressManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the LibAddressManager contract. -type LibAddressManagerOwnershipTransferredIterator struct { - Event *LibAddressManagerOwnershipTransferred // 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 *LibAddressManagerOwnershipTransferredIterator) 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(LibAddressManagerOwnershipTransferred) - 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(LibAddressManagerOwnershipTransferred) - 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 *LibAddressManagerOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LibAddressManagerOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LibAddressManagerOwnershipTransferred represents a OwnershipTransferred event raised by the LibAddressManager contract. -type LibAddressManagerOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_LibAddressManager *LibAddressManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*LibAddressManagerOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _LibAddressManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &LibAddressManagerOwnershipTransferredIterator{contract: _LibAddressManager.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_LibAddressManager *LibAddressManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LibAddressManagerOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _LibAddressManager.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - 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(LibAddressManagerOwnershipTransferred) - if err := _LibAddressManager.contract.UnpackLog(event, "OwnershipTransferred", 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 -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_LibAddressManager *LibAddressManagerFilterer) ParseOwnershipTransferred(log types.Log) (*LibAddressManagerOwnershipTransferred, error) { - event := new(LibAddressManagerOwnershipTransferred) - if err := _LibAddressManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - return event, nil -} diff --git a/contracts/addressresolver/Lib_AddressResolver.go b/contracts/addressresolver/Lib_AddressResolver.go deleted file mode 100644 index 8bb809f65921..000000000000 --- a/contracts/addressresolver/Lib_AddressResolver.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package addressresolver - -import ( - "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 ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// LibAddressResolverABI is the input ABI used to generate the binding from. -const LibAddressResolverABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_contract\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" - -// LibAddressResolverBin is the compiled bytecode used for deploying new contracts. -var LibAddressResolverBin = "0x608060405234801561001057600080fd5b506040516102693803806102698339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610204806100656000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063461a447814610030575b600080fd5b6100d66004803603602081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184600183028401116401000000008311171561009557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506100f2945050505050565b604080516001600160a01b039092168252519081900360200190f35b6000805460405163bf40fac160e01b81526020600482018181528551602484015285516001600160a01b039094169363bf40fac19387938392604490920191908501908083838b5b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060206040518083038186803b15801561019c57600080fd5b505afa1580156101b0573d6000803e3d6000fd5b505050506040513d60208110156101c657600080fd5b50519291505056fea26469706673582212202d65863aab3b960819b4723b506367e35ce09bc37fd925a075175883011ce4d864736f6c63430007000033" - -// DeployLibAddressResolver deploys a new Ethereum contract, binding an instance of LibAddressResolver to it. -func DeployLibAddressResolver(auth *bind.TransactOpts, backend bind.ContractBackend, _libAddressManager common.Address) (common.Address, *types.Transaction, *LibAddressResolver, error) { - parsed, err := abi.JSON(strings.NewReader(LibAddressResolverABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(LibAddressResolverBin), backend, _libAddressManager) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &LibAddressResolver{LibAddressResolverCaller: LibAddressResolverCaller{contract: contract}, LibAddressResolverTransactor: LibAddressResolverTransactor{contract: contract}, LibAddressResolverFilterer: LibAddressResolverFilterer{contract: contract}}, nil -} - -// LibAddressResolver is an auto generated Go binding around an Ethereum contract. -type LibAddressResolver struct { - LibAddressResolverCaller // Read-only binding to the contract - LibAddressResolverTransactor // Write-only binding to the contract - LibAddressResolverFilterer // Log filterer for contract events -} - -// LibAddressResolverCaller is an auto generated read-only Go binding around an Ethereum contract. -type LibAddressResolverCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LibAddressResolverTransactor is an auto generated write-only Go binding around an Ethereum contract. -type LibAddressResolverTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LibAddressResolverFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type LibAddressResolverFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// LibAddressResolverSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type LibAddressResolverSession struct { - Contract *LibAddressResolver // 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 -} - -// LibAddressResolverCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type LibAddressResolverCallerSession struct { - Contract *LibAddressResolverCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// LibAddressResolverTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type LibAddressResolverTransactorSession struct { - Contract *LibAddressResolverTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// LibAddressResolverRaw is an auto generated low-level Go binding around an Ethereum contract. -type LibAddressResolverRaw struct { - Contract *LibAddressResolver // Generic contract binding to access the raw methods on -} - -// LibAddressResolverCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type LibAddressResolverCallerRaw struct { - Contract *LibAddressResolverCaller // Generic read-only contract binding to access the raw methods on -} - -// LibAddressResolverTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type LibAddressResolverTransactorRaw struct { - Contract *LibAddressResolverTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewLibAddressResolver creates a new instance of LibAddressResolver, bound to a specific deployed contract. -func NewLibAddressResolver(address common.Address, backend bind.ContractBackend) (*LibAddressResolver, error) { - contract, err := bindLibAddressResolver(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &LibAddressResolver{LibAddressResolverCaller: LibAddressResolverCaller{contract: contract}, LibAddressResolverTransactor: LibAddressResolverTransactor{contract: contract}, LibAddressResolverFilterer: LibAddressResolverFilterer{contract: contract}}, nil -} - -// NewLibAddressResolverCaller creates a new read-only instance of LibAddressResolver, bound to a specific deployed contract. -func NewLibAddressResolverCaller(address common.Address, caller bind.ContractCaller) (*LibAddressResolverCaller, error) { - contract, err := bindLibAddressResolver(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &LibAddressResolverCaller{contract: contract}, nil -} - -// NewLibAddressResolverTransactor creates a new write-only instance of LibAddressResolver, bound to a specific deployed contract. -func NewLibAddressResolverTransactor(address common.Address, transactor bind.ContractTransactor) (*LibAddressResolverTransactor, error) { - contract, err := bindLibAddressResolver(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &LibAddressResolverTransactor{contract: contract}, nil -} - -// NewLibAddressResolverFilterer creates a new log filterer instance of LibAddressResolver, bound to a specific deployed contract. -func NewLibAddressResolverFilterer(address common.Address, filterer bind.ContractFilterer) (*LibAddressResolverFilterer, error) { - contract, err := bindLibAddressResolver(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &LibAddressResolverFilterer{contract: contract}, nil -} - -// bindLibAddressResolver binds a generic wrapper to an already deployed contract. -func bindLibAddressResolver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(LibAddressResolverABI)) - 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 (_LibAddressResolver *LibAddressResolverRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _LibAddressResolver.Contract.LibAddressResolverCaller.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 (_LibAddressResolver *LibAddressResolverRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LibAddressResolver.Contract.LibAddressResolverTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LibAddressResolver *LibAddressResolverRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LibAddressResolver.Contract.LibAddressResolverTransactor.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 (_LibAddressResolver *LibAddressResolverCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _LibAddressResolver.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 (_LibAddressResolver *LibAddressResolverTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LibAddressResolver.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_LibAddressResolver *LibAddressResolverTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _LibAddressResolver.Contract.contract.Transact(opts, method, params...) -} - -// Resolve is a free data retrieval call binding the contract method 0x461a4478. -// -// Solidity: function resolve(string _name) constant returns(address _contract) -func (_LibAddressResolver *LibAddressResolverCaller) Resolve(opts *bind.CallOpts, _name string) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _LibAddressResolver.contract.Call(opts, out, "resolve", _name) - return *ret0, err -} - -// Resolve is a free data retrieval call binding the contract method 0x461a4478. -// -// Solidity: function resolve(string _name) constant returns(address _contract) -func (_LibAddressResolver *LibAddressResolverSession) Resolve(_name string) (common.Address, error) { - return _LibAddressResolver.Contract.Resolve(&_LibAddressResolver.CallOpts, _name) -} - -// Resolve is a free data retrieval call binding the contract method 0x461a4478. -// -// Solidity: function resolve(string _name) constant returns(address _contract) -func (_LibAddressResolver *LibAddressResolverCallerSession) Resolve(_name string) (common.Address, error) { - return _LibAddressResolver.Contract.Resolve(&_LibAddressResolver.CallOpts, _name) -} diff --git a/contracts/canonicaltransactionchain/OVM_CanonicalTransactionChain.go b/contracts/canonicaltransactionchain/OVM_CanonicalTransactionChain.go deleted file mode 100644 index 337b1dcb77a9..000000000000 --- a/contracts/canonicaltransactionchain/OVM_CanonicalTransactionChain.go +++ /dev/null @@ -1,963 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package canonicaltransactionchain - -import ( - "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 ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = 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 -} - -// Lib_OVMCodecQueueElement is an auto generated low-level Go binding around an user-defined struct. -type Lib_OVMCodecQueueElement struct { - QueueRoot [32]byte - Timestamp *big.Int - BlockNumber *big.Int -} - -// Lib_OVMCodecTransaction is an auto generated low-level Go binding around an user-defined struct. -type Lib_OVMCodecTransaction struct { - Timestamp *big.Int - BlockNumber *big.Int - L1QueueOrigin uint8 - L1TxOrigin common.Address - Entrypoint common.Address - GasLimit *big.Int - Data []byte -} - -// Lib_OVMCodecTransactionChainElement is an auto generated low-level Go binding around an user-defined struct. -type Lib_OVMCodecTransactionChainElement struct { - IsSequenced bool - QueueIndex *big.Int - Timestamp *big.Int - BlockNumber *big.Int - TxData []byte -} - -// OVMCanonicalTransactionChainABI is the input ABI used to generate the binding from. -const OVMCanonicalTransactionChainABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_forceInclusionPeriodSeconds\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":false,\"internalType\":\"address\",\"name\":\"_l1TxOrigin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_queueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"TransactionEnqueued\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"L2_GAS_DISCOUNT_DIVISOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\":[{\"internalType\":\"uint256\",\"name\":\"_numQueuedTransactions\",\"type\":\"uint256\"}],\"name\":\"appendQueueBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"appendSequencerBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"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\":\"queueRoot\",\"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\":\"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\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_contract\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"enumLib_OVMCodec.QueueOrigin\",\"name\":\"l1QueueOrigin\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"l1TxOrigin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"entrypoint\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structLib_OVMCodec.Transaction\",\"name\":\"_transaction\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"isSequenced\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"queueIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"txData\",\"type\":\"bytes\"}],\"internalType\":\"structLib_OVMCodec.TransactionChainElement\",\"name\":\"_txChainElement\",\"type\":\"tuple\"},{\"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\":\"_inclusionProof\",\"type\":\"tuple\"}],\"name\":\"verifyTransaction\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" - -// OVMCanonicalTransactionChainBin is the compiled bytecode used for deploying new contracts. -var OVMCanonicalTransactionChainBin = "0x60806040523480156200001157600080fd5b5060405162002abb38038062002abb8339810160408190526200003491620002ed565b600080546001600160a01b0319166001600160a01b03841617905560408051808201909152600d81526c27ab26afa9b2b8bab2b731b2b960991b60208201526200007e90620001fb565b600360006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620000c860405180606001604052806022815260200162002a9960229139620001fb565b600480546001600160a01b0319166001600160a01b0392909216919091179055600181905560408051808201909152601881527f4f564d5f5374617465436f6d6d69746d656e74436861696e000000000000000060208201526200016e906010907f9413776a3b6f36bbb044c745c87ab6e7ffed37fc3ab60731591a70782169714d906200015690620001fb565b60056200028860201b6200095d17909392919060201c565b620001f360107f30a907da349b6916f6bc60eb25a37176d5705fba414069bdb6f625ebf8bb6c55620001db6040518060400160405280601881526020017f4f564d5f5374617465436f6d6d69746d656e74436861696e0000000000000000815250620001fb60201b60201c565b600d6200028860201b6200095d17909392919060201c565b50506200037d565b6000805460405163bf40fac160e01b81526001600160a01b039091169063bf40fac1906200022e90859060040162000327565b60206040518083038186803b1580156200024757600080fd5b505afa1580156200025c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002829190620002bd565b92915050565b6004840183905560068401929092558255600190910180546001600160a01b0319166001600160a01b03909216919091179055565b600060208284031215620002cf578081fd5b81516001600160a01b0381168114620002e6578182fd5b9392505050565b6000806040838503121562000300578081fd5b82516001600160a01b038116811462000317578182fd5b6020939093015192949293505050565b6000602080835283518082850152825b81811015620003555785810183015185820160400152820162000337565b81811115620003675783604083870101525b50601f01601f1916929092016040019392505050565b61270c806200038d6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80637aa63a861161008c578063d0f8934411610066578063d0f8934414610194578063e561dddc1461019c578063f722b41a146101a4578063facdc5da146101ac576100cf565b80637aa63a861461017c578063876ed5cb14610184578063c2cf696f1461018c576100cf565b80632a7f18be146100d4578063461a4478146100fd5780634de569ce1461011d5780636fee07e01461013d57806378f4b2f2146101525780637a167a8a14610167575b600080fd5b6100e76100e2366004611d2c565b6101bf565b6040516100f491906125f3565b60405180910390f35b61011061010b366004611bd1565b61022a565b6040516100f49190611dbe565b61013061012b366004611c03565b6102b1565b6040516100f49190611e5e565b61015061014b366004611b5f565b6102eb565b005b61015a610429565b6040516100f49190611da7565b61016f61042f565b6040516100f49190612637565b61015a610441565b61015a61045a565b61015a610460565b610150610465565b61015a6107a4565b61016f6107bc565b6101506101ba366004611d2c565b6107d4565b6101c7611896565b6002820260006101df600d64ffffffffff8416610992565b905060006101f8600d64ffffffffff6001860116610992565b6040805160608101825293845264ffffffffff808316602086015260289290921c90911690830152509150505b919050565b6000805460405163bf40fac160e01b81526001600160a01b039091169063bf40fac19061025b908590600401611edb565b60206040518083038186803b15801561027357600080fd5b505afa158015610287573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ab9190611b43565b92915050565b82516000901515600114156102d3576102cc85858585610af0565b90506102e3565b6102cc8585602001518585610c98565b949350505050565b612710815111156103175760405162461bcd60e51b815260040161030e906122bf565b60405180910390fd5b614e208210156103395760405162461bcd60e51b815260040161030e90612122565b600a820460005a90508181116103615760405162461bcd60e51b815260040161030e90612393565b60005b825a8303101561037657600101610364565b60003387878760405160200161038f9493929190611dd2565b60408051601f19818403018152919052805160209091012090504360281b42176103bb600d8383610d77565b600060026103c9600d610dab565b64ffffffffff16816103d757fe5b0490507f4b388aecf9fa6cc92253704e5975a6129a4f735bdbd99567df4ed0094ee4ceb5338a8a8a600186034260405161041696959493929190611e0f565b60405180910390a1505050505050505050565b614e2081565b60008061043a610dc6565b9250505090565b60008061044c610dc6565b5064ffffffffff1691505090565b61271081565b600a81565b60043560d81c60093560e890811c90600c35901c610481610441565b8364ffffffffff16146104a65760405162461bcd60e51b815260040161030e906121de565b6003546001600160a01b031633146104d05760405162461bcd60e51b815260040161030e9061223b565b60008162ffffff16116104f55760405162461bcd60e51b815260040161030e90611fb7565b60008262ffffff161161051a5760405162461bcd60e51b815260040161030e906124be565b600f601062ffffff831602013664ffffffffff821681101561054e5760405162461bcd60e51b815260040161030e90612568565b60608462ffffff166001600160401b038111801561056b57600080fd5b50604051908082528060200260200182016040528015610595578160200160208202803683370190505b50905060008060006105a561042f565b905060006105b1610ded565b905060005b8862ffffff168163ffffffff1610156106d4576105d16118b6565b6105e08263ffffffff16610e0f565b90506105ec8185610e5f565b60005b815163ffffffff8216101561064a57893560e81c6106158364ffffffffff8d1683610f23565b898963ffffffff168151811061062757fe5b6020908102919091010152999099016003019860019687019695860195016105ef565b5060005b81602001518163ffffffff1610156106ca578364ffffffffff168564ffffffffff161061068d5760405162461bcd60e51b815260040161030e906125aa565b61069d8564ffffffffff16610fad565b888863ffffffff16815181106106af57fe5b6020908102919091010152600196870196948501940161064e565b50506001016105b6565b508664ffffffffff1686146106fb5760405162461bcd60e51b815260040161030e90611fff565b8862ffffff168463ffffffff16146107255760405162461bcd60e51b815260040161030e9061204d565b63ffffffff62ffffff8a168490031661075361074087610ff2565b8b62ffffff168364ffffffffff16611207565b7f602f1aeac0ca2e7a13e281a9ef0ad7838542712ce16780fa2ecffd351f05f89981840382610780610441565b60405161078f93929190612649565b60405180910390a15050505050505050505050565b60006107b06005610dab565b64ffffffffff16905090565b60006107c661042f565b6107ce610ded565b03905090565b6107ec816107e06107bc565b64ffffffffff166112a6565b90506000811161080e5760405162461bcd60e51b815260040161030e9061231c565b6060816001600160401b038111801561082657600080fd5b50604051908082528060200260200182016040528015610850578160200160208202803683370190505b509050600061085d61042f565b905060005b838110156108f9576003546001600160a01b031633146108c657610884611896565b6108948364ffffffffff166101bf565b905042600154826020015164ffffffffff1601106108c45760405162461bcd60e51b815260040161030e9061216b565b505b6108d68264ffffffffff16610fad565b8382815181106108e257fe5b602090810291909101015260019182019101610862565b5061090d61090683610ff2565b8485611207565b7f64d7f508348c70dea42d5302a393987e4abc20e45954ab3f9d320207751956f0838264ffffffffff160384610941610441565b60405161095093929190612621565b60405180910390a1505050565b6004840183905560068401929092558255600190910180546001600160a01b0319166001600160a01b03909216919091179055565b600061099c6118de565b6109a5846112bd565b805190915064ffffffffff1683106109cf5760405162461bcd60e51b815260040161030e906120f4565b60006109f182604001516001600160401b03168661131f90919063ffffffff16565b90506000610a1883604001516001016001600160401b03168761131f90919063ffffffff16565b9050826080015164ffffffffff168510610a79576080830151825464ffffffffff9091168603908110610a5d5760405162461bcd60e51b815260040161030e906120f4565b6000908152600190920160205250604090205491506102ab9050565b6080830151606084015164ffffffffff9182168781039290911610610ab05760405162461bcd60e51b815260040161030e906120f4565b8154811115610ad15760405162461bcd60e51b815260040161030e906120f4565b81540360009081526001909101602052604090205492506102ab915050565b600080610b286040518060400160405280601481526020017327ab26afa2bc32b1baba34b7b726b0b730b3b2b960611b81525061022a565b90506000816001600160a01b0316631c4712a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6557600080fd5b505afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9d9190611d44565b90506000610baa8761133f565b9050610bb78187876113d8565b610bd35760405162461bcd60e51b815260040161030e90611f32565b86606001518860200151148015610bee575060408701518851145b8015610c0c575060045460808901516001600160a01b039081169116145b8015610c1b5750818860a00151145b8015610c32575060608801516001600160a01b0316155b8015610c4d5750600088604001516001811115610c4b57fe5b145b8015610c6e57508660800151805190602001208860c0015180519060200120145b610c8a5760405162461bcd60e51b815260040161030e90611f80565b506001979650505050505050565b600080610ca88360000151610fad565b9050610cb58185856113d8565b610cd15760405162461bcd60e51b815260040161030e906123de565b6000866060015187608001518860a001518960c00151604051602001610cfa9493929190611dd2565b604051602081830303815290604052805190602001209050610d1a611896565b610d23876101bf565b805190915082148015610d4157508751602082015164ffffffffff16145b8015610d5b57508760200151816040015164ffffffffff16145b610c8a5760405162461bcd60e51b815260040161030e90612288565b610d7f6118de565b610d88846112bd565b9050610da5838383602001518761145c909392919063ffffffff16565b50505050565b6000610db56118de565b610dbe836112bd565b519392505050565b6000806000610dd56005611472565b64ffffffffff602882901c16935060501c9150509091565b60006002610dfb600d610dab565b64ffffffffff1681610e0957fe5b04905090565b610e176118b6565b5060408051608081018252601092909202600f81013560e890811c84526012820135901c6020840152601581013560d890811c92840192909252601a0135901c606082015290565b610e676107bc565b64ffffffffff16610e7757610f1f565b610e7f611896565b610e8f8264ffffffffff166101bf565b9050600154816020015164ffffffffff16014210610ebf5760405162461bcd60e51b815260040161030e906124ff565b806020015164ffffffffff1683604001511115610eee5760405162461bcd60e51b815260040161030e90612428565b806040015164ffffffffff1683606001511115610f1d5760405162461bcd60e51b815260040161030e90612472565b505b5050565b60006060826041016001600160401b0381118015610f4057600080fd5b506040519080825280601f01601f191660200182016040528015610f6b576020820181803683370190505b50604086015160608701519192509060006020840160018153836001820152826021820152866003890160418301376041870190209450505050509392505050565b60006102ab6040518060a00160405280600015158152602001848152602001600081526020016000815260200160405180602001604052806000815250815250611490565b6000808251116110145760405162461bcd60e51b815260040161030e90611eee565b81516001141561103a578160008151811061102b57fe5b60200260200101519050610225565b606061104683516114d8565b8351909150839060029006600114156110e15783516001016001600160401b038111801561107357600080fd5b5060405190808252806020026020018201604052801561109d578160200160208202803683370190505b50905060005b84518110156110df578481815181106110b857fe5b60200260200101518282815181106110cc57fe5b60209081029190910101526001016110a3565b505b83516000906002810660011415611121578382815181106110fe57fe5b602002602001015183828151811061111257fe5b60209081029190910101526001015b60018111156111e75760018201915060005b600282048110156111965761117784826002028151811061115057fe5b602002602001015185836002026001018151811061116a57fe5b60200260200101516115cd565b84828151811061118357fe5b6020908102919091010152600101611133565b506002900460018082161480156111ae575080600114155b156111e2578382815181106111bf57fe5b60200260200101518382815181106111d357fe5b60209081029190910101526001015b611121565b826000815181106111f457fe5b6020026020010151945050505050919050565b600080611212610dc6565b9150915061121e61190c565b6040518060a001604052806112336005610dab565b64ffffffffff1681526020018781526020018681526020018464ffffffffff168152602001604051806020016040528060008152508152509050600061127882611600565b9050600061128e83604001518601878601611629565b905061129c60058383611637565b5050505050505050565b6000818310156112b75750816102ab565b50919050565b6112c56118de565b5060028101546003909101546040805160a08101825264ffffffffff808516825264ffffffffff1990941660208201526001600160401b038316818301529082901c8316606082015260689190911c909116608082015290565b600060028206156113335782600601611338565b826004015b9392505050565b60808101518051600091906060604182016001600160401b038111801561136557600080fd5b506040519080825280601f01601f191660200182016040528015611390576020820181803683370190505b5060408601516060870151919250906000602084016001815383600182015282602182015285604182018760208a0160045afa50604190950190942095505050505050919050565b60006113f8836000015163ffffffff16600561099290919063ffffffff16565b61140184611600565b1461141e5760405162461bcd60e51b815260040161030e90612364565b611436836020015185846000015185602001516117c5565b6114525760405162461bcd60e51b815260040161030e906120bd565b5060019392505050565b611467848483611637565b610da5848383611637565b600061147c6118de565b611485836112bd565b602001519392505050565b80516020808301516040808501516060860151608087015192516000966114bb969095949101611e69565b604051602081830303815290604052805190602001209050919050565b606080826001600160401b03811180156114f157600080fd5b5060405190808252806020026020018201604052801561151b578160200160208202803683370190505b50905060006040516020016115309190611da7565b604051602081830303815290604052805190602001208160008151811061155357fe5b602090810291909101015260015b81518110156115c65781600182038151811061157957fe5b60200260200101516040516020016115919190611da7565b604051602081830303815290604052805190602001208282815181106115b357fe5b6020908102919091010152600101611561565b5092915050565b600082826040516020016115e2929190611db0565b60405160208183030381529060405280519060200120905092915050565b600081602001518260400151836060015184608001516040516020016114bb9493929190611ea1565b602890811b91909117901b90565b61163f6118de565b611648846112bd565b9050600061166c82604001516001600160401b03168661131f90919063ffffffff16565b805490915061167a57601081555b8054608083015183510364ffffffffff16106117725760018501548554608084015160405163677f5aff60e01b81526000936001600160a01b03169263677f5aff926116c892600401611ec6565b602060405180830381600087803b1580156116e257600080fd5b505af1925050508015611712575060408051601f3d908101601f1916820190925261170f91810190611bb5565b60015b61171e57506000611721565b90505b8015611768576040830180516001016001600160401b03169081905260808401805164ffffffffff9081166060870152855116905261176190879061131f565b9150611770565b815460020282555b505b608082015182510364ffffffffff9081166000818152600184810160209081526040909220889055855101909216845264ffffffffff198516918401919091526117bc8684611830565b50505050505050565b600083815b83518110156118245760008482815181106117e157fe5b60209081029190910101519050600186831c811614801561180d5761180684836115cd565b935061181a565b61181782856115cd565b93505b50506001016117ca565b50909414949350505050565b80516020820151604080840151606085015160808601516002880154600096868117969584901b8517606884901b1795909490939092909187146118765760028a018790555b858a60030154146118895760038a018690555b5050505050505092915050565b604080516060810182526000808252602082018190529181019190915290565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6040518060a0016040528060008152602001600080191681526020016000815260200160008152602001606081525090565b80356102ab816126b0565b600082601f830112611959578081fd5b81356001600160401b0381111561196e578182fd5b611981601f8201601f191660200161266b565b915080825283602082850101111561199857600080fd5b8060208401602084013760009082016020015292915050565b8035600281106102ab57600080fd5b600060a082840312156119d1578081fd5b6119db60a061266b565b90508135815260208201356020820152604082013560408201526060820135606082015260808201356001600160401b03811115611a1857600080fd5b611a2484828501611949565b60808301525092915050565b600060408284031215611a41578081fd5b611a4b604061266b565b9050813581526020808301356001600160401b03811115611a6b57600080fd5b8301601f81018513611a7c57600080fd5b8035611a8f611a8a82612691565b61266b565b8181528381019083850185840285018601891015611aac57600080fd5b600094505b83851015611acf578035835260019490940193918501918501611ab1565b508085870152505050505092915050565b600060a08284031215611af1578081fd5b611afb60a061266b565b90508135611b08816126c8565b8082525060208201356020820152604082013560408201526060820135606082015260808201356001600160401b03811115611a1857600080fd5b600060208284031215611b54578081fd5b8151611338816126b0565b600080600060608486031215611b73578182fd5b8335611b7e816126b0565b92506020840135915060408401356001600160401b03811115611b9f578182fd5b611bab86828701611949565b9150509250925092565b600060208284031215611bc6578081fd5b8151611338816126c8565b600060208284031215611be2578081fd5b81356001600160401b03811115611bf7578182fd5b6102e384828501611949565b60008060008060808587031215611c18578081fd5b84356001600160401b0380821115611c2e578283fd5b9086019060e08289031215611c41578283fd5b611c4b60e061266b565b8235815260208301356020820152611c6689604085016119b1565b6040820152611c78896060850161193e565b6060820152611c8a896080850161193e565b608082015260a083013560a082015260c083013582811115611caa578485fd5b611cb68a828601611949565b60c08301525095506020870135915080821115611cd1578283fd5b611cdd88838901611ae0565b94506040870135915080821115611cf2578283fd5b611cfe888389016119c0565b93506060870135915080821115611d13578283fd5b50611d2087828801611a30565b91505092959194509250565b600060208284031215611d3d578081fd5b5035919050565b600060208284031215611d55578081fd5b5051919050565b60008151808452815b81811015611d8157602081850181015186830182015201611d65565b81811115611d925782602083870101525b50601f01601f19169290920160200192915050565b90815260200190565b918252602082015260400190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611e0590830184611d5c565b9695505050505050565b6001600160a01b038781168252861660208201526040810185905260c060608201819052600090611e4290830186611d5c565b64ffffffffff9490941660808301525060a00152949350505050565b901515815260200190565b6000861515825285602083015284604083015283606083015260a06080830152611e9660a0830184611d5c565b979650505050505050565b600085825284602083015283604083015260806060830152611e056080830184611d5c565b91825264ffffffffff16602082015260400190565b6000602082526113386020830184611d5c565b60208082526024908201527f4d7573742070726f76696465206174206c65617374206f6e65206c656166206860408201526330b9b41760e11b606082015260800190565b6020808252602e908201527f496e76616c69642053657175656e636572207472616e73616374696f6e20696e60408201526d31b63ab9b4b7b710383937b7b31760911b606082015260800190565b6020808252601e908201527f496e76616c69642053657175656e636572207472616e73616374696f6e2e0000604082015260600190565b60208082526028908201527f4d7573742070726f76696465206174206c65617374206f6e652062617463682060408201526731b7b73a32bc3a1760c11b606082015260800190565b6020808252602e908201527f4e6f7420616c6c2073657175656e636572207472616e73616374696f6e73207760408201526d32b93290383937b1b2b9b9b2b21760911b606082015260800190565b6020808252604a908201527f41637475616c207472616e73616374696f6e20696e64657820646f6573206e6f60408201527f74206d6174636820657870656374656420746f74616c20656c656d656e7473206060820152693a379030b83832b7321760b11b608082015260a00190565b60208082526018908201527f496e76616c696420696e636c7573696f6e2070726f6f662e0000000000000000604082015260600190565b60208082526014908201527324b73232bc1037baba1037b3103137bab732399760611b604082015260600190565b60208082526029908201527f5472616e73616374696f6e20676173206c696d697420746f6f206c6f7720746f6040820152681032b738bab2bab29760b91b606082015260800190565b6020808252604d908201527f5175657565207472616e73616374696f6e732063616e6e6f742062652073756260408201527f6d697474656420647572696e67207468652073657175656e63657220696e636c60608201526c3ab9b4b7b7103832b934b7b21760991b608082015260a00190565b6020808252603d908201527f41637475616c20626174636820737461727420696e64657820646f6573206e6f60408201527f74206d6174636820657870656374656420737461727420696e6465782e000000606082015260800190565b6020808252602d908201527f46756e6374696f6e2063616e206f6e6c792062652063616c6c6564206279207460408201526c34329029b2b8bab2b731b2b91760991b606082015260800190565b6020808252601a908201527f496e76616c6964205175657565207472616e73616374696f6e2e000000000000604082015260600190565b60208082526039908201527f5472616e73616374696f6e2065786365656473206d6178696d756d20726f6c6c60408201527f7570207472616e73616374696f6e20646174612073697a652e00000000000000606082015260800190565b60208082526028908201527f4d75737420617070656e64206d6f7265207468616e207a65726f207472616e7360408201526730b1ba34b7b7399760c11b606082015260800190565b60208082526015908201527424b73b30b634b2103130ba31b4103432b0b232b91760591b604082015260600190565b6020808252602b908201527f496e73756666696369656e742067617320666f72204c322072617465206c696d60408201526a34ba34b73390313ab9371760a91b606082015260800190565b6020808252602a908201527f496e76616c6964205175657565207472616e73616374696f6e20696e636c757360408201526934b7b710383937b7b31760b11b606082015260800190565b6020808252602a908201527f53657175656e636572207472616e73616374696f6e732074696d657374616d70604082015269103a37b7903434b3b41760b11b606082015260800190565b6020808252602c908201527f53657175656e636572207472616e73616374696f6e7320626c6f636b4e756d6260408201526b32b9103a37b7903434b3b41760a11b606082015260800190565b60208082526021908201527f4d75737420617070656e64206174206c65617374206f6e6520656c656d656e746040820152601760f91b606082015260800190565b60208082526043908201527f4f6c6465722071756575652062617463686573206d7573742062652070726f6360408201527f6573736564206265666f72652061206e65772073657175656e6365722062617460608201526231b41760e91b608082015260a00190565b60208082526022908201527f4e6f7420656e6f756768204261746368436f6e74657874732070726f76696465604082015261321760f11b606082015260800190565b60208082526029908201527f4e6f7420656e6f75676820717565756564207472616e73616374696f6e732074604082015268379030b83832b7321760b91b606082015260800190565b8151815260208083015164ffffffffff90811691830191909152604092830151169181019190915260600190565b9283526020830191909152604082015260600190565b64ffffffffff91909116815260200190565b64ffffffffff9384168152919092166020820152604081019190915260600190565b6040518181016001600160401b038111828210171561268957600080fd5b604052919050565b60006001600160401b038211156126a6578081fd5b5060209081020190565b6001600160a01b03811681146126c557600080fd5b50565b80151581146126c557600080fdfea264697066735822122018bdcaf85f998551b97bc3cb1cabf1204dfc42873d1094734cdc0931a6dcdf2664736f6c634300070000334f564d5f4465636f6d7072657373696f6e507265636f6d70696c6541646472657373" - -// DeployOVMCanonicalTransactionChain deploys a new Ethereum contract, binding an instance of OVMCanonicalTransactionChain to it. -func DeployOVMCanonicalTransactionChain(auth *bind.TransactOpts, backend bind.ContractBackend, _libAddressManager common.Address, _forceInclusionPeriodSeconds *big.Int) (common.Address, *types.Transaction, *OVMCanonicalTransactionChain, error) { - parsed, err := abi.JSON(strings.NewReader(OVMCanonicalTransactionChainABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(OVMCanonicalTransactionChainBin), backend, _libAddressManager, _forceInclusionPeriodSeconds) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &OVMCanonicalTransactionChain{OVMCanonicalTransactionChainCaller: OVMCanonicalTransactionChainCaller{contract: contract}, OVMCanonicalTransactionChainTransactor: OVMCanonicalTransactionChainTransactor{contract: contract}, OVMCanonicalTransactionChainFilterer: OVMCanonicalTransactionChainFilterer{contract: contract}}, nil -} - -// OVMCanonicalTransactionChain is an auto generated Go binding around an Ethereum contract. -type OVMCanonicalTransactionChain struct { - OVMCanonicalTransactionChainCaller // Read-only binding to the contract - OVMCanonicalTransactionChainTransactor // Write-only binding to the contract - OVMCanonicalTransactionChainFilterer // Log filterer for contract events -} - -// OVMCanonicalTransactionChainCaller is an auto generated read-only Go binding around an Ethereum contract. -type OVMCanonicalTransactionChainCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// OVMCanonicalTransactionChainTransactor is an auto generated write-only Go binding around an Ethereum contract. -type OVMCanonicalTransactionChainTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// OVMCanonicalTransactionChainFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type OVMCanonicalTransactionChainFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// OVMCanonicalTransactionChainSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type OVMCanonicalTransactionChainSession struct { - Contract *OVMCanonicalTransactionChain // 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 -} - -// OVMCanonicalTransactionChainCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type OVMCanonicalTransactionChainCallerSession struct { - Contract *OVMCanonicalTransactionChainCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// OVMCanonicalTransactionChainTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type OVMCanonicalTransactionChainTransactorSession struct { - Contract *OVMCanonicalTransactionChainTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// OVMCanonicalTransactionChainRaw is an auto generated low-level Go binding around an Ethereum contract. -type OVMCanonicalTransactionChainRaw struct { - Contract *OVMCanonicalTransactionChain // Generic contract binding to access the raw methods on -} - -// OVMCanonicalTransactionChainCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type OVMCanonicalTransactionChainCallerRaw struct { - Contract *OVMCanonicalTransactionChainCaller // Generic read-only contract binding to access the raw methods on -} - -// OVMCanonicalTransactionChainTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type OVMCanonicalTransactionChainTransactorRaw struct { - Contract *OVMCanonicalTransactionChainTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewOVMCanonicalTransactionChain creates a new instance of OVMCanonicalTransactionChain, bound to a specific deployed contract. -func NewOVMCanonicalTransactionChain(address common.Address, backend bind.ContractBackend) (*OVMCanonicalTransactionChain, error) { - contract, err := bindOVMCanonicalTransactionChain(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChain{OVMCanonicalTransactionChainCaller: OVMCanonicalTransactionChainCaller{contract: contract}, OVMCanonicalTransactionChainTransactor: OVMCanonicalTransactionChainTransactor{contract: contract}, OVMCanonicalTransactionChainFilterer: OVMCanonicalTransactionChainFilterer{contract: contract}}, nil -} - -// NewOVMCanonicalTransactionChainCaller creates a new read-only instance of OVMCanonicalTransactionChain, bound to a specific deployed contract. -func NewOVMCanonicalTransactionChainCaller(address common.Address, caller bind.ContractCaller) (*OVMCanonicalTransactionChainCaller, error) { - contract, err := bindOVMCanonicalTransactionChain(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChainCaller{contract: contract}, nil -} - -// NewOVMCanonicalTransactionChainTransactor creates a new write-only instance of OVMCanonicalTransactionChain, bound to a specific deployed contract. -func NewOVMCanonicalTransactionChainTransactor(address common.Address, transactor bind.ContractTransactor) (*OVMCanonicalTransactionChainTransactor, error) { - contract, err := bindOVMCanonicalTransactionChain(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChainTransactor{contract: contract}, nil -} - -// NewOVMCanonicalTransactionChainFilterer creates a new log filterer instance of OVMCanonicalTransactionChain, bound to a specific deployed contract. -func NewOVMCanonicalTransactionChainFilterer(address common.Address, filterer bind.ContractFilterer) (*OVMCanonicalTransactionChainFilterer, error) { - contract, err := bindOVMCanonicalTransactionChain(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChainFilterer{contract: contract}, nil -} - -// bindOVMCanonicalTransactionChain binds a generic wrapper to an already deployed contract. -func bindOVMCanonicalTransactionChain(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(OVMCanonicalTransactionChainABI)) - 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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _OVMCanonicalTransactionChain.Contract.OVMCanonicalTransactionChainCaller.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.OVMCanonicalTransactionChainTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.OVMCanonicalTransactionChainTransactor.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.contract.Transact(opts, method, params...) -} - -// L2GASDISCOUNTDIVISOR is a free data retrieval call binding the contract method 0xc2cf696f. -// -// Solidity: function L2_GAS_DISCOUNT_DIVISOR() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) L2GASDISCOUNTDIVISOR(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "L2_GAS_DISCOUNT_DIVISOR") - return *ret0, err -} - -// L2GASDISCOUNTDIVISOR is a free data retrieval call binding the contract method 0xc2cf696f. -// -// Solidity: function L2_GAS_DISCOUNT_DIVISOR() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) L2GASDISCOUNTDIVISOR() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.L2GASDISCOUNTDIVISOR(&_OVMCanonicalTransactionChain.CallOpts) -} - -// L2GASDISCOUNTDIVISOR is a free data retrieval call binding the contract method 0xc2cf696f. -// -// Solidity: function L2_GAS_DISCOUNT_DIVISOR() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) L2GASDISCOUNTDIVISOR() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.L2GASDISCOUNTDIVISOR(&_OVMCanonicalTransactionChain.CallOpts) -} - -// MAXROLLUPTXSIZE is a free data retrieval call binding the contract method 0x876ed5cb. -// -// Solidity: function MAX_ROLLUP_TX_SIZE() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) MAXROLLUPTXSIZE(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "MAX_ROLLUP_TX_SIZE") - return *ret0, err -} - -// MAXROLLUPTXSIZE is a free data retrieval call binding the contract method 0x876ed5cb. -// -// Solidity: function MAX_ROLLUP_TX_SIZE() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) MAXROLLUPTXSIZE() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.MAXROLLUPTXSIZE(&_OVMCanonicalTransactionChain.CallOpts) -} - -// MAXROLLUPTXSIZE is a free data retrieval call binding the contract method 0x876ed5cb. -// -// Solidity: function MAX_ROLLUP_TX_SIZE() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) MAXROLLUPTXSIZE() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.MAXROLLUPTXSIZE(&_OVMCanonicalTransactionChain.CallOpts) -} - -// MINROLLUPTXGAS is a free data retrieval call binding the contract method 0x78f4b2f2. -// -// Solidity: function MIN_ROLLUP_TX_GAS() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) MINROLLUPTXGAS(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "MIN_ROLLUP_TX_GAS") - return *ret0, err -} - -// MINROLLUPTXGAS is a free data retrieval call binding the contract method 0x78f4b2f2. -// -// Solidity: function MIN_ROLLUP_TX_GAS() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) MINROLLUPTXGAS() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.MINROLLUPTXGAS(&_OVMCanonicalTransactionChain.CallOpts) -} - -// MINROLLUPTXGAS is a free data retrieval call binding the contract method 0x78f4b2f2. -// -// Solidity: function MIN_ROLLUP_TX_GAS() constant returns(uint256) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) MINROLLUPTXGAS() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.MINROLLUPTXGAS(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetNextQueueIndex is a free data retrieval call binding the contract method 0x7a167a8a. -// -// Solidity: function getNextQueueIndex() constant returns(uint40) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) GetNextQueueIndex(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "getNextQueueIndex") - return *ret0, err -} - -// GetNextQueueIndex is a free data retrieval call binding the contract method 0x7a167a8a. -// -// Solidity: function getNextQueueIndex() constant returns(uint40) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) GetNextQueueIndex() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetNextQueueIndex(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetNextQueueIndex is a free data retrieval call binding the contract method 0x7a167a8a. -// -// Solidity: function getNextQueueIndex() constant returns(uint40) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) GetNextQueueIndex() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetNextQueueIndex(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetNumPendingQueueElements is a free data retrieval call binding the contract method 0xf722b41a. -// -// Solidity: function getNumPendingQueueElements() constant returns(uint40) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) GetNumPendingQueueElements(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "getNumPendingQueueElements") - return *ret0, err -} - -// GetNumPendingQueueElements is a free data retrieval call binding the contract method 0xf722b41a. -// -// Solidity: function getNumPendingQueueElements() constant returns(uint40) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) GetNumPendingQueueElements() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetNumPendingQueueElements(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetNumPendingQueueElements is a free data retrieval call binding the contract method 0xf722b41a. -// -// Solidity: function getNumPendingQueueElements() constant returns(uint40) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) GetNumPendingQueueElements() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetNumPendingQueueElements(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetQueueElement is a free data retrieval call binding the contract method 0x2a7f18be. -// -// Solidity: function getQueueElement(uint256 _index) constant returns(Lib_OVMCodecQueueElement _element) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) GetQueueElement(opts *bind.CallOpts, _index *big.Int) (Lib_OVMCodecQueueElement, error) { - var ( - ret0 = new(Lib_OVMCodecQueueElement) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "getQueueElement", _index) - return *ret0, err -} - -// GetQueueElement is a free data retrieval call binding the contract method 0x2a7f18be. -// -// Solidity: function getQueueElement(uint256 _index) constant returns(Lib_OVMCodecQueueElement _element) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) GetQueueElement(_index *big.Int) (Lib_OVMCodecQueueElement, error) { - return _OVMCanonicalTransactionChain.Contract.GetQueueElement(&_OVMCanonicalTransactionChain.CallOpts, _index) -} - -// GetQueueElement is a free data retrieval call binding the contract method 0x2a7f18be. -// -// Solidity: function getQueueElement(uint256 _index) constant returns(Lib_OVMCodecQueueElement _element) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) GetQueueElement(_index *big.Int) (Lib_OVMCodecQueueElement, error) { - return _OVMCanonicalTransactionChain.Contract.GetQueueElement(&_OVMCanonicalTransactionChain.CallOpts, _index) -} - -// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. -// -// Solidity: function getTotalBatches() constant returns(uint256 _totalBatches) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) GetTotalBatches(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "getTotalBatches") - return *ret0, err -} - -// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. -// -// Solidity: function getTotalBatches() constant returns(uint256 _totalBatches) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) GetTotalBatches() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetTotalBatches(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetTotalBatches is a free data retrieval call binding the contract method 0xe561dddc. -// -// Solidity: function getTotalBatches() constant returns(uint256 _totalBatches) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) GetTotalBatches() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetTotalBatches(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. -// -// Solidity: function getTotalElements() constant returns(uint256 _totalElements) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) GetTotalElements(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "getTotalElements") - return *ret0, err -} - -// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. -// -// Solidity: function getTotalElements() constant returns(uint256 _totalElements) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) GetTotalElements() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetTotalElements(&_OVMCanonicalTransactionChain.CallOpts) -} - -// GetTotalElements is a free data retrieval call binding the contract method 0x7aa63a86. -// -// Solidity: function getTotalElements() constant returns(uint256 _totalElements) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) GetTotalElements() (*big.Int, error) { - return _OVMCanonicalTransactionChain.Contract.GetTotalElements(&_OVMCanonicalTransactionChain.CallOpts) -} - -// Resolve is a free data retrieval call binding the contract method 0x461a4478. -// -// Solidity: function resolve(string _name) constant returns(address _contract) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) Resolve(opts *bind.CallOpts, _name string) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "resolve", _name) - return *ret0, err -} - -// Resolve is a free data retrieval call binding the contract method 0x461a4478. -// -// Solidity: function resolve(string _name) constant returns(address _contract) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) Resolve(_name string) (common.Address, error) { - return _OVMCanonicalTransactionChain.Contract.Resolve(&_OVMCanonicalTransactionChain.CallOpts, _name) -} - -// Resolve is a free data retrieval call binding the contract method 0x461a4478. -// -// Solidity: function resolve(string _name) constant returns(address _contract) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) Resolve(_name string) (common.Address, error) { - return _OVMCanonicalTransactionChain.Contract.Resolve(&_OVMCanonicalTransactionChain.CallOpts, _name) -} - -// VerifyTransaction is a free data retrieval call binding the contract method 0x4de569ce. -// -// Solidity: function verifyTransaction(Lib_OVMCodecTransaction _transaction, Lib_OVMCodecTransactionChainElement _txChainElement, Lib_OVMCodecChainBatchHeader _batchHeader, Lib_OVMCodecChainInclusionProof _inclusionProof) constant returns(bool) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCaller) VerifyTransaction(opts *bind.CallOpts, _transaction Lib_OVMCodecTransaction, _txChainElement Lib_OVMCodecTransactionChainElement, _batchHeader Lib_OVMCodecChainBatchHeader, _inclusionProof Lib_OVMCodecChainInclusionProof) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _OVMCanonicalTransactionChain.contract.Call(opts, out, "verifyTransaction", _transaction, _txChainElement, _batchHeader, _inclusionProof) - return *ret0, err -} - -// VerifyTransaction is a free data retrieval call binding the contract method 0x4de569ce. -// -// Solidity: function verifyTransaction(Lib_OVMCodecTransaction _transaction, Lib_OVMCodecTransactionChainElement _txChainElement, Lib_OVMCodecChainBatchHeader _batchHeader, Lib_OVMCodecChainInclusionProof _inclusionProof) constant returns(bool) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) VerifyTransaction(_transaction Lib_OVMCodecTransaction, _txChainElement Lib_OVMCodecTransactionChainElement, _batchHeader Lib_OVMCodecChainBatchHeader, _inclusionProof Lib_OVMCodecChainInclusionProof) (bool, error) { - return _OVMCanonicalTransactionChain.Contract.VerifyTransaction(&_OVMCanonicalTransactionChain.CallOpts, _transaction, _txChainElement, _batchHeader, _inclusionProof) -} - -// VerifyTransaction is a free data retrieval call binding the contract method 0x4de569ce. -// -// Solidity: function verifyTransaction(Lib_OVMCodecTransaction _transaction, Lib_OVMCodecTransactionChainElement _txChainElement, Lib_OVMCodecChainBatchHeader _batchHeader, Lib_OVMCodecChainInclusionProof _inclusionProof) constant returns(bool) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainCallerSession) VerifyTransaction(_transaction Lib_OVMCodecTransaction, _txChainElement Lib_OVMCodecTransactionChainElement, _batchHeader Lib_OVMCodecChainBatchHeader, _inclusionProof Lib_OVMCodecChainInclusionProof) (bool, error) { - return _OVMCanonicalTransactionChain.Contract.VerifyTransaction(&_OVMCanonicalTransactionChain.CallOpts, _transaction, _txChainElement, _batchHeader, _inclusionProof) -} - -// AppendQueueBatch is a paid mutator transaction binding the contract method 0xfacdc5da. -// -// Solidity: function appendQueueBatch(uint256 _numQueuedTransactions) returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactor) AppendQueueBatch(opts *bind.TransactOpts, _numQueuedTransactions *big.Int) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.contract.Transact(opts, "appendQueueBatch", _numQueuedTransactions) -} - -// AppendQueueBatch is a paid mutator transaction binding the contract method 0xfacdc5da. -// -// Solidity: function appendQueueBatch(uint256 _numQueuedTransactions) returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) AppendQueueBatch(_numQueuedTransactions *big.Int) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.AppendQueueBatch(&_OVMCanonicalTransactionChain.TransactOpts, _numQueuedTransactions) -} - -// AppendQueueBatch is a paid mutator transaction binding the contract method 0xfacdc5da. -// -// Solidity: function appendQueueBatch(uint256 _numQueuedTransactions) returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactorSession) AppendQueueBatch(_numQueuedTransactions *big.Int) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.AppendQueueBatch(&_OVMCanonicalTransactionChain.TransactOpts, _numQueuedTransactions) -} - -// AppendSequencerBatch is a paid mutator transaction binding the contract method 0xd0f89344. -// -// Solidity: function appendSequencerBatch() returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactor) AppendSequencerBatch(opts *bind.TransactOpts) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.contract.Transact(opts, "appendSequencerBatch") -} - -// AppendSequencerBatch is a paid mutator transaction binding the contract method 0xd0f89344. -// -// Solidity: function appendSequencerBatch() returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) AppendSequencerBatch() (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.AppendSequencerBatch(&_OVMCanonicalTransactionChain.TransactOpts) -} - -// AppendSequencerBatch is a paid mutator transaction binding the contract method 0xd0f89344. -// -// Solidity: function appendSequencerBatch() returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactorSession) AppendSequencerBatch() (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.AppendSequencerBatch(&_OVMCanonicalTransactionChain.TransactOpts) -} - -// Enqueue is a paid mutator transaction binding the contract method 0x6fee07e0. -// -// Solidity: function enqueue(address _target, uint256 _gasLimit, bytes _data) returns() -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactor) Enqueue(opts *bind.TransactOpts, _target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainSession) Enqueue(_target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.Enqueue(&_OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainTransactorSession) Enqueue(_target common.Address, _gasLimit *big.Int, _data []byte) (*types.Transaction, error) { - return _OVMCanonicalTransactionChain.Contract.Enqueue(&_OVMCanonicalTransactionChain.TransactOpts, _target, _gasLimit, _data) -} - -// OVMCanonicalTransactionChainQueueBatchAppendedIterator is returned from FilterQueueBatchAppended and is used to iterate over the raw logs and unpacked data for QueueBatchAppended events raised by the OVMCanonicalTransactionChain contract. -type OVMCanonicalTransactionChainQueueBatchAppendedIterator struct { - Event *OVMCanonicalTransactionChainQueueBatchAppended // 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 *OVMCanonicalTransactionChainQueueBatchAppendedIterator) 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(OVMCanonicalTransactionChainQueueBatchAppended) - 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(OVMCanonicalTransactionChainQueueBatchAppended) - 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 *OVMCanonicalTransactionChainQueueBatchAppendedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *OVMCanonicalTransactionChainQueueBatchAppendedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// OVMCanonicalTransactionChainQueueBatchAppended represents a QueueBatchAppended event raised by the OVMCanonicalTransactionChain contract. -type OVMCanonicalTransactionChainQueueBatchAppended 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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) FilterQueueBatchAppended(opts *bind.FilterOpts) (*OVMCanonicalTransactionChainQueueBatchAppendedIterator, error) { - - logs, sub, err := _OVMCanonicalTransactionChain.contract.FilterLogs(opts, "QueueBatchAppended") - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChainQueueBatchAppendedIterator{contract: _OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) WatchQueueBatchAppended(opts *bind.WatchOpts, sink chan<- *OVMCanonicalTransactionChainQueueBatchAppended) (event.Subscription, error) { - - logs, sub, err := _OVMCanonicalTransactionChain.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(OVMCanonicalTransactionChainQueueBatchAppended) - if err := _OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) ParseQueueBatchAppended(log types.Log) (*OVMCanonicalTransactionChainQueueBatchAppended, error) { - event := new(OVMCanonicalTransactionChainQueueBatchAppended) - if err := _OVMCanonicalTransactionChain.contract.UnpackLog(event, "QueueBatchAppended", log); err != nil { - return nil, err - } - return event, nil -} - -// OVMCanonicalTransactionChainSequencerBatchAppendedIterator is returned from FilterSequencerBatchAppended and is used to iterate over the raw logs and unpacked data for SequencerBatchAppended events raised by the OVMCanonicalTransactionChain contract. -type OVMCanonicalTransactionChainSequencerBatchAppendedIterator struct { - Event *OVMCanonicalTransactionChainSequencerBatchAppended // 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 *OVMCanonicalTransactionChainSequencerBatchAppendedIterator) 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(OVMCanonicalTransactionChainSequencerBatchAppended) - 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(OVMCanonicalTransactionChainSequencerBatchAppended) - 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 *OVMCanonicalTransactionChainSequencerBatchAppendedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *OVMCanonicalTransactionChainSequencerBatchAppendedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// OVMCanonicalTransactionChainSequencerBatchAppended represents a SequencerBatchAppended event raised by the OVMCanonicalTransactionChain contract. -type OVMCanonicalTransactionChainSequencerBatchAppended 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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) FilterSequencerBatchAppended(opts *bind.FilterOpts) (*OVMCanonicalTransactionChainSequencerBatchAppendedIterator, error) { - - logs, sub, err := _OVMCanonicalTransactionChain.contract.FilterLogs(opts, "SequencerBatchAppended") - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChainSequencerBatchAppendedIterator{contract: _OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) WatchSequencerBatchAppended(opts *bind.WatchOpts, sink chan<- *OVMCanonicalTransactionChainSequencerBatchAppended) (event.Subscription, error) { - - logs, sub, err := _OVMCanonicalTransactionChain.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(OVMCanonicalTransactionChainSequencerBatchAppended) - if err := _OVMCanonicalTransactionChain.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 (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) ParseSequencerBatchAppended(log types.Log) (*OVMCanonicalTransactionChainSequencerBatchAppended, error) { - event := new(OVMCanonicalTransactionChainSequencerBatchAppended) - if err := _OVMCanonicalTransactionChain.contract.UnpackLog(event, "SequencerBatchAppended", log); err != nil { - return nil, err - } - return event, nil -} - -// OVMCanonicalTransactionChainTransactionEnqueuedIterator is returned from FilterTransactionEnqueued and is used to iterate over the raw logs and unpacked data for TransactionEnqueued events raised by the OVMCanonicalTransactionChain contract. -type OVMCanonicalTransactionChainTransactionEnqueuedIterator struct { - Event *OVMCanonicalTransactionChainTransactionEnqueued // 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 *OVMCanonicalTransactionChainTransactionEnqueuedIterator) 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(OVMCanonicalTransactionChainTransactionEnqueued) - 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(OVMCanonicalTransactionChainTransactionEnqueued) - 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 *OVMCanonicalTransactionChainTransactionEnqueuedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *OVMCanonicalTransactionChainTransactionEnqueuedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// OVMCanonicalTransactionChainTransactionEnqueued represents a TransactionEnqueued event raised by the OVMCanonicalTransactionChain contract. -type OVMCanonicalTransactionChainTransactionEnqueued 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 _l1TxOrigin, address _target, uint256 _gasLimit, bytes _data, uint256 _queueIndex, uint256 _timestamp) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) FilterTransactionEnqueued(opts *bind.FilterOpts) (*OVMCanonicalTransactionChainTransactionEnqueuedIterator, error) { - - logs, sub, err := _OVMCanonicalTransactionChain.contract.FilterLogs(opts, "TransactionEnqueued") - if err != nil { - return nil, err - } - return &OVMCanonicalTransactionChainTransactionEnqueuedIterator{contract: _OVMCanonicalTransactionChain.contract, event: "TransactionEnqueued", logs: logs, sub: sub}, nil -} - -// WatchTransactionEnqueued is a free log subscription operation binding the contract event 0x4b388aecf9fa6cc92253704e5975a6129a4f735bdbd99567df4ed0094ee4ceb5. -// -// Solidity: event TransactionEnqueued(address _l1TxOrigin, address _target, uint256 _gasLimit, bytes _data, uint256 _queueIndex, uint256 _timestamp) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) WatchTransactionEnqueued(opts *bind.WatchOpts, sink chan<- *OVMCanonicalTransactionChainTransactionEnqueued) (event.Subscription, error) { - - logs, sub, err := _OVMCanonicalTransactionChain.contract.WatchLogs(opts, "TransactionEnqueued") - 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(OVMCanonicalTransactionChainTransactionEnqueued) - if err := _OVMCanonicalTransactionChain.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 _l1TxOrigin, address _target, uint256 _gasLimit, bytes _data, uint256 _queueIndex, uint256 _timestamp) -func (_OVMCanonicalTransactionChain *OVMCanonicalTransactionChainFilterer) ParseTransactionEnqueued(log types.Log) (*OVMCanonicalTransactionChainTransactionEnqueued, error) { - event := new(OVMCanonicalTransactionChainTransactionEnqueued) - if err := _OVMCanonicalTransactionChain.contract.UnpackLog(event, "TransactionEnqueued", log); err != nil { - return nil, err - } - return event, nil -} diff --git a/contracts/executionmanager/OVM_ExecutionManager.go b/contracts/executionmanager/OVM_ExecutionManager.go deleted file mode 100644 index 5f6800542908..000000000000 --- a/contracts/executionmanager/OVM_ExecutionManager.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package executionmanager - -import ( - "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 ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// OVMExecutionManagerABI is the input ABI used to generate the binding from. -const OVMExecutionManagerABI = "[{\"inputs\":[],\"name\":\"getMaxTransactionGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxTransactionGasLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" - -// OVMExecutionManagerBin is the compiled bytecode used for deploying new contracts. -var OVMExecutionManagerBin = "0x60806040523480156200001157600080fd5b5060405162003e0338038062003e03833981016040819052620000349162000188565b600080546001600160a01b0319166001600160a01b03851617905560408051808201909152601181527027ab26afa9b0b332ba3ca1b432b1b5b2b960791b60208201526200008290620000cb565b600180546001600160a01b0319166001600160a01b03929092169190911790558151600355602082015160045560408201516005556060909101516006555160075550620002ab565b6000805460405163bf40fac160e01b81526001600160a01b039091169063bf40fac190620000fe9085906004016200022e565b60206040518083038186803b1580156200011757600080fd5b505afa1580156200012c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000152919062000158565b92915050565b6000602082840312156200016a578081fd5b81516001600160a01b038116811462000181578182fd5b9392505050565b600080600083850360c08112156200019e578283fd5b84516001600160a01b0381168114620001b5578384fd5b93506080601f1982011215620001c9578283fd5b620001d5608062000284565b60208601518152604086015160208201526060860151604082015260808601516060820152809350506020609f198201121562000210578182fd5b506200021d602062000284565b60a094909401518452509093909250565b6000602080835283518082850152825b818110156200025c578581018301518582016040015282016200023e565b818111156200026e5783604083870101525b50601f01601f1916929092016040019392505050565b6040518181016001600160401b0381118282101715620002a357600080fd5b604052919050565b613b4880620002bb6000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c8063741a33eb116100de578063996d79a5116100975780639dc9dc93116100715780639dc9dc9314610335578063bdbf8c361461033d578063c1fb2ea214610345578063ffe739141461034d5761018e565b8063996d79a51461030757806399ccd98b1461030f5780639be3ad67146103225761018e565b8063741a33eb14610285578063746c32f1146102985780638435035b146102b85780638540661f146102cb57806385979f76146102ec57806390580256146102ff5761018e565b806322bd64c01161014b578063461a447811610125578063461a44781461024f5780634d780092146102625780635a98c36114610275578063735090641461027d5761018e565b806322bd64c01461021657806324749d5c146102295780632a2a7adb1461023c5761018e565b806303daa959146101935780630da449d1146101bc578063101185a4146101d157806314aa2ff7146101e65780631c4712a71461020657806320160f3a1461020e575b600080fd5b6101a66101a1366004612335565b610360565b6040516101b3919061273f565b60405180910390f35b6101cf6101ca366004612335565b6103a5565b005b6101d96103cc565b6040516101b39190612779565b6101f96101f43660046123c7565b6103d5565b6040516101b3919061268e565b6101a6610459565b6101a661045f565b6101cf610224366004612365565b610465565b6101a661023736600461225b565b6104c8565b6101cf61024a3660046123c7565b6104e3565b6101f961025d3660046123c7565b6104ee565b6101cf610270366004612293565b61056f565b6101a6610728565b6101f961072e565b6101cf610293366004612386565b61073d565b6102ab6102a63660046122e1565b610862565b6040516101b39190612766565b6101a66102c636600461225b565b610895565b6102de6102d93660046125b6565b6108a8565b6040516101b3929190612724565b6102de6102fa3660046125b6565b610920565b6101a661097a565b6101f9610980565b6101f961031d366004612402565b61098f565b6101cf6103303660046124e3565b610a0e565b6101f9610b62565b6101a6610b71565b6101a6610b77565b6102de61035b3660046125b6565b610b8e565b6000619c4060005a90506000610374610980565b90506103808186610bea565b93505060005a820390508083101561039d57601080548483030190555b505050919050565b6103ad610b77565b81116103b8576103c9565b6103c96103c3610980565b82610c81565b50565b60085460ff1690565b600f5460009060ff600160a01b909104161515600114156103fa576103fa6007610cf2565b8151606402619c400160005a90506000610412610980565b905060006104288261042384610d0b565b610d96565b90506104348187610e27565b9450505060005a820390508083101561039d5760108054848303019055505050919050565b60045490565b600b5490565b600f5460ff600160a01b90910416151560011415610487576104876007610cf2565b61ea6060005a90506000610499610980565b90506104a6818686610ef3565b5060005a82039050808310156104c157601080548483030190555b5050505050565b60006104db6104d683610f5f565b610f9a565b90505b919050565b6103c9600282610f9e565b6000805460405163bf40fac160e01b81526001600160a01b039091169063bf40fac19061051f908590600401612766565b60206040518083038186803b15801561053757600080fd5b505afa15801561054b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190612277565b33301461057b57610724565b61058482610fe1565b610592576105926006610cf2565b6001546040516352275acd60e11b81526001600160a01b039091169063a44eb59a906105c2908490600401612766565b60206040518083038186803b1580156105da57600080fd5b505afa1580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190612315565b610620576106206005610cf2565b6106298261106c565b6000610634826110d3565b90506001600160a01b03811661064e5761064e6008610cf2565b600060125460ff16600881111561066157fe5b14610675576012546106759060ff16610cf2565b6060610680826110e4565b6001546040516352275acd60e11b81529192506001600160a01b03169063a44eb59a906106b1908490600401612766565b60206040518083038186803b1580156106c957600080fd5b505afa1580156106dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107019190612315565b61070f5761070f6005610cf2565b610721848383805190602001206110fa565b50505b5050565b600a5490565b600e546001600160a01b031690565b600f5460ff600160a01b9091041615156001141561075f5761075f6007610cf2565b6000600185600861076e61097a565b6002028703038585604051600081526020016040526040516107939493929190612748565b6020604051602081039080840390855afa1580156107b5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166107f1576107f1604051806060016040528060388152602001613adb603891396104e3565b6107fa81610fe1565b6108045750610721565b61080d8161106c565b600060405161081b906121c1565b604051809103906000f080158015610837573d6000803e3d6000fd5b5090506060610845826110e4565b9050610859838383805190602001206110fa565b50505050505050565b60606000826001146108745782610877565b60025b905061088c61088586610f5f565b8583611137565b95945050505050565b60006104db6108a383610f5f565b611159565b600060606201388060005a90506108bd6121ce565b5060408051606081018252600f546001600160a01b039081168252881660208201526001918101829052906108f5828a8a8a8561115d565b95509550505060005a820390508083101561091557601080548483030190555b505050935093915050565b60006060620186a060005a90506109356121ce565b5060408051606081018252600f5460ff600160a01b8204161515928201929092526001600160a01b039182168152908716602082015260006108f5828a8a8a8561115d565b60075490565b600f546001600160a01b031690565b600f5460009060ff600160a01b909104161515600114156109b4576109b46007610cf2565b8251606402619c400160005a905060006109cc610980565b905060006109db8288886111a2565b90506109e78188610e27565b9450505060005a8203905080831015610a0557601080548483030190555b50505092915050565b600280546001600160a01b0319166001600160a01b03838116919091179182905560408051638da5cb5b60e01b815290519290911691638da5cb5b91600480820192602092909190829003018186803b158015610a6a57600080fd5b505afa158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa29190612277565b6001600160a01b0316336001600160a01b031614610adb5760405162461bcd60e51b8152600401610ad2906127fb565b60405180910390fd5b8151610ae6906111e8565b610af88260a00151836040015161122a565b610b0157610724565b610b0a8261129d565b60005a9050610b2d6003600001548460a001510384608001518560c00151610920565b505060005a82039050610b4481856040015161130f565b610b4c611354565b5050600280546001600160a01b03191690555050565b600d546001600160a01b031690565b60095490565b6000610b89610b84610980565b610d0b565b905090565b60006060619c4060005a9050610ba26121ce565b5060408051606081018252600e546001600160a01b039081168252600f549081166020830152600160a01b900460ff1615159181019190915260006108f5828a8a8a8561115d565b6000610bf683836113b7565b600254604051631aaf392f60e01b81526001600160a01b0390911690631aaf392f90610c2890869086906004016126c6565b60206040518083038186803b158015610c4057600080fd5b505afa158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c78919061234d565b90505b92915050565b610c8a826114f4565b6002546040516374855dc360e11b81526001600160a01b039091169063e90abb8690610cbc90859085906004016126c6565b600060405180830381600087803b158015610cd657600080fd5b505af1158015610cea573d6000803e3d6000fd5b505050505050565b6103c98160405180602001604052806000815250610f9e565b6000610d1682611601565b60025460405163d126199f60e01b81526001600160a01b039091169063d126199f90610d4690859060040161268e565b60206040518083038186803b158015610d5e57600080fd5b505afa158015610d72573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db919061234d565b60408051600280825260608281019093526000929190816020015b6060815260200190600190039081610db1579050509050610dd184611741565b81600081518110610dde57fe5b6020026020010181905250610df28361176b565b81600181518110610dff57fe5b60200260200101819052506060610e158261177e565b905061088c81805190602001206117a1565b6000610e47610e34610980565b610e3f610b84610980565b600101610c81565b610e4f6121ce565b5060408051606081018252600f5460ff600160a01b8204161515928201929092526001600160a01b03918216815290841660208201526000610ed1825a308888604051602401610ea0929190612700565b60408051601f198184030181529190526020810180516001600160e01b03166326bc004960e11b17905260006117ad565b506012805460ff19169055905080610eea57600061088c565b50929392505050565b610efd8383611969565b600254604051635c17d62960e01b81526001600160a01b0390911690635c17d62990610f31908690869086906004016126df565b600060405180830381600087803b158015610f4b57600080fd5b505af1158015610859573d6000803e3d6000fd5b6000610f6a82611601565b600254604051637c8ee70360e01b81526001600160a01b0390911690637c8ee7039061051f90859060040161268e565b3f90565b333b158015610fcb576012805484919060ff19166001836008811115610fc057fe5b021790555060016000f35b6060610fd78484611b0e565b9050805160208201fd5b6000610fec82611601565b6002546040516307a1294560e01b81526001600160a01b03909116906307a129459061101c90859060040161268e565b60206040518083038186803b15801561103457600080fd5b505afa158015611048573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104db9190612315565b61107581611601565b600254604051637e78a4d160e11b81526001600160a01b039091169063fcf149a2906110a590849060040161268e565b600060405180830381600087803b1580156110bf57600080fd5b505af11580156104c1573d6000803e3d6000fd5b60008151602083016000f092915050565b60606104db8260006110f585611159565b611137565b611103836114f4565b6002546040516368510af960e11b81526001600160a01b039091169063d0a215f290610f31908690869086906004016126a2565b60606040519050602082018101604052818152818360208301863c9392505050565b3b90565b6000606060006064866001600160a01b0316106111825761117d86610f5f565b611184565b855b905061119388888388886117ad565b92509250509550959350505050565b60008060ff60f81b858486805190602001206040516020016111c79493929190612639565b60405160208183030381529060405280519060200120905061088c816117a1565b6006546111f56000611bcd565b0181106103c957611207600082611bf8565b61121b60036112166001611bcd565b611bf8565b6103c960046112166002611bcd565b60045460009083111561123f57506000610c7b565b60035483101561125157506000610c7b565b6000808084600181111561126157fe5b1415611273575060019050600361127b565b506002905060045b6005548561128883611bcd565b61129185611bcd565b03011095945050505050565b80516009556020810151600a5560a0810151600c5560408101516008805460ff1916600183818111156112cc57fe5b02179055506060810151600d80546001600160a01b0319166001600160a01b03909216919091179055600554600b5560a081015161130990611c22565b60115550565b60008082600181111561131e57fe5b141561132c57506001611330565b5060025b60105460035461134f918391869061134784611bcd565b010103611bf8565b505050565b600d80546001600160a01b031990811690915560006009819055600a819055600b819055600c8190556008805460ff199081169091556010829055600e8054909316909255600f80546001600160a81b0319169055601155601280549091169055565b6175305a10156113cb576113cb6001610cf2565b600254604051630ad2267960e01b81526001600160a01b0390911690630ad22679906113fd90859085906004016126c6565b602060405180830381600087803b15801561141757600080fd5b505af115801561142b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144f9190612315565b61145d5761145d6004610cf2565b600254604051632bcdee1960e21b81526000916001600160a01b03169063af37b8649061149090869086906004016126c6565b602060405180830381600087803b1580156114aa57600080fd5b505af11580156114be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e29190612315565b90508061134f5761134f614e20611c35565b60025460405163011b1f7960e41b81526000916001600160a01b0316906311b1f7909061152590859060040161268e565b602060405180830381600087803b15801561153f57600080fd5b505af1158015611553573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115779190612315565b90508061072457600260009054906101000a90046001600160a01b03166001600160a01b03166333f943056040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115ce57600080fd5b505af11580156115e2573d6000803e3d6000fd5b5050505061072461753060646115fa6108a386610f5f565b0201611c35565b6175305a1015611615576116156001610cf2565b60025460405163c8e40fbf60e01b81526001600160a01b039091169063c8e40fbf9061164590849060040161268e565b60206040518083038186803b15801561165d57600080fd5b505afa158015611671573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116959190612315565b6116a3576116a36004610cf2565b600254604051633ecdecc760e21b81526000916001600160a01b03169063fb37b31c906116d490859060040161268e565b602060405180830381600087803b1580156116ee57600080fd5b505af1158015611702573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117269190612315565b9050806107245761072461753060646115fa6108a386610f5f565b60408051600560a21b831860148201526034810190915260609061176481611c55565b9392505050565b60606104db61177983611c9e565b611c55565b60608061178a83611da7565b905061176461179b825160c0611ea8565b82611ff8565b6001600160a01b031690565b600060606117b96121ce565b5060408051606081018252600e546001600160a01b039081168252600f549081166020830152600160a01b900460ff161515918101919091526117fc8189612075565b601154600061180a89611c22565b90508060116000018190555060006060896001600160a01b03168b8a6040516118339190612672565b60006040518083038160008787f1925050503d8060008114611871576040519150601f19603f3d011682016040523d82523d6000602084013e611876565b606091505b50915091506118858c86612075565b60115482611951576000806000606061189d86612129565b9296509094509250905060048460088111156118b557fe5b14156118c4576118c484610cf2565b60078460088111156118d257fe5b1480156118dd57508c155b156118eb576118eb84610cf2565b60028460088111156118f957fe5b14806119105750600584600881111561190e57fe5b145b1561191b5760108290555b600284600881111561192957fe5b14156119375780955061194a565b6040518060200160405280600081525095505b5090925050505b90920390920360115590999098509650505050505050565b6175305a101561197d5761197d6001610cf2565b600254604051630ad2267960e01b81526001600160a01b0390911690630ad22679906119af90859085906004016126c6565b602060405180830381600087803b1580156119c957600080fd5b505af11580156119dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a019190612315565b611a0f57611a0f6004610cf2565b60025460405163af3dc01160e01b81526000916001600160a01b03169063af3dc01190611a4290869086906004016126c6565b602060405180830381600087803b158015611a5c57600080fd5b505af1158015611a70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a949190612315565b90508061134f57600260009054906101000a90046001600160a01b03166001600160a01b031663c3fd9b256040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611aeb57600080fd5b505af1158015611aff573d6000803e3d6000fd5b5050505061134f614e20611c35565b60606001836008811115611b1e57fe5b1480611b3557506008836008811115611b3357fe5b145b15611b4f5750604080516020810190915260008152610c7b565b6004836008811115611b5d57fe5b1415611b9b57604080516020808201835260008083529251611b85938793909283920161278d565b6040516020818303038152906040529050610c7b565b601154601054604051611bb6928692909186906020016127cc565b604051602081830303815290604052905092915050565b60006104db7306a506a506a506a506a506a506a506a506a506a5836004811115611bf357fe5b610bea565b6107247306a506a506a506a506a506a506a506a506a506a5836004811115611c1c57fe5b83610ef3565b60005a8210611c31575a6104db565b5090565b601154811115611c4957611c496003610cf2565b60118054919091039055565b60608082516001148015611c7d5750608083600081518110611c7357fe5b016020015160f81c105b15611c895750816104db565b610c78611c9884516080611ea8565b84611ff8565b60408051602080825281830190925260609182919060208201818036833701905050905082602082015260005b6020811015611d0157818181518110611ce057fe5b01602001516001600160f81b03191615611cf957611d01565b600101611ccb565b60608160200367ffffffffffffffff81118015611d1d57600080fd5b506040519080825280601f01601f191660200182016040528015611d48576020820181803683370190505b50905060005b8151811015611d9e578351600184019385918110611d6857fe5b602001015160f81c60f81b828281518110611d7f57fe5b60200101906001600160f81b031916908160001a905350600101611d4e565b50949350505050565b6060815160001415611dc857506040805160008152602081019091526104de565b6000805b8351811015611dfb57838181518110611de157fe5b602002602001015151820191508080600101915050611dcc565b60608267ffffffffffffffff81118015611e1457600080fd5b506040519080825280601f01601f191660200182016040528015611e3f576020820181803683370190505b50600092509050602081015b8551831015611d9e576060868481518110611e6257fe5b602002602001015190506000602082019050611e808382845161217d565b878581518110611e8c57fe5b6020026020010151518301925050508280600101935050611e4b565b6060806038841015611f02576040805160018082528183019092529060208201818036833701905050905082840160f81b81600081518110611ee657fe5b60200101906001600160f81b031916908160001a905350610c78565b600060015b808681611f1057fe5b0415611f255760019091019061010002611f07565b8160010167ffffffffffffffff81118015611f3f57600080fd5b506040519080825280601f01601f191660200182016040528015611f6a576020820181803683370190505b50925084820160370160f81b83600081518110611f8357fe5b60200101906001600160f81b031916908160001a905350600190505b818111611fef576101008183036101000a8781611fb857fe5b0481611fc057fe5b0660f81b838281518110611fd057fe5b60200101906001600160f81b031916908160001a905350600101611f9f565b50509392505050565b6060806040519050835180825260208201818101602087015b81831015612029578051835260209283019201612011565b50855184518101855292509050808201602086015b8183101561205657805183526020928301920161203e565b508651929092011591909101601f01601f191660405250905092915050565b805182516001600160a01b039081169116146120ad578051600e80546001600160a01b0319166001600160a01b039092169190911790555b80602001516001600160a01b031682602001516001600160a01b0316146120f3576020810151600f80546001600160a01b0319166001600160a01b039092169190911790555b8060400151151582604001511515146107245760400151600f8054911515600160a01b0260ff60a01b1990921691909117905550565b60008060006060845160001415612159575050604080516020810190915260008082526001935091508190612176565b8480602001905181019061216d9190612445565b93509350935093505b9193509193565b8282825b602081106121a0578151835260209283019290910190601f1901612181565b905182516020929092036101000a6000190180199091169116179052505050565b6111f6806128e583390190565b604080516060810182526000808252602082018190529181019190915290565b8035610c7b816128cf565b600082601f830112612209578081fd5b813561221c6122178261287f565b612858565b915080825283602082850101111561223357600080fd5b8060208401602084013760009082016020015292915050565b803560028110610c7b57600080fd5b60006020828403121561226c578081fd5b8135610c78816128cf565b600060208284031215612288578081fd5b8151610c78816128cf565b600080604083850312156122a5578081fd5b82356122b0816128cf565b9150602083013567ffffffffffffffff8111156122cb578182fd5b6122d7858286016121f9565b9150509250929050565b6000806000606084860312156122f5578081fd5b8335612300816128cf565b95602085013595506040909401359392505050565b600060208284031215612326578081fd5b81518015158114610c78578182fd5b600060208284031215612346578081fd5b5035919050565b60006020828403121561235e578081fd5b5051919050565b60008060408385031215612377578182fd5b50508035926020909101359150565b6000806000806080858703121561239b578081fd5b84359350602085013560ff811681146123b2578182fd5b93969395505050506040820135916060013590565b6000602082840312156123d8578081fd5b813567ffffffffffffffff8111156123ee578182fd5b6123fa848285016121f9565b949350505050565b60008060408385031215612414578182fd5b823567ffffffffffffffff81111561242a578283fd5b612436858286016121f9565b95602094909401359450505050565b6000806000806080858703121561245a578182fd5b845160098110612468578283fd5b809450506020850151925060408501519150606085015167ffffffffffffffff811115612493578182fd5b8501601f810187136124a3578182fd5b80516124b16122178261287f565b8181528860208385010111156124c5578384fd5b6124d68260208301602086016128a3565b9598949750929550505050565b600080604083850312156124f5578182fd5b823567ffffffffffffffff8082111561250c578384fd5b9084019060e0828703121561251f578384fd5b61252960e0612858565b8235815260208301356020820152612544876040850161224c565b604082015261255687606085016121ee565b606082015261256887608085016121ee565b608082015260a083013560a082015260c083013582811115612588578586fd5b612594888286016121f9565b60c0830152508094505050506125ad84602085016121ee565b90509250929050565b6000806000606084860312156125ca578081fd5b8335925060208401356125dc816128cf565b9150604084013567ffffffffffffffff8111156125f7578182fd5b612603868287016121f9565b9150509250925092565b600081518084526126258160208601602086016128a3565b601f01601f19169290920160200192915050565b6001600160f81b031994909416845260609290921b6bffffffffffffffffffffffff191660018401526015830152603582015260550190565b600082516126848184602087016128a3565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b03831681526040602082018190526000906123fa9083018461260d565b60008315158252604060208301526123fa604083018461260d565b90815260200190565b93845260ff9290921660208401526040830152606082015260800190565b600060208252610c78602083018461260d565b602081016002831061278757fe5b91905290565b60006009861061279957fe5b85825260ff8516602083015260ff84166040830152608060608301526127c2608083018461260d565b9695505050505050565b6000600986106127d857fe5b858252846020830152836040830152608060608301526127c2608083018461260d565b6020808252603c908201527f4f6e6c7920746865206f776e6572206f6620746865206f766d53746174654d6160408201527f6e616765722063616e2063616c6c20746869732066756e6374696f6e00000000606082015260800190565b60405181810167ffffffffffffffff8111828210171561287757600080fd5b604052919050565b600067ffffffffffffffff821115612895578081fd5b50601f01601f191660200190565b60005b838110156128be5781810151838201526020016128a6565b838111156107215750506000910152565b6001600160a01b03811681146103c957600080fdfe608060405234801561001057600080fd5b506111d6806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063d1be05c214610030575b600080fd5b61004361003e366004610c0c565b61005a565b604051610051929190610d4d565b60405180910390f35b600060603361006881610190565b6001600160a01b03166100958960008a600181111561008357fe5b14898989610090886101e9565b610239565b6001600160a01b0316146100c45760405162461bcd60e51b81526004016100bb90610e08565b60405180910390fd5b6100cc610ae8565b6100d5896102cb565b90506100e082610373565b6001018160200151146101055760405162461bcd60e51b81526004016100bb90610ff9565b80516001600160a01b031661015957600061012983836040015184606001516103ad565b905060018160405160200161013e9190610d39565b60405160208183030381529060405294509450505050610186565b610167828260200151610417565b61017f82826040015183600001518460600151610460565b9350935050505b9550959350505050565b6040805160048152602481019091526020810180516001600160e01b031663996d79a560e01b1790526000906060906101ca9084906104d1565b9050808060200190518101906101e09190610b53565b9150505b919050565b6040805160048152602481019091526020810180516001600160e01b031663482c012b60e11b1790526000906060906102239084906104d1565b9050808060200190518101906101e09190610cb7565b600080600087156102575761024d896104e7565b915086905061026e565b61026089610557565b915050600719600284028703015b600182828888604051600081526020016040526040516102919493929190610d70565b6020604051602081039080840390855afa1580156102b3573d6000803e3d6000fd5b5050604051601f1901519a9950505050505050505050565b6102d3610ae8565b60606102de83610562565b90506040518060800160405280610308836003815181106102fb57fe5b6020026020010151610575565b6001600160a01b031681526020016103338360008151811061032657fe5b60200260200101516105b0565b81526020016103488360028151811061032657fe5b815260200161036a8360058151811061035d57fe5b60200260200101516105bb565b90529392505050565b6040805160048152602481019091526020810180516001600160e01b03166360fd975160e11b1790526000906060906102239084906104d1565b600060606103f68585856040516024016103c79190610d8e565b60408051601f198184030181529190526020810180516001600160e01b03166314aa2ff760e01b179052610615565b90508080602001905181019061040c9190610b53565b9150505b9392505050565b61045b828260405160240161042c91906110f2565b60408051601f198184030181529190526020810180516001600160e01b0316630da449d160e01b1790526104d1565b505050565b60006060806104ad8787878760405160240161047e939291906110fb565b60408051601f198184030181529190526020810180516001600160e01b03166342cbcfbb60e11b1790526104d1565b9050808060200190518101906104c39190610b7a565b925092505094509492505050565b60606104de835a84610615565b90505b92915050565b604080518082018252601c81527f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152835184820120925160009391610538918491849101610d17565b6040516020818303038152906040528051906020012092505050919050565b805160209091012090565b60606104e1610570836106a3565b6106c8565b80516000906001141561058a575060006101e4565b81516015146105ab5760405162461bcd60e51b81526004016100bb90610f8b565b6104e1825b60006104e1826107ea565b606060008060006105cb8561087a565b9194509250905060008160018111156105e057fe5b146105fd5760405162461bcd60e51b81526004016100bb90611084565b61060c85602001518484610a37565b95945050505050565b606060006060856001600160a01b031685856040516106349190610cfb565b60006040518083038160008787f1925050503d8060008114610672576040519150601f19603f3d011682016040523d82523d6000602084013e610677565b606091505b5090925090508161068a57805160208201fd5b80516001141561069a5760016000f35b91506104109050565b6106ab610b19565b506040805180820190915281518152602082810190820152919050565b60606000806106d68461087a565b919350909150600190508160018111156106ec57fe5b146107095760405162461bcd60e51b81526004016100bb90610f1d565b6040805160208082526104208201909252606091816020015b61072a610b19565b8152602001906001900390816107225790505090506000835b86518110156107df576020821061076c5760405162461bcd60e51b81526004016100bb90610e9c565b6000806107986040518060400160405280858c60000151038152602001858c602001510181525061087a565b509150915060405180604001604052808383018152602001848b60200151018152508585815181106107c657fe5b6020908102919091010152600193909301920101610743565b508152949350505050565b60006021826000015111156108115760405162461bcd60e51b81526004016100bb90610ee6565b600080600061081f8561087a565b91945092509050600081600181111561083457fe5b146108515760405162461bcd60e51b81526004016100bb90610ee6565b6020808601518401805190918410156108705760208490036101000a90045b9695505050505050565b6000806000808460000151116108a25760405162461bcd60e51b81526004016100bb90610fc2565b6020840151805160001a607f81116108c7576000600160009450945094505050610a30565b60b78111610907578551607f1982019081106108f55760405162461bcd60e51b81526004016100bb90610f54565b60019550935060009250610a30915050565b60bf811161098157855160b61982019081106109355760405162461bcd60e51b81526004016100bb90610e65565b6000816020036101000a600185015104905080820188600001511161096c5760405162461bcd60e51b81526004016100bb9061104d565b60019091019550935060009250610a30915050565b60f781116109c057855160bf1982019081106109af5760405162461bcd60e51b81526004016100bb906110bb565b600195509350849250610a30915050565b855160f61982019081106109e65760405162461bcd60e51b81526004016100bb90610da1565b6000816020036101000a6001850151049050808201886000015111610a1d5760405162461bcd60e51b81526004016100bb90610dd8565b6001918201965094509250610a30915050565b9193909250565b6060808267ffffffffffffffff81118015610a5157600080fd5b506040519080825280601f01601f191660200182016040528015610a7c576020820181803683370190505b509050805160001415610a90579050610410565b8484016020820160005b60208604811015610abb578251825260209283019290910190600101610a9a565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b604051806080016040528060006001600160a01b031681526020016000815260200160008152602001606081525090565b604051806040016040528060008152602001600081525090565b8035600281106104e157600080fd5b803560ff811681146104e157600080fd5b600060208284031215610b64578081fd5b81516001600160a01b0381168114610410578182fd5b60008060408385031215610b8c578081fd5b82518015158114610b9b578182fd5b602084015190925067ffffffffffffffff811115610bb7578182fd5b8301601f81018513610bc7578182fd5b8051610bda610bd58261114c565b611125565b818152866020838501011115610bee578384fd5b610bff826020830160208601611170565b8093505050509250929050565b600080600080600060a08688031215610c23578081fd5b853567ffffffffffffffff811115610c39578182fd5b8601601f81018813610c49578182fd5b8035610c57610bd58261114c565b818152896020838501011115610c6b578384fd5b816020840160208301378360208383010152809750505050610c908760208801610b33565b9350610c9f8760408801610b42565b94979396509394606081013594506080013592915050565b600060208284031215610cc8578081fd5b5051919050565b60008151808452610ce7816020860160208601611170565b601f01601f19169290920160200192915050565b60008251610d0d818460208701611170565b9190910192915050565b60008351610d29818460208801611170565b9190910191825250602001919050565b6001600160a01b0391909116815260200190565b6000831515825260406020830152610d686040830184610ccf565b949350505050565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526104de6020830184610ccf565b6020808252601d908201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e000000604082015260600190565b60208082526016908201527524b73b30b634b210292628103637b733903634b9ba1760511b604082015260600190565b6020808252603c908201527f5369676e61747572652070726f766964656420666f7220454f41207472616e7360408201527f616374696f6e20657865637574696f6e20697320696e76616c69642e00000000606082015260800190565b6020808252601f908201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e00604082015260600190565b6020808252602a908201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960408201526939ba103632b733ba341760b11b606082015260800190565b6020808252601a908201527f496e76616c696420524c5020627974657333322076616c75652e000000000000604082015260600190565b60208082526017908201527f496e76616c696420524c50206c6973742076616c75652e000000000000000000604082015260600190565b60208082526019908201527f496e76616c696420524c502073686f727420737472696e672e00000000000000604082015260600190565b6020808252601a908201527f496e76616c696420524c5020616464726573732076616c75652e000000000000604082015260600190565b60208082526018908201527f524c50206974656d2063616e6e6f74206265206e756c6c2e0000000000000000604082015260600190565b60208082526034908201527f5472616e73616374696f6e206e6f6e636520646f6573206e6f74206d61746368604082015273103a34329032bc3832b1ba32b2103737b731b29760611b606082015260800190565b60208082526018908201527f496e76616c696420524c50206c6f6e6720737472696e672e0000000000000000604082015260600190565b60208082526018908201527f496e76616c696420524c502062797465732076616c75652e0000000000000000604082015260600190565b60208082526017908201527f496e76616c696420524c502073686f7274206c6973742e000000000000000000604082015260600190565b90815260200190565b8381526001600160a01b038316602082015260606040820181905260009061060c90830184610ccf565b60405181810167ffffffffffffffff8111828210171561114457600080fd5b604052919050565b600067ffffffffffffffff821115611162578081fd5b50601f01601f191660200190565b60005b8381101561118b578181015183820152602001611173565b8381111561119a576000848401525b5050505056fea2646970667358221220b936e5469c6b8ecc6a0396998134d82c2a760483f882d715abc2f42aee84b7d264736f6c634300070000335369676e61747572652070726f766964656420666f7220454f4120636f6e7472616374206372656174696f6e20697320696e76616c69642ea2646970667358221220f40c4ad16e95d010b85648d50cc32bf0ea39d93e9eac570f7c4735008c79017664736f6c63430007000033" - -// DeployOVMExecutionManager deploys a new Ethereum contract, binding an instance of OVMExecutionManager to it. -func DeployOVMExecutionManager(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *OVMExecutionManager, error) { - parsed, err := abi.JSON(strings.NewReader(OVMExecutionManagerABI)) - if err != nil { - return common.Address{}, nil, nil, err - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(OVMExecutionManagerBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &OVMExecutionManager{OVMExecutionManagerCaller: OVMExecutionManagerCaller{contract: contract}, OVMExecutionManagerTransactor: OVMExecutionManagerTransactor{contract: contract}, OVMExecutionManagerFilterer: OVMExecutionManagerFilterer{contract: contract}}, nil -} - -// OVMExecutionManager is an auto generated Go binding around an Ethereum contract. -type OVMExecutionManager struct { - OVMExecutionManagerCaller // Read-only binding to the contract - OVMExecutionManagerTransactor // Write-only binding to the contract - OVMExecutionManagerFilterer // Log filterer for contract events -} - -// OVMExecutionManagerCaller is an auto generated read-only Go binding around an Ethereum contract. -type OVMExecutionManagerCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// OVMExecutionManagerTransactor is an auto generated write-only Go binding around an Ethereum contract. -type OVMExecutionManagerTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// OVMExecutionManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type OVMExecutionManagerFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// OVMExecutionManagerSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type OVMExecutionManagerSession struct { - Contract *OVMExecutionManager // 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 -} - -// OVMExecutionManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type OVMExecutionManagerCallerSession struct { - Contract *OVMExecutionManagerCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// OVMExecutionManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type OVMExecutionManagerTransactorSession struct { - Contract *OVMExecutionManagerTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// OVMExecutionManagerRaw is an auto generated low-level Go binding around an Ethereum contract. -type OVMExecutionManagerRaw struct { - Contract *OVMExecutionManager // Generic contract binding to access the raw methods on -} - -// OVMExecutionManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type OVMExecutionManagerCallerRaw struct { - Contract *OVMExecutionManagerCaller // Generic read-only contract binding to access the raw methods on -} - -// OVMExecutionManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type OVMExecutionManagerTransactorRaw struct { - Contract *OVMExecutionManagerTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewOVMExecutionManager creates a new instance of OVMExecutionManager, bound to a specific deployed contract. -func NewOVMExecutionManager(address common.Address, backend bind.ContractBackend) (*OVMExecutionManager, error) { - contract, err := bindOVMExecutionManager(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &OVMExecutionManager{OVMExecutionManagerCaller: OVMExecutionManagerCaller{contract: contract}, OVMExecutionManagerTransactor: OVMExecutionManagerTransactor{contract: contract}, OVMExecutionManagerFilterer: OVMExecutionManagerFilterer{contract: contract}}, nil -} - -// NewOVMExecutionManagerCaller creates a new read-only instance of OVMExecutionManager, bound to a specific deployed contract. -func NewOVMExecutionManagerCaller(address common.Address, caller bind.ContractCaller) (*OVMExecutionManagerCaller, error) { - contract, err := bindOVMExecutionManager(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &OVMExecutionManagerCaller{contract: contract}, nil -} - -// NewOVMExecutionManagerTransactor creates a new write-only instance of OVMExecutionManager, bound to a specific deployed contract. -func NewOVMExecutionManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*OVMExecutionManagerTransactor, error) { - contract, err := bindOVMExecutionManager(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &OVMExecutionManagerTransactor{contract: contract}, nil -} - -// NewOVMExecutionManagerFilterer creates a new log filterer instance of OVMExecutionManager, bound to a specific deployed contract. -func NewOVMExecutionManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*OVMExecutionManagerFilterer, error) { - contract, err := bindOVMExecutionManager(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &OVMExecutionManagerFilterer{contract: contract}, nil -} - -// bindOVMExecutionManager binds a generic wrapper to an already deployed contract. -func bindOVMExecutionManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(OVMExecutionManagerABI)) - 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 (_OVMExecutionManager *OVMExecutionManagerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _OVMExecutionManager.Contract.OVMExecutionManagerCaller.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 (_OVMExecutionManager *OVMExecutionManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _OVMExecutionManager.Contract.OVMExecutionManagerTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_OVMExecutionManager *OVMExecutionManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _OVMExecutionManager.Contract.OVMExecutionManagerTransactor.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 (_OVMExecutionManager *OVMExecutionManagerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _OVMExecutionManager.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 (_OVMExecutionManager *OVMExecutionManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _OVMExecutionManager.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_OVMExecutionManager *OVMExecutionManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _OVMExecutionManager.Contract.contract.Transact(opts, method, params...) -} - -// GetMaxTransactionGasLimit is a free data retrieval call binding the contract method 0x1c4712a7. -// -// Solidity: function getMaxTransactionGasLimit() constant returns(uint256 _maxTransactionGasLimit) -func (_OVMExecutionManager *OVMExecutionManagerCaller) GetMaxTransactionGasLimit(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _OVMExecutionManager.contract.Call(opts, out, "getMaxTransactionGasLimit") - return *ret0, err -} - -// GetMaxTransactionGasLimit is a free data retrieval call binding the contract method 0x1c4712a7. -// -// Solidity: function getMaxTransactionGasLimit() constant returns(uint256 _maxTransactionGasLimit) -func (_OVMExecutionManager *OVMExecutionManagerSession) GetMaxTransactionGasLimit() (*big.Int, error) { - return _OVMExecutionManager.Contract.GetMaxTransactionGasLimit(&_OVMExecutionManager.CallOpts) -} - -// GetMaxTransactionGasLimit is a free data retrieval call binding the contract method 0x1c4712a7. -// -// Solidity: function getMaxTransactionGasLimit() constant returns(uint256 _maxTransactionGasLimit) -func (_OVMExecutionManager *OVMExecutionManagerCallerSession) GetMaxTransactionGasLimit() (*big.Int, error) { - return _OVMExecutionManager.Contract.GetMaxTransactionGasLimit(&_OVMExecutionManager.CallOpts) -} diff --git a/core/bench_test.go b/core/bench_test.go index c4ed7fc1210d..d7a5e11c2f15 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -119,7 +119,14 @@ func genTxRing(naccounts int) func(int, *BlockGen) { break } to := (from + 1) % naccounts - tx := types.NewTransaction(gen.TxNonce(ringAddrs[from]), ringAddrs[to], benchRootFunds, params.TxGas, nil, nil) + tx := types.NewTransaction( + gen.TxNonce(ringAddrs[from]), + ringAddrs[to], + benchRootFunds, + params.TxGas, + nil, + nil, + ) tx, _ = types.SignTx(tx, types.HomesteadSigner{}, ringKeys[from]) gen.AddTx(tx) from = to diff --git a/core/blockchain.go b/core/blockchain.go index bc7b9f9674b3..9e769878118c 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -91,7 +91,7 @@ const ( // // - Version 4 // The following incompatible database changes were added: - // * the `SubmissionNumber`, `TxHash`, `TxIndex`, `BlockHash` and `Index` fields of log are deleted + // * the `BlockNumber`, `TxHash`, `TxIndex`, `BlockHash` and `Index` fields of log are deleted // * the `Bloom` field of receipt is deleted // * the `BlockIndex` and `TxIndex` fields of txlookup are deleted // - Version 5 diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go index db51c49763ba..d83d662886fc 100644 --- a/core/chain_makers_test.go +++ b/core/chain_makers_test.go @@ -18,73 +18,83 @@ package core import ( "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) func ExampleGenerateChain() { fmt.Println("OVM breaks this... SKIPPING: Example Generate Chain fails because of the genesis.") - // var ( - // key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") - // key2, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a") - // key3, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee") - // addr1 = crypto.PubkeyToAddress(key1.PublicKey) - // addr2 = crypto.PubkeyToAddress(key2.PublicKey) - // addr3 = crypto.PubkeyToAddress(key3.PublicKey) - // db = rawdb.NewMemoryDatabase() - // ) + return + + var ( + key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") + key2, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a") + key3, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee") + addr1 = crypto.PubkeyToAddress(key1.PublicKey) + addr2 = crypto.PubkeyToAddress(key2.PublicKey) + addr3 = crypto.PubkeyToAddress(key3.PublicKey) + db = rawdb.NewMemoryDatabase() + ) - // // Ensure that key1 has some funds in the genesis block. - // gspec := &Genesis{ - // Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int)}, - // Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(1000000)}}, - // } - // genesis := gspec.MustCommit(db) + // Ensure that key1 has some funds in the genesis block. + gspec := &Genesis{ + Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int)}, + Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(1000000)}}, + } + genesis := gspec.MustCommit(db) - // // This call generates a chain of 5 blocks. The function runs for - // // each block and adds different features to gen based on the - // // block index. - // signer := types.HomesteadSigner{} - // chain, _ := GenerateChain(gspec.Config, genesis, ethash.NewFaker(), db, 5, func(i int, gen *BlockGen) { - // switch i { - // case 0: - // // In block 1, addr1 sends addr2 some ether. - // tx, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr1), addr2, big.NewInt(10000), params.TxGas, nil, nil, nil, nil), signer, key1) - // gen.AddTx(tx) - // case 1: - // // In block 2, addr1 sends some more ether to addr2. - // // addr2 passes it on to addr3. - // tx1, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr1), addr2, big.NewInt(1000), params.TxGas, nil, nil, nil, nil), signer, key1) - // tx2, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr2), addr3, big.NewInt(1000), params.TxGas, nil, nil, nil, nil), signer, key2) - // gen.AddTx(tx1) - // gen.AddTx(tx2) - // case 2: - // // Block 3 is empty but was mined by addr3. - // gen.SetCoinbase(addr3) - // gen.SetExtra([]byte("yeehaw")) - // case 3: - // // Block 4 includes blocks 2 and 3 as uncle headers (with modified extra data). - // b2 := gen.PrevBlock(1).Header() - // b2.Extra = []byte("foo") - // gen.AddUncle(b2) - // b3 := gen.PrevBlock(2).Header() - // b3.Extra = []byte("foo") - // gen.AddUncle(b3) - // } - // }) + // This call generates a chain of 5 blocks. The function runs for + // each block and adds different features to gen based on the + // block index. + signer := types.HomesteadSigner{} + chain, _ := GenerateChain(gspec.Config, genesis, ethash.NewFaker(), db, 5, func(i int, gen *BlockGen) { + switch i { + case 0: + // In block 1, addr1 sends addr2 some ether. + tx, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr1), addr2, big.NewInt(10000), params.TxGas, nil, nil), signer, key1) + gen.AddTx(tx) + case 1: + // In block 2, addr1 sends some more ether to addr2. + // addr2 passes it on to addr3. + tx1, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr1), addr2, big.NewInt(1000), params.TxGas, nil, nil), signer, key1) + tx2, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr2), addr3, big.NewInt(1000), params.TxGas, nil, nil), signer, key2) + gen.AddTx(tx1) + gen.AddTx(tx2) + case 2: + // Block 3 is empty but was mined by addr3. + gen.SetCoinbase(addr3) + gen.SetExtra([]byte("yeehaw")) + case 3: + // Block 4 includes blocks 2 and 3 as uncle headers (with modified extra data). + b2 := gen.PrevBlock(1).Header() + b2.Extra = []byte("foo") + gen.AddUncle(b2) + b3 := gen.PrevBlock(2).Header() + b3.Extra = []byte("foo") + gen.AddUncle(b3) + } + }) - // // Import the chain. This runs all block validation rules. - // blockchain, _ := NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{}, nil) - // defer blockchain.Stop() + // Import the chain. This runs all block validation rules. + blockchain, _ := NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{}, nil) + defer blockchain.Stop() - // if i, err := blockchain.InsertChain(chain); err != nil { - // fmt.Printf("insert error (block %d): %v\n", chain[i].NumberU64(), err) - // return - // } + if i, err := blockchain.InsertChain(chain); err != nil { + fmt.Printf("insert error (block %d): %v\n", chain[i].NumberU64(), err) + return + } - // state, _ := blockchain.State() - // fmt.Printf("last block: #%d\n", blockchain.CurrentBlock().Number()) - // fmt.Println("balance of addr1:", state.GetBalance(addr1)) - // fmt.Println("balance of addr2:", state.GetBalance(addr2)) - // fmt.Println("balance of addr3:", state.GetBalance(addr3)) + state, _ := blockchain.State() + fmt.Printf("last block: #%d\n", blockchain.CurrentBlock().Number()) + fmt.Println("balance of addr1:", state.GetBalance(addr1)) + fmt.Println("balance of addr2:", state.GetBalance(addr2)) + fmt.Println("balance of addr3:", state.GetBalance(addr3)) // // Output: // // last block: #5 // // balance of addr1: 989000 diff --git a/core/dao_test.go b/core/dao_test.go index 50c13a6bf0ee..4e8dba9e8488 100644 --- a/core/dao_test.go +++ b/core/dao_test.go @@ -122,6 +122,7 @@ func TestDAOForkRangeExtradata(t *testing.T) { gspec.MustCommit(db) bc, _ := NewBlockChain(db, nil, &conConf, ethash.NewFaker(), vm.Config{}, nil) defer bc.Stop() + blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64())) for j := 0; j < len(blocks)/2; j++ { blocks[j], blocks[len(blocks)-1-j] = blocks[len(blocks)-1-j], blocks[j] diff --git a/core/genesis_test.go b/core/genesis_test.go index fa2ffa9a854d..231fb55a597c 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -47,7 +47,7 @@ func TestSetupGenesis(t *testing.T) { t.Skip("OVM Genesis breaks this test because it adds the OVM contracts to the state.") var ( - customghash = common.HexToHash("0xc4651b85bcce4003ab6ff39a969fc1589673294d4ff4ea8f052c6669aa8571a4") + customghash = common.HexToHash("0x89c99d90b79719238d2645c7642f2c9295246e80775b38cfd162b696817fbd50") customg = Genesis{ Config: ¶ms.ChainConfig{HomesteadBlock: big.NewInt(3)}, Alloc: GenesisAlloc{ diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 4bbf72e3142b..6ca48ac788a3 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -94,7 +94,6 @@ func ReadTransaction(db ethdb.Reader, hash common.Hash) (*types.Transaction, com return tx, blockHash, *blockNumber, uint64(txIndex) } } - log.Error("Transaction not found", "number", blockNumber, "hash", blockHash, "txhash", hash) return nil, common.Hash{}, 0, 0 } diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index 08c272afd1e5..e4a22b376869 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -44,10 +44,6 @@ func getChunk(size int, b int) []byte { // TestFreezerBasics test initializing a freezertable from scratch, writing to the table, // and reading it back. func TestFreezerBasics(t *testing.T) { - - // TODO: SKIPPING - t.Skip("This test fails on the last pre-fork commit. It may be OS X related") - t.Parallel() // set cutoff at 50 bytes f, err := newCustomTable(os.TempDir(), @@ -134,10 +130,6 @@ func TestFreezerBasicsClosing(t *testing.T) { // TestFreezerRepairDanglingHead tests that we can recover if index entries are removed func TestFreezerRepairDanglingHead(t *testing.T) { - - // TODO: SKIPPING - t.Skip("This test fails on the last pre-fork commit. It may be OS X related") - t.Parallel() rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("dangling_headtest-%d", rand.Uint64()) @@ -259,10 +251,6 @@ func TestFreezerRepairDanglingHeadLarge(t *testing.T) { // TestSnappyDetection tests that we fail to open a snappy database and vice versa func TestSnappyDetection(t *testing.T) { - - // TODO: SKIPPING - t.Skip("This test fails on the last pre-fork commit. It may be OS X related") - t.Parallel() rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("snappytest-%d", rand.Uint64()) diff --git a/core/state/statedb.go b/core/state/statedb.go index ff796cc30a46..e5be7ab75358 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -74,9 +74,11 @@ type DiffDB interface { // * Contracts // * Accounts type StateDB struct { - db Database - trie Trie + db Database + trie Trie + diffdb DiffDB + // This map holds 'live' objects, which will get modified while processing a state transition. stateObjects map[common.Address]*stateObject stateObjectsPending map[common.Address]struct{} // State objects finalized but not yet written to the trie diff --git a/core/state_processor.go b/core/state_processor.go index d96ebdc5b85b..da5c50d40a34 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -60,7 +60,6 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg allLogs []*types.Log gp = new(GasPool).AddGas(block.GasLimit()) ) - // Iterate over and process the individual transactions for i, tx := range block.Transactions() { statedb.Prepare(tx.Hash(), block.Hash(), i) diff --git a/core/state_transition.go b/core/state_transition.go index 88c7f6676b5b..d0106680f52c 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -235,6 +235,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo } var ( + evm = st.evm // vm errors do not effect consensus and are therefore // not assigned to err, except for insufficient balance // error. @@ -256,7 +257,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo } if contractCreation { - ret, _, st.gas, vmerr = st.evm.Create(sender, st.data, st.gas, st.value) + ret, _, st.gas, vmerr = evm.Create(sender, st.data, st.gas, st.value) } else { // Increment the nonce for the next transaction if !vm.UsingOVM { @@ -264,7 +265,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo st.state.SetNonce(msg.From(), st.state.GetNonce(msg.From())+1) } - ret, st.gas, vmerr = st.evm.Call(sender, st.to(), st.data, st.gas, st.value) + ret, st.gas, vmerr = evm.Call(sender, st.to(), st.data, st.gas, st.value) } if vmerr != nil { @@ -276,7 +277,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo if !vm.UsingOVM { // OVM_DISABLED - st.state.AddBalance(st.evm.Coinbase, new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.gasPrice)) + st.state.AddBalance(evm.Coinbase, new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), st.gasPrice)) } return ret, st.gasUsed(), vmerr != nil, err } diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index a6e0944c0795..806b3dd2ab88 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -203,7 +203,7 @@ func TestDeriveFields(t *testing.T) { t.Errorf("receipts[%d].BlockHash = %s, want %s", i, receipts[i].BlockHash.String(), hash.String()) } if receipts[i].BlockNumber.Cmp(number) != 0 { - t.Errorf("receipts[%c].SubmissionNumber = %s, want %s", i, receipts[i].BlockNumber.String(), number.String()) + t.Errorf("receipts[%c].BlockNumber = %s, want %s", i, receipts[i].BlockNumber.String(), number.String()) } if receipts[i].TransactionIndex != uint(i) { t.Errorf("receipts[%d].TransactionIndex = %d, want %d", i, receipts[i].TransactionIndex, i) @@ -221,7 +221,7 @@ func TestDeriveFields(t *testing.T) { } for j := range receipts[i].Logs { if receipts[i].Logs[j].BlockNumber != number.Uint64() { - t.Errorf("receipts[%d].Logs[%d].SubmissionNumber = %d, want %d", i, j, receipts[i].Logs[j].BlockNumber, number.Uint64()) + t.Errorf("receipts[%d].Logs[%d].BlockNumber = %d, want %d", i, j, receipts[i].Logs[j].BlockNumber, number.Uint64()) } if receipts[i].Logs[j].BlockHash != hash { t.Errorf("receipts[%d].Logs[%d].BlockHash = %s, want %s", i, j, receipts[i].Logs[j].BlockHash.String(), hash.String()) diff --git a/core/types/transaction.go b/core/types/transaction.go index 16310a3cc5a5..b33fa78cb7a2 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -223,12 +223,13 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error { return nil } -func (tx *Transaction) Data() []byte { return common.CopyBytes(tx.data.Payload) } -func (tx *Transaction) Gas() uint64 { return tx.data.GasLimit } -func (tx *Transaction) GasPrice() *big.Int { return new(big.Int).Set(tx.data.Price) } -func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.data.Amount) } -func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce } -func (tx *Transaction) CheckNonce() bool { return true } +func (tx *Transaction) Data() []byte { return common.CopyBytes(tx.data.Payload) } +func (tx *Transaction) Gas() uint64 { return tx.data.GasLimit } +func (tx *Transaction) GasPrice() *big.Int { return new(big.Int).Set(tx.data.Price) } +func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.data.Amount) } +func (tx *Transaction) Nonce() uint64 { return tx.data.AccountNonce } +func (tx *Transaction) CheckNonce() bool { return true } + func (tx *Transaction) SetNonce(nonce uint64) { tx.data.AccountNonce = nonce } func (tx *Transaction) SignatureHashType() SignatureHashType { return tx.meta.SignatureHashType } func (tx *Transaction) SetSignatureHashType(sighashType SignatureHashType) { @@ -308,17 +309,18 @@ func (tx *Transaction) Size() common.StorageSize { // XXX Rename message to something less arbitrary? func (tx *Transaction) AsMessage(s Signer) (Message, error) { msg := Message{ - nonce: tx.data.AccountNonce, - gasLimit: tx.data.GasLimit, - gasPrice: new(big.Int).Set(tx.data.Price), - to: tx.data.Recipient, + nonce: tx.data.AccountNonce, + gasLimit: tx.data.GasLimit, + gasPrice: new(big.Int).Set(tx.data.Price), + to: tx.data.Recipient, + amount: tx.data.Amount, + data: tx.data.Payload, + checkNonce: true, + l1MessageSender: tx.meta.L1MessageSender, l1BlockNumber: tx.meta.L1BlockNumber, signatureHashType: tx.meta.SignatureHashType, queueOrigin: tx.meta.QueueOrigin, - amount: tx.data.Amount, - data: tx.data.Payload, - checkNonce: true, } var err error @@ -522,30 +524,32 @@ func (t *TransactionsByPriceAndNonce) Pop() { // // NOTE: In a future PR this will be removed. type Message struct { - to *common.Address + to *common.Address + from common.Address + nonce uint64 + amount *big.Int + gasLimit uint64 + gasPrice *big.Int + data []byte + checkNonce bool + l1MessageSender *common.Address l1BlockNumber *big.Int signatureHashType SignatureHashType queueOrigin *big.Int - from common.Address - nonce uint64 - amount *big.Int - gasLimit uint64 - gasPrice *big.Int - data []byte - checkNonce bool } func NewMessage(from common.Address, to *common.Address, nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, checkNonce bool, l1MessageSender *common.Address, l1BlockNumber *big.Int, queueOrigin QueueOrigin, signatureHashType SignatureHashType) Message { return Message{ - from: from, - to: to, - nonce: nonce, - amount: amount, - gasLimit: gasLimit, - gasPrice: gasPrice, - data: data, - checkNonce: checkNonce, + from: from, + to: to, + nonce: nonce, + amount: amount, + gasLimit: gasLimit, + gasPrice: gasPrice, + data: data, + checkNonce: checkNonce, + l1BlockNumber: l1BlockNumber, l1MessageSender: l1MessageSender, signatureHashType: signatureHashType, @@ -553,15 +557,16 @@ func NewMessage(from common.Address, to *common.Address, nonce uint64, amount *b } } -func (m Message) From() common.Address { return m.from } -func (m Message) To() *common.Address { return m.to } +func (m Message) From() common.Address { return m.from } +func (m Message) To() *common.Address { return m.to } +func (m Message) GasPrice() *big.Int { return m.gasPrice } +func (m Message) Value() *big.Int { return m.amount } +func (m Message) Gas() uint64 { return m.gasLimit } +func (m Message) Nonce() uint64 { return m.nonce } +func (m Message) Data() []byte { return m.data } +func (m Message) CheckNonce() bool { return m.checkNonce } + func (m Message) L1MessageSender() *common.Address { return m.l1MessageSender } func (m Message) L1BlockNumber() *big.Int { return m.l1BlockNumber } func (m Message) SignatureHashType() SignatureHashType { return m.signatureHashType } func (m Message) QueueOrigin() *big.Int { return m.queueOrigin } -func (m Message) GasPrice() *big.Int { return m.gasPrice } -func (m Message) Value() *big.Int { return m.amount } -func (m Message) Gas() uint64 { return m.gasLimit } -func (m Message) Nonce() uint64 { return m.nonce } -func (m Message) Data() []byte { return m.data } -func (m Message) CheckNonce() bool { return m.checkNonce } diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index ff04f8d637b8..0dd441fc8a0d 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -153,7 +153,6 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( // Reset the previous call's return data. It's unimportant to preserve the old buffer // as every returning call will return new data anyway. in.returnData = nil - var returnDataCopy = "" // Don't bother with the execution if there's no code. if len(contract.Code) == 0 { @@ -267,9 +266,6 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( logged = true } - if len(returnDataCopy) > 0 { - in.returnData = []byte(returnDataCopy) - } // execute the operation res, err = operation.execute(&pc, in, contract, mem, stack) // verifyPool is a build flag. Pool verification makes sure the integrity @@ -280,8 +276,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( // if the operation clears the return data (e.g. it has returning data) // set the last return to the result of the operation. if operation.returns { - in.returnData = res - returnDataCopy = string(res) + in.returnData = common.CopyBytes(res) } switch { diff --git a/interfaces.go b/interfaces.go index 255737d6ca9e..50bde19ddf8c 100644 --- a/interfaces.go +++ b/interfaces.go @@ -113,12 +113,13 @@ type ChainSyncReader interface { // CallMsg contains parameters for contract calls. type CallMsg struct { - From common.Address // the sender of the 'transaction' - To *common.Address // the destination contract (nil for contract creation) - Gas uint64 // if 0, the call executes with near-infinite gas - GasPrice *big.Int // wei <-> gas exchange ratio - Value *big.Int // amount of wei sent along with the call - Data []byte // input data, usually an ABI-encoded contract method invocation + From common.Address // the sender of the 'transaction' + To *common.Address // the destination contract (nil for contract creation) + Gas uint64 // if 0, the call executes with near-infinite gas + GasPrice *big.Int // wei <-> gas exchange ratio + Value *big.Int // amount of wei sent along with the call + Data []byte // input data, usually an ABI-encoded contract method invocation + L1MessageSender *common.Address L1BlockNumber *big.Int QueueOrigin *big.Int diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1779e5b9c51a..6324c2c150d5 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -522,7 +522,7 @@ func (s *PublicBlockChainAPI) ChainId() *hexutil.Big { return (*hexutil.Big)(s.b.ChainConfig().ChainID) } -// SubmissionNumber returns the block number of the chain head. +// BlockNumber returns the block number of the chain head. func (s *PublicBlockChainAPI) BlockNumber() hexutil.Uint64 { header, _ := s.b.HeaderByNumber(context.Background(), rpc.LatestBlockNumber) // latest header should always be available return hexutil.Uint64(header.Number.Uint64()) @@ -536,8 +536,7 @@ func (s *PublicBlockChainAPI) GetBalance(ctx context.Context, address common.Add if state == nil || err != nil { return nil, err } - balance := state.GetOVMBalance(address) - return (*hexutil.Big)(balance), state.Error() + return (*hexutil.Big)(state.GetOVMBalance(address)), state.Error() } // Result structs for GetProof @@ -551,10 +550,9 @@ type AccountResult struct { StorageProof []StorageResult `json:"storageProof"` } type StorageResult struct { - Key string `json:"key"` - Value *hexutil.Big `json:"value"` - Proof []string `json:"proof"` - Mutated bool `json:"mutated"` + Key string `json:"key"` + Value *hexutil.Big `json:"value"` + Proof []string `json:"proof"` } // Result structs for GetStateDiffProof @@ -607,11 +605,6 @@ func (s *PublicBlockChainAPI) GetStateDiffProof(ctx context.Context, blockNrOrHa return nil, err } - // iterate over all the proofs and set their mutated bit - for i := range res.StorageProof { - res.StorageProof[i].Mutated = keys[i].Mutated - } - accounts = append(accounts, *res) } @@ -656,19 +649,9 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre if storageError != nil { return nil, storageError } - // by default, the GetProof API does not return if a storage item - // was mutated or not. - storageProof[i] = StorageResult{ - Key: key, - Value: (*hexutil.Big)(state.GetState(address, common.HexToHash(key)).Big()), - Proof: common.ToHexArray(proof), - } + storageProof[i] = StorageResult{key, (*hexutil.Big)(state.GetState(address, common.HexToHash(key)).Big()), common.ToHexArray(proof)} } else { - storageProof[i] = StorageResult{ - Key: key, - Value: &hexutil.Big{}, - Proof: []string{}, - } + storageProof[i] = StorageResult{key, &hexutil.Big{}, []string{}} } } @@ -1487,8 +1470,9 @@ type SendTxArgs struct { Nonce *hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. "input" is the // newer name and should be preferred by clients. - Data *hexutil.Bytes `json:"data"` - Input *hexutil.Bytes `json:"input"` + Data *hexutil.Bytes `json:"data"` + Input *hexutil.Bytes `json:"input"` + L1BlockNumber *big.Int `json:"l1BlockNumber"` L1MessageSender *common.Address `json:"l1MessageSender"` SignatureHashType types.SignatureHashType `json:"signatureHashType"` diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index d0a4555e0b0a..0ff8643a25ce 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -83,6 +83,9 @@ type Backend interface { SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + ChainConfig() *params.ChainConfig + CurrentBlock() *types.Block + // Optimism-specific API SetTimestamp(timestamp int64) IsVerifier() bool @@ -90,10 +93,6 @@ type Backend interface { GetEthContext() (uint64, uint64) GetRollupContext() (uint64, uint64) GasLimit() uint64 - - ChainConfig() *params.ChainConfig - CurrentBlock() *types.Block - GetDiff(*big.Int) (diffdb.Diff, error) } diff --git a/les/handler_test.go b/les/handler_test.go new file mode 100644 index 000000000000..b1be9e507811 --- /dev/null +++ b/les/handler_test.go @@ -0,0 +1,673 @@ +// Copyright 2016 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package les + +import ( + "encoding/binary" + "math/big" + "math/rand" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" +) + +func expectResponse(r p2p.MsgReader, msgcode, reqID, bv uint64, data interface{}) error { + type resp struct { + ReqID, BV uint64 + Data interface{} + } + return p2p.ExpectMsg(r, msgcode, resp{reqID, bv, data}) +} + +// Tests that block headers can be retrieved from a remote chain based on user queries. +func TestGetBlockHeadersLes2(t *testing.T) { testGetBlockHeaders(t, 2) } +func TestGetBlockHeadersLes3(t *testing.T) { testGetBlockHeaders(t, 3) } + +func testGetBlockHeaders(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + server, tearDown := newServerEnv(t, downloader.MaxHashFetch+15, protocol, nil, false, true, 0) + defer tearDown() + + bc := server.handler.blockchain + + // Create a "random" unknown hash for testing + var unknown common.Hash + for i := range unknown { + unknown[i] = byte(i) + } + // Create a batch of tests for various scenarios + limit := uint64(MaxHeaderFetch) + tests := []struct { + query *getBlockHeadersData // The query to execute for header retrieval + expect []common.Hash // The hashes of the block whose headers are expected + }{ + // A single random block should be retrievable by hash and number too + { + &getBlockHeadersData{Origin: hashOrNumber{Hash: bc.GetBlockByNumber(limit / 2).Hash()}, Amount: 1}, + []common.Hash{bc.GetBlockByNumber(limit / 2).Hash()}, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: limit / 2}, Amount: 1}, + []common.Hash{bc.GetBlockByNumber(limit / 2).Hash()}, + }, + // Multiple headers should be retrievable in both directions + { + &getBlockHeadersData{Origin: hashOrNumber{Number: limit / 2}, Amount: 3}, + []common.Hash{ + bc.GetBlockByNumber(limit / 2).Hash(), + bc.GetBlockByNumber(limit/2 + 1).Hash(), + bc.GetBlockByNumber(limit/2 + 2).Hash(), + }, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: limit / 2}, Amount: 3, Reverse: true}, + []common.Hash{ + bc.GetBlockByNumber(limit / 2).Hash(), + bc.GetBlockByNumber(limit/2 - 1).Hash(), + bc.GetBlockByNumber(limit/2 - 2).Hash(), + }, + }, + // Multiple headers with skip lists should be retrievable + { + &getBlockHeadersData{Origin: hashOrNumber{Number: limit / 2}, Skip: 3, Amount: 3}, + []common.Hash{ + bc.GetBlockByNumber(limit / 2).Hash(), + bc.GetBlockByNumber(limit/2 + 4).Hash(), + bc.GetBlockByNumber(limit/2 + 8).Hash(), + }, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: limit / 2}, Skip: 3, Amount: 3, Reverse: true}, + []common.Hash{ + bc.GetBlockByNumber(limit / 2).Hash(), + bc.GetBlockByNumber(limit/2 - 4).Hash(), + bc.GetBlockByNumber(limit/2 - 8).Hash(), + }, + }, + // The chain endpoints should be retrievable + { + &getBlockHeadersData{Origin: hashOrNumber{Number: 0}, Amount: 1}, + []common.Hash{bc.GetBlockByNumber(0).Hash()}, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: bc.CurrentBlock().NumberU64()}, Amount: 1}, + []common.Hash{bc.CurrentBlock().Hash()}, + }, + // Ensure protocol limits are honored + //{ + // &getBlockHeadersData{Origin: hashOrNumber{Number: bc.CurrentBlock().NumberU64() - 1}, Amount: limit + 10, Reverse: true}, + // []common.Hash{}, + //}, + // Check that requesting more than available is handled gracefully + { + &getBlockHeadersData{Origin: hashOrNumber{Number: bc.CurrentBlock().NumberU64() - 4}, Skip: 3, Amount: 3}, + []common.Hash{ + bc.GetBlockByNumber(bc.CurrentBlock().NumberU64() - 4).Hash(), + bc.GetBlockByNumber(bc.CurrentBlock().NumberU64()).Hash(), + }, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: 4}, Skip: 3, Amount: 3, Reverse: true}, + []common.Hash{ + bc.GetBlockByNumber(4).Hash(), + bc.GetBlockByNumber(0).Hash(), + }, + }, + // Check that requesting more than available is handled gracefully, even if mid skip + { + &getBlockHeadersData{Origin: hashOrNumber{Number: bc.CurrentBlock().NumberU64() - 4}, Skip: 2, Amount: 3}, + []common.Hash{ + bc.GetBlockByNumber(bc.CurrentBlock().NumberU64() - 4).Hash(), + bc.GetBlockByNumber(bc.CurrentBlock().NumberU64() - 1).Hash(), + }, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: 4}, Skip: 2, Amount: 3, Reverse: true}, + []common.Hash{ + bc.GetBlockByNumber(4).Hash(), + bc.GetBlockByNumber(1).Hash(), + }, + }, + // Check that non existing headers aren't returned + { + &getBlockHeadersData{Origin: hashOrNumber{Hash: unknown}, Amount: 1}, + []common.Hash{}, + }, { + &getBlockHeadersData{Origin: hashOrNumber{Number: bc.CurrentBlock().NumberU64() + 1}, Amount: 1}, + []common.Hash{}, + }, + } + // Run each of the tests and verify the results against the chain + var reqID uint64 + for i, tt := range tests { + // Collect the headers to expect in the response + var headers []*types.Header + for _, hash := range tt.expect { + headers = append(headers, bc.GetHeaderByHash(hash)) + } + // Send the hash request and verify the response + reqID++ + + cost := server.peer.peer.GetRequestCost(GetBlockHeadersMsg, int(tt.query.Amount)) + sendRequest(server.peer.app, GetBlockHeadersMsg, reqID, cost, tt.query) + if err := expectResponse(server.peer.app, BlockHeadersMsg, reqID, testBufLimit, headers); err != nil { + t.Errorf("test %d: headers mismatch: %v", i, err) + } + } +} + +// Tests that block contents can be retrieved from a remote chain based on their hashes. +func TestGetBlockBodiesLes2(t *testing.T) { testGetBlockBodies(t, 2) } +func TestGetBlockBodiesLes3(t *testing.T) { testGetBlockBodies(t, 3) } + +func testGetBlockBodies(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + server, tearDown := newServerEnv(t, downloader.MaxBlockFetch+15, protocol, nil, false, true, 0) + defer tearDown() + + bc := server.handler.blockchain + + // Create a batch of tests for various scenarios + limit := MaxBodyFetch + tests := []struct { + random int // Number of blocks to fetch randomly from the chain + explicit []common.Hash // Explicitly requested blocks + available []bool // Availability of explicitly requested blocks + expected int // Total number of existing blocks to expect + }{ + {1, nil, nil, 1}, // A single random block should be retrievable + {10, nil, nil, 10}, // Multiple random blocks should be retrievable + {limit, nil, nil, limit}, // The maximum possible blocks should be retrievable + //{limit + 1, nil, nil, limit}, // No more than the possible block count should be returned + {0, []common.Hash{bc.Genesis().Hash()}, []bool{true}, 1}, // The genesis block should be retrievable + {0, []common.Hash{bc.CurrentBlock().Hash()}, []bool{true}, 1}, // The chains head block should be retrievable + {0, []common.Hash{{}}, []bool{false}, 0}, // A non existent block should not be returned + + // Existing and non-existing blocks interleaved should not cause problems + {0, []common.Hash{ + {}, + bc.GetBlockByNumber(1).Hash(), + {}, + bc.GetBlockByNumber(10).Hash(), + {}, + bc.GetBlockByNumber(100).Hash(), + {}, + }, []bool{false, true, false, true, false, true, false}, 3}, + } + // Run each of the tests and verify the results against the chain + var reqID uint64 + for i, tt := range tests { + // Collect the hashes to request, and the response to expect + var hashes []common.Hash + seen := make(map[int64]bool) + var bodies []*types.Body + + for j := 0; j < tt.random; j++ { + for { + num := rand.Int63n(int64(bc.CurrentBlock().NumberU64())) + if !seen[num] { + seen[num] = true + + block := bc.GetBlockByNumber(uint64(num)) + hashes = append(hashes, block.Hash()) + if len(bodies) < tt.expected { + bodies = append(bodies, &types.Body{Transactions: block.Transactions(), Uncles: block.Uncles()}) + } + break + } + } + } + for j, hash := range tt.explicit { + hashes = append(hashes, hash) + if tt.available[j] && len(bodies) < tt.expected { + block := bc.GetBlockByHash(hash) + bodies = append(bodies, &types.Body{Transactions: block.Transactions(), Uncles: block.Uncles()}) + } + } + reqID++ + + // Send the hash request and verify the response + cost := server.peer.peer.GetRequestCost(GetBlockBodiesMsg, len(hashes)) + sendRequest(server.peer.app, GetBlockBodiesMsg, reqID, cost, hashes) + if err := expectResponse(server.peer.app, BlockBodiesMsg, reqID, testBufLimit, bodies); err != nil { + t.Errorf("test %d: bodies mismatch: %v", i, err) + } + } +} + +// Tests that the contract codes can be retrieved based on account addresses. +func TestGetCodeLes2(t *testing.T) { testGetCode(t, 2) } +func TestGetCodeLes3(t *testing.T) { testGetCode(t, 3) } + +func testGetCode(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + // Assemble the test environment + server, tearDown := newServerEnv(t, 4, protocol, nil, false, true, 0) + defer tearDown() + bc := server.handler.blockchain + + var codereqs []*CodeReq + var codes [][]byte + for i := uint64(0); i <= bc.CurrentBlock().NumberU64(); i++ { + header := bc.GetHeaderByNumber(i) + req := &CodeReq{ + BHash: header.Hash(), + AccKey: crypto.Keccak256(testContractAddr[:]), + } + codereqs = append(codereqs, req) + if i >= testContractDeployed { + codes = append(codes, testContractCodeDeployed) + } + } + + cost := server.peer.peer.GetRequestCost(GetCodeMsg, len(codereqs)) + sendRequest(server.peer.app, GetCodeMsg, 42, cost, codereqs) + if err := expectResponse(server.peer.app, CodeMsg, 42, testBufLimit, codes); err != nil { + t.Errorf("codes mismatch: %v", err) + } +} + +// Tests that the stale contract codes can't be retrieved based on account addresses. +func TestGetStaleCodeLes2(t *testing.T) { testGetStaleCode(t, 2) } +func TestGetStaleCodeLes3(t *testing.T) { testGetStaleCode(t, 3) } + +func testGetStaleCode(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + server, tearDown := newServerEnv(t, core.TriesInMemory+4, protocol, nil, false, true, 0) + defer tearDown() + bc := server.handler.blockchain + + check := func(number uint64, expected [][]byte) { + req := &CodeReq{ + BHash: bc.GetHeaderByNumber(number).Hash(), + AccKey: crypto.Keccak256(testContractAddr[:]), + } + cost := server.peer.peer.GetRequestCost(GetCodeMsg, 1) + sendRequest(server.peer.app, GetCodeMsg, 42, cost, []*CodeReq{req}) + if err := expectResponse(server.peer.app, CodeMsg, 42, testBufLimit, expected); err != nil { + t.Errorf("codes mismatch: %v", err) + } + } + check(0, [][]byte{}) // Non-exist contract + check(testContractDeployed, [][]byte{}) // Stale contract + check(bc.CurrentHeader().Number.Uint64(), [][]byte{testContractCodeDeployed}) // Fresh contract +} + +// Tests that the transaction receipts can be retrieved based on hashes. +func TestGetReceiptLes2(t *testing.T) { testGetReceipt(t, 2) } +func TestGetReceiptLes3(t *testing.T) { testGetReceipt(t, 3) } + +func testGetReceipt(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + // Assemble the test environment + server, tearDown := newServerEnv(t, 4, protocol, nil, false, true, 0) + defer tearDown() + + bc := server.handler.blockchain + + // Collect the hashes to request, and the response to expect + var receipts []types.Receipts + var hashes []common.Hash + for i := uint64(0); i <= bc.CurrentBlock().NumberU64(); i++ { + block := bc.GetBlockByNumber(i) + + hashes = append(hashes, block.Hash()) + receipts = append(receipts, rawdb.ReadRawReceipts(server.db, block.Hash(), block.NumberU64())) + } + // Send the hash request and verify the response + cost := server.peer.peer.GetRequestCost(GetReceiptsMsg, len(hashes)) + sendRequest(server.peer.app, GetReceiptsMsg, 42, cost, hashes) + if err := expectResponse(server.peer.app, ReceiptsMsg, 42, testBufLimit, receipts); err != nil { + t.Errorf("receipts mismatch: %v", err) + } +} + +// Tests that trie merkle proofs can be retrieved +func TestGetProofsLes2(t *testing.T) { testGetProofs(t, 2) } +func TestGetProofsLes3(t *testing.T) { testGetProofs(t, 3) } + +func testGetProofs(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + // Assemble the test environment + server, tearDown := newServerEnv(t, 4, protocol, nil, false, true, 0) + defer tearDown() + + bc := server.handler.blockchain + + var proofreqs []ProofReq + proofsV2 := light.NewNodeSet() + + accounts := []common.Address{bankAddr, userAddr1, userAddr2, signerAddr, {}} + for i := uint64(0); i <= bc.CurrentBlock().NumberU64(); i++ { + header := bc.GetHeaderByNumber(i) + trie, _ := trie.New(header.Root, trie.NewDatabase(server.db)) + + for _, acc := range accounts { + req := ProofReq{ + BHash: header.Hash(), + Key: crypto.Keccak256(acc[:]), + } + proofreqs = append(proofreqs, req) + trie.Prove(crypto.Keccak256(acc[:]), 0, proofsV2) + } + } + // Send the proof request and verify the response + cost := server.peer.peer.GetRequestCost(GetProofsV2Msg, len(proofreqs)) + sendRequest(server.peer.app, GetProofsV2Msg, 42, cost, proofreqs) + if err := expectResponse(server.peer.app, ProofsV2Msg, 42, testBufLimit, proofsV2.NodeList()); err != nil { + t.Errorf("proofs mismatch: %v", err) + } +} + +// Tests that the stale contract codes can't be retrieved based on account addresses. +func TestGetStaleProofLes2(t *testing.T) { testGetStaleProof(t, 2) } +func TestGetStaleProofLes3(t *testing.T) { testGetStaleProof(t, 3) } + +func testGetStaleProof(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + server, tearDown := newServerEnv(t, core.TriesInMemory+4, protocol, nil, false, true, 0) + defer tearDown() + bc := server.handler.blockchain + + check := func(number uint64, wantOK bool) { + var ( + header = bc.GetHeaderByNumber(number) + account = crypto.Keccak256(userAddr1.Bytes()) + ) + req := &ProofReq{ + BHash: header.Hash(), + Key: account, + } + cost := server.peer.peer.GetRequestCost(GetProofsV2Msg, 1) + sendRequest(server.peer.app, GetProofsV2Msg, 42, cost, []*ProofReq{req}) + + var expected []rlp.RawValue + if wantOK { + proofsV2 := light.NewNodeSet() + t, _ := trie.New(header.Root, trie.NewDatabase(server.db)) + t.Prove(account, 0, proofsV2) + expected = proofsV2.NodeList() + } + if err := expectResponse(server.peer.app, ProofsV2Msg, 42, testBufLimit, expected); err != nil { + t.Errorf("codes mismatch: %v", err) + } + } + check(0, false) // Non-exist proof + check(2, false) // Stale proof + check(bc.CurrentHeader().Number.Uint64(), true) // Fresh proof +} + +// Tests that CHT proofs can be correctly retrieved. +func TestGetCHTProofsLes2(t *testing.T) { testGetCHTProofs(t, 2) } +func TestGetCHTProofsLes3(t *testing.T) { testGetCHTProofs(t, 3) } + +func testGetCHTProofs(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + config := light.TestServerIndexerConfig + + waitIndexers := func(cIndexer, bIndexer, btIndexer *core.ChainIndexer) { + for { + cs, _, _ := cIndexer.Sections() + if cs >= 1 { + break + } + time.Sleep(10 * time.Millisecond) + } + } + server, tearDown := newServerEnv(t, int(config.ChtSize+config.ChtConfirms), protocol, waitIndexers, false, true, 0) + defer tearDown() + + bc := server.handler.blockchain + + // Assemble the proofs from the different protocols + header := bc.GetHeaderByNumber(config.ChtSize - 1) + rlp, _ := rlp.EncodeToBytes(header) + + key := make([]byte, 8) + binary.BigEndian.PutUint64(key, config.ChtSize-1) + + proofsV2 := HelperTrieResps{ + AuxData: [][]byte{rlp}, + } + root := light.GetChtRoot(server.db, 0, bc.GetHeaderByNumber(config.ChtSize-1).Hash()) + trie, _ := trie.New(root, trie.NewDatabase(rawdb.NewTable(server.db, light.ChtTablePrefix))) + trie.Prove(key, 0, &proofsV2.Proofs) + // Assemble the requests for the different protocols + requestsV2 := []HelperTrieReq{{ + Type: htCanonical, + TrieIdx: 0, + Key: key, + AuxReq: auxHeader, + }} + // Send the proof request and verify the response + cost := server.peer.peer.GetRequestCost(GetHelperTrieProofsMsg, len(requestsV2)) + sendRequest(server.peer.app, GetHelperTrieProofsMsg, 42, cost, requestsV2) + if err := expectResponse(server.peer.app, HelperTrieProofsMsg, 42, testBufLimit, proofsV2); err != nil { + t.Errorf("proofs mismatch: %v", err) + } +} + +func TestGetBloombitsProofsLes2(t *testing.T) { testGetBloombitsProofs(t, 2) } +func TestGetBloombitsProofsLes3(t *testing.T) { testGetBloombitsProofs(t, 3) } + +// Tests that bloombits proofs can be correctly retrieved. +func testGetBloombitsProofs(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + config := light.TestServerIndexerConfig + + waitIndexers := func(cIndexer, bIndexer, btIndexer *core.ChainIndexer) { + for { + bts, _, _ := btIndexer.Sections() + if bts >= 1 { + break + } + time.Sleep(10 * time.Millisecond) + } + } + server, tearDown := newServerEnv(t, int(config.BloomTrieSize+config.BloomTrieConfirms), protocol, waitIndexers, false, true, 0) + defer tearDown() + + bc := server.handler.blockchain + + // Request and verify each bit of the bloom bits proofs + for bit := 0; bit < 2048; bit++ { + // Assemble the request and proofs for the bloombits + key := make([]byte, 10) + + binary.BigEndian.PutUint16(key[:2], uint16(bit)) + // Only the first bloom section has data. + binary.BigEndian.PutUint64(key[2:], 0) + + requests := []HelperTrieReq{{ + Type: htBloomBits, + TrieIdx: 0, + Key: key, + }} + var proofs HelperTrieResps + + root := light.GetBloomTrieRoot(server.db, 0, bc.GetHeaderByNumber(config.BloomTrieSize-1).Hash()) + trie, _ := trie.New(root, trie.NewDatabase(rawdb.NewTable(server.db, light.BloomTrieTablePrefix))) + trie.Prove(key, 0, &proofs.Proofs) + + // Send the proof request and verify the response + cost := server.peer.peer.GetRequestCost(GetHelperTrieProofsMsg, len(requests)) + sendRequest(server.peer.app, GetHelperTrieProofsMsg, 42, cost, requests) + if err := expectResponse(server.peer.app, HelperTrieProofsMsg, 42, testBufLimit, proofs); err != nil { + t.Errorf("bit %d: proofs mismatch: %v", bit, err) + } + } +} + +func TestTransactionStatusLes2(t *testing.T) { testTransactionStatus(t, 2) } +func TestTransactionStatusLes3(t *testing.T) { testTransactionStatus(t, 3) } + +func testTransactionStatus(t *testing.T, protocol int) { + t.Skip("SKIPPING (OVM)") + + server, tearDown := newServerEnv(t, 0, protocol, nil, false, true, 0) + defer tearDown() + server.handler.addTxsSync = true + + chain := server.handler.blockchain + + var reqID uint64 + + test := func(tx *types.Transaction, send bool, expStatus light.TxStatus) { + reqID++ + if send { + cost := server.peer.peer.GetRequestCost(SendTxV2Msg, 1) + sendRequest(server.peer.app, SendTxV2Msg, reqID, cost, types.Transactions{tx}) + } else { + cost := server.peer.peer.GetRequestCost(GetTxStatusMsg, 1) + sendRequest(server.peer.app, GetTxStatusMsg, reqID, cost, []common.Hash{tx.Hash()}) + } + if err := expectResponse(server.peer.app, TxStatusMsg, reqID, testBufLimit, []light.TxStatus{expStatus}); err != nil { + t.Errorf("transaction status mismatch") + } + } + signer := types.HomesteadSigner{} + + // test error status by sending an underpriced transaction + tx0, _ := types.SignTx(types.NewTransaction(0, userAddr1, big.NewInt(10000), params.TxGas, nil, nil), signer, bankKey) + test(tx0, true, light.TxStatus{Status: core.TxStatusUnknown, Error: core.ErrUnderpriced.Error()}) + + tx1, _ := types.SignTx(types.NewTransaction(0, userAddr1, big.NewInt(10000), params.TxGas, big.NewInt(100000000000), nil), signer, bankKey) + test(tx1, false, light.TxStatus{Status: core.TxStatusUnknown}) // query before sending, should be unknown + test(tx1, true, light.TxStatus{Status: core.TxStatusPending}) // send valid processable tx, should return pending + test(tx1, true, light.TxStatus{Status: core.TxStatusPending}) // adding it again should not return an error + + tx2, _ := types.SignTx(types.NewTransaction(1, userAddr1, big.NewInt(10000), params.TxGas, big.NewInt(100000000000), nil), signer, bankKey) + tx3, _ := types.SignTx(types.NewTransaction(2, userAddr1, big.NewInt(10000), params.TxGas, big.NewInt(100000000000), nil), signer, bankKey) + // send transactions in the wrong order, tx3 should be queued + test(tx3, true, light.TxStatus{Status: core.TxStatusQueued}) + test(tx2, true, light.TxStatus{Status: core.TxStatusPending}) + // query again, now tx3 should be pending too + test(tx3, false, light.TxStatus{Status: core.TxStatusPending}) + + // generate and add a block with tx1 and tx2 included + gchain, _ := core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), server.db, 1, func(i int, block *core.BlockGen) { + block.AddTx(tx1) + block.AddTx(tx2) + }) + if _, err := chain.InsertChain(gchain); err != nil { + panic(err) + } + // wait until TxPool processes the inserted block + for i := 0; i < 10; i++ { + if pending, _ := server.handler.txpool.Stats(); pending == 1 { + break + } + time.Sleep(100 * time.Millisecond) + } + if pending, _ := server.handler.txpool.Stats(); pending != 1 { + t.Fatalf("pending count mismatch: have %d, want 1", pending) + } + // Discard new block announcement + msg, _ := server.peer.app.ReadMsg() + msg.Discard() + + // check if their status is included now + block1hash := rawdb.ReadCanonicalHash(server.db, 1) + test(tx1, false, light.TxStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.LegacyTxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 0}}) + + test(tx2, false, light.TxStatus{Status: core.TxStatusIncluded, Lookup: &rawdb.LegacyTxLookupEntry{BlockHash: block1hash, BlockIndex: 1, Index: 1}}) + + // create a reorg that rolls them back + gchain, _ = core.GenerateChain(params.TestChainConfig, chain.GetBlockByNumber(0), ethash.NewFaker(), server.db, 2, func(i int, block *core.BlockGen) {}) + if _, err := chain.InsertChain(gchain); err != nil { + panic(err) + } + // wait until TxPool processes the reorg + for i := 0; i < 10; i++ { + if pending, _ := server.handler.txpool.Stats(); pending == 3 { + break + } + time.Sleep(100 * time.Millisecond) + } + if pending, _ := server.handler.txpool.Stats(); pending != 3 { + t.Fatalf("pending count mismatch: have %d, want 3", pending) + } + // Discard new block announcement + msg, _ = server.peer.app.ReadMsg() + msg.Discard() + + // check if their status is pending again + test(tx1, false, light.TxStatus{Status: core.TxStatusPending}) + test(tx2, false, light.TxStatus{Status: core.TxStatusPending}) +} + +func TestStopResumeLes3(t *testing.T) { + server, tearDown := newServerEnv(t, 0, 3, nil, true, true, testBufLimit/10) + defer tearDown() + + server.handler.server.costTracker.testing = true + + var ( + reqID uint64 + expBuf = testBufLimit + testCost = testBufLimit / 10 + ) + header := server.handler.blockchain.CurrentHeader() + req := func() { + reqID++ + sendRequest(server.peer.app, GetBlockHeadersMsg, reqID, testCost, &getBlockHeadersData{Origin: hashOrNumber{Hash: header.Hash()}, Amount: 1}) + } + for i := 1; i <= 5; i++ { + // send requests while we still have enough buffer and expect a response + for expBuf >= testCost { + req() + expBuf -= testCost + if err := expectResponse(server.peer.app, BlockHeadersMsg, reqID, expBuf, []*types.Header{header}); err != nil { + t.Errorf("expected response and failed: %v", err) + } + } + // send some more requests in excess and expect a single StopMsg + c := i + for c > 0 { + req() + c-- + } + if err := p2p.ExpectMsg(server.peer.app, StopMsg, nil); err != nil { + t.Errorf("expected StopMsg and failed: %v", err) + } + // wait until the buffer is recharged by half of the limit + wait := testBufLimit / testBufRecharge / 2 + server.clock.(*mclock.Simulated).Run(time.Millisecond * time.Duration(wait)) + + // expect a ResumeMsg with the partially recharged buffer value + expBuf += testBufRecharge * wait + if err := p2p.ExpectMsg(server.peer.app, ResumeMsg, expBuf); err != nil { + t.Errorf("expected ResumeMsg and failed: %v", err) + } + } +} diff --git a/les/odr_test.go b/les/odr_test.go index 78e214cf8043..c1004326d093 100644 --- a/les/odr_test.go +++ b/les/odr_test.go @@ -38,16 +38,8 @@ import ( type odrTestFn func(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte -func TestOdrGetBlockLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 2, 1, true, odrGetBlock) -} -func TestOdrGetBlockLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 3, 1, true, odrGetBlock) -} +func TestOdrGetBlockLes2(t *testing.T) { testOdr(t, 2, 1, true, odrGetBlock) } +func TestOdrGetBlockLes3(t *testing.T) { testOdr(t, 3, 1, true, odrGetBlock) } func odrGetBlock(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte { var block *types.Block @@ -63,16 +55,8 @@ func odrGetBlock(ctx context.Context, db ethdb.Database, config *params.ChainCon return rlp } -func TestOdrGetReceiptsLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 2, 1, true, odrGetReceipts) -} -func TestOdrGetReceiptsLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 3, 1, true, odrGetReceipts) -} +func TestOdrGetReceiptsLes2(t *testing.T) { testOdr(t, 2, 1, true, odrGetReceipts) } +func TestOdrGetReceiptsLes3(t *testing.T) { testOdr(t, 3, 1, true, odrGetReceipts) } func odrGetReceipts(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte { var receipts types.Receipts @@ -92,16 +76,8 @@ func odrGetReceipts(ctx context.Context, db ethdb.Database, config *params.Chain return rlp } -func TestOdrAccountsLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 2, 1, true, odrAccounts) -} -func TestOdrAccountsLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 3, 1, true, odrAccounts) -} +func TestOdrAccountsLes2(t *testing.T) { testOdr(t, 2, 1, true, odrAccounts) } +func TestOdrAccountsLes3(t *testing.T) { testOdr(t, 3, 1, true, odrAccounts) } func odrAccounts(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte { dummyAddr := common.HexToAddress("1234567812345678123456781234567812345678") @@ -129,16 +105,8 @@ func odrAccounts(ctx context.Context, db ethdb.Database, config *params.ChainCon return res } -func TestOdrContractCallLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 2, 2, true, odrContractCall) -} -func TestOdrContractCallLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 3, 2, true, odrContractCall) -} +func TestOdrContractCallLes2(t *testing.T) { testOdr(t, 2, 2, true, odrContractCall) } +func TestOdrContractCallLes3(t *testing.T) { testOdr(t, 3, 2, true, odrContractCall) } type callmsg struct { types.Message @@ -187,16 +155,8 @@ func odrContractCall(ctx context.Context, db ethdb.Database, config *params.Chai return res } -func TestOdrTxStatusLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 2, 1, false, odrTxStatus) -} -func TestOdrTxStatusLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testOdr(t, 3, 1, false, odrTxStatus) -} +func TestOdrTxStatusLes2(t *testing.T) { testOdr(t, 2, 1, false, odrTxStatus) } +func TestOdrTxStatusLes3(t *testing.T) { testOdr(t, 3, 1, false, odrTxStatus) } func odrTxStatus(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte { var txs types.Transactions @@ -222,6 +182,8 @@ func odrTxStatus(ctx context.Context, db ethdb.Database, config *params.ChainCon // testOdr tests odr requests whose validation guaranteed by block headers. func testOdr(t *testing.T, protocol int, expFail uint64, checkCached bool, fn odrTestFn) { + t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") + // Assemble the test environment server, client, tearDown := newClientServerEnv(t, 4, protocol, nil, nil, 0, false, true) defer tearDown() diff --git a/les/request_test.go b/les/request_test.go index 09c4225062b4..d3e0bbe93e51 100644 --- a/les/request_test.go +++ b/les/request_test.go @@ -36,46 +36,22 @@ func secAddr(addr common.Address) []byte { type accessTestFn func(db ethdb.Database, bhash common.Hash, number uint64) light.OdrRequest -func TestBlockAccessLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 2, tfBlockAccess) -} -func TestBlockAccessLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 3, tfBlockAccess) -} +func TestBlockAccessLes2(t *testing.T) { testAccess(t, 2, tfBlockAccess) } +func TestBlockAccessLes3(t *testing.T) { testAccess(t, 3, tfBlockAccess) } func tfBlockAccess(db ethdb.Database, bhash common.Hash, number uint64) light.OdrRequest { return &light.BlockRequest{Hash: bhash, Number: number} } -func TestReceiptsAccessLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 2, tfReceiptsAccess) -} -func TestReceiptsAccessLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 3, tfReceiptsAccess) -} +func TestReceiptsAccessLes2(t *testing.T) { testAccess(t, 2, tfReceiptsAccess) } +func TestReceiptsAccessLes3(t *testing.T) { testAccess(t, 3, tfReceiptsAccess) } func tfReceiptsAccess(db ethdb.Database, bhash common.Hash, number uint64) light.OdrRequest { return &light.ReceiptsRequest{Hash: bhash, Number: number} } -func TestTrieEntryAccessLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 2, tfTrieEntryAccess) -} -func TestTrieEntryAccessLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 3, tfTrieEntryAccess) -} +func TestTrieEntryAccessLes2(t *testing.T) { testAccess(t, 2, tfTrieEntryAccess) } +func TestTrieEntryAccessLes3(t *testing.T) { testAccess(t, 3, tfTrieEntryAccess) } func tfTrieEntryAccess(db ethdb.Database, bhash common.Hash, number uint64) light.OdrRequest { if number := rawdb.ReadHeaderNumber(db, bhash); number != nil { @@ -84,16 +60,8 @@ func tfTrieEntryAccess(db ethdb.Database, bhash common.Hash, number uint64) ligh return nil } -func TestCodeAccessLes2(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 2, tfCodeAccess) -} -func TestCodeAccessLes3(t *testing.T) { - t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") - - testAccess(t, 3, tfCodeAccess) -} +func TestCodeAccessLes2(t *testing.T) { testAccess(t, 2, tfCodeAccess) } +func TestCodeAccessLes3(t *testing.T) { testAccess(t, 3, tfCodeAccess) } func tfCodeAccess(db ethdb.Database, bhash common.Hash, num uint64) light.OdrRequest { number := rawdb.ReadHeaderNumber(db, bhash) @@ -110,6 +78,8 @@ func tfCodeAccess(db ethdb.Database, bhash common.Hash, num uint64) light.OdrReq } func testAccess(t *testing.T, protocol int, fn accessTestFn) { + t.Skip("OVM breaks this with `insufficient balance for transfer`, probably because transfers don't work.") + // Assemble the test environment server, client, tearDown := newClientServerEnv(t, 4, protocol, nil, nil, 0, false, true) defer tearDown() diff --git a/miner/worker_test.go b/miner/worker_test.go index 730236eb9b3e..8534084f7ee5 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -92,13 +92,14 @@ func init() { // testWorkerBackend implements worker.Backend interfaces and wraps all information needed during the testing. type testWorkerBackend struct { - db ethdb.Database - txPool *core.TxPool - chain *core.BlockChain + db ethdb.Database + txPool *core.TxPool + chain *core.BlockChain + testTxFeed event.Feed + genesis *core.Genesis + uncleBlock *types.Block + syncService *rollup.SyncService - testTxFeed event.Feed - genesis *core.Genesis - uncleBlock *types.Block } func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, db ethdb.Database, n int) *testWorkerBackend { @@ -141,17 +142,19 @@ func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine }) return &testWorkerBackend{ - db: db, - chain: chain, - txPool: txpool, + db: db, + chain: chain, + txPool: txpool, + genesis: &gspec, + uncleBlock: blocks[0], + syncService: &rollup.SyncService{}, - genesis: &gspec, - uncleBlock: blocks[0], } } -func (b *testWorkerBackend) BlockChain() *core.BlockChain { return b.chain } -func (b *testWorkerBackend) TxPool() *core.TxPool { return b.txPool } +func (b *testWorkerBackend) BlockChain() *core.BlockChain { return b.chain } +func (b *testWorkerBackend) TxPool() *core.TxPool { return b.txPool } + func (b *testWorkerBackend) SyncService() *rollup.SyncService { return b.syncService } func (b *testWorkerBackend) newRandomUncle() *types.Block { diff --git a/p2p/discv5/node_test.go b/p2p/discv5/node_test.go index 2859e9761e2e..4e0fdbe3db67 100644 --- a/p2p/discv5/node_test.go +++ b/p2p/discv5/node_test.go @@ -141,15 +141,11 @@ var parseNodeTests = []struct { { // This test checks that errors from url.Parse are handled. rawurl: "://foo", - wantError: `parse ://foo: missing protocol scheme`, + wantError: `missing protocol scheme`, }, } func TestParseNode(t *testing.T) { - - // TODO: SKIPPING - t.Skip("This test fails on the last pre-fork commit. It may be OS X related") - for _, test := range parseNodeTests { n, err := ParseNode(test.rawurl) if test.wantError != "" { diff --git a/rlp/decode.go b/rlp/decode.go index cb356ab03aae..5f3f5eedfd1b 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -409,7 +409,6 @@ func makeStructDecoder(typ reflect.Type) (decoder, error) { // makePtrDecoder creates a decoder that decodes into the pointer's element type. func makePtrDecoder(typ reflect.Type, tag tags) (decoder, error) { - etype := typ.Elem() etypeinfo := cachedTypeInfo1(etype, tags{}) switch { diff --git a/rpc/handler.go b/rpc/handler.go index a65aca59fc8b..ab32cf47e4bb 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -366,9 +366,7 @@ func (h *handler) handleSubscribe(cp *callProc, msg *jsonrpcMessage) *jsonrpcMes // runMethod runs the Go callback for an RPC method. func (h *handler) runMethod(ctx context.Context, msg *jsonrpcMessage, callb *callback, args []reflect.Value) *jsonrpcMessage { - var result interface{} - var err error - result, err = callb.call(ctx, msg.Method, args) + result, err := callb.call(ctx, msg.Method, args) if err != nil { return msg.errorResponse(err) } diff --git a/rpc/types.go b/rpc/types.go index 38a12a0fd010..dc9248d0feb8 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -68,7 +68,7 @@ const ( EarliestBlockNumber = BlockNumber(0) ) -// UnmarshalJSON parses the given JSON fragment into a SubmissionNumber. It supports: +// UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports: // - "latest", "earliest" or "pending" as string arguments // - the block number // Returned errors: @@ -119,7 +119,7 @@ func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error { err := json.Unmarshal(data, &e) if err == nil { if e.BlockNumber != nil && e.BlockHash != nil { - return fmt.Errorf("cannot specify both BlockHash and SubmissionNumber, choose one or the other") + return fmt.Errorf("cannot specify both BlockHash and BlockNumber, choose one or the other") } bnh.BlockNumber = e.BlockNumber bnh.BlockHash = e.BlockHash diff --git a/signer/core/types.go b/signer/core/types.go index 0ab85d2ea53e..179b7aee3f20 100644 --- a/signer/core/types.go +++ b/signer/core/types.go @@ -75,8 +75,9 @@ type SendTxArgs struct { Value hexutil.Big `json:"value"` Nonce hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. - Data *hexutil.Bytes `json:"data"` - Input *hexutil.Bytes `json:"input"` + Data *hexutil.Bytes `json:"data"` + Input *hexutil.Bytes `json:"input"` + L1MessageSender *common.MixedcaseAddress `json:"l1MessageSender"` L1BlockNumber *big.Int `json:"l1BlockNumber"` SignatureHashType types.SignatureHashType `json:"signatureHashType"` diff --git a/tests/StateManagerABI.json b/tests/StateManagerABI.json deleted file mode 100644 index b1b23ce5df85..000000000000 --- a/tests/StateManagerABI.json +++ /dev/null @@ -1,275 +0,0 @@ -[ - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_codeContractAddress", - "type": "address" - } - ], - "name": "associateCodeContract", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - } - ], - "name": "getCodeContractAddressFromOvmAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "_codeContractAddress", - "type": "address" - } - ], - "name": "getCodeContractBytecode", - "outputs": [ - { - "internalType": "bytes", - "name": "codeContractBytecode", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "_codeContractAddress", - "type": "address" - } - ], - "name": "getCodeContractHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "_codeContractHash", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "_codeContractAddress", - "type": "address" - } - ], - "name": "getOvmAddressFromCodeContractAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - } - ], - "name": "getOvmContractNonce", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - } - ], - "name": "getOvmContractNonceView", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_slot", - "type": "bytes32" - } - ], - "name": "getStorage", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_slot", - "type": "bytes32" - } - ], - "name": "getStorageView", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - } - ], - "name": "incrementOvmContractNonce", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - } - ], - "name": "registerCreatedContract", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "setOvmContractNonce", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_ovmContractAddress", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_slot", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_value", - "type": "bytes32" - } - ], - "name": "setStorage", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file