From 78745551c077bf54151202138c2629f288769561 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 15 Sep 2020 23:55:34 -0400 Subject: WIP: geth-tavum --- examples/multicoin/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/multicoin/main.go b/examples/multicoin/main.go index 3b221b1..792a5b5 100644 --- a/examples/multicoin/main.go +++ b/examples/multicoin/main.go @@ -5,12 +5,12 @@ import ( "encoding/json" "fmt" "github.com/ava-labs/coreth" - "github.com/ava-labs/coreth/accounts/abi" "github.com/ava-labs/coreth/core" "github.com/ava-labs/coreth/core/types" "github.com/ava-labs/coreth/core/vm" "github.com/ava-labs/coreth/eth" "github.com/ava-labs/coreth/params" + "github.com/ava-labs/go-ethereum/accounts/abi" "github.com/ava-labs/go-ethereum/common" "github.com/ava-labs/go-ethereum/common/compiler" "github.com/ava-labs/go-ethereum/crypto" -- cgit v1.2.3 From 8478802ddacc027a8d8c866da9365f6739d9d9d4 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 16 Sep 2020 18:26:55 -0400 Subject: ... --- examples/block/main.go | 8 ++++---- examples/chain/main.go | 8 ++++---- examples/counter/main.go | 8 ++++---- examples/multicoin/main.go | 10 +++++----- examples/payments/main.go | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'examples') diff --git a/examples/block/main.go b/examples/block/main.go index 45d7586..89540c6 100644 --- a/examples/block/main.go +++ b/examples/block/main.go @@ -8,10 +8,10 @@ import ( "github.com/ava-labs/coreth/core/types" "github.com/ava-labs/coreth/eth" "github.com/ava-labs/coreth/params" - "github.com/ava-labs/go-ethereum/common" - "github.com/ava-labs/go-ethereum/common/hexutil" - "github.com/ava-labs/go-ethereum/crypto" - "github.com/ava-labs/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" "math/big" ) diff --git a/examples/chain/main.go b/examples/chain/main.go index 26fc5ce..17003b5 100644 --- a/examples/chain/main.go +++ b/examples/chain/main.go @@ -8,10 +8,10 @@ import ( "github.com/ava-labs/coreth/core/types" "github.com/ava-labs/coreth/eth" "github.com/ava-labs/coreth/params" - "github.com/ava-labs/go-ethereum/common" - "github.com/ava-labs/go-ethereum/common/hexutil" - "github.com/ava-labs/go-ethereum/log" - "github.com/ava-labs/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" "math/big" "sync" ) diff --git a/examples/counter/main.go b/examples/counter/main.go index 85aa9d1..9e18cd8 100644 --- a/examples/counter/main.go +++ b/examples/counter/main.go @@ -10,10 +10,10 @@ import ( "github.com/ava-labs/coreth/core/types" "github.com/ava-labs/coreth/eth" "github.com/ava-labs/coreth/params" - "github.com/ava-labs/go-ethereum/common" - "github.com/ava-labs/go-ethereum/common/compiler" - "github.com/ava-labs/go-ethereum/crypto" - "github.com/ava-labs/go-ethereum/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/compiler" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "go/build" "math/big" "os" diff --git a/examples/multicoin/main.go b/examples/multicoin/main.go index 792a5b5..1f96647 100644 --- a/examples/multicoin/main.go +++ b/examples/multicoin/main.go @@ -10,11 +10,11 @@ import ( "github.com/ava-labs/coreth/core/vm" "github.com/ava-labs/coreth/eth" "github.com/ava-labs/coreth/params" - "github.com/ava-labs/go-ethereum/accounts/abi" - "github.com/ava-labs/go-ethereum/common" - "github.com/ava-labs/go-ethereum/common/compiler" - "github.com/ava-labs/go-ethereum/crypto" - "github.com/ava-labs/go-ethereum/log" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/compiler" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "go/build" "math/big" "os" diff --git a/examples/payments/main.go b/examples/payments/main.go index 40a90c2..fee2060 100644 --- a/examples/payments/main.go +++ b/examples/payments/main.go @@ -8,9 +8,9 @@ import ( "github.com/ava-labs/coreth/core/types" "github.com/ava-labs/coreth/eth" "github.com/ava-labs/coreth/params" - "github.com/ava-labs/go-ethereum/common" - "github.com/ava-labs/go-ethereum/common/hexutil" - "github.com/ava-labs/go-ethereum/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" "math/big" ) -- cgit v1.2.3 From ed839907e592ad25e6119e145e7e05ca78b00fcd Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 16 Sep 2020 22:54:37 -0400 Subject: ... --- examples/chain/main.go | 4 +++- examples/counter/counter.sol | 2 +- examples/multicoin/main.go | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/chain/main.go b/examples/chain/main.go index 17003b5..94c5d6b 100644 --- a/examples/chain/main.go +++ b/examples/chain/main.go @@ -138,6 +138,8 @@ func run(config *eth.Config, a1, a2, b1, b2 int) { bob := NewTestChain("bob", config, aliceBlk, bobBlk, aliceAck, bobAck) alice.Start() bob.Start() + log.Info("alice genesis", "block", alice.chain.GetGenesisBlock().Hash().Hex()) + log.Info("bob genesis", "block", bob.chain.GetGenesisBlock().Hash().Hex()) alice.GenRandomTree(a1, a2) log.Info("alice finished generating the tree") //time.Sleep(1 * time.Second) @@ -205,7 +207,7 @@ func main() { ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(0), Ethash: nil, } diff --git a/examples/counter/counter.sol b/examples/counter/counter.sol index b21c3bf..952b925 100644 --- a/examples/counter/counter.sol +++ b/examples/counter/counter.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.6.0; +pragma solidity >=0.6.0; contract Counter { uint256 x; diff --git a/examples/multicoin/main.go b/examples/multicoin/main.go index 1f96647..fc379d4 100644 --- a/examples/multicoin/main.go +++ b/examples/multicoin/main.go @@ -47,12 +47,12 @@ func main() { ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(0), Ethash: nil, } // configure the genesis block - genesisJSON := `{"config":{"chainId":1,"homesteadBlock":0,"daoForkBlock":0,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0},"nonce":"0x0","timestamp":"0x0","extraData":"0x00","gasLimit":"0x5f5e100","difficulty":"0x0","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","coinbase":"0x0000000000000000000000000000000000000000","alloc":{"751a0b96e1042bee789452ecb20253fba40dbe85":{"balance":"0x1000000000000000", "mcbalance": {"0x0000000000000000000000000000000000000000000000000000000000000000": 1000000000000000000}}, "0100000000000000000000000000000000000000": {"code": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80631e01043914610050578063abb24ba014610092578063b6510bb3146100a9575b600080fd5b61007c6004803603602081101561006657600080fd5b8101908080359060200190929190505050610118565b6040518082815260200191505060405180910390f35b81801561009e57600080fd5b506100a761013b565b005b8180156100b557600080fd5b50610116600480360360808110156100cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061013e565b005b60003073ffffffffffffffffffffffffffffffffffffffff1682905d9050919050565b5c565b8373ffffffffffffffffffffffffffffffffffffffff1681836108fc8690811502906040516000604051808303818888878c8af69550505050505015801561018a573d6000803e3d6000fd5b505050505056fea2646970667358221220ed2100d6623a884d196eceefabe5e03da4309a2562bb25262f3874f1acb31cd764736f6c634300060a0033", "balance": "0x0", "mcbalance": {}}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}` + genesisJSON := `{"config":{"chainId":1,"homesteadBlock":0,"daoForkBlock":0,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0},"nonce":"0x0","timestamp":"0x0","extraData":"0x00","gasLimit":"0x5f5e100","difficulty":"0x0","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","coinbase":"0x0000000000000000000000000000000000000000","alloc":{"751a0b96e1042bee789452ecb20253fba40dbe85":{"balance":"0x1000000000000000", "mcbalance": {"0x0000000000000000000000000000000000000000000000000000000000000000": 1000000000000000000}}, "0100000000000000000000000000000000000000": {"code": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80631e01043914610050578063abb24ba014610092578063b6510bb3146100a9575b600080fd5b61007c6004803603602081101561006657600080fd5b8101908080359060200190929190505050610118565b6040518082815260200191505060405180910390f35b81801561009e57600080fd5b506100a761013b565b005b8180156100b557600080fd5b50610116600480360360808110156100cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061013e565b005b60003073ffffffffffffffffffffffffffffffffffffffff168290cd9050919050565bce565b8373ffffffffffffffffffffffffffffffffffffffff1681836108fc8690811502906040516000604051808303818888878c8acf9550505050505015801561018a573d6000803e3d6000fd5b505050505056fea26469706673582212205c4d96aa2a6488c426daa9567616a383dd6156eb3fe84f4905239179e553fc0f64736f6c634300060a0033", "balance": "0x0", "mcbalance": {}}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}` mcAbiJSON := `[{"inputs":[],"name":"enableMultiCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"coinid","type":"uint256"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"coinid","type":"uint256"},{"internalType":"uint256","name":"amount2","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"}]` genesisKey := "0xabd71b35d559563fea757f0f5edbde286fb8c043105b15abb7cd57189306d7d1" -- cgit v1.2.3 From 7063564c571bcdc94b981db7ed3707902f0466d0 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 17 Sep 2020 00:25:32 -0400 Subject: disable snapshot --- examples/multicoin/main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples') diff --git a/examples/multicoin/main.go b/examples/multicoin/main.go index fc379d4..bfad5ca 100644 --- a/examples/multicoin/main.go +++ b/examples/multicoin/main.go @@ -64,6 +64,9 @@ func main() { genKey := coreth.NewKeyFromECDSA(hk) config.Genesis = genesisBlock + config.TrieCleanCache += config.SnapshotCache + config.SnapshotCache = 0 + // grab the control of block generation and disable auto uncle config.Miner.ManualMining = true config.Miner.ManualUncle = true -- cgit v1.2.3 From 3ea6a7940e40677b629270dfc7a1466bca295bd3 Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 18 Sep 2020 13:09:22 -0400 Subject: clean up the code --- examples/block/main.go | 2 +- examples/counter/main.go | 2 +- examples/payments/main.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/block/main.go b/examples/block/main.go index 89540c6..55fedfe 100644 --- a/examples/block/main.go +++ b/examples/block/main.go @@ -37,7 +37,7 @@ func main() { ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(0), Ethash: nil, } diff --git a/examples/counter/main.go b/examples/counter/main.go index 9e18cd8..f78f28f 100644 --- a/examples/counter/main.go +++ b/examples/counter/main.go @@ -45,7 +45,7 @@ func main() { ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(0), Ethash: nil, } diff --git a/examples/payments/main.go b/examples/payments/main.go index fee2060..9023b3a 100644 --- a/examples/payments/main.go +++ b/examples/payments/main.go @@ -36,7 +36,7 @@ func main() { ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(0), Ethash: nil, } -- cgit v1.2.3