From 33433b6402e45e30830f2623e09aaa23927b1c74 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 14 Jun 2022 18:34:03 -0300 Subject: [PATCH 01/30] geth/core/params: add startup arg for Electroneum's mainnet and testnet --- cmd/faucet/faucet.go | 8 +++-- cmd/geth/consolecmd.go | 2 ++ cmd/geth/main.go | 7 +++++ cmd/utils/flags.go | 37 ++++++++++++++++++++++- core/genesis.go | 34 ++++++++++++++++++++++ core/genesis_alloc.go | 3 ++ params/bootnodes.go | 8 +++++ params/config.go | 66 ++++++++++++++++++++++++++++++++++++++---- 8 files changed, 156 insertions(+), 9 deletions(-) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index bcb837062..f4b10fd92 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -86,6 +86,8 @@ var ( goerliFlag = flag.Bool("goerli", false, "Initializes the faucet with Görli network config") rinkebyFlag = flag.Bool("rinkeby", false, "Initializes the faucet with Rinkeby network config") + + electroneumTestnetFlag = flag.Bool("electroneum-testnet", false, "Initializes the faucet with Electroneum test network config") ) var ( @@ -143,7 +145,7 @@ func main() { log.Crit("Failed to render the faucet template", "err", err) } // Load and parse the genesis block requested by the user - genesis, err := getGenesis(*genesisFlag, *goerliFlag, *rinkebyFlag) + genesis, err := getGenesis(*genesisFlag, *goerliFlag, *rinkebyFlag, *electroneumTestnetFlag) if err != nil { log.Crit("Failed to parse genesis config", "err", err) } @@ -882,7 +884,7 @@ func authNoAuth(url string) (string, string, common.Address, error) { } // getGenesis returns a genesis based on input args -func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool) (*core.Genesis, error) { +func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool, electroneumTestnetFlag bool) (*core.Genesis, error) { switch { case genesisFlag != "": var genesis core.Genesis @@ -892,6 +894,8 @@ func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool) (*core.Ge return core.DefaultGoerliGenesisBlock(), nil case rinkebyFlag: return core.DefaultRinkebyGenesisBlock(), nil + case electroneumTestnetFlag: + return core.DefaultElectroneumTestnetGenesisBlock(), nil default: return nil, fmt.Errorf("no genesis flag provided") } diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 5167f8536..68ce8b012 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -143,6 +143,8 @@ func remoteConsole(ctx *cli.Context) error { path = filepath.Join(path, "sepolia") } else if ctx.GlobalBool(utils.KilnFlag.Name) { path = filepath.Join(path, "kiln") + } else if ctx.GlobalBool(utils.ElectroneumTestnetFlag.Name) { + path = filepath.Join(path, "electroneum-testnet") } } endpoint = fmt.Sprintf("%s/geth.ipc", path) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 791d93440..ad3c7f497 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -282,6 +282,9 @@ func prepare(ctx *cli.Context) { case ctx.GlobalIsSet(utils.GoerliFlag.Name): log.Info("Starting Geth on Görli testnet...") + case ctx.GlobalIsSet(utils.ElectroneumTestnetFlag.Name): + log.Info("Starting Geth on Electroneum testnet...") + case ctx.GlobalIsSet(utils.SepoliaFlag.Name): log.Info("Starting Geth on Sepolia testnet...") @@ -306,6 +309,9 @@ func prepare(ctx *cli.Context) { to 0, and discovery is disabled. `) + case ctx.GlobalIsSet(utils.ElectroneumFlag.Name): + log.Info("Starting Geth on Electroneum mainnet...") + case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name): log.Info("Starting Geth on Ethereum mainnet...") } @@ -317,6 +323,7 @@ func prepare(ctx *cli.Context) { !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.KilnFlag.Name) && + !ctx.GlobalIsSet(utils.ElectroneumTestnetFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) { // Nope, we're really on mainnet. Bump that cache up! log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2f851e930..2fc1990b0 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -148,6 +148,10 @@ var ( Name: "mainnet", Usage: "Ethereum mainnet", } + ElectroneumFlag = cli.BoolFlag{ + Name: "electroneum", + Usage: "Electroneum mainnet", + } RopstenFlag = cli.BoolFlag{ Name: "ropsten", Usage: "Ropsten network: pre-configured proof-of-work test network", @@ -168,6 +172,10 @@ var ( Name: "kiln", Usage: "Kiln network: pre-configured proof-of-work to proof-of-stake test network", } + ElectroneumTestnetFlag = cli.BoolFlag{ + Name: "electroneum-testnet", + Usage: "Electroneum Test network: pre-configured IBFT test network", + } DeveloperFlag = cli.BoolFlag{ Name: "dev", Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled", @@ -848,10 +856,12 @@ var ( GoerliFlag, SepoliaFlag, KilnFlag, + ElectroneumTestnetFlag, } // NetworkFlags is the flag group of all built-in supported networks. NetworkFlags = append([]cli.Flag{ MainnetFlag, + ElectroneumFlag, }, TestnetFlags...) // DatabasePathFlags is the flag group of all database path flags. @@ -893,6 +903,9 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.GlobalBool(KilnFlag.Name) { return filepath.Join(path, "kiln") } + if ctx.GlobalBool(ElectroneumTestnetFlag.Name) { + return filepath.Join(path, "electroneum-testnet") + } return path } Fatalf("Cannot determine default data directory, please set manually (--datadir)") @@ -949,6 +962,10 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.GoerliBootnodes case ctx.GlobalBool(KilnFlag.Name): urls = params.KilnBootnodes + case ctx.GlobalBool(ElectroneumFlag.Name): + urls = params.ElectroneumBootnodes + case ctx.GlobalBool(ElectroneumTestnetFlag.Name): + urls = params.ElectroneumTestnetBootnodes case cfg.BootstrapNodes != nil: return // already set, don't apply defaults. } @@ -1401,6 +1418,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia") case ctx.GlobalBool(KilnFlag.Name) && cfg.DataDir == node.DefaultDataDir(): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "kiln") + case ctx.GlobalBool(ElectroneumTestnetFlag.Name) && cfg.DataDir == node.DefaultDataDir(): + cfg.DataDir = filepath.Join(node.DefaultDataDir(), "etn-testnet") } } @@ -1603,7 +1622,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) { // SetEthConfig applies eth-related command line flags to the config. func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Avoid conflicting network flags - CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag) + CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag, ElectroneumFlag, ElectroneumTestnetFlag) CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { @@ -1744,6 +1763,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) + case ctx.GlobalBool(ElectroneumFlag.Name): + if !ctx.GlobalIsSet(NetworkIdFlag.Name) { + cfg.NetworkId = 52014 + } + cfg.Genesis = core.DefaultElectroneumGenesisBlock() + SetDNSDiscoveryDefaults(cfg, params.ElectroneumGenesisHash) case ctx.GlobalBool(RopstenFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 3 @@ -1778,6 +1803,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultGoerliGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash) + case ctx.GlobalBool(ElectroneumTestnetFlag.Name): + if !ctx.GlobalIsSet(NetworkIdFlag.Name) { + cfg.NetworkId = 5201420 + } + cfg.Genesis = core.DefaultElectroneumTestnetGenesisBlock() + SetDNSDiscoveryDefaults(cfg, params.ElectroneumTestnetGenesisHash) case ctx.GlobalBool(KilnFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 1337802 @@ -2016,6 +2047,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { switch { case ctx.GlobalBool(MainnetFlag.Name): genesis = core.DefaultGenesisBlock() + case ctx.GlobalBool(ElectroneumFlag.Name): + genesis = core.DefaultElectroneumGenesisBlock() case ctx.GlobalBool(RopstenFlag.Name): genesis = core.DefaultRopstenGenesisBlock() case ctx.GlobalBool(SepoliaFlag.Name): @@ -2024,6 +2057,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { genesis = core.DefaultRinkebyGenesisBlock() case ctx.GlobalBool(GoerliFlag.Name): genesis = core.DefaultGoerliGenesisBlock() + case ctx.GlobalBool(ElectroneumTestnetFlag.Name): + genesis = core.DefaultElectroneumTestnetGenesisBlock() case ctx.GlobalBool(KilnFlag.Name): genesis = core.DefaultKilnGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): diff --git a/core/genesis.go b/core/genesis.go index 64ee99c54..1c69aae03 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -445,6 +445,23 @@ func DefaultGenesisBlock() *Genesis { } } +// DefaultGenesisBlock returns the Ethereum main net genesis block. +func DefaultElectroneumGenesisBlock() *Genesis { + return &Genesis{ + Config: params.ElectroneumChainConfig, + Nonce: 0, + Timestamp: 1492009146, + ExtraData: hexutil.MustDecode("0xf87aa00000000000000000000000000000000000000000000000000000000000000000f854944c7968f79c1a414c34cd4d3c1ac7a3a8413da50c946c3d358156962440424c8c2bd5a8c79664b9956d94f27ed0217ec98beec0478a221e07471885d639a2944dd607ce3b4ec9e22fd3ce59c672fafee09cf332c080c0"), + GasLimit: 16234336, + Difficulty: big.NewInt(1), + Number: 0, + GasUsed: 0, + Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), + Coinbase: common.Address{}, + Alloc: GenesisAlloc{}, + } +} + // DefaultRopstenGenesisBlock returns the Ropsten network genesis block. func DefaultRopstenGenesisBlock() *Genesis { return &Genesis{ @@ -481,6 +498,23 @@ func DefaultGoerliGenesisBlock() *Genesis { } } +// DefaultGoerliGenesisBlock returns the Görli network genesis block. +func DefaultElectroneumTestnetGenesisBlock() *Genesis { + return &Genesis{ + Config: params.ElectroneumTestnetChainConfig, + Nonce: 0, + Timestamp: 1492009146, + ExtraData: hexutil.MustDecode("0xf87aa00000000000000000000000000000000000000000000000000000000000000000f854944c7968f79c1a414c34cd4d3c1ac7a3a8413da50c946c3d358156962440424c8c2bd5a8c79664b9956d94f27ed0217ec98beec0478a221e07471885d639a2944dd607ce3b4ec9e22fd3ce59c672fafee09cf332c080c0"), + GasLimit: 16234336, + Difficulty: big.NewInt(1), + Number: 0, + GasUsed: 0, + Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), + Coinbase: common.Address{}, + Alloc: GenesisAlloc{}, + } +} + // DefaultSepoliaGenesisBlock returns the Sepolia network genesis block. func DefaultSepoliaGenesisBlock() *Genesis { return &Genesis{ diff --git a/core/genesis_alloc.go b/core/genesis_alloc.go index 041c55424..d5ae3e25c 100644 --- a/core/genesis_alloc.go +++ b/core/genesis_alloc.go @@ -892,3 +892,6 @@ const KilnAllocData = `{ "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0" }` + +const electroneumAllocData = "" +const electroneumTestnetAllocData = "" diff --git a/params/bootnodes.go b/params/bootnodes.go index 2ad230268..35c3f8030 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -32,6 +32,10 @@ var MainnetBootnodes = []string{ "enode://4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052@157.90.35.166:30303", // bootnode-hetzner-fsn } +// ElectroneumBootnodes are the enode URLs of the P2P bootstrap nodes running on +// the main Electroneum network. +var ElectroneumBootnodes = []string{} + // RopstenBootnodes are the enode URLs of the P2P bootstrap nodes running on the // Ropsten test network. var RopstenBootnodes = []string{ @@ -75,6 +79,10 @@ var GoerliBootnodes = []string{ "enode://d2b720352e8216c9efc470091aa91ddafc53e222b32780f505c817ceef69e01d5b0b0797b69db254c586f493872352f5a022b4d8479a00fc92ec55f9ad46a27e@88.99.70.182:30303", } +// ElectroneumTestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on +// the main Electroneum Testnet network. +var ElectroneumTestnetBootnodes = []string{} + var KilnBootnodes = []string{ "enode://c354db99124f0faf677ff0e75c3cbbd568b2febc186af664e0c51ac435609badedc67a18a63adb64dacc1780a28dcefebfc29b83fd1a3f4aa3c0eb161364cf94@164.92.130.5:30303", "enode://d41af1662434cad0a88fe3c7c92375ec5719f4516ab6d8cb9695e0e2e815382c767038e72c224e04040885157da47422f756c040a9072676c6e35c5b1a383cce@138.68.66.103:30303", diff --git a/params/config.go b/params/config.go index 84bc362e6..6f8feab87 100644 --- a/params/config.go +++ b/params/config.go @@ -27,12 +27,14 @@ import ( // Genesis hashes to enforce below configs on. var ( - MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") - RopstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") - SepoliaGenesisHash = common.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9") - RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") - GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") - KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8") + MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") + ElectroneumGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") + RopstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") + SepoliaGenesisHash = common.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9") + RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") + GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") + ElectroneumTestnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") + KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of @@ -97,6 +99,32 @@ var ( Threshold: 2, } + // ElectroneumChainConfig is the chain parameters to run a node on the main network. + ElectroneumChainConfig = &ChainConfig{ + ChainID: big.NewInt(52014), + HomesteadBlock: big.NewInt(0), + DAOForkBlock: nil, + DAOForkSupport: true, + EIP150Block: big.NewInt(0), + EIP155Block: big.NewInt(0), + EIP158Block: big.NewInt(0), + ByzantiumBlock: big.NewInt(0), + ConstantinopleBlock: big.NewInt(0), + PetersburgBlock: big.NewInt(0), + IstanbulBlock: big.NewInt(0), + MuirGlacierBlock: nil, + BerlinBlock: big.NewInt(0), + LondonBlock: big.NewInt(0), + ArrowGlacierBlock: nil, + Istanbul: &IstanbulConfig{ + ProposerPolicy: 2, + Epoch: 30000, + Ceil2Nby3Block: big.NewInt(0), + TestQBFTBlock: big.NewInt(0), + }, + IsQuorum: true, + } + // RopstenChainConfig contains the chain parameters to run a node on the Ropsten test network. RopstenChainConfig = &ChainConfig{ ChainID: big.NewInt(3), @@ -254,6 +282,32 @@ var ( Threshold: 2, } + // ElectroneumTestnetChainConfig is the chain parameters to run a node on the main network. + ElectroneumTestnetChainConfig = &ChainConfig{ + ChainID: big.NewInt(5201420), + HomesteadBlock: big.NewInt(0), + DAOForkBlock: nil, + DAOForkSupport: true, + EIP150Block: big.NewInt(0), + EIP155Block: big.NewInt(0), + EIP158Block: big.NewInt(0), + ByzantiumBlock: big.NewInt(0), + ConstantinopleBlock: big.NewInt(0), + PetersburgBlock: big.NewInt(0), + IstanbulBlock: big.NewInt(0), + MuirGlacierBlock: nil, + BerlinBlock: big.NewInt(0), + LondonBlock: big.NewInt(0), + ArrowGlacierBlock: nil, + Istanbul: &IstanbulConfig{ + ProposerPolicy: 2, + Epoch: 30000, + Ceil2Nby3Block: big.NewInt(0), + TestQBFTBlock: big.NewInt(0), + }, + IsQuorum: true, + } + // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Ethash consensus. // From f776e66c21d1c79b4e22f32cc1dc378307193a2f Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 14 Jun 2022 18:34:45 -0300 Subject: [PATCH 02/30] node: change default data dir --- node/defaults.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/defaults.go b/node/defaults.go index fd0277e29..305f58c0a 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -74,19 +74,19 @@ func DefaultDataDir() string { if home != "" { switch runtime.GOOS { case "darwin": - return filepath.Join(home, "Library", "Ethereum") + return filepath.Join(home, "Library", "Electroneum") case "windows": // We used to put everything in %HOME%\AppData\Roaming, but this caused // problems with non-typical setups. If this fallback location exists and // is non-empty, use it, otherwise DTRT and check %LOCALAPPDATA%. - fallback := filepath.Join(home, "AppData", "Roaming", "Ethereum") + fallback := filepath.Join(home, "AppData", "Roaming", "Electroneum") appdata := windowsAppData() if appdata == "" || isNonEmptyDir(fallback) { return fallback } - return filepath.Join(appdata, "Ethereum") + return filepath.Join(appdata, "Electroneum") default: - return filepath.Join(home, ".ethereum") + return filepath.Join(home, ".electroneum") } } // As we cannot guess a stable location, return empty and handle later From c320d45c94724bb60e2e570f3da5093e7f30a27a Mon Sep 17 00:00:00 2001 From: andrepatta Date: Wed, 15 Jun 2022 16:29:47 -0300 Subject: [PATCH 03/30] qbft: check if coinbase address corresponds with block signer --- consensus/istanbul/common/errors.go | 3 +++ consensus/istanbul/qbft/engine/engine.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/consensus/istanbul/common/errors.go b/consensus/istanbul/common/errors.go index 34ca699f6..4c31e6dba 100644 --- a/consensus/istanbul/common/errors.go +++ b/consensus/istanbul/common/errors.go @@ -92,4 +92,7 @@ var ( // ErrFailedDecodeMessageSet = errors.New("failed to decode message set") // ErrInvalidSigner is returned when the message is signed by a validator different than message sender ErrInvalidSigner = errors.New("message not signed by the sender") + + // ErrInvalidCoinbase is returned when the Coinbase address is different from current Proposer's Address + ErrInvalidCoinbase = errors.New("coinbase does not match with current proposer") ) diff --git a/consensus/istanbul/qbft/engine/engine.go b/consensus/istanbul/qbft/engine/engine.go index 87fdab98d..a931c1559 100644 --- a/consensus/istanbul/qbft/engine/engine.go +++ b/consensus/istanbul/qbft/engine/engine.go @@ -225,6 +225,11 @@ func (e *Engine) verifySigner(chain consensus.ChainHeaderReader, header *types.H return istanbulcommon.ErrUnauthorized } + // Ensure that Coinbase address is the same as signer's address + if header.Number.Uint64() > 0 && header.Coinbase != signer { + return istanbulcommon.ErrInvalidCoinbase + } + return nil } From 2d176a3fd7277f0cd8a677ca7214d406a76d2cf2 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Wed, 15 Jun 2022 16:36:35 -0300 Subject: [PATCH 04/30] cmd/core/eth/mobile/params: Remove eth testnets and add Electroneum's mainnet/testnet configs Electroneum mainnet chainId: 52014 (A1Z26 cipher for "ETN") Electroneum testnet chainId: 5201420 (A1Z26 cipher for "ETNT") --- cmd/devp2p/discv4cmd.go | 2 +- cmd/devp2p/nodesetcmd.go | 10 +- cmd/faucet/faucet.go | 17 +- cmd/geth/consolecmd.go | 22 +- cmd/geth/consolecmd_test.go | 22 +- cmd/geth/dao_test.go | 2 +- cmd/geth/main.go | 31 +-- cmd/utils/flags.go | 169 ++----------- consensus/istanbul/testutils/genesis.go | 1 + core/forkid/forkid_test.go | 95 ++++---- core/genesis.go | 104 +------- core/genesis_test.go | 22 +- core/rawdb/accessors_indexes_test.go | 16 +- eth/backend.go | 7 +- eth/ethconfig/config.go | 2 +- .../internal/tracetest/calltrace_test.go | 8 +- miner/stress/1559/main.go | 2 +- miner/stress/beacon/main.go | 2 +- miner/stress/clique/main.go | 2 +- miner/stress/ethash/main.go | 2 +- mobile/geth.go | 27 +-- mobile/params.go | 33 +-- params/bootnodes.go | 96 +------- params/config.go | 228 +----------------- tests/difficulty_test.go | 25 +- 25 files changed, 174 insertions(+), 773 deletions(-) diff --git a/cmd/devp2p/discv4cmd.go b/cmd/devp2p/discv4cmd.go index 3b6dc09a1..5e4c5ed5d 100644 --- a/cmd/devp2p/discv4cmd.go +++ b/cmd/devp2p/discv4cmd.go @@ -276,7 +276,7 @@ func listen(ln *enode.LocalNode, addr string) *net.UDPConn { } func parseBootnodes(ctx *cli.Context) ([]*enode.Node, error) { - s := params.RinkebyBootnodes + s := params.TestnetBootnodes if ctx.IsSet(bootnodesFlag.Name) { input := ctx.String(bootnodesFlag.Name) if input == "" { diff --git a/cmd/devp2p/nodesetcmd.go b/cmd/devp2p/nodesetcmd.go index d65d6314c..8ebe51a81 100644 --- a/cmd/devp2p/nodesetcmd.go +++ b/cmd/devp2p/nodesetcmd.go @@ -229,14 +229,8 @@ func ethFilter(args []string) (nodeFilter, error) { switch args[0] { case "mainnet": filter = forkid.NewStaticFilter(params.MainnetChainConfig, params.MainnetGenesisHash) - case "rinkeby": - filter = forkid.NewStaticFilter(params.RinkebyChainConfig, params.RinkebyGenesisHash) - case "goerli": - filter = forkid.NewStaticFilter(params.GoerliChainConfig, params.GoerliGenesisHash) - case "ropsten": - filter = forkid.NewStaticFilter(params.RopstenChainConfig, params.RopstenGenesisHash) - case "sepolia": - filter = forkid.NewStaticFilter(params.SepoliaChainConfig, params.SepoliaGenesisHash) + case "testnet": + filter = forkid.NewStaticFilter(params.TestnetChainConfig, params.TestnetGenesisHash) default: return nil, fmt.Errorf("unknown network %q", args[0]) } diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index f4b10fd92..8b2b13058 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -84,10 +84,7 @@ var ( twitterTokenFlag = flag.String("twitter.token", "", "Bearer token to authenticate with the v2 Twitter API") twitterTokenV1Flag = flag.String("twitter.token.v1", "", "Bearer token to authenticate with the v1.1 Twitter API") - goerliFlag = flag.Bool("goerli", false, "Initializes the faucet with Görli network config") - rinkebyFlag = flag.Bool("rinkeby", false, "Initializes the faucet with Rinkeby network config") - - electroneumTestnetFlag = flag.Bool("electroneum-testnet", false, "Initializes the faucet with Electroneum test network config") + testnetFlag = flag.Bool("testnet", false, "Initializes the faucet with Electroneum test network config") ) var ( @@ -145,7 +142,7 @@ func main() { log.Crit("Failed to render the faucet template", "err", err) } // Load and parse the genesis block requested by the user - genesis, err := getGenesis(*genesisFlag, *goerliFlag, *rinkebyFlag, *electroneumTestnetFlag) + genesis, err := getGenesis(*genesisFlag, *testnetFlag) if err != nil { log.Crit("Failed to parse genesis config", "err", err) } @@ -884,18 +881,14 @@ func authNoAuth(url string) (string, string, common.Address, error) { } // getGenesis returns a genesis based on input args -func getGenesis(genesisFlag string, goerliFlag bool, rinkebyFlag bool, electroneumTestnetFlag bool) (*core.Genesis, error) { +func getGenesis(genesisFlag string, TestnetFlag bool) (*core.Genesis, error) { switch { case genesisFlag != "": var genesis core.Genesis err := common.LoadJSON(genesisFlag, &genesis) return &genesis, err - case goerliFlag: - return core.DefaultGoerliGenesisBlock(), nil - case rinkebyFlag: - return core.DefaultRinkebyGenesisBlock(), nil - case electroneumTestnetFlag: - return core.DefaultElectroneumTestnetGenesisBlock(), nil + case TestnetFlag: + return core.DefaultTestnetGenesisBlock(), nil default: return nil, fmt.Errorf("no genesis flag provided") } diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 68ce8b012..4b0e25e6b 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -22,7 +22,6 @@ import ( "strings" "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" @@ -126,25 +125,8 @@ func remoteConsole(ctx *cli.Context) error { path = ctx.GlobalString(utils.DataDirFlag.Name) } if path != "" { - if ctx.GlobalBool(utils.RopstenFlag.Name) { - // Maintain compatibility with older Geth configurations storing the - // Ropsten database in `testnet` instead of `ropsten`. - legacyPath := filepath.Join(path, "testnet") - if common.FileExist(legacyPath) { - path = legacyPath - } else { - path = filepath.Join(path, "ropsten") - } - } else if ctx.GlobalBool(utils.RinkebyFlag.Name) { - path = filepath.Join(path, "rinkeby") - } else if ctx.GlobalBool(utils.GoerliFlag.Name) { - path = filepath.Join(path, "goerli") - } else if ctx.GlobalBool(utils.SepoliaFlag.Name) { - path = filepath.Join(path, "sepolia") - } else if ctx.GlobalBool(utils.KilnFlag.Name) { - path = filepath.Join(path, "kiln") - } else if ctx.GlobalBool(utils.ElectroneumTestnetFlag.Name) { - path = filepath.Join(path, "electroneum-testnet") + if ctx.GlobalBool(utils.TestnetFlag.Name) { + path = filepath.Join(path, "testnet") } } endpoint = fmt.Sprintf("%s/geth.ipc", path) diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index f4e8bf490..f76202648 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -30,7 +30,7 @@ import ( ) const ( - ipcAPIs = "admin:1.0 debug:1.0 engine:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0" + ipcAPIs = "admin:1.0 debug:1.0 eth:1.0 istanbul:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0" httpAPIs = "eth:1.0 net:1.0 rpc:1.0 web3:1.0" ) @@ -38,10 +38,10 @@ const ( // memory and disk IO. If the args don't set --datadir, the // child g gets a temporary data directory. func runMinimalGeth(t *testing.T, args ...string) *testgeth { - // --ropsten to make the 'writing genesis to disk' faster (no accounts) + // --testnet to make the 'writing genesis to disk' faster (no accounts) // --networkid=1337 to avoid cache bump // --syncmode=full to avoid allocating fast sync bloom - allArgs := []string{"--ropsten", "--networkid", "1337", "--syncmode=full", "--port", "0", + allArgs := []string{"--testnet", "--networkid", "1337", "--syncmode=full", "--port", "0", "--nat", "none", "--nodiscover", "--maxpeers", "0", "--cache", "64", "--datadir.minfreedisk", "0"} return runGeth(t, append(allArgs, args...)...) @@ -50,10 +50,11 @@ func runMinimalGeth(t *testing.T, args ...string) *testgeth { // Tests that a node embedded within a console can be started up properly and // then terminated by closing the input stream. func TestConsoleWelcome(t *testing.T) { - coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182" + nodekey := "ba6dc97bd7bbd4742adbb808136a96a9d59743fe06d7c0c740f528d36bbc82ac" + // Coinbase for this nodekey = 0x4c7968f79c1a414c34cd4d3c1ac7a3a8413da50c // Start a geth console, make sure it's cleaned up and terminate the console - geth := runMinimalGeth(t, "--miner.etherbase", coinbase, "console") + geth := runMinimalGeth(t, "--nodekeyhex", nodekey, "console") // Gather all the infos the welcome message needs to contain geth.SetTemplateFunc("goos", func() string { return runtime.GOOS }) @@ -61,7 +62,7 @@ func TestConsoleWelcome(t *testing.T) { geth.SetTemplateFunc("gover", runtime.Version) geth.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) geth.SetTemplateFunc("niltime", func() string { - return time.Unix(0, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") + return time.Unix(1492009146, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") }) geth.SetTemplateFunc("apis", func() string { return ipcAPIs }) @@ -70,7 +71,7 @@ func TestConsoleWelcome(t *testing.T) { Welcome to the Geth JavaScript console! instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} -coinbase: {{.Etherbase}} +coinbase: 0x4c7968f79c1a414c34cd4d3c1ac7a3a8413da50c at block: 0 ({{niltime}}) datadir: {{.Datadir}} modules: {{apis}} @@ -98,7 +99,7 @@ func TestAttachWelcome(t *testing.T) { p := trulyRandInt(1024, 65533) // Yeah, sometimes this will fail, sorry :P httpPort = strconv.Itoa(p) wsPort = strconv.Itoa(p + 1) - geth := runMinimalGeth(t, "--miner.etherbase", "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182", + geth := runMinimalGeth(t, "--nodekeyhex", "ba6dc97bd7bbd4742adbb808136a96a9d59743fe06d7c0c740f528d36bbc82ac", "--ipcpath", ipc, "--http", "--http.port", httpPort, "--ws", "--ws.port", wsPort) @@ -130,9 +131,8 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { attach.SetTemplateFunc("goarch", func() string { return runtime.GOARCH }) attach.SetTemplateFunc("gover", runtime.Version) attach.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) - attach.SetTemplateFunc("etherbase", func() string { return geth.Etherbase }) attach.SetTemplateFunc("niltime", func() string { - return time.Unix(0, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") + return time.Unix(1492009146, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) attach.SetTemplateFunc("datadir", func() string { return geth.Datadir }) @@ -143,7 +143,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { Welcome to the Geth JavaScript console! instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} -coinbase: {{etherbase}} +coinbase: 0x4c7968f79c1a414c34cd4d3c1ac7a3a8413da50c at block: 0 ({{niltime}}){{if ipc}} datadir: {{datadir}}{{end}} modules: {{apis}} diff --git a/cmd/geth/dao_test.go b/cmd/geth/dao_test.go index 0701a2d5a..b9b8cf24f 100644 --- a/cmd/geth/dao_test.go +++ b/cmd/geth/dao_test.go @@ -127,7 +127,7 @@ func testDAOForkBlockNewChain(t *testing.T, test int, genesis string, expectBloc } defer db.Close() - genesisHash := common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") + genesisHash := params.MainnetGenesisHash if genesis != "" { genesisHash = daoGenesisHash } diff --git a/cmd/geth/main.go b/cmd/geth/main.go index ad3c7f497..648af433d 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -273,24 +273,6 @@ func main() { func prepare(ctx *cli.Context) { // If we're running a known preset, log it for convenience. switch { - case ctx.GlobalIsSet(utils.RopstenFlag.Name): - log.Info("Starting Geth on Ropsten testnet...") - - case ctx.GlobalIsSet(utils.RinkebyFlag.Name): - log.Info("Starting Geth on Rinkeby testnet...") - - case ctx.GlobalIsSet(utils.GoerliFlag.Name): - log.Info("Starting Geth on Görli testnet...") - - case ctx.GlobalIsSet(utils.ElectroneumTestnetFlag.Name): - log.Info("Starting Geth on Electroneum testnet...") - - case ctx.GlobalIsSet(utils.SepoliaFlag.Name): - log.Info("Starting Geth on Sepolia testnet...") - - case ctx.GlobalIsSet(utils.KilnFlag.Name): - log.Info("Starting Geth on Kiln testnet...") - case ctx.GlobalIsSet(utils.DeveloperFlag.Name): log.Info("Starting Geth in ephemeral dev mode...") log.Warn(`You are running Geth in --dev mode. Please note the following: @@ -309,21 +291,16 @@ func prepare(ctx *cli.Context) { to 0, and discovery is disabled. `) - case ctx.GlobalIsSet(utils.ElectroneumFlag.Name): - log.Info("Starting Geth on Electroneum mainnet...") + case ctx.GlobalIsSet(utils.TestnetFlag.Name): + log.Info("Starting Geth on Electroneum testnet...") case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name): - log.Info("Starting Geth on Ethereum mainnet...") + log.Info("Starting Geth on Electroneum mainnet...") } // If we're a full node on mainnet without --cache specified, bump default cache allowance if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) { // Make sure we're not on any supported preconfigured testnet either - if !ctx.GlobalIsSet(utils.RopstenFlag.Name) && - !ctx.GlobalIsSet(utils.SepoliaFlag.Name) && - !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && - !ctx.GlobalIsSet(utils.GoerliFlag.Name) && - !ctx.GlobalIsSet(utils.KilnFlag.Name) && - !ctx.GlobalIsSet(utils.ElectroneumTestnetFlag.Name) && + if !ctx.GlobalIsSet(utils.TestnetFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) { // Nope, we're really on mainnet. Bump that cache up! log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2fc1990b0..945b69b34 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -146,34 +146,10 @@ var ( } MainnetFlag = cli.BoolFlag{ Name: "mainnet", - Usage: "Ethereum mainnet", - } - ElectroneumFlag = cli.BoolFlag{ - Name: "electroneum", Usage: "Electroneum mainnet", } - RopstenFlag = cli.BoolFlag{ - Name: "ropsten", - Usage: "Ropsten network: pre-configured proof-of-work test network", - } - RinkebyFlag = cli.BoolFlag{ - Name: "rinkeby", - Usage: "Rinkeby network: pre-configured proof-of-authority test network", - } - GoerliFlag = cli.BoolFlag{ - Name: "goerli", - Usage: "Görli network: pre-configured proof-of-authority test network", - } - SepoliaFlag = cli.BoolFlag{ - Name: "sepolia", - Usage: "Sepolia network: pre-configured proof-of-work test network", - } - KilnFlag = cli.BoolFlag{ - Name: "kiln", - Usage: "Kiln network: pre-configured proof-of-work to proof-of-stake test network", - } - ElectroneumTestnetFlag = cli.BoolFlag{ - Name: "electroneum-testnet", + TestnetFlag = cli.BoolFlag{ + Name: "testnet", Usage: "Electroneum Test network: pre-configured IBFT test network", } DeveloperFlag = cli.BoolFlag{ @@ -851,17 +827,11 @@ var ( var ( // TestnetFlags is the flag group of all built-in supported testnets. TestnetFlags = []cli.Flag{ - RopstenFlag, - RinkebyFlag, - GoerliFlag, - SepoliaFlag, - KilnFlag, - ElectroneumTestnetFlag, + TestnetFlag, } // NetworkFlags is the flag group of all built-in supported networks. NetworkFlags = append([]cli.Flag{ MainnetFlag, - ElectroneumFlag, }, TestnetFlags...) // DatabasePathFlags is the flag group of all database path flags. @@ -886,25 +856,8 @@ func GroupFlags(groups ...[]cli.Flag) []cli.Flag { // then a subdirectory of the specified datadir will be used. func MakeDataDir(ctx *cli.Context) string { if path := ctx.GlobalString(DataDirFlag.Name); path != "" { - if ctx.GlobalBool(RopstenFlag.Name) { - // Maintain compatibility with older Geth configurations storing the - // Ropsten database in `testnet` instead of `ropsten`. - return filepath.Join(path, "ropsten") - } - if ctx.GlobalBool(RinkebyFlag.Name) { - return filepath.Join(path, "rinkeby") - } - if ctx.GlobalBool(GoerliFlag.Name) { - return filepath.Join(path, "goerli") - } - if ctx.GlobalBool(SepoliaFlag.Name) { - return filepath.Join(path, "sepolia") - } - if ctx.GlobalBool(KilnFlag.Name) { - return filepath.Join(path, "kiln") - } - if ctx.GlobalBool(ElectroneumTestnetFlag.Name) { - return filepath.Join(path, "electroneum-testnet") + if ctx.GlobalBool(TestnetFlag.Name) { + return filepath.Join(path, "testnet") } return path } @@ -952,20 +905,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { switch { case ctx.GlobalIsSet(BootnodesFlag.Name): urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name)) - case ctx.GlobalBool(RopstenFlag.Name): - urls = params.RopstenBootnodes - case ctx.GlobalBool(SepoliaFlag.Name): - urls = params.SepoliaBootnodes - case ctx.GlobalBool(RinkebyFlag.Name): - urls = params.RinkebyBootnodes - case ctx.GlobalBool(GoerliFlag.Name): - urls = params.GoerliBootnodes - case ctx.GlobalBool(KilnFlag.Name): - urls = params.KilnBootnodes - case ctx.GlobalBool(ElectroneumFlag.Name): - urls = params.ElectroneumBootnodes - case ctx.GlobalBool(ElectroneumTestnetFlag.Name): - urls = params.ElectroneumTestnetBootnodes + case ctx.GlobalBool(TestnetFlag.Name): + urls = params.TestnetBootnodes case cfg.BootstrapNodes != nil: return // already set, don't apply defaults. } @@ -1398,28 +1339,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = ctx.GlobalString(DataDirFlag.Name) case ctx.GlobalBool(DeveloperFlag.Name): cfg.DataDir = "" // unless explicitly requested, use memory databases - case ctx.GlobalBool(RopstenFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - // Maintain compatibility with older Geth configurations storing the - // Ropsten database in `testnet` instead of `ropsten`. - legacyPath := filepath.Join(node.DefaultDataDir(), "testnet") - if common.FileExist(legacyPath) { - log.Warn("Using the deprecated `testnet` datadir. Future versions will store the Ropsten chain in `ropsten`.") - cfg.DataDir = legacyPath - } else { - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "ropsten") - } - - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "ropsten") - case ctx.GlobalBool(RinkebyFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby") - case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli") - case ctx.GlobalBool(SepoliaFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia") - case ctx.GlobalBool(KilnFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "kiln") - case ctx.GlobalBool(ElectroneumTestnetFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "etn-testnet") + case ctx.GlobalBool(TestnetFlag.Name) && cfg.DataDir == node.DefaultDataDir(): + cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet") } } @@ -1622,7 +1543,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) { // SetEthConfig applies eth-related command line flags to the config. func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Avoid conflicting network flags - CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag, ElectroneumFlag, ElectroneumTestnetFlag) + CheckExclusive(ctx, MainnetFlag, TestnetFlag, DeveloperFlag) CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { @@ -1759,62 +1680,16 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { switch { case ctx.GlobalBool(MainnetFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 1 + cfg.NetworkId = 52014 } cfg.Genesis = core.DefaultGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) - case ctx.GlobalBool(ElectroneumFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 52014 - } - cfg.Genesis = core.DefaultElectroneumGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.ElectroneumGenesisHash) - case ctx.GlobalBool(RopstenFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 3 - } - cfg.Genesis = core.DefaultRopstenGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.RopstenGenesisHash) - case ctx.GlobalBool(SepoliaFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 11155111 - } - cfg.Genesis = core.DefaultSepoliaGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.SepoliaGenesisHash) - case ctx.GlobalBool(RinkebyFlag.Name): - log.Warn("") - log.Warn("--------------------------------------------------------------------------------") - log.Warn("Please note, Rinkeby has been deprecated. It will still work for the time being,") - log.Warn("but there will be no further hard-forks shipped for it. Eventually the network") - log.Warn("will be permanently halted after the other networks transition through the merge") - log.Warn("and prove stable enough. For the most future proof testnet, choose Sepolia as") - log.Warn("your replacement environment (--sepolia instead of --rinkeby).") - log.Warn("--------------------------------------------------------------------------------") - log.Warn("") - - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 4 - } - cfg.Genesis = core.DefaultRinkebyGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.RinkebyGenesisHash) - case ctx.GlobalBool(GoerliFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 5 - } - cfg.Genesis = core.DefaultGoerliGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash) - case ctx.GlobalBool(ElectroneumTestnetFlag.Name): + case ctx.GlobalBool(TestnetFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 5201420 } - cfg.Genesis = core.DefaultElectroneumTestnetGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.ElectroneumTestnetGenesisHash) - case ctx.GlobalBool(KilnFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 1337802 - } - cfg.Genesis = core.DefaultKilnGenesisBlock() - SetDNSDiscoveryDefaults(cfg, params.KilnGenesisHash) + cfg.Genesis = core.DefaultTestnetGenesisBlock() + SetDNSDiscoveryDefaults(cfg, params.TestnetGenesisHash) case ctx.GlobalBool(DeveloperFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 1337 @@ -2047,20 +1922,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { switch { case ctx.GlobalBool(MainnetFlag.Name): genesis = core.DefaultGenesisBlock() - case ctx.GlobalBool(ElectroneumFlag.Name): - genesis = core.DefaultElectroneumGenesisBlock() - case ctx.GlobalBool(RopstenFlag.Name): - genesis = core.DefaultRopstenGenesisBlock() - case ctx.GlobalBool(SepoliaFlag.Name): - genesis = core.DefaultSepoliaGenesisBlock() - case ctx.GlobalBool(RinkebyFlag.Name): - genesis = core.DefaultRinkebyGenesisBlock() - case ctx.GlobalBool(GoerliFlag.Name): - genesis = core.DefaultGoerliGenesisBlock() - case ctx.GlobalBool(ElectroneumTestnetFlag.Name): - genesis = core.DefaultElectroneumTestnetGenesisBlock() - case ctx.GlobalBool(KilnFlag.Name): - genesis = core.DefaultKilnGenesisBlock() + case ctx.GlobalBool(TestnetFlag.Name): + genesis = core.DefaultTestnetGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): Fatalf("Developer chains are ephemeral") } diff --git a/consensus/istanbul/testutils/genesis.go b/consensus/istanbul/testutils/genesis.go index ae8ff962c..06b855d55 100644 --- a/consensus/istanbul/testutils/genesis.go +++ b/consensus/istanbul/testutils/genesis.go @@ -20,6 +20,7 @@ func Genesis(validators []common.Address, isQBFT bool) *core.Genesis { // force enable Istanbul engine genesis.Config.Istanbul = ¶ms.IstanbulConfig{} genesis.Config.Ethash = nil + genesis.ExtraData = nil genesis.Difficulty = istanbulcommon.DefaultDifficulty genesis.Nonce = istanbulcommon.EmptyBlockNonce.Uint64() genesis.Mixhash = types.IstanbulDigest diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index b0ee59b9e..3ec3870ad 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -27,10 +27,52 @@ import ( "github.com/ethereum/go-ethereum/rlp" ) +var ( + mainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") + mainnetChainConfig = params.ChainConfig{ + ChainID: big.NewInt(1), + HomesteadBlock: big.NewInt(1_150_000), + DAOForkBlock: big.NewInt(1_920_000), + DAOForkSupport: true, + EIP150Block: big.NewInt(2_463_000), + EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"), + EIP155Block: big.NewInt(2_675_000), + EIP158Block: big.NewInt(2_675_000), + ByzantiumBlock: big.NewInt(4_370_000), + ConstantinopleBlock: big.NewInt(7_280_000), + PetersburgBlock: big.NewInt(7_280_000), + IstanbulBlock: big.NewInt(9_069_000), + MuirGlacierBlock: big.NewInt(9_200_000), + BerlinBlock: big.NewInt(12_244_000), + LondonBlock: big.NewInt(12_965_000), + ArrowGlacierBlock: big.NewInt(13_773_000), + } + + ropstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") + ropstenChainConfig = params.ChainConfig{ + ChainID: big.NewInt(3), + HomesteadBlock: big.NewInt(0), + DAOForkBlock: nil, + DAOForkSupport: true, + EIP150Block: big.NewInt(0), + EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"), + EIP155Block: big.NewInt(10), + EIP158Block: big.NewInt(10), + ByzantiumBlock: big.NewInt(1_700_000), + ConstantinopleBlock: big.NewInt(4_230_000), + PetersburgBlock: big.NewInt(4_939_394), + IstanbulBlock: big.NewInt(6_485_846), + MuirGlacierBlock: big.NewInt(7_117_117), + BerlinBlock: big.NewInt(9_812_189), + LondonBlock: big.NewInt(10_499_401), + TerminalTotalDifficulty: big.NewInt(43531756765713534), + } +) + // TestCreation tests that different genesis and fork rule combinations result in // the correct fork ID. func TestCreation(t *testing.T) { - mergeConfig := *params.MainnetChainConfig + mergeConfig := mainnetChainConfig mergeConfig.MergeForkBlock = big.NewInt(15000000) type testcase struct { head uint64 @@ -43,8 +85,8 @@ func TestCreation(t *testing.T) { }{ // Mainnet test cases { - params.MainnetChainConfig, - params.MainnetGenesisHash, + &mainnetChainConfig, + mainnetGenesisHash, []testcase{ {0, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Unsynced {1149999, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Last Frontier block @@ -74,8 +116,8 @@ func TestCreation(t *testing.T) { }, // Ropsten test cases { - params.RopstenChainConfig, - params.RopstenGenesisHash, + &ropstenChainConfig, + ropstenGenesisHash, []testcase{ {0, ID{Hash: checksumToBytes(0x30c7ddbc), Next: 10}}, // Unsynced, last Frontier, Homestead and first Tangerine block {9, ID{Hash: checksumToBytes(0x30c7ddbc), Next: 10}}, // Last Tangerine block @@ -97,49 +139,10 @@ func TestCreation(t *testing.T) { {11000000, ID{Hash: checksumToBytes(0x7119b6b3), Next: 0}}, // Future London block }, }, - // Rinkeby test cases - { - params.RinkebyChainConfig, - params.RinkebyGenesisHash, - []testcase{ - {0, ID{Hash: checksumToBytes(0x3b8e0691), Next: 1}}, // Unsynced, last Frontier block - {1, ID{Hash: checksumToBytes(0x60949295), Next: 2}}, // First and last Homestead block - {2, ID{Hash: checksumToBytes(0x8bde40dd), Next: 3}}, // First and last Tangerine block - {3, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // First Spurious block - {1035300, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // Last Spurious block - {1035301, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // First Byzantium block - {3660662, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // Last Byzantium block - {3660663, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // First Constantinople block - {4321233, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // Last Constantinople block - {4321234, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // First Petersburg block - {5435344, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // Last Petersburg block - {5435345, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // First Istanbul block - {8290927, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // Last Istanbul block - {8290928, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // First Berlin block - {8897987, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // Last Berlin block - {8897988, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // First London block - {10000000, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // Future London block - }, - }, - // Goerli test cases - { - params.GoerliChainConfig, - params.GoerliGenesisHash, - []testcase{ - {0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block - {1561650, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Last Petersburg block - {1561651, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // First Istanbul block - {4460643, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // Last Istanbul block - {4460644, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // First Berlin block - {5000000, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // Last Berlin block - {5062605, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // First London block - {6000000, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // Future London block - }, - }, // Merge test cases { &mergeConfig, - params.MainnetGenesisHash, + mainnetGenesisHash, []testcase{ {0, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Unsynced {1149999, ID{Hash: checksumToBytes(0xfc64ec04), Next: 1150000}}, // Last Frontier block @@ -253,7 +256,7 @@ func TestValidation(t *testing.T) { {7279999, ID{Hash: checksumToBytes(0xa00bc324), Next: 7279999}, ErrLocalIncompatibleOrStale}, } for i, tt := range tests { - filter := newFilter(params.MainnetChainConfig, params.MainnetGenesisHash, func() uint64 { return tt.head }) + filter := newFilter(&mainnetChainConfig, mainnetGenesisHash, func() uint64 { return tt.head }) if err := filter(tt.id); err != tt.err { t.Errorf("test %d: validation error mismatch: have %v, want %v", i, err, tt.err) } diff --git a/core/genesis.go b/core/genesis.go index 1c69aae03..90213e822 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -23,7 +23,6 @@ import ( "errors" "fmt" "math/big" - "strings" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -35,7 +34,6 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" ) @@ -136,14 +134,8 @@ func CommitGenesisState(db ethdb.Database, hash common.Hash) error { switch hash { case params.MainnetGenesisHash: genesis = DefaultGenesisBlock() - case params.RopstenGenesisHash: - genesis = DefaultRopstenGenesisBlock() - case params.RinkebyGenesisHash: - genesis = DefaultRinkebyGenesisBlock() - case params.GoerliGenesisHash: - genesis = DefaultGoerliGenesisBlock() - case params.SepoliaGenesisHash: - genesis = DefaultSepoliaGenesisBlock() + case params.TestnetGenesisHash: + genesis = DefaultTestnetGenesisBlock() } if genesis != nil { alloc = genesis.Alloc @@ -328,16 +320,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { return g.Config case ghash == params.MainnetGenesisHash: return params.MainnetChainConfig - case ghash == params.RopstenGenesisHash: - return params.RopstenChainConfig - case ghash == params.SepoliaGenesisHash: - return params.SepoliaChainConfig - case ghash == params.RinkebyGenesisHash: - return params.RinkebyChainConfig - case ghash == params.GoerliGenesisHash: - return params.GoerliChainConfig - case ghash == params.KilnGenesisHash: - return DefaultKilnGenesisBlock().Config + case ghash == params.TestnetGenesisHash: + return params.TestnetChainConfig default: return params.AllEthashProtocolChanges } @@ -437,106 +421,32 @@ func GenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big func DefaultGenesisBlock() *Genesis { return &Genesis{ Config: params.MainnetChainConfig, - Nonce: 66, - ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"), - GasLimit: 5000, - Difficulty: big.NewInt(17179869184), - Alloc: decodePrealloc(mainnetAllocData), - } -} - -// DefaultGenesisBlock returns the Ethereum main net genesis block. -func DefaultElectroneumGenesisBlock() *Genesis { - return &Genesis{ - Config: params.ElectroneumChainConfig, Nonce: 0, Timestamp: 1492009146, ExtraData: hexutil.MustDecode("0xf87aa00000000000000000000000000000000000000000000000000000000000000000f854944c7968f79c1a414c34cd4d3c1ac7a3a8413da50c946c3d358156962440424c8c2bd5a8c79664b9956d94f27ed0217ec98beec0478a221e07471885d639a2944dd607ce3b4ec9e22fd3ce59c672fafee09cf332c080c0"), GasLimit: 16234336, Difficulty: big.NewInt(1), - Number: 0, - GasUsed: 0, Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), Coinbase: common.Address{}, Alloc: GenesisAlloc{}, } } -// DefaultRopstenGenesisBlock returns the Ropsten network genesis block. -func DefaultRopstenGenesisBlock() *Genesis { - return &Genesis{ - Config: params.RopstenChainConfig, - Nonce: 66, - ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"), - GasLimit: 16777216, - Difficulty: big.NewInt(1048576), - Alloc: decodePrealloc(ropstenAllocData), - } -} - -// DefaultRinkebyGenesisBlock returns the Rinkeby network genesis block. -func DefaultRinkebyGenesisBlock() *Genesis { - return &Genesis{ - Config: params.RinkebyChainConfig, - Timestamp: 1492009146, - ExtraData: hexutil.MustDecode("0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - GasLimit: 4700000, - Difficulty: big.NewInt(1), - Alloc: decodePrealloc(rinkebyAllocData), - } -} - // DefaultGoerliGenesisBlock returns the Görli network genesis block. -func DefaultGoerliGenesisBlock() *Genesis { +func DefaultTestnetGenesisBlock() *Genesis { return &Genesis{ - Config: params.GoerliChainConfig, - Timestamp: 1548854791, - ExtraData: hexutil.MustDecode("0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - GasLimit: 10485760, - Difficulty: big.NewInt(1), - Alloc: decodePrealloc(goerliAllocData), - } -} - -// DefaultGoerliGenesisBlock returns the Görli network genesis block. -func DefaultElectroneumTestnetGenesisBlock() *Genesis { - return &Genesis{ - Config: params.ElectroneumTestnetChainConfig, + Config: params.TestnetChainConfig, Nonce: 0, Timestamp: 1492009146, ExtraData: hexutil.MustDecode("0xf87aa00000000000000000000000000000000000000000000000000000000000000000f854944c7968f79c1a414c34cd4d3c1ac7a3a8413da50c946c3d358156962440424c8c2bd5a8c79664b9956d94f27ed0217ec98beec0478a221e07471885d639a2944dd607ce3b4ec9e22fd3ce59c672fafee09cf332c080c0"), GasLimit: 16234336, Difficulty: big.NewInt(1), - Number: 0, - GasUsed: 0, Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), Coinbase: common.Address{}, Alloc: GenesisAlloc{}, } } -// DefaultSepoliaGenesisBlock returns the Sepolia network genesis block. -func DefaultSepoliaGenesisBlock() *Genesis { - return &Genesis{ - Config: params.SepoliaChainConfig, - Nonce: 0, - ExtraData: []byte("Sepolia, Athens, Attica, Greece!"), - GasLimit: 0x1c9c380, - Difficulty: big.NewInt(0x20000), - Timestamp: 1633267481, - Alloc: decodePrealloc(sepoliaAllocData), - } -} - -func DefaultKilnGenesisBlock() *Genesis { - g := new(Genesis) - reader := strings.NewReader(KilnAllocData) - if err := json.NewDecoder(reader).Decode(g); err != nil { - panic(err) - } - return g -} - // DeveloperGenesisBlock returns the 'geth --dev' genesis block. func DeveloperGenesisBlock(period uint64, gasLimit uint64, faucet common.Address) *Genesis { // Override the default period to the user requested one @@ -568,6 +478,7 @@ func DeveloperGenesisBlock(period uint64, gasLimit uint64, faucet common.Address } } +/* func decodePrealloc(data string) GenesisAlloc { var p []struct{ Addr, Balance *big.Int } if err := rlp.NewStream(strings.NewReader(data), 0).Decode(&p); err != nil { @@ -579,3 +490,4 @@ func decodePrealloc(data string) GenesisAlloc { } return ga } +*/ diff --git a/core/genesis_test.go b/core/genesis_test.go index 8e18e8213..2e1b8ecf3 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -31,7 +31,12 @@ import ( ) func TestInvalidCliqueConfig(t *testing.T) { - block := DefaultGoerliGenesisBlock() + block := DefaultTestnetGenesisBlock() + block.Config.Istanbul = ¶ms.IstanbulConfig{} + block.Config.Clique = ¶ms.CliqueConfig{ + Period: 15, + Epoch: 30000, + } block.ExtraData = []byte{} if _, err := block.Commit(nil); err == nil { t.Fatal("Expected error on invalid clique config") @@ -92,14 +97,14 @@ func TestSetupGenesis(t *testing.T) { wantConfig: customg.Config, }, { - name: "custom block in DB, genesis == ropsten", + name: "custom block in DB, genesis == testnet", fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) { customg.MustCommit(db) - return SetupGenesisBlock(db, DefaultRopstenGenesisBlock()) + return SetupGenesisBlock(db, DefaultTestnetGenesisBlock()) }, - wantErr: &GenesisMismatchError{Stored: customghash, New: params.RopstenGenesisHash}, - wantHash: params.RopstenGenesisHash, - wantConfig: params.RopstenChainConfig, + wantErr: &GenesisMismatchError{Stored: customghash, New: params.TestnetGenesisHash}, + wantHash: params.TestnetGenesisHash, + wantConfig: params.TestnetChainConfig, }, { name: "compatible config in DB", @@ -168,10 +173,7 @@ func TestGenesisHashes(t *testing.T) { want common.Hash }{ {DefaultGenesisBlock(), params.MainnetGenesisHash}, - {DefaultGoerliGenesisBlock(), params.GoerliGenesisHash}, - {DefaultRopstenGenesisBlock(), params.RopstenGenesisHash}, - {DefaultRinkebyGenesisBlock(), params.RinkebyGenesisHash}, - {DefaultSepoliaGenesisBlock(), params.SepoliaGenesisHash}, + {DefaultTestnetGenesisBlock(), params.TestnetGenesisHash}, } { // Test via MustCommit if have := c.genesis.MustCommit(rawdb.NewMemoryDatabase()).Hash(); have != c.want { diff --git a/core/rawdb/accessors_indexes_test.go b/core/rawdb/accessors_indexes_test.go index 4734e986e..43fd6f1c5 100644 --- a/core/rawdb/accessors_indexes_test.go +++ b/core/rawdb/accessors_indexes_test.go @@ -141,7 +141,7 @@ func TestDeleteBloomBits(t *testing.T) { for i := uint(0); i < 2; i++ { for s := uint64(0); s < 2; s++ { WriteBloomBits(db, i, s, params.MainnetGenesisHash, []byte{0x01, 0x02}) - WriteBloomBits(db, i, s, params.RinkebyGenesisHash, []byte{0x01, 0x02}) + WriteBloomBits(db, i, s, params.TestnetGenesisHash, []byte{0x01, 0x02}) } } check := func(bit uint, section uint64, head common.Hash, exist bool) { @@ -155,25 +155,25 @@ func TestDeleteBloomBits(t *testing.T) { } // Check the existence of written data. check(0, 0, params.MainnetGenesisHash, true) - check(0, 0, params.RinkebyGenesisHash, true) + check(0, 0, params.TestnetGenesisHash, true) // Check the existence of deleted data. DeleteBloombits(db, 0, 0, 1) check(0, 0, params.MainnetGenesisHash, false) - check(0, 0, params.RinkebyGenesisHash, false) + check(0, 0, params.TestnetGenesisHash, false) check(0, 1, params.MainnetGenesisHash, true) - check(0, 1, params.RinkebyGenesisHash, true) + check(0, 1, params.TestnetGenesisHash, true) // Check the existence of deleted data. DeleteBloombits(db, 0, 0, 2) check(0, 0, params.MainnetGenesisHash, false) - check(0, 0, params.RinkebyGenesisHash, false) + check(0, 0, params.TestnetGenesisHash, false) check(0, 1, params.MainnetGenesisHash, false) - check(0, 1, params.RinkebyGenesisHash, false) + check(0, 1, params.TestnetGenesisHash, false) // Bit1 shouldn't be affect. check(1, 0, params.MainnetGenesisHash, true) - check(1, 0, params.RinkebyGenesisHash, true) + check(1, 0, params.TestnetGenesisHash, true) check(1, 1, params.MainnetGenesisHash, true) - check(1, 1, params.RinkebyGenesisHash, true) + check(1, 1, params.TestnetGenesisHash, true) } diff --git a/eth/backend.go b/eth/backend.go index f1e53998d..de07a6401 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -205,11 +205,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { if bcVersion != nil { dbVer = fmt.Sprintf("%d", *bcVersion) } - log.Info("Initialising Ethereum protocol", "network", config.NetworkId, "dbversion", dbVer) - // Quorum - if chainConfig.IsQuorum { - log.Info("Initialising Quorum consensus protocol", "name", quorumConsensusProtocolName, "versions", quorumConsensusProtocolVersions, "network", config.NetworkId, "dbversion", dbVer) - } + + log.Info("Initialising protocol", "name", quorumConsensusProtocolName, "versions", quorumConsensusProtocolVersions, "network", config.NetworkId, "dbversion", dbVer) if !config.SkipBcVersionCheck { if bcVersion != nil && *bcVersion > core.BlockChainVersion { diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index ddaba8177..df11e2bd5 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -74,7 +74,7 @@ var Defaults = Config{ DatasetsOnDisk: 2, DatasetsLockMmap: false, }, - NetworkId: 1, + NetworkId: 52014, TxLookupLimit: 2350000, LightPeers: 100, UltraLightFraction: 75, diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index cbf20ed00..61a9b12bc 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -357,13 +357,19 @@ func TestZeroValueToNotExitCall(t *testing.T) { Balance: big.NewInt(500000000000000), }, } + + var testchainConfig = params.MainnetChainConfig + testchainConfig.IstanbulBlock = big.NewInt(9_069_000) + testchainConfig.BerlinBlock = big.NewInt(12_244_000) + testchainConfig.LondonBlock = big.NewInt(12_965_000) + _, statedb := tests.MakePreState(rawdb.NewMemoryDatabase(), alloc, false) // Create the tracer, the EVM environment and run it tracer, err := tracers.New("callTracer", nil) if err != nil { t.Fatalf("failed to create call tracer: %v", err) } - evm := vm.NewEVM(context, txContext, statedb, params.MainnetChainConfig, vm.Config{Debug: true, Tracer: tracer}) + evm := vm.NewEVM(context, txContext, statedb, testchainConfig, vm.Config{Debug: true, Tracer: tracer}) msg, err := tx.AsMessage(signer, nil) if err != nil { t.Fatalf("failed to prepare transaction for tracing: %v", err) diff --git a/miner/stress/1559/main.go b/miner/stress/1559/main.go index 9c1ab0f4a..e7438cbbe 100644 --- a/miner/stress/1559/main.go +++ b/miner/stress/1559/main.go @@ -193,7 +193,7 @@ func makeTransaction(nonce uint64, privKey *ecdsa.PrivateKey, signer types.Signe // makeGenesis creates a custom Ethash genesis block based on some pre-defined // faucet accounts. func makeGenesis(faucets []*ecdsa.PrivateKey) *core.Genesis { - genesis := core.DefaultRopstenGenesisBlock() + genesis := core.DefaultTestnetGenesisBlock() genesis.Config = params.AllEthashProtocolChanges genesis.Config.LondonBlock = londonBlock diff --git a/miner/stress/beacon/main.go b/miner/stress/beacon/main.go index 3f751049b..646ea129f 100644 --- a/miner/stress/beacon/main.go +++ b/miner/stress/beacon/main.go @@ -441,7 +441,7 @@ func main() { // makeGenesis creates a custom Ethash genesis block based on some pre-defined // faucet accounts. func makeGenesis(faucets []*ecdsa.PrivateKey) *core.Genesis { - genesis := core.DefaultRopstenGenesisBlock() + genesis := core.DefaultTestnetGenesisBlock() genesis.Difficulty = params.MinimumDifficulty genesis.GasLimit = 25000000 diff --git a/miner/stress/clique/main.go b/miner/stress/clique/main.go index 070a6ed60..b10fad30a 100644 --- a/miner/stress/clique/main.go +++ b/miner/stress/clique/main.go @@ -147,7 +147,7 @@ func main() { // signer and faucet accounts. func makeGenesis(faucets []*ecdsa.PrivateKey, sealers []*ecdsa.PrivateKey) *core.Genesis { // Create a Clique network based off of the Rinkeby config - genesis := core.DefaultRinkebyGenesisBlock() + genesis := core.DefaultTestnetGenesisBlock() genesis.GasLimit = 25000000 genesis.Config.ChainID = big.NewInt(18) diff --git a/miner/stress/ethash/main.go b/miner/stress/ethash/main.go index 56a6e5817..f89a7794d 100644 --- a/miner/stress/ethash/main.go +++ b/miner/stress/ethash/main.go @@ -133,7 +133,7 @@ func main() { // makeGenesis creates a custom Ethash genesis block based on some pre-defined // faucet accounts. func makeGenesis(faucets []*ecdsa.PrivateKey) *core.Genesis { - genesis := core.DefaultRopstenGenesisBlock() + genesis := core.DefaultTestnetGenesisBlock() genesis.Difficulty = params.MinimumDifficulty genesis.GasLimit = 25000000 diff --git a/mobile/geth.go b/mobile/geth.go index 709b68cbd..ef1e4478e 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -159,31 +159,10 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) { return nil, fmt.Errorf("invalid genesis spec: %v", err) } // If we have the Ropsten testnet, hard code the chain configs too - if config.EthereumGenesis == RopstenGenesis() { - genesis.Config = params.RopstenChainConfig + if config.EthereumGenesis == TestnetGenesis() { + genesis.Config = params.TestnetChainConfig if config.EthereumNetworkID == 1 { - config.EthereumNetworkID = 3 - } - } - // If we have the Sepolia testnet, hard code the chain configs too - if config.EthereumGenesis == SepoliaGenesis() { - genesis.Config = params.SepoliaChainConfig - if config.EthereumNetworkID == 1 { - config.EthereumNetworkID = 11155111 - } - } - // If we have the Rinkeby testnet, hard code the chain configs too - if config.EthereumGenesis == RinkebyGenesis() { - genesis.Config = params.RinkebyChainConfig - if config.EthereumNetworkID == 1 { - config.EthereumNetworkID = 4 - } - } - // If we have the Goerli testnet, hard code the chain configs too - if config.EthereumGenesis == GoerliGenesis() { - genesis.Config = params.GoerliChainConfig - if config.EthereumNetworkID == 1 { - config.EthereumNetworkID = 5 + config.EthereumNetworkID = 5201420 } } } diff --git a/mobile/params.go b/mobile/params.go index 2f4240b2e..17f3df334 100644 --- a/mobile/params.go +++ b/mobile/params.go @@ -32,36 +32,9 @@ func MainnetGenesis() string { return "" } -// RopstenGenesis returns the JSON spec to use for the Ropsten test network. -func RopstenGenesis() string { - enc, err := json.Marshal(core.DefaultRopstenGenesisBlock()) - if err != nil { - panic(err) - } - return string(enc) -} - -// SepoliaGenesis returns the JSON spec to use for the Sepolia test network. -func SepoliaGenesis() string { - enc, err := json.Marshal(core.DefaultSepoliaGenesisBlock()) - if err != nil { - panic(err) - } - return string(enc) -} - -// RinkebyGenesis returns the JSON spec to use for the Rinkeby test network -func RinkebyGenesis() string { - enc, err := json.Marshal(core.DefaultRinkebyGenesisBlock()) - if err != nil { - panic(err) - } - return string(enc) -} - -// GoerliGenesis returns the JSON spec to use for the Goerli test network -func GoerliGenesis() string { - enc, err := json.Marshal(core.DefaultGoerliGenesisBlock()) +// TestnetGenesis returns the JSON spec to use for the Testnet network. +func TestnetGenesis() string { + enc, err := json.Marshal(core.DefaultTestnetGenesisBlock()) if err != nil { panic(err) } diff --git a/params/bootnodes.go b/params/bootnodes.go index 35c3f8030..124bff392 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -19,94 +19,14 @@ package params import "github.com/ethereum/go-ethereum/common" // MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on -// the main Ethereum network. -var MainnetBootnodes = []string{ - // Ethereum Foundation Go Bootnodes - "enode://d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666@18.138.108.67:30303", // bootnode-aws-ap-southeast-1-001 - "enode://22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de@3.209.45.79:30303", // bootnode-aws-us-east-1-001 - "enode://8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a@52.187.207.27:30303", // bootnode-azure-australiaeast-001 - "enode://103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1@191.234.162.198:30303", // bootnode-azure-brazilsouth-001 - "enode://715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8@52.231.165.108:30303", // bootnode-azure-koreasouth-001 - "enode://5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f@104.42.217.25:30303", // bootnode-azure-westus-001 - "enode://2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc@65.108.70.101:30303", // bootnode-hetzner-hel - "enode://4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052@157.90.35.166:30303", // bootnode-hetzner-fsn -} - -// ElectroneumBootnodes are the enode URLs of the P2P bootstrap nodes running on // the main Electroneum network. -var ElectroneumBootnodes = []string{} - -// RopstenBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Ropsten test network. -var RopstenBootnodes = []string{ - "enode://30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606@52.176.7.10:30303", // US-Azure geth - "enode://865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c@52.176.100.77:30303", // US-Azure parity - "enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303", // Parity - "enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303", // @gpip -} - -// SepoliaBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Sepolia test network. -var SepoliaBootnodes = []string{ - // geth - "enode://9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066@18.168.182.86:30303", - // besu - "enode://ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7@52.14.151.177:30303", -} - -// RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Rinkeby test network. -var RinkebyBootnodes = []string{ - "enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303", // IE - "enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303", // INFURA - "enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA -} +var MainnetBootnodes = []string{} -// GoerliBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Görli test network. -var GoerliBootnodes = []string{ - // Upstream bootnodes - "enode://011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a@51.141.78.53:30303", - "enode://176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b@13.93.54.137:30303", - "enode://46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291@94.237.54.114:30313", - "enode://b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949@18.218.250.66:30303", - - // Ethereum Foundation bootnode - "enode://a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91@3.11.147.67:30303", - - // Goerli Initiative bootnodes - "enode://d4f764a48ec2a8ecf883735776fdefe0a3949eb0ca476bd7bc8d0954a9defe8fea15ae5da7d40b5d2d59ce9524a99daedadf6da6283fca492cc80b53689fb3b3@46.4.99.122:32109", - "enode://d2b720352e8216c9efc470091aa91ddafc53e222b32780f505c817ceef69e01d5b0b0797b69db254c586f493872352f5a022b4d8479a00fc92ec55f9ad46a27e@88.99.70.182:30303", -} - -// ElectroneumTestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on +// TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on // the main Electroneum Testnet network. -var ElectroneumTestnetBootnodes = []string{} +var TestnetBootnodes = []string{} -var KilnBootnodes = []string{ - "enode://c354db99124f0faf677ff0e75c3cbbd568b2febc186af664e0c51ac435609badedc67a18a63adb64dacc1780a28dcefebfc29b83fd1a3f4aa3c0eb161364cf94@164.92.130.5:30303", - "enode://d41af1662434cad0a88fe3c7c92375ec5719f4516ab6d8cb9695e0e2e815382c767038e72c224e04040885157da47422f756c040a9072676c6e35c5b1a383cce@138.68.66.103:30303", - "enode://91a745c3fb069f6b99cad10b75c463d527711b106b622756e9ef9f12d2631b6cb885f831d1c8731b9bc7177cae5e1ea1f1be087f86d7d30b590a91f22bc041b0@165.232.180.230:30303", - "enode://b74bd2e8a9f0c53f0c93bcce80818f2f19439fd807af5c7fbc3efb10130c6ee08be8f3aaec7dc0a057ad7b2a809c8f34dc62431e9b6954b07a6548cc59867884@164.92.140.200:30303", -} - -var V5Bootnodes = []string{ - // Teku team's bootnode - "enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA", - "enr:-KG4QDyytgmE4f7AnvW-ZaUOIi9i79qX4JwjRAiXBZCU65wOfBu-3Nb5I7b_Rmg3KCOcZM_C3y5pg7EBU5XGrcLTduQEhGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaEDKnz_-ps3UUOfHWVYaskI5kWYO_vtYMGYCQRAR3gHDouDdGNwgiMog3VkcIIjKA", - // Prylab team's bootnodes - "enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wnpuC3gvSC8AfbFOnZY_On34wIN1ZHCCIyg", - "enr:-Ku4QP2xDnEtUXIjzJ_DhlCRN9SN99RYQPJL92TMlSv7U5C1YnYLjwOQHgZIUXw6c-BvRg2Yc2QsZxxoS_pPRVe0yK8Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMeFF5GrS7UZpAH2Ly84aLK-TyvH-dRo0JM1i8yygH50YN1ZHCCJxA", - "enr:-Ku4QPp9z1W4tAO8Ber_NQierYaOStqhDqQdOPY3bB3jDgkjcbk6YrEnVYIiCBbTxuar3CzS528d2iE7TdJsrL-dEKoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMw5fqqkw2hHC4F5HZZDPsNmPdB1Gi8JPQK7pRc9XHh-oN1ZHCCKvg", - // Lighthouse team's bootnodes - "enr:-IS4QLkKqDMy_ExrpOEWa59NiClemOnor-krjp4qoeZwIw2QduPC-q7Kz4u1IOWf3DDbdxqQIgC4fejavBOuUPy-HE4BgmlkgnY0gmlwhCLzAHqJc2VjcDI1NmsxoQLQSJfEAHZApkm5edTCZ_4qps_1k_ub2CxHFxi-gr2JMIN1ZHCCIyg", - "enr:-IS4QDAyibHCzYZmIYZCjXwU9BqpotWmv2BsFlIq1V31BwDDMJPFEbox1ijT5c2Ou3kvieOKejxuaCqIcjxBjJ_3j_cBgmlkgnY0gmlwhAMaHiCJc2VjcDI1NmsxoQJIdpj_foZ02MXz4It8xKD7yUHTBx7lVFn3oeRP21KRV4N1ZHCCIyg", - // EF bootnodes - "enr:-Ku4QHqVeJ8PPICcWk1vSn_XcSkjOkNiTg6Fmii5j6vUQgvzMc9L1goFnLKgXqBJspJjIsB91LTOleFmyWWrFVATGngBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhAMRHkWJc2VjcDI1NmsxoQKLVXFOhp2uX6jeT0DvvDpPcU8FWMjQdR4wMuORMhpX24N1ZHCCIyg", - "enr:-Ku4QG-2_Md3sZIAUebGYT6g0SMskIml77l6yR-M_JXc-UdNHCmHQeOiMLbylPejyJsdAPsTHJyjJB2sYGDLe0dn8uYBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhBLY-NyJc2VjcDI1NmsxoQORcM6e19T1T9gi7jxEZjk_sjVLGFscUNqAY9obgZaxbIN1ZHCCIyg", - "enr:-Ku4QPn5eVhcoF1opaFEvg1b6JNFD2rqVkHQ8HApOKK61OIcIXD127bKWgAtbwI7pnxx6cDyk_nI88TrZKQaGMZj0q0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDayLMaJc2VjcDI1NmsxoQK2sBOLGcUb4AwuYzFuAVCaNHA-dy24UuEKkeFNgCVCsIN1ZHCCIyg", - "enr:-Ku4QEWzdnVtXc2Q0ZVigfCGggOVB2Vc1ZCPEc6j21NIFLODSJbvNaef1g4PxhPwl_3kax86YPheFUSLXPRs98vvYsoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDZBrP2Jc2VjcDI1NmsxoQM6jr8Rb1ktLEsVcKAPa08wCsKUmvoQ8khiOl_SLozf9IN1ZHCCIyg", -} +var V5Bootnodes = []string{} const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" @@ -118,12 +38,8 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string { switch genesis { case MainnetGenesisHash: net = "mainnet" - case RopstenGenesisHash: - net = "ropsten" - case RinkebyGenesisHash: - net = "rinkeby" - case GoerliGenesisHash: - net = "goerli" + case TestnetGenesisHash: + net = "testnet" default: return "" } diff --git a/params/config.go b/params/config.go index 6f8feab87..692883c21 100644 --- a/params/config.go +++ b/params/config.go @@ -27,80 +27,21 @@ import ( // Genesis hashes to enforce below configs on. var ( - MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3") - ElectroneumGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") - RopstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") - SepoliaGenesisHash = common.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9") - RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") - GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") - ElectroneumTestnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") - KilnGenesisHash = common.HexToHash("0x51c7fe41be669f69c45c33a56982cbde405313342d9e2b00d7c91a7b284dd4f8") + MainnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") + TestnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of // the chain it belongs to. -var TrustedCheckpoints = map[common.Hash]*TrustedCheckpoint{ - MainnetGenesisHash: MainnetTrustedCheckpoint, - RopstenGenesisHash: RopstenTrustedCheckpoint, - SepoliaGenesisHash: SepoliaTrustedCheckpoint, - RinkebyGenesisHash: RinkebyTrustedCheckpoint, - GoerliGenesisHash: GoerliTrustedCheckpoint, -} +var TrustedCheckpoints = map[common.Hash]*TrustedCheckpoint{} // CheckpointOracles associates each known checkpoint oracles with the genesis hash of // the chain it belongs to. -var CheckpointOracles = map[common.Hash]*CheckpointOracleConfig{ - MainnetGenesisHash: MainnetCheckpointOracle, - RopstenGenesisHash: RopstenCheckpointOracle, - RinkebyGenesisHash: RinkebyCheckpointOracle, - GoerliGenesisHash: GoerliCheckpointOracle, -} +var CheckpointOracles = map[common.Hash]*CheckpointOracleConfig{} var ( // MainnetChainConfig is the chain parameters to run a node on the main network. MainnetChainConfig = &ChainConfig{ - ChainID: big.NewInt(1), - HomesteadBlock: big.NewInt(1_150_000), - DAOForkBlock: big.NewInt(1_920_000), - DAOForkSupport: true, - EIP150Block: big.NewInt(2_463_000), - EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"), - EIP155Block: big.NewInt(2_675_000), - EIP158Block: big.NewInt(2_675_000), - ByzantiumBlock: big.NewInt(4_370_000), - ConstantinopleBlock: big.NewInt(7_280_000), - PetersburgBlock: big.NewInt(7_280_000), - IstanbulBlock: big.NewInt(9_069_000), - MuirGlacierBlock: big.NewInt(9_200_000), - BerlinBlock: big.NewInt(12_244_000), - LondonBlock: big.NewInt(12_965_000), - ArrowGlacierBlock: big.NewInt(13_773_000), - Ethash: new(EthashConfig), - } - - // MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network. - MainnetTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 451, - SectionHead: common.HexToHash("0xe47f84b9967eb2ad2afff74d59901b63134660011822fdababaf8fdd18a75aa6"), - CHTRoot: common.HexToHash("0xc31e0462ca3d39a46111bb6b63ac4e1cac84089472b7474a319d582f72b3f0c0"), - BloomRoot: common.HexToHash("0x7c9f25ce3577a3ab330d52a7343f801899cf9d4980c69f81de31ccc1a055c809"), - } - - // MainnetCheckpointOracle contains a set of configs for the main network oracle. - MainnetCheckpointOracle = &CheckpointOracleConfig{ - Address: common.HexToAddress("0x9a9070028361F7AAbeB3f2F2Dc07F82C4a98A02a"), - Signers: []common.Address{ - common.HexToAddress("0x1b2C260efc720BE89101890E4Db589b44E950527"), // Peter - common.HexToAddress("0x78d1aD571A1A09D60D9BBf25894b44e4C8859595"), // Martin - common.HexToAddress("0x286834935f4A8Cfb4FF4C77D5770C2775aE2b0E7"), // Zsolt - common.HexToAddress("0xb86e2B0Ab5A4B1373e40c51A7C712c70Ba2f9f8E"), // Gary - common.HexToAddress("0x0DF8fa387C602AE62559cC4aFa4972A7045d6707"), // Guillaume - }, - Threshold: 2, - } - - // ElectroneumChainConfig is the chain parameters to run a node on the main network. - ElectroneumChainConfig = &ChainConfig{ ChainID: big.NewInt(52014), HomesteadBlock: big.NewInt(0), DAOForkBlock: nil, @@ -125,165 +66,8 @@ var ( IsQuorum: true, } - // RopstenChainConfig contains the chain parameters to run a node on the Ropsten test network. - RopstenChainConfig = &ChainConfig{ - ChainID: big.NewInt(3), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"), - EIP155Block: big.NewInt(10), - EIP158Block: big.NewInt(10), - ByzantiumBlock: big.NewInt(1_700_000), - ConstantinopleBlock: big.NewInt(4_230_000), - PetersburgBlock: big.NewInt(4_939_394), - IstanbulBlock: big.NewInt(6_485_846), - MuirGlacierBlock: big.NewInt(7_117_117), - BerlinBlock: big.NewInt(9_812_189), - LondonBlock: big.NewInt(10_499_401), - TerminalTotalDifficulty: big.NewInt(43531756765713534), - Ethash: new(EthashConfig), - } - - // RopstenTrustedCheckpoint contains the light client trusted checkpoint for the Ropsten test network. - RopstenTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 346, - SectionHead: common.HexToHash("0xafa0384ebd13a751fb7475aaa7fc08ac308925c8b2e2195bca2d4ab1878a7a84"), - CHTRoot: common.HexToHash("0x522ae1f334bfa36033b2315d0b9954052780700b69448ecea8d5877e0f7ee477"), - BloomRoot: common.HexToHash("0x4093fd53b0d2cc50181dca353fe66f03ae113e7cb65f869a4dfb5905de6a0493"), - } - - // RopstenCheckpointOracle contains a set of configs for the Ropsten test network oracle. - RopstenCheckpointOracle = &CheckpointOracleConfig{ - Address: common.HexToAddress("0xEF79475013f154E6A65b54cB2742867791bf0B84"), - Signers: []common.Address{ - common.HexToAddress("0x32162F3581E88a5f62e8A61892B42C46E2c18f7b"), // Peter - common.HexToAddress("0x78d1aD571A1A09D60D9BBf25894b44e4C8859595"), // Martin - common.HexToAddress("0x286834935f4A8Cfb4FF4C77D5770C2775aE2b0E7"), // Zsolt - common.HexToAddress("0xb86e2B0Ab5A4B1373e40c51A7C712c70Ba2f9f8E"), // Gary - common.HexToAddress("0x0DF8fa387C602AE62559cC4aFa4972A7045d6707"), // Guillaume - }, - Threshold: 2, - } - - // SepoliaChainConfig contains the chain parameters to run a node on the Sepolia test network. - SepoliaChainConfig = &ChainConfig{ - ChainID: big.NewInt(11155111), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - Ethash: new(EthashConfig), - } - - // SepoliaTrustedCheckpoint contains the light client trusted checkpoint for the Sepolia test network. - SepoliaTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 34, - SectionHead: common.HexToHash("0xe361400fcbc468d641e7bdd0b0946a3548e97c5d2703b124f04a3f1deccec244"), - CHTRoot: common.HexToHash("0xea6768fd288dce7d84f590884908ec39e4de78e6e1a38de5c5419b0f49a42f91"), - BloomRoot: common.HexToHash("0x06d32f35d5a611bfd0333ad44e39c619449824167d8ef2913edc48a8112be2cd"), - } - - // RinkebyChainConfig contains the chain parameters to run a node on the Rinkeby test network. - RinkebyChainConfig = &ChainConfig{ - ChainID: big.NewInt(4), - HomesteadBlock: big.NewInt(1), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(2), - EIP150Hash: common.HexToHash("0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"), - EIP155Block: big.NewInt(3), - EIP158Block: big.NewInt(3), - ByzantiumBlock: big.NewInt(1_035_301), - ConstantinopleBlock: big.NewInt(3_660_663), - PetersburgBlock: big.NewInt(4_321_234), - IstanbulBlock: big.NewInt(5_435_345), - MuirGlacierBlock: nil, - BerlinBlock: big.NewInt(8_290_928), - LondonBlock: big.NewInt(8_897_988), - ArrowGlacierBlock: nil, - Clique: &CliqueConfig{ - Period: 15, - Epoch: 30000, - }, - } - - // RinkebyTrustedCheckpoint contains the light client trusted checkpoint for the Rinkeby test network. - RinkebyTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 326, - SectionHead: common.HexToHash("0x941a41a153b0e36cb15d9d193d1d0f9715bdb2435efd1c95119b64168667ce00"), - CHTRoot: common.HexToHash("0xe2331e00d579cf4093091dee35bef772e63c2341380c276041dc22563c8aba2e"), - BloomRoot: common.HexToHash("0x595206febcf118958c2bc1218ea71d01fd04b8f97ad71813df4be0af5b36b0e5"), - } - - // RinkebyCheckpointOracle contains a set of configs for the Rinkeby test network oracle. - RinkebyCheckpointOracle = &CheckpointOracleConfig{ - Address: common.HexToAddress("0xebe8eFA441B9302A0d7eaECc277c09d20D684540"), - Signers: []common.Address{ - common.HexToAddress("0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3"), // Peter - common.HexToAddress("0x78d1aD571A1A09D60D9BBf25894b44e4C8859595"), // Martin - common.HexToAddress("0x286834935f4A8Cfb4FF4C77D5770C2775aE2b0E7"), // Zsolt - common.HexToAddress("0xb86e2B0Ab5A4B1373e40c51A7C712c70Ba2f9f8E"), // Gary - }, - Threshold: 2, - } - - // GoerliChainConfig contains the chain parameters to run a node on the Görli test network. - GoerliChainConfig = &ChainConfig{ - ChainID: big.NewInt(5), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(1_561_651), - MuirGlacierBlock: nil, - BerlinBlock: big.NewInt(4_460_644), - LondonBlock: big.NewInt(5_062_605), - ArrowGlacierBlock: nil, - Clique: &CliqueConfig{ - Period: 15, - Epoch: 30000, - }, - } - - // GoerliTrustedCheckpoint contains the light client trusted checkpoint for the Görli test network. - GoerliTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 210, - SectionHead: common.HexToHash("0xbb11eaf551a6c06f74a6c7bbfe1699cbf64b8f248b64691da916dd443176db2f"), - CHTRoot: common.HexToHash("0x9934ae326d00d9c7de2e074c0e51689efb7fa7fcba18929ff4279c27259c45e6"), - BloomRoot: common.HexToHash("0x7fe3bd4fd45194aa8a5cfe5ac590edff1f870d3d98d3c310494e7f67613a87ff"), - } - - // GoerliCheckpointOracle contains a set of configs for the Goerli test network oracle. - GoerliCheckpointOracle = &CheckpointOracleConfig{ - Address: common.HexToAddress("0x18CA0E045F0D772a851BC7e48357Bcaab0a0795D"), - Signers: []common.Address{ - common.HexToAddress("0x4769bcaD07e3b938B7f43EB7D278Bc7Cb9efFb38"), // Peter - common.HexToAddress("0x78d1aD571A1A09D60D9BBf25894b44e4C8859595"), // Martin - common.HexToAddress("0x286834935f4A8Cfb4FF4C77D5770C2775aE2b0E7"), // Zsolt - common.HexToAddress("0xb86e2B0Ab5A4B1373e40c51A7C712c70Ba2f9f8E"), // Gary - common.HexToAddress("0x0DF8fa387C602AE62559cC4aFa4972A7045d6707"), // Guillaume - }, - Threshold: 2, - } - - // ElectroneumTestnetChainConfig is the chain parameters to run a node on the main network. - ElectroneumTestnetChainConfig = &ChainConfig{ + // TestnetChainConfig is the chain parameters to run a node on the test network. + TestnetChainConfig = &ChainConfig{ ChainID: big.NewInt(5201420), HomesteadBlock: big.NewInt(0), DAOForkBlock: nil, diff --git a/tests/difficulty_test.go b/tests/difficulty_test.go index 192dff12c..9144fa5e0 100644 --- a/tests/difficulty_test.go +++ b/tests/difficulty_test.go @@ -36,6 +36,25 @@ var ( EIP158Block: big.NewInt(2675000), ByzantiumBlock: big.NewInt(4370000), } + + ropstenChainConfig = params.ChainConfig{ + ChainID: big.NewInt(3), + HomesteadBlock: big.NewInt(0), + DAOForkBlock: nil, + DAOForkSupport: true, + EIP150Block: big.NewInt(0), + EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"), + EIP155Block: big.NewInt(10), + EIP158Block: big.NewInt(10), + ByzantiumBlock: big.NewInt(1_700_000), + ConstantinopleBlock: big.NewInt(4_230_000), + PetersburgBlock: big.NewInt(4_939_394), + IstanbulBlock: big.NewInt(6_485_846), + MuirGlacierBlock: big.NewInt(7_117_117), + BerlinBlock: big.NewInt(9_812_189), + LondonBlock: big.NewInt(10_499_401), + TerminalTotalDifficulty: big.NewInt(43531756765713534), + } ) func TestDifficulty(t *testing.T) { @@ -55,8 +74,8 @@ func TestDifficulty(t *testing.T) { dt.skipLoad("difficultyMorden\\.json") dt.skipLoad("difficultyOlimpic\\.json") - dt.config("Ropsten", *params.RopstenChainConfig) - dt.config("Morden", *params.RopstenChainConfig) + dt.config("Ropsten", ropstenChainConfig) + dt.config("Morden", ropstenChainConfig) dt.config("Frontier", params.ChainConfig{}) dt.config("Homestead", params.ChainConfig{ @@ -67,7 +86,7 @@ func TestDifficulty(t *testing.T) { ByzantiumBlock: big.NewInt(0), }) - dt.config("Frontier", *params.RopstenChainConfig) + dt.config("Frontier", ropstenChainConfig) dt.config("MainNetwork", mainnetChainConfig) dt.config("CustomMainNetwork", mainnetChainConfig) dt.config("Constantinople", params.ChainConfig{ From 165834b306891f8cf59bded47963333028d227af Mon Sep 17 00:00:00 2001 From: andrepatta Date: Sat, 18 Jun 2022 23:04:34 -0300 Subject: [PATCH 05/30] consensus/eth/params: always use Ceil2Nby3 for istanbul consensus messages --- consensus/istanbul/config.go | 2 -- consensus/istanbul/ibft/core/commit_test.go | 4 ++-- consensus/istanbul/ibft/core/core.go | 5 ----- consensus/istanbul/ibft/core/prepare_test.go | 2 +- consensus/istanbul/qbft/core/core.go | 5 ----- eth/ethconfig/config.go | 4 ---- params/config.go | 18 +++++++----------- 7 files changed, 10 insertions(+), 30 deletions(-) diff --git a/consensus/istanbul/config.go b/consensus/istanbul/config.go index b9266873e..0dcc1a9dd 100644 --- a/consensus/istanbul/config.go +++ b/consensus/istanbul/config.go @@ -122,7 +122,6 @@ type Config struct { BlockPeriod uint64 `toml:",omitempty"` // Default minimum difference between two consecutive block's timestamps in second ProposerPolicy *ProposerPolicy `toml:",omitempty"` // The policy for proposer selection Epoch uint64 `toml:",omitempty"` // The number of blocks after which to checkpoint and reset the pending votes - Ceil2Nby3Block *big.Int `toml:",omitempty"` // Number of confirmations required to move from one state to next [2F + 1 to Ceil(2N/3)] AllowedFutureBlockTime uint64 `toml:",omitempty"` // Max time (in seconds) from current time allowed for blocks, before they're considered future blocks TestQBFTBlock *big.Int `toml:",omitempty"` // Fork block at which block confirmations are done using qbft consensus instead of ibft } @@ -132,7 +131,6 @@ var DefaultConfig = &Config{ BlockPeriod: 5, ProposerPolicy: NewRoundRobinProposerPolicy(), Epoch: 30000, - Ceil2Nby3Block: big.NewInt(0), AllowedFutureBlockTime: 0, TestQBFTBlock: big.NewInt(0), } diff --git a/consensus/istanbul/ibft/core/commit_test.go b/consensus/istanbul/ibft/core/commit_test.go index d0b8a8f8e..ea9261745 100644 --- a/consensus/istanbul/ibft/core/commit_test.go +++ b/consensus/istanbul/ibft/core/commit_test.go @@ -202,9 +202,9 @@ OUTER: continue } - // core should have 2F+1 before Ceil2Nby3Block or Ceil(2N/3) prepare messages + // core should have Ceil(2N/3) prepare messages if r0.current.Commits.Size() < r0.QuorumSize() { - t.Errorf("the size of commit messages should be larger than 2F+1 or Ceil(2N/3): size %v", r0.QuorumSize()) + t.Errorf("the size of commit messages should be larger than Ceil(2N/3): size %v", r0.QuorumSize()) } // check signatures large than F diff --git a/consensus/istanbul/ibft/core/core.go b/consensus/istanbul/ibft/core/core.go index ce940fbb6..28babb3ec 100644 --- a/consensus/istanbul/ibft/core/core.go +++ b/consensus/istanbul/ibft/core/core.go @@ -347,11 +347,6 @@ func (c *core) checkValidatorSignature(data []byte, sig []byte) (common.Address, } func (c *core) QuorumSize() int { - if c.config.Ceil2Nby3Block == nil || (c.current != nil && c.current.sequence.Cmp(c.config.Ceil2Nby3Block) < 0) { - c.logger.Trace("Confirmation Formula used 2F+ 1") - return (2 * c.valSet.F()) + 1 - } - c.logger.Trace("Confirmation Formula used ceil(2N/3)") return int(math.Ceil(float64(2*c.valSet.Size()) / 3)) } diff --git a/consensus/istanbul/ibft/core/prepare_test.go b/consensus/istanbul/ibft/core/prepare_test.go index 82f7aa37a..ff49e9c83 100644 --- a/consensus/istanbul/ibft/core/prepare_test.go +++ b/consensus/istanbul/ibft/core/prepare_test.go @@ -226,7 +226,7 @@ OUTER: continue } - // core should have 2F+1 before Ceil2Nby3Block and Ceil(2N/3) after Ceil2Nby3Block PREPARE messages + // core should have Ceil(2N/3) PREPARE messages if r0.current.Prepares.Size() < r0.QuorumSize() { t.Errorf("the size of PREPARE messages should be larger than 2F+1 or ceil(2N/3): size %v", r0.current.Commits.Size()) } diff --git a/consensus/istanbul/qbft/core/core.go b/consensus/istanbul/qbft/core/core.go index 5045fdc8b..8eea88dad 100644 --- a/consensus/istanbul/qbft/core/core.go +++ b/consensus/istanbul/qbft/core/core.go @@ -268,11 +268,6 @@ func (c *core) checkValidatorSignature(data []byte, sig []byte) (common.Address, } func (c *core) QuorumSize() int { - if c.config.Ceil2Nby3Block == nil || (c.current != nil && c.current.sequence.Cmp(c.config.Ceil2Nby3Block) < 0) { - c.currentLogger(true, nil).Trace("QBFT: confirmation Formula used 2F+ 1") - return (2 * c.valSet.F()) + 1 - } - c.currentLogger(true, nil).Trace("QBFT: confirmation Formula used ceil(2N/3)") return int(math.Ceil(float64(2*c.valSet.Size()) / 3)) } diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index df11e2bd5..137ae6a97 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -236,7 +236,6 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, co config.Istanbul.Epoch = chainConfig.Istanbul.Epoch } config.Istanbul.ProposerPolicy = istanbul.NewProposerPolicy(istanbul.ProposerPolicyId(chainConfig.Istanbul.ProposerPolicy)) - config.Istanbul.Ceil2Nby3Block = chainConfig.Istanbul.Ceil2Nby3Block config.Istanbul.AllowedFutureBlockTime = 0 //Quorum config.Istanbul.TestQBFTBlock = chainConfig.Istanbul.TestQBFTBlock @@ -291,7 +290,4 @@ func setBFTConfig(istanbulConfig *istanbul.Config, bftConfig *params.BFTConfig) if bftConfig.ProposerPolicy != 0 { istanbulConfig.ProposerPolicy = istanbul.NewProposerPolicy(istanbul.ProposerPolicyId(bftConfig.ProposerPolicy)) } - if bftConfig.Ceil2Nby3Block != nil { - istanbulConfig.Ceil2Nby3Block = bftConfig.Ceil2Nby3Block - } } diff --git a/params/config.go b/params/config.go index 692883c21..e0e5c4f44 100644 --- a/params/config.go +++ b/params/config.go @@ -60,7 +60,6 @@ var ( Istanbul: &IstanbulConfig{ ProposerPolicy: 2, Epoch: 30000, - Ceil2Nby3Block: big.NewInt(0), TestQBFTBlock: big.NewInt(0), }, IsQuorum: true, @@ -86,7 +85,6 @@ var ( Istanbul: &IstanbulConfig{ ProposerPolicy: 2, Epoch: 30000, - Ceil2Nby3Block: big.NewInt(0), TestQBFTBlock: big.NewInt(0), }, IsQuorum: true, @@ -223,10 +221,9 @@ func (c *CliqueConfig) String() string { // IstanbulConfig is the consensus engine configs for Istanbul based sealing. type IstanbulConfig struct { - Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint - ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection - Ceil2Nby3Block *big.Int `json:"ceil2Nby3Block,omitempty"` // Number of confirmations required to move from one state to next [2F + 1 to Ceil(2N/3)] - TestQBFTBlock *big.Int `json:"testQBFTBlock,omitempty"` // Fork block at which block confirmations are done using qbft consensus instead of ibft + Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint + ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection + TestQBFTBlock *big.Int `json:"testQBFTBlock,omitempty"` // Fork block at which block confirmations are done using qbft consensus instead of ibft } // String implements the stringer interface, returning the consensus engine details. @@ -235,11 +232,10 @@ func (c *IstanbulConfig) String() string { } type BFTConfig struct { - EpochLength uint64 `json:"epochlength"` // Number of blocks that should pass before pending validator votes are reset - BlockPeriodSeconds uint64 `json:"blockperiodseconds"` // Minimum time between two consecutive IBFT or QBFT blocks’ timestamps in seconds - RequestTimeoutSeconds uint64 `json:"requesttimeoutseconds"` // Minimum request timeout for each IBFT or QBFT round in milliseconds - ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection - Ceil2Nby3Block *big.Int `json:"ceil2Nby3Block,omitempty"` // Number of confirmations required to move from one state to next [2F + 1 to Ceil(2N/3)] + EpochLength uint64 `json:"epochlength"` // Number of blocks that should pass before pending validator votes are reset + BlockPeriodSeconds uint64 `json:"blockperiodseconds"` // Minimum time between two consecutive IBFT or QBFT blocks’ timestamps in seconds + RequestTimeoutSeconds uint64 `json:"requesttimeoutseconds"` // Minimum request timeout for each IBFT or QBFT round in milliseconds + ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection } type IBFTConfig struct { From 8d2a05c3fcff3e2d8b7576412f77d253d24e8b23 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Sat, 18 Jun 2022 23:48:49 -0300 Subject: [PATCH 06/30] cmd/core/eth/miner/params: remove IsQuorum chain configuration flag --- cmd/geth/chaincmd.go | 23 ---------------------- cmd/geth/genesis_test.go | 5 ++--- cmd/geth/main.go | 2 +- cmd/geth/testdata/clique.json | 3 +-- core/genesis_test.go | 2 +- eth/backend.go | 37 +++++++++++++---------------------- miner/worker.go | 2 +- params/config.go | 13 ++++-------- params/protocol_params.go | 11 +++++------ 9 files changed, 29 insertions(+), 69 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 3bb8eacd4..5e1dfe725 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -20,7 +20,6 @@ import ( "encoding/json" "errors" "fmt" - "io" "os" "runtime" "strconv" @@ -171,24 +170,6 @@ This command dumps out the state for a given block (or latest, if none provided) } ) -// In the regular Genesis / ChainConfig struct, due to the way go deserializes -// json, IsQuorum defaults to false (when not specified). Here we specify it as -// a pointer so we can make the distinction and default unspecified to true. -func getIsQuorum(file io.Reader) bool { - altGenesis := new(struct { - Config *struct { - IsQuorum *bool `json:"isQuorum"` - } `json:"config"` - }) - - if err := json.NewDecoder(file).Decode(altGenesis); err != nil { - utils.Fatalf("invalid genesis file: %v", err) - } - - // unspecified defaults to true - return altGenesis.Config.IsQuorum == nil || *altGenesis.Config.IsQuorum -} - // initGenesis will initialise the given JSON format genesis file and writes it as // the zero'd block (i.e. genesis) or will fail hard if it can't succeed. func initGenesis(ctx *cli.Context) error { @@ -208,10 +189,6 @@ func initGenesis(ctx *cli.Context) error { utils.Fatalf("invalid genesis file: %v", err) } - // Quorum - file.Seek(0, 0) - genesis.Config.IsQuorum = getIsQuorum(file) - // Open and initialise both full and light databases stack, _ := makeConfigNode(ctx) defer stack.Close() diff --git a/cmd/geth/genesis_test.go b/cmd/geth/genesis_test.go index bc2c98e13..c95755f2d 100644 --- a/cmd/geth/genesis_test.go +++ b/cmd/geth/genesis_test.go @@ -39,7 +39,7 @@ var customGenesisTests = []struct { "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp" : "0x00", - "config" : {"isQuorum":false } + "config" : {} }`, query: "eth.getBlock(0).nonce", result: "0x0000000000001338", @@ -59,8 +59,7 @@ var customGenesisTests = []struct { "config" : { "homesteadBlock" : 42, "daoForkBlock" : 141, - "daoForkSupport" : true, - "isQuorum" : false + "daoForkSupport" : true } }`, query: "eth.getBlock(0).nonce", diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 648af433d..dbd6ed8d4 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -439,7 +439,7 @@ func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isCon // Quorum // checks quorum features that depend on the ethereum service - if backend.ChainConfig().IsQuorum { + if backend.ChainConfig().Istanbul != nil { quorumValidateEthService(stack) } diff --git a/cmd/geth/testdata/clique.json b/cmd/geth/testdata/clique.json index 8d9021df7..b54b4a7d3 100644 --- a/cmd/geth/testdata/clique.json +++ b/cmd/geth/testdata/clique.json @@ -11,8 +11,7 @@ "clique": { "period": 5, "epoch": 30000 - }, - "isQuorum": false + } }, "difficulty": "1", "gasLimit": "8000000", diff --git a/core/genesis_test.go b/core/genesis_test.go index 2e1b8ecf3..26141480d 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -47,7 +47,7 @@ func TestSetupGenesis(t *testing.T) { var ( customghash = common.HexToHash("0x89c99d90b79719238d2645c7642f2c9295246e80775b38cfd162b696817fbd50") customg = Genesis{ - Config: ¶ms.ChainConfig{HomesteadBlock: big.NewInt(3), IsQuorum: true}, + Config: ¶ms.ChainConfig{HomesteadBlock: big.NewInt(3)}, Alloc: GenesisAlloc{ {1}: {Balance: big.NewInt(1), Storage: map[common.Hash]common.Hash{{1}: {1}}}, }, diff --git a/eth/backend.go b/eth/backend.go index de07a6401..b82234495 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -146,20 +146,14 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { if err := pruner.RecoverPruning(stack.ResolvePath(""), chainDb, stack.ResolvePath(config.TrieCleanCacheJournal)); err != nil { log.Error("Failed to recover state", "error", err) } - // Quorum - if chainConfig.IsQuorum { - // changes to manipulate the chain id for migration from 2.0.2 and below version to 2.0.3 - // version of Quorum - this is applicable for v2.0.3 onwards - if (chainConfig.ChainID != nil && chainConfig.ChainID.Int64() == 1) || config.NetworkId == 1 { - return nil, errors.New("cannot have chain id or network id as 1") - } - if chainConfig.Istanbul != nil && (chainConfig.IBFT != nil || chainConfig.QBFT != nil) { - return nil, errors.New("the attributes config.Istanbul and config.[IBFT|QBFT] are mutually exclusive on the genesis file") - } - if chainConfig.IBFT != nil && chainConfig.QBFT != nil { - return nil, errors.New("the attributes config.IBFT and config.QBFT are mutually exclusive on the genesis file") - } + + if chainConfig.Istanbul != nil && (chainConfig.IBFT != nil || chainConfig.QBFT != nil) { + return nil, errors.New("the attributes config.Istanbul and config.[IBFT|QBFT] are mutually exclusive on the genesis file") + } + if chainConfig.IBFT != nil && chainConfig.QBFT != nil { + return nil, errors.New("the attributes config.IBFT and config.QBFT are mutually exclusive on the genesis file") } + merger := consensus.NewMerger(chainDb) eth := &Ethereum{ config: config, @@ -178,7 +172,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { shutdownTracker: shutdowncheck.NewShutdownTracker(chainDb), } - // Quorum: Set protocol Name/Version + // Set protocol Name/Version // keep `var protocolName = "eth"` as is, and only update the quorum consensus specific protocol // This is used to enable the eth service to return multiple devp2p subprotocols. // Previously, for istanbul/64 istnbul/99 and clique (v2.6) `protocolName` would be overridden and @@ -186,17 +180,14 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { // communicate over the "eth" subprotocol, e.g. "eth" or "istanbul/99" but not eth" and "istanbul/99". // With this change, support is added so that the "eth" subprotocol remains and optionally a consensus subprotocol // can be added allowing the node to communicate over "eth" and an optional consensus subprotocol, e.g. "eth" and "istanbul/100" - if chainConfig.IsQuorum { + if chainConfig.Istanbul != nil { quorumProtocol := eth.engine.Protocol() // set the quorum specific consensus devp2p subprotocol, eth subprotocol remains set to protocolName as in upstream geth. quorumConsensusProtocolName = quorumProtocol.Name quorumConsensusProtocolVersions = quorumProtocol.Versions quorumConsensusProtocolLengths = quorumProtocol.Lengths - } - // Quorum - // force to set the istanbul etherbase to node key address - if chainConfig.Istanbul != nil { + // force to set the istanbul etherbase to node key address eth.etherbase = crypto.PubkeyToAddress(stack.GetNodeKey().PublicKey) } @@ -274,7 +265,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { } eth.miner = miner.New(eth, &config.Miner, chainConfig, eth.EventMux(), eth.engine, eth.isLocalBlock) - eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData, eth.blockchain.Config().IsQuorum)) + eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData, eth.blockchain.Config().Istanbul != nil)) eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil} if eth.APIBackend.allowUnprotectedTxs { @@ -311,7 +302,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { return eth, nil } -func makeExtraData(extra []byte, isQuorum bool) []byte { +func makeExtraData(extra []byte, isIstanbulConsensus bool) []byte { if len(extra) == 0 { // create default extradata extra, _ = rlp.EncodeToBytes([]interface{}{ @@ -321,8 +312,8 @@ func makeExtraData(extra []byte, isQuorum bool) []byte { runtime.GOOS, }) } - if uint64(len(extra)) > params.GetMaximumExtraDataSize(isQuorum) { - log.Warn("Miner extra data exceed limit", "extra", hexutil.Bytes(extra), "limit", params.GetMaximumExtraDataSize(isQuorum)) + if uint64(len(extra)) > params.GetMaximumExtraDataSize(isIstanbulConsensus) { + log.Warn("Miner extra data exceed limit", "extra", hexutil.Bytes(extra), "limit", params.GetMaximumExtraDataSize(isIstanbulConsensus)) extra = nil } return extra diff --git a/miner/worker.go b/miner/worker.go index 37d612a1a..a15e5c81c 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -277,7 +277,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus resubmitIntervalCh: make(chan time.Duration), resubmitAdjustCh: make(chan *intervalAdjust, resubmitAdjustChanSize), } - if _, ok := engine.(consensus.Istanbul); ok || !chainConfig.IsQuorum || chainConfig.Clique != nil { + if _, ok := engine.(consensus.Istanbul); ok || chainConfig.Istanbul == nil || chainConfig.Clique != nil { // Subscribe NewTxsEvent for tx pool worker.txsSub = eth.TxPool().SubscribeNewTxsEvent(worker.txsCh) // Subscribe events for blockchain diff --git a/params/config.go b/params/config.go index e0e5c4f44..f81e1e377 100644 --- a/params/config.go +++ b/params/config.go @@ -62,7 +62,6 @@ var ( Epoch: 30000, TestQBFTBlock: big.NewInt(0), }, - IsQuorum: true, } // TestnetChainConfig is the chain parameters to run a node on the test network. @@ -87,7 +86,6 @@ var ( Epoch: 30000, TestQBFTBlock: big.NewInt(0), }, - IsQuorum: true, } // AllEthashProtocolChanges contains every protocol change (EIPs) introduced @@ -95,16 +93,16 @@ var ( // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil, nil, false} + AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil, nil} // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Clique consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, nil, nil, false} + AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, nil, nil} - TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil, nil, false} + TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil, nil} TestRules = TestChainConfig.Rules(new(big.Int), false) ) @@ -196,8 +194,6 @@ type ChainConfig struct { Istanbul *IstanbulConfig `json:"istanbul,omitempty"` // Quorum IBFT *IBFTConfig `json:"ibft,omitempty"` // Quorum QBFT *QBFTConfig `json:"qbft,omitempty"` // Quorum - - IsQuorum bool `json:"isQuorum"` // Quorum flag } // EthashConfig is the consensus engine configs for proof-of-work based sealing. @@ -267,7 +263,7 @@ func (c *ChainConfig) String() string { default: engine = "unknown" } - return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v IsQuorum: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, MergeFork: %v, Terminal TD: %v, Engine: %v}", + return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, MergeFork: %v, Terminal TD: %v, Engine: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -276,7 +272,6 @@ func (c *ChainConfig) String() string { c.EIP155Block, c.EIP158Block, c.ByzantiumBlock, - c.IsQuorum, c.ConstantinopleBlock, c.PetersburgBlock, c.IstanbulBlock, diff --git a/params/protocol_params.go b/params/protocol_params.go index e58433c1d..e8dd43462 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -158,9 +158,8 @@ const ( RefundQuotient uint64 = 2 RefundQuotientEIP3529 uint64 = 5 - QuorumMaximumExtraDataSize uint64 = 65 // Maximum size extra data may be after Genesis. - // Quorum - payload for a transaction, the size of the buffer to 128kb to match the maximum allowed in chain config - QuorumMaxPayloadBufferSize uint64 = 128 + IBFTMaximumExtraDataSize uint64 = 65 // Maximum size extra data may be after Genesis. + IBFTMaxPayloadBufferSize uint64 = 128 // // Payload for a transaction, the size of the buffer to 128kb to match the maximum allowed in chain config ) // Gas discount table for BLS12-381 G1 and G2 multi exponentiation operations @@ -173,9 +172,9 @@ var ( DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. ) -func GetMaximumExtraDataSize(isQuorum bool) uint64 { - if isQuorum { - return QuorumMaximumExtraDataSize +func GetMaximumExtraDataSize(isIstanbulConsensus bool) uint64 { + if isIstanbulConsensus { + return IBFTMaximumExtraDataSize } else { return MaximumExtraDataSize } From 948787f41297d202e8bf5afd99bb411ffa5edd1d Mon Sep 17 00:00:00 2001 From: andrepatta Date: Sun, 19 Jun 2022 00:22:43 -0300 Subject: [PATCH 07/30] consensus/eth/params: remove TestQBFTBlock from chain configuration (always use QBFT instead of standard IBFT) --- consensus/istanbul/backend.go | 3 - consensus/istanbul/backend/api.go | 1 - consensus/istanbul/backend/backend.go | 58 ++------------- consensus/istanbul/backend/backend_test.go | 71 ++----------------- consensus/istanbul/backend/engine.go | 9 +-- consensus/istanbul/backend/engine_test.go | 27 +++---- consensus/istanbul/backend/handler.go | 13 +--- consensus/istanbul/backend/handler_test.go | 53 +------------- consensus/istanbul/backend/snapshot_test.go | 3 +- consensus/istanbul/config.go | 28 -------- consensus/istanbul/ibft/core/core.go | 4 +- .../istanbul/ibft/core/final_committed.go | 11 +-- .../istanbul/ibft/core/testbackend_test.go | 4 -- consensus/istanbul/testutils/genesis.go | 31 ++------ eth/ethconfig/config.go | 3 - params/config.go | 7 +- 16 files changed, 36 insertions(+), 290 deletions(-) diff --git a/consensus/istanbul/backend.go b/consensus/istanbul/backend.go index ce52cf2ab..5ded62701 100644 --- a/consensus/istanbul/backend.go +++ b/consensus/istanbul/backend.go @@ -76,9 +76,6 @@ type Backend interface { Close() error - // IsQBFTConsensus checks qbftBlock fork block and returns if it should be enabled - IsQBFTConsensusAt(*big.Int) bool - // StartQBFTConsensus stops existing legacy ibft consensus and starts the new qbft consensus StartQBFTConsensus() error } diff --git a/consensus/istanbul/backend/api.go b/consensus/istanbul/backend/api.go index 4c5c3738e..8d157de77 100644 --- a/consensus/istanbul/backend/api.go +++ b/consensus/istanbul/backend/api.go @@ -219,7 +219,6 @@ func (api *API) Status(startBlockNum *rpc.BlockNumber, endBlockNum *rpc.BlockNum } numBlocks = end - start - header = api.chain.GetHeaderByNumber(end) blockNumber = rpc.BlockNumber(end) } diff --git a/consensus/istanbul/backend/backend.go b/consensus/istanbul/backend/backend.go index 56cc0be71..f33c16054 100644 --- a/consensus/istanbul/backend/backend.go +++ b/consensus/istanbul/backend/backend.go @@ -26,7 +26,6 @@ import ( "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/istanbul" istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibftcore "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/core" ibftengine "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/engine" qbftcore "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core" qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/engine" @@ -116,8 +115,6 @@ type Backend struct { recentMessages *lru.ARCCache // the cache of peer's messages knownMessages *lru.ARCCache // the cache of self messages - - qbftConsensusEnabled bool // qbft consensus } func (sb *Backend) Engine() istanbul.Engine { @@ -125,14 +122,7 @@ func (sb *Backend) Engine() istanbul.Engine { } func (sb *Backend) EngineForBlockNumber(blockNumber *big.Int) istanbul.Engine { - switch { - case blockNumber != nil && sb.IsQBFTConsensusAt(blockNumber): - return sb.qbftEngine - case blockNumber == nil && sb.IsQBFTConsensus(): - return sb.qbftEngine - default: - return sb.ibftEngine - } + return sb.qbftEngine } // zekun: HACK @@ -192,15 +182,11 @@ func (sb *Backend) Gossip(valSet istanbul.ValidatorSet, code uint64, payload []b m.Add(hash, true) sb.recentMessages.Add(addr, m) - if sb.IsQBFTConsensus() { - var outboundCode uint64 = istanbulMsg - if _, ok := qbfttypes.MessageCodes()[code]; ok { - outboundCode = code - } - go p.SendQBFTConsensus(outboundCode, payload) - } else { - go p.SendConsensus(istanbulMsg, payload) + var outboundCode uint64 = istanbulMsg + if _, ok := qbfttypes.MessageCodes()[code]; ok { + outboundCode = code } + go p.SendQBFTConsensus(outboundCode, payload) } } return nil @@ -361,42 +347,10 @@ func (sb *Backend) Close() error { return nil } -// IsQBFTConsensus returns whether qbft consensus should be used -func (sb *Backend) IsQBFTConsensus() bool { - if sb.qbftConsensusEnabled { - return true - } - if sb.chain != nil { - return sb.IsQBFTConsensusAt(sb.chain.CurrentHeader().Number) - } - return false -} - -// IsQBFTConsensusForHeader checks if qbft consensus is enabled for the block height identified by the given header -func (sb *Backend) IsQBFTConsensusAt(blockNumber *big.Int) bool { - return sb.config.IsQBFTConsensusAt(blockNumber) -} - -func (sb *Backend) startIBFT() error { - sb.logger.Info("BFT: activate IBFT") - sb.logger.Trace("BFT: set ProposerPolicy sorter to ValidatorSortByStringFun") - sb.config.ProposerPolicy.Use(istanbul.ValidatorSortByString()) - sb.qbftConsensusEnabled = false - - sb.core = ibftcore.New(sb, sb.config) - if err := sb.core.Start(); err != nil { - sb.logger.Error("BFT: failed to activate IBFT", "err", err) - return err - } - - return nil -} - func (sb *Backend) startQBFT() error { sb.logger.Info("BFT: activate QBFT") sb.logger.Trace("BFT: set ProposerPolicy sorter to ValidatorSortByByteFunc") sb.config.ProposerPolicy.Use(istanbul.ValidatorSortByByte()) - sb.qbftConsensusEnabled = true sb.core = qbftcore.New(sb, sb.config) if err := sb.core.Start(); err != nil { @@ -419,8 +373,6 @@ func (sb *Backend) stop() error { } } - sb.qbftConsensusEnabled = false - return nil } diff --git a/consensus/istanbul/backend/backend_test.go b/consensus/istanbul/backend/backend_test.go index 9438c643b..64ba9c7d8 100644 --- a/consensus/istanbul/backend/backend_test.go +++ b/consensus/istanbul/backend/backend_test.go @@ -131,7 +131,7 @@ func TestCommit(t *testing.T) { nil, [][]byte{append([]byte{1}, bytes.Repeat([]byte{0x00}, types.IstanbulExtraSeal-1)...)}, func() *types.Block { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) block := makeBlockWithoutSeal(chain, engine, chain.Genesis(), true) return updateQBFTBlock(block, engine.Address()) }, @@ -141,7 +141,7 @@ func TestCommit(t *testing.T) { istanbulcommon.ErrInvalidCommittedSeals, nil, func() *types.Block { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) block := makeBlockWithoutSeal(chain, engine, chain.Genesis(), true) return updateQBFTBlock(block, engine.Address()) }, @@ -177,7 +177,7 @@ func TestCommit(t *testing.T) { } func TestGetProposer(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() block := makeBlock(chain, engine, chain.Genesis()) chain.InsertChain(types.Blocks{block}) @@ -188,69 +188,6 @@ func TestGetProposer(t *testing.T) { } } -// TestQBFTTransitionDeadlock test whether a deadlock occurs when testQBFTBlock is set to 1 -// This was fixed as part of commit 2a8310663ecafc0233758ca7883676bf568e926e -func TestQBFTTransitionDeadlock(t *testing.T) { - timeout := time.After(1 * time.Minute) - done := make(chan bool) - go func() { - chain, engine := newBlockChain(1, big.NewInt(1)) - defer engine.Stop() - // Create an insert a new block into the chain. - block := makeBlock(chain, engine, chain.Genesis()) - _, err := chain.InsertChain(types.Blocks{block}) - if err != nil { - t.Errorf("Error inserting block: %v", err) - } - - if err = engine.NewChainHead(); err != nil { - t.Errorf("Error posting NewChainHead Event: %v", err) - } - - if !engine.IsQBFTConsensus() { - t.Errorf("IsQBFTConsensus() should return true after block insertion") - } - done <- true - }() - - select { - case <-timeout: - t.Fatal("Deadlock occurred during IBFT to QBFT transition") - case <-done: - } -} - -func TestIsQBFTConsensus(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(2)) - defer engine.Stop() - qbftConsensus := engine.IsQBFTConsensus() - if qbftConsensus { - t.Errorf("IsQBFTConsensus() should return false") - } - - // Create an insert a new block into the chain. - block := makeBlock(chain, engine, chain.Genesis()) - _, err := chain.InsertChain(types.Blocks{block}) - if err != nil { - t.Errorf("Error inserting block: %v", err) - } - - if err = engine.NewChainHead(); err != nil { - t.Errorf("Error posting NewChainHead Event: %v", err) - } - - secondBlock := makeBlock(chain, engine, block) - _, err = chain.InsertChain(types.Blocks{secondBlock}) - if err != nil { - t.Errorf("Error inserting block: %v", err) - } - - qbftConsensus = engine.IsQBFTConsensus() - if !qbftConsensus { - t.Errorf("IsQBFTConsensus() should return true after block insertion") - } -} - /** * SimpleBackend * Private key: bb047e5940b6d83354d9432db7c449ac8fca2248008aaa7271369880f9f11cc1 @@ -299,7 +236,7 @@ func (slice Keys) Swap(i, j int) { } func newBackend() (b *Backend) { - _, b = newBlockChain(1, big.NewInt(0)) + _, b = newBlockChain(1) key, _ := generatePrivateKey() b.privateKey = key return diff --git a/consensus/istanbul/backend/engine.go b/consensus/istanbul/backend/engine.go index e4be3f827..de581b2c0 100644 --- a/consensus/istanbul/backend/engine.go +++ b/consensus/istanbul/backend/engine.go @@ -269,14 +269,7 @@ func (sb *Backend) Start(chain consensus.ChainHeaderReader, currentBlock func() sb.hasBadBlock = hasBadBlock // Check if qbft Consensus needs to be used after chain is set - var err error - if sb.IsQBFTConsensus() { - err = sb.startQBFT() - } else { - err = sb.startIBFT() - } - - if err != nil { + if err := sb.startQBFT(); err != nil { return err } diff --git a/consensus/istanbul/backend/engine_test.go b/consensus/istanbul/backend/engine_test.go index a722d1c5e..45e193923 100644 --- a/consensus/istanbul/backend/engine_test.go +++ b/consensus/istanbul/backend/engine_test.go @@ -42,7 +42,6 @@ func newBlockchainFromConfig(genesis *core.Genesis, nodeKeys []*ecdsa.PrivateKey // Use the first key as private key backend := New(cfg, nodeKeys[0], memDB) - backend.qbftConsensusEnabled = backend.IsQBFTConsensus() genesis.MustCommit(memDB) blockchain, err := core.NewBlockChain(memDB, nil, genesis.Config, backend, vm.Config{}, nil, nil) @@ -76,14 +75,10 @@ func newBlockchainFromConfig(genesis *core.Genesis, nodeKeys []*ecdsa.PrivateKey // in this test, we can set n to 1, and it means we can process Istanbul and commit a // block by one node. Otherwise, if n is larger than 1, we have to generate // other fake events to process Istanbul. -func newBlockChain(n int, qbftBlock *big.Int) (*core.BlockChain, *Backend) { - isQBFT := qbftBlock != nil && qbftBlock.Uint64() == 0 - genesis, nodeKeys := testutils.GenesisAndKeys(n, isQBFT) - +func newBlockChain(n int) (*core.BlockChain, *Backend) { + genesis, nodeKeys := testutils.GenesisAndKeys(n) config := copyConfig(istanbul.DefaultConfig) - config.TestQBFTBlock = qbftBlock - return newBlockchainFromConfig(genesis, nodeKeys, config) } @@ -129,9 +124,8 @@ func makeBlockWithoutSeal(chain *core.BlockChain, engine *Backend, parent *types } func TestIBFTPrepare(t *testing.T) { - chain, engine := newBlockChain(1, nil) + chain, engine := newBlockChain(1) defer engine.Stop() - chain.Config().Istanbul.TestQBFTBlock = nil header := makeHeader(chain.Genesis(), engine.config) err := engine.Prepare(chain, header) if err != nil { @@ -145,7 +139,7 @@ func TestIBFTPrepare(t *testing.T) { } func TestQBFTPrepare(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() header := makeHeader(chain.Genesis(), engine.config) err := engine.Prepare(chain, header) @@ -161,7 +155,7 @@ func TestQBFTPrepare(t *testing.T) { } func TestSealStopChannel(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() block := makeBlockWithoutSeal(chain, engine, chain.Genesis(), true) stop := make(chan struct{}, 1) @@ -191,7 +185,7 @@ func TestSealStopChannel(t *testing.T) { } func TestSealCommittedOtherHash(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() block := makeBlockWithoutSeal(chain, engine, chain.Genesis(), false) otherBlock := makeBlockWithoutSeal(chain, engine, block, false) @@ -239,7 +233,7 @@ func updateQBFTBlock(block *types.Block, addr common.Address) *types.Block { } func TestSealCommitted(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() block := makeBlockWithoutSeal(chain, engine, chain.Genesis(), true) expectedBlock := updateQBFTBlock(block, engine.Address()) @@ -260,12 +254,11 @@ func TestSealCommitted(t *testing.T) { } func TestVerifyHeader(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() // istanbulcommon.ErrEmptyCommittedSeals case block := makeBlockWithoutSeal(chain, engine, chain.Genesis(), true) - header := engine.chain.GetHeader(block.ParentHash(), block.NumberU64()-1) block = updateQBFTBlock(block, engine.Address()) err := engine.VerifyHeader(chain, block.Header(), false) if err != istanbulcommon.ErrEmptyCommittedSeals { @@ -273,7 +266,7 @@ func TestVerifyHeader(t *testing.T) { } // short extra data - header = block.Header() + header := block.Header() header.Extra = []byte{} err = engine.VerifyHeader(chain, header, false) if err != istanbulcommon.ErrInvalidExtraDataFormat { @@ -356,7 +349,7 @@ func TestVerifyHeader(t *testing.T) { } func TestVerifyHeaders(t *testing.T) { - chain, engine := newBlockChain(1, big.NewInt(0)) + chain, engine := newBlockChain(1) defer engine.Stop() genesis := chain.Genesis() diff --git a/consensus/istanbul/backend/handler.go b/consensus/istanbul/backend/handler.go index 2a53c208f..4d3301c41 100644 --- a/consensus/istanbul/backend/handler.go +++ b/consensus/istanbul/backend/handler.go @@ -51,16 +51,9 @@ func (sb *Backend) Protocol() consensus.Protocol { } func (sb *Backend) decode(msg p2p.Msg) ([]byte, common.Hash, error) { - var data []byte - if sb.IsQBFTConsensus() { - data = make([]byte, msg.Size) - if _, err := msg.Payload.Read(data); err != nil { - return nil, common.Hash{}, errPayloadReadFailed - } - } else { - if err := msg.Decode(&data); err != nil { - return nil, common.Hash{}, errDecodeFailed - } + var data []byte = make([]byte, msg.Size) + if _, err := msg.Payload.Read(data); err != nil { + return nil, common.Hash{}, errPayloadReadFailed } return data, istanbul.RLPHash(data), nil } diff --git a/consensus/istanbul/backend/handler_test.go b/consensus/istanbul/backend/handler_test.go index 816fe5ea8..6d2e41296 100644 --- a/consensus/istanbul/backend/handler_test.go +++ b/consensus/istanbul/backend/handler_test.go @@ -29,55 +29,8 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" ) -func TestIstanbulMessage(t *testing.T) { - _, backend := newBlockChain(1, nil) - defer backend.Stop() - - // generate one msg - data := []byte("data1") - hash := istanbul.RLPHash(data) - msg := makeMsg(istanbulMsg, data) - addr := common.StringToAddress("address") - - // 1. this message should not be in cache - // for peers - if _, ok := backend.recentMessages.Get(addr); ok { - t.Fatalf("the cache of messages for this peer should be nil") - } - - // for self - if _, ok := backend.knownMessages.Get(hash); ok { - t.Fatalf("the cache of messages should be nil") - } - - // 2. this message should be in cache after we handle it - _, err := backend.HandleMsg(addr, msg) - if err != nil { - t.Fatalf("handle message failed: %v", err) - } - // for peers - if ms, ok := backend.recentMessages.Get(addr); ms == nil || !ok { - t.Fatalf("the cache of messages for this peer cannot be nil") - } else if m, ok := ms.(*lru.ARCCache); !ok { - t.Fatalf("the cache of messages for this peer cannot be casted") - } else if _, ok := m.Get(hash); !ok { - t.Fatalf("the cache of messages for this peer cannot be found") - } - - // for self - if _, ok := backend.knownMessages.Get(hash); !ok { - t.Fatalf("the cache of messages cannot be found") - } -} - -func makeMsg(msgcode uint64, data interface{}) p2p.Msg { - size, r, _ := rlp.EncodeToReader(data) - return p2p.Msg{Code: msgcode, Size: uint32(size), Payload: r} -} - func tryUntilMessageIsHandled(backend *Backend, arbitraryAddress common.Address, arbitraryP2PMessage p2p.Msg) (handled bool, err error) { for i := 0; i < 5; i++ { // make 5 tries if a little wait handled, err = backend.HandleMsg(arbitraryAddress, arbitraryP2PMessage) @@ -90,7 +43,7 @@ func tryUntilMessageIsHandled(backend *Backend, arbitraryAddress common.Address, } func TestHandleNewBlockMessage_whenTypical(t *testing.T) { - _, backend := newBlockChain(1, nil) + _, backend := newBlockChain(1) defer backend.Stop() arbitraryAddress := common.StringToAddress("arbitrary") arbitraryBlock, arbitraryP2PMessage := buildArbitraryP2PNewBlockMessage(t, false) @@ -109,7 +62,7 @@ func TestHandleNewBlockMessage_whenTypical(t *testing.T) { } func TestHandleNewBlockMessage_whenNotAProposedBlock(t *testing.T) { - _, backend := newBlockChain(1, nil) + _, backend := newBlockChain(1) defer backend.Stop() arbitraryAddress := common.StringToAddress("arbitrary") _, arbitraryP2PMessage := buildArbitraryP2PNewBlockMessage(t, false) @@ -133,7 +86,7 @@ func TestHandleNewBlockMessage_whenNotAProposedBlock(t *testing.T) { } func TestHandleNewBlockMessage_whenFailToDecode(t *testing.T) { - _, backend := newBlockChain(1, nil) + _, backend := newBlockChain(1) defer backend.Stop() arbitraryAddress := common.StringToAddress("arbitrary") _, arbitraryP2PMessage := buildArbitraryP2PNewBlockMessage(t, true) diff --git a/consensus/istanbul/backend/snapshot_test.go b/consensus/istanbul/backend/snapshot_test.go index a8d479a54..21c5c7834 100644 --- a/consensus/istanbul/backend/snapshot_test.go +++ b/consensus/istanbul/backend/snapshot_test.go @@ -328,10 +328,9 @@ func TestVoting(t *testing.T) { } } - genesis := testutils.Genesis(validators, true) + genesis := testutils.Genesis(validators) config := new(istanbul.Config) *config = *istanbul.DefaultConfig - config.TestQBFTBlock = big.NewInt(0) if tt.epoch != 0 { config.Epoch = tt.epoch } diff --git a/consensus/istanbul/config.go b/consensus/istanbul/config.go index 0dcc1a9dd..067bb855f 100644 --- a/consensus/istanbul/config.go +++ b/consensus/istanbul/config.go @@ -17,7 +17,6 @@ package istanbul import ( - "math/big" "sync" "github.com/naoina/toml" @@ -123,7 +122,6 @@ type Config struct { ProposerPolicy *ProposerPolicy `toml:",omitempty"` // The policy for proposer selection Epoch uint64 `toml:",omitempty"` // The number of blocks after which to checkpoint and reset the pending votes AllowedFutureBlockTime uint64 `toml:",omitempty"` // Max time (in seconds) from current time allowed for blocks, before they're considered future blocks - TestQBFTBlock *big.Int `toml:",omitempty"` // Fork block at which block confirmations are done using qbft consensus instead of ibft } var DefaultConfig = &Config{ @@ -132,30 +130,4 @@ var DefaultConfig = &Config{ ProposerPolicy: NewRoundRobinProposerPolicy(), Epoch: 30000, AllowedFutureBlockTime: 0, - TestQBFTBlock: big.NewInt(0), -} - -// QBFTBlockNumber returns the qbftBlock fork block number, returns -1 if qbftBlock is not defined -func (c Config) QBFTBlockNumber() int64 { - if c.TestQBFTBlock == nil { - return -1 - } - return c.TestQBFTBlock.Int64() -} - -// IsQBFTConsensusAt checks if qbft consensus is enabled for the block height identified by the given header -func (c *Config) IsQBFTConsensusAt(blockNumber *big.Int) bool { - // If qbftBlock is not defined in genesis qbft consensus is not used - if c.TestQBFTBlock == nil { - return false - } - - if c.TestQBFTBlock.Uint64() == 0 { - return true - } - - if blockNumber.Cmp(c.TestQBFTBlock) >= 0 { - return true - } - return false } diff --git a/consensus/istanbul/ibft/core/core.go b/consensus/istanbul/ibft/core/core.go index 28babb3ec..795c88200 100644 --- a/consensus/istanbul/ibft/core/core.go +++ b/consensus/istanbul/ibft/core/core.go @@ -234,8 +234,8 @@ func (c *core) startNewRound(round *big.Int) { c.valSet = c.backend.Validators(lastProposal) } - // If new round is 0, then check if qbftConsensus needs to be enabled - if round.Uint64() == 0 && c.backend.IsQBFTConsensusAt(newView.Sequence) { + // If new round is 0, then enable qbft consensus + if round.Uint64() == 0 { logger.Trace("Starting qbft consensus as qbftBlock has passed") if err := c.backend.StartQBFTConsensus(); err != nil { // If err is returned, then QBFT consensus is started for the next block diff --git a/consensus/istanbul/ibft/core/final_committed.go b/consensus/istanbul/ibft/core/final_committed.go index 811c89aab..4377f58a7 100644 --- a/consensus/istanbul/ibft/core/final_committed.go +++ b/consensus/istanbul/ibft/core/final_committed.go @@ -17,8 +17,6 @@ package core import ( - "math/big" - "github.com/ethereum/go-ethereum/common" ) @@ -26,13 +24,6 @@ func (c *core) handleFinalCommitted() error { logger := c.logger.New("state", c.state) logger.Trace("Received a final committed proposal") - // startNewRound() needs to be called asynchronously when the transition to qbft happens - // This is required so that the stop() on core can successfully unsubscribe from events - nextSeq := new(big.Int).Add(c.currentView().Sequence, big.NewInt(1)) - if c.backend.IsQBFTConsensusAt(nextSeq) { - go c.startNewRound(common.Big0) - } else { - c.startNewRound(common.Big0) - } + go c.startNewRound(common.Big0) return nil } diff --git a/consensus/istanbul/ibft/core/testbackend_test.go b/consensus/istanbul/ibft/core/testbackend_test.go index d78984c1e..2a94d1437 100644 --- a/consensus/istanbul/ibft/core/testbackend_test.go +++ b/consensus/istanbul/ibft/core/testbackend_test.go @@ -169,10 +169,6 @@ func (sb *testSystemBackend) Close() error { return nil } -func (sb *testSystemBackend) IsQBFTConsensusAt(*big.Int) bool { - return false -} - func (sb *testSystemBackend) StartQBFTConsensus() error { return nil } diff --git a/consensus/istanbul/testutils/genesis.go b/consensus/istanbul/testutils/genesis.go index 06b855d55..b43ba57a1 100644 --- a/consensus/istanbul/testutils/genesis.go +++ b/consensus/istanbul/testutils/genesis.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum/rlp" ) -func Genesis(validators []common.Address, isQBFT bool) *core.Genesis { +func Genesis(validators []common.Address) *core.Genesis { // generate genesis block genesis := core.DefaultGenesisBlock() genesis.Config = params.TestChainConfig @@ -25,16 +25,12 @@ func Genesis(validators []common.Address, isQBFT bool) *core.Genesis { genesis.Nonce = istanbulcommon.EmptyBlockNonce.Uint64() genesis.Mixhash = types.IstanbulDigest - if isQBFT { - appendValidators(genesis, validators) - } else { - appendValidatorsIstanbulExtra(genesis, validators) - } + appendValidators(genesis, validators) return genesis } -func GenesisAndKeys(n int, isQBFT bool) (*core.Genesis, []*ecdsa.PrivateKey) { +func GenesisAndKeys(n int) (*core.Genesis, []*ecdsa.PrivateKey) { // Setup validators var nodeKeys = make([]*ecdsa.PrivateKey, n) var addrs = make([]common.Address, n) @@ -44,30 +40,11 @@ func GenesisAndKeys(n int, isQBFT bool) (*core.Genesis, []*ecdsa.PrivateKey) { } // generate genesis block - genesis := Genesis(addrs, isQBFT) + genesis := Genesis(addrs) return genesis, nodeKeys } -func appendValidatorsIstanbulExtra(genesis *core.Genesis, addrs []common.Address) { - if len(genesis.ExtraData) < types.IstanbulExtraVanity { - genesis.ExtraData = append(genesis.ExtraData, bytes.Repeat([]byte{0x00}, types.IstanbulExtraVanity)...) - } - genesis.ExtraData = genesis.ExtraData[:types.IstanbulExtraVanity] - - ist := &types.IstanbulExtra{ - Validators: addrs, - Seal: []byte{}, - CommittedSeal: [][]byte{}, - } - - istPayload, err := rlp.EncodeToBytes(&ist) - if err != nil { - panic("failed to encode istanbul extra") - } - genesis.ExtraData = append(genesis.ExtraData, istPayload...) -} - func appendValidators(genesis *core.Genesis, addrs []common.Address) { vanity := append(genesis.ExtraData, bytes.Repeat([]byte{0x00}, types.IstanbulExtraVanity-len(genesis.ExtraData))...) ist := &types.QBFTExtra{ diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 137ae6a97..e15fb45b9 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -237,18 +237,15 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, co } config.Istanbul.ProposerPolicy = istanbul.NewProposerPolicy(istanbul.ProposerPolicyId(chainConfig.Istanbul.ProposerPolicy)) config.Istanbul.AllowedFutureBlockTime = 0 //Quorum - config.Istanbul.TestQBFTBlock = chainConfig.Istanbul.TestQBFTBlock return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) } if chainConfig.IBFT != nil { setBFTConfig(&config.Istanbul, chainConfig.IBFT.BFTConfig) - config.Istanbul.TestQBFTBlock = nil return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) } if chainConfig.QBFT != nil { setBFTConfig(&config.Istanbul, chainConfig.QBFT.BFTConfig) - config.Istanbul.TestQBFTBlock = big.NewInt(0) return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) } diff --git a/params/config.go b/params/config.go index f81e1e377..a1cb4bf4c 100644 --- a/params/config.go +++ b/params/config.go @@ -60,7 +60,6 @@ var ( Istanbul: &IstanbulConfig{ ProposerPolicy: 2, Epoch: 30000, - TestQBFTBlock: big.NewInt(0), }, } @@ -84,7 +83,6 @@ var ( Istanbul: &IstanbulConfig{ ProposerPolicy: 2, Epoch: 30000, - TestQBFTBlock: big.NewInt(0), }, } @@ -217,9 +215,8 @@ func (c *CliqueConfig) String() string { // IstanbulConfig is the consensus engine configs for Istanbul based sealing. type IstanbulConfig struct { - Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint - ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection - TestQBFTBlock *big.Int `json:"testQBFTBlock,omitempty"` // Fork block at which block confirmations are done using qbft consensus instead of ibft + Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint + ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection } // String implements the stringer interface, returning the consensus engine details. From 3495451141907c75612bc010873da466c7366c94 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Sun, 19 Jun 2022 00:44:05 -0300 Subject: [PATCH 08/30] consensus/eth/params: remove standard IBFT consensus engine (keep the modified QBFT one) --- cmd/geth/config.go | 2 +- consensus/istanbul/backend/backend.go | 9 +- consensus/istanbul/backend/handler.go | 2 +- consensus/istanbul/backend/snapshot_test.go | 2 +- consensus/istanbul/{qbft => }/core/backlog.go | 2 +- consensus/istanbul/{qbft => }/core/commit.go | 2 +- consensus/istanbul/{qbft => }/core/core.go | 2 +- consensus/istanbul/{qbft => }/core/errors.go | 0 consensus/istanbul/{qbft => }/core/events.go | 2 +- .../{qbft => }/core/final_committed.go | 0 consensus/istanbul/{qbft => }/core/handler.go | 2 +- .../istanbul/{qbft => }/core/justification.go | 2 +- .../{qbft => }/core/justification_test.go | 2 +- consensus/istanbul/{qbft => }/core/prepare.go | 2 +- .../istanbul/{qbft => }/core/preprepare.go | 2 +- .../istanbul/{qbft => }/core/qbft_msg_set.go | 2 +- consensus/istanbul/{qbft => }/core/request.go | 0 .../istanbul/{qbft => }/core/roundchange.go | 2 +- .../istanbul/{qbft => }/core/roundstate.go | 2 +- consensus/istanbul/{qbft => }/core/types.go | 2 +- .../istanbul/{qbft => }/engine/apply_extra.go | 0 .../istanbul/{qbft => }/engine/engine.go | 0 .../istanbul/{qbft => }/engine/engine_test.go | 0 consensus/istanbul/ibft/core/backlog.go | 190 ------- consensus/istanbul/ibft/core/backlog_test.go | 366 ------------- consensus/istanbul/ibft/core/commit.go | 109 ---- consensus/istanbul/ibft/core/commit_test.go | 327 ----------- consensus/istanbul/ibft/core/core.go | 359 ------------ consensus/istanbul/ibft/core/core_test.go | 132 ----- consensus/istanbul/ibft/core/events.go | 29 - .../istanbul/ibft/core/final_committed.go | 29 - consensus/istanbul/ibft/core/handler.go | 209 ------- consensus/istanbul/ibft/core/handler_test.go | 129 ----- consensus/istanbul/ibft/core/message_set.go | 116 ---- .../istanbul/ibft/core/message_set_test.go | 107 ---- consensus/istanbul/ibft/core/prepare.go | 97 ---- consensus/istanbul/ibft/core/prepare_test.go | 361 ------------ consensus/istanbul/ibft/core/preprepare.go | 131 ----- .../istanbul/ibft/core/preprepare_test.go | 300 ---------- consensus/istanbul/ibft/core/request.go | 101 ---- consensus/istanbul/ibft/core/request_test.go | 140 ----- consensus/istanbul/ibft/core/roundchange.go | 174 ------ .../istanbul/ibft/core/roundchange_test.go | 93 ---- consensus/istanbul/ibft/core/roundstate.go | 221 -------- .../istanbul/ibft/core/roundstate_test.go | 76 --- .../istanbul/ibft/core/testbackend_test.go | 303 ----------- consensus/istanbul/ibft/engine/engine.go | 515 ------------------ consensus/istanbul/ibft/engine/engine_test.go | 138 ----- consensus/istanbul/ibft/types/message.go | 129 ----- consensus/istanbul/ibft/types/message_test.go | 193 ------- consensus/istanbul/ibft/types/state.go | 38 -- consensus/istanbul/ibft/types/state_test.go | 1 - consensus/istanbul/{qbft => }/types/commit.go | 0 consensus/istanbul/{qbft => }/types/common.go | 0 consensus/istanbul/{qbft => }/types/decode.go | 0 .../istanbul/{qbft => }/types/message.go | 0 .../istanbul/{qbft => }/types/prepare.go | 0 .../istanbul/{qbft => }/types/preprepare.go | 0 .../istanbul/{qbft => }/types/roundchange.go | 0 eth/backend.go | 7 +- eth/ethconfig/config.go | 6 +- params/config.go | 7 +- 62 files changed, 25 insertions(+), 5149 deletions(-) rename consensus/istanbul/{qbft => }/core/backlog.go (98%) rename consensus/istanbul/{qbft => }/core/commit.go (98%) rename consensus/istanbul/{qbft => }/core/core.go (99%) rename consensus/istanbul/{qbft => }/core/errors.go (100%) rename consensus/istanbul/{qbft => }/core/events.go (92%) rename consensus/istanbul/{qbft => }/core/final_committed.go (100%) rename consensus/istanbul/{qbft => }/core/handler.go (99%) rename consensus/istanbul/{qbft => }/core/justification.go (98%) rename consensus/istanbul/{qbft => }/core/justification_test.go (98%) rename consensus/istanbul/{qbft => }/core/prepare.go (98%) rename consensus/istanbul/{qbft => }/core/preprepare.go (98%) rename consensus/istanbul/{qbft => }/core/qbft_msg_set.go (98%) rename consensus/istanbul/{qbft => }/core/request.go (100%) rename consensus/istanbul/{qbft => }/core/roundchange.go (99%) rename consensus/istanbul/{qbft => }/core/roundstate.go (97%) rename consensus/istanbul/{qbft => }/core/types.go (96%) rename consensus/istanbul/{qbft => }/engine/apply_extra.go (100%) rename consensus/istanbul/{qbft => }/engine/engine.go (100%) rename consensus/istanbul/{qbft => }/engine/engine_test.go (100%) delete mode 100644 consensus/istanbul/ibft/core/backlog.go delete mode 100644 consensus/istanbul/ibft/core/backlog_test.go delete mode 100644 consensus/istanbul/ibft/core/commit.go delete mode 100644 consensus/istanbul/ibft/core/commit_test.go delete mode 100644 consensus/istanbul/ibft/core/core.go delete mode 100644 consensus/istanbul/ibft/core/core_test.go delete mode 100644 consensus/istanbul/ibft/core/events.go delete mode 100644 consensus/istanbul/ibft/core/final_committed.go delete mode 100644 consensus/istanbul/ibft/core/handler.go delete mode 100644 consensus/istanbul/ibft/core/handler_test.go delete mode 100644 consensus/istanbul/ibft/core/message_set.go delete mode 100644 consensus/istanbul/ibft/core/message_set_test.go delete mode 100644 consensus/istanbul/ibft/core/prepare.go delete mode 100644 consensus/istanbul/ibft/core/prepare_test.go delete mode 100644 consensus/istanbul/ibft/core/preprepare.go delete mode 100644 consensus/istanbul/ibft/core/preprepare_test.go delete mode 100644 consensus/istanbul/ibft/core/request.go delete mode 100644 consensus/istanbul/ibft/core/request_test.go delete mode 100644 consensus/istanbul/ibft/core/roundchange.go delete mode 100644 consensus/istanbul/ibft/core/roundchange_test.go delete mode 100644 consensus/istanbul/ibft/core/roundstate.go delete mode 100644 consensus/istanbul/ibft/core/roundstate_test.go delete mode 100644 consensus/istanbul/ibft/core/testbackend_test.go delete mode 100644 consensus/istanbul/ibft/engine/engine.go delete mode 100644 consensus/istanbul/ibft/engine/engine_test.go delete mode 100644 consensus/istanbul/ibft/types/message.go delete mode 100644 consensus/istanbul/ibft/types/message_test.go delete mode 100644 consensus/istanbul/ibft/types/state.go delete mode 100644 consensus/istanbul/ibft/types/state_test.go rename consensus/istanbul/{qbft => }/types/commit.go (100%) rename consensus/istanbul/{qbft => }/types/common.go (100%) rename consensus/istanbul/{qbft => }/types/decode.go (100%) rename consensus/istanbul/{qbft => }/types/message.go (100%) rename consensus/istanbul/{qbft => }/types/prepare.go (100%) rename consensus/istanbul/{qbft => }/types/preprepare.go (100%) rename consensus/istanbul/{qbft => }/types/roundchange.go (100%) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 94ed3d61b..c7a262e17 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -281,7 +281,7 @@ func quorumValidateEthService(stack *node.Node) { // quorumValidateConsensus checks if a consensus was used. The node is killed if consensus was not used func quorumValidateConsensus(ethereum *eth.Ethereum) { - if ethereum.BlockChain().Config().Istanbul == nil && ethereum.BlockChain().Config().IBFT == nil && ethereum.BlockChain().Config().QBFT == nil && ethereum.BlockChain().Config().Clique == nil { + if ethereum.BlockChain().Config().Istanbul == nil && ethereum.BlockChain().Config().QBFT == nil && ethereum.BlockChain().Config().Clique == nil { utils.Fatalf("Consensus not specified. Exiting!!") } } diff --git a/consensus/istanbul/backend/backend.go b/consensus/istanbul/backend/backend.go index f33c16054..049d7b867 100644 --- a/consensus/istanbul/backend/backend.go +++ b/consensus/istanbul/backend/backend.go @@ -26,10 +26,9 @@ import ( "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/istanbul" istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibftengine "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/engine" - qbftcore "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/core" - qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/engine" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbftcore "github.com/ethereum/go-ethereum/consensus/istanbul/core" + qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/engine" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/consensus/istanbul/validator" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" @@ -68,7 +67,6 @@ func New(config *istanbul.Config, privateKey *ecdsa.PrivateKey, db ethdb.Databas } sb.qbftEngine = qbftengine.NewEngine(sb.config, sb.address, sb.Sign) - sb.ibftEngine = ibftengine.NewEngine(sb.config, sb.address, sb.Sign) return sb } @@ -83,7 +81,6 @@ type Backend struct { core istanbul.Core - ibftEngine *ibftengine.Engine qbftEngine *qbftengine.Engine istanbulEventMux *event.TypeMux diff --git a/consensus/istanbul/backend/handler.go b/consensus/istanbul/backend/handler.go index 4d3301c41..462e8578e 100644 --- a/consensus/istanbul/backend/handler.go +++ b/consensus/istanbul/backend/handler.go @@ -26,7 +26,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/p2p" lru "github.com/hashicorp/golang-lru" diff --git a/consensus/istanbul/backend/snapshot_test.go b/consensus/istanbul/backend/snapshot_test.go index 21c5c7834..6e7cab532 100644 --- a/consensus/istanbul/backend/snapshot_test.go +++ b/consensus/istanbul/backend/snapshot_test.go @@ -26,7 +26,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/engine" + qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/engine" "github.com/ethereum/go-ethereum/consensus/istanbul/testutils" "github.com/ethereum/go-ethereum/consensus/istanbul/validator" "github.com/ethereum/go-ethereum/core/rawdb" diff --git a/consensus/istanbul/qbft/core/backlog.go b/consensus/istanbul/core/backlog.go similarity index 98% rename from consensus/istanbul/qbft/core/backlog.go rename to consensus/istanbul/core/backlog.go index f51d3b26e..13874b799 100644 --- a/consensus/istanbul/qbft/core/backlog.go +++ b/consensus/istanbul/core/backlog.go @@ -18,7 +18,7 @@ package core import ( "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) diff --git a/consensus/istanbul/qbft/core/commit.go b/consensus/istanbul/core/commit.go similarity index 98% rename from consensus/istanbul/qbft/core/commit.go rename to consensus/istanbul/core/commit.go index 3dce6c36e..8a63c24d5 100644 --- a/consensus/istanbul/qbft/core/commit.go +++ b/consensus/istanbul/core/commit.go @@ -18,7 +18,7 @@ package core import ( "github.com/ethereum/go-ethereum/common/hexutil" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/consensus/istanbul/qbft/core/core.go b/consensus/istanbul/core/core.go similarity index 99% rename from consensus/istanbul/qbft/core/core.go rename to consensus/istanbul/core/core.go index 8eea88dad..0e3544aec 100644 --- a/consensus/istanbul/qbft/core/core.go +++ b/consensus/istanbul/core/core.go @@ -24,7 +24,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" diff --git a/consensus/istanbul/qbft/core/errors.go b/consensus/istanbul/core/errors.go similarity index 100% rename from consensus/istanbul/qbft/core/errors.go rename to consensus/istanbul/core/errors.go diff --git a/consensus/istanbul/qbft/core/events.go b/consensus/istanbul/core/events.go similarity index 92% rename from consensus/istanbul/qbft/core/events.go rename to consensus/istanbul/core/events.go index fdf8fb33b..733d1a033 100644 --- a/consensus/istanbul/qbft/core/events.go +++ b/consensus/istanbul/core/events.go @@ -18,7 +18,7 @@ package core import ( "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" ) type backlogEvent struct { diff --git a/consensus/istanbul/qbft/core/final_committed.go b/consensus/istanbul/core/final_committed.go similarity index 100% rename from consensus/istanbul/qbft/core/final_committed.go rename to consensus/istanbul/core/final_committed.go diff --git a/consensus/istanbul/qbft/core/handler.go b/consensus/istanbul/core/handler.go similarity index 99% rename from consensus/istanbul/qbft/core/handler.go rename to consensus/istanbul/core/handler.go index d66c9b246..2bed75587 100644 --- a/consensus/istanbul/qbft/core/handler.go +++ b/consensus/istanbul/core/handler.go @@ -22,7 +22,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/consensus/istanbul/qbft/core/justification.go b/consensus/istanbul/core/justification.go similarity index 98% rename from consensus/istanbul/qbft/core/justification.go rename to consensus/istanbul/core/justification.go index d0a37bc1a..5537e9c84 100644 --- a/consensus/istanbul/qbft/core/justification.go +++ b/consensus/istanbul/core/justification.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/log" ) diff --git a/consensus/istanbul/qbft/core/justification_test.go b/consensus/istanbul/core/justification_test.go similarity index 98% rename from consensus/istanbul/qbft/core/justification_test.go rename to consensus/istanbul/core/justification_test.go index 7aec31406..d598beb42 100644 --- a/consensus/istanbul/qbft/core/justification_test.go +++ b/consensus/istanbul/core/justification_test.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/consensus/istanbul/validator" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" diff --git a/consensus/istanbul/qbft/core/prepare.go b/consensus/istanbul/core/prepare.go similarity index 98% rename from consensus/istanbul/qbft/core/prepare.go rename to consensus/istanbul/core/prepare.go index 1ee6edfe1..7cae14905 100644 --- a/consensus/istanbul/qbft/core/prepare.go +++ b/consensus/istanbul/core/prepare.go @@ -18,7 +18,7 @@ package core import ( "github.com/ethereum/go-ethereum/common/hexutil" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/consensus/istanbul/qbft/core/preprepare.go b/consensus/istanbul/core/preprepare.go similarity index 98% rename from consensus/istanbul/qbft/core/preprepare.go rename to consensus/istanbul/core/preprepare.go index 31305ec5a..300a7dbef 100644 --- a/consensus/istanbul/qbft/core/preprepare.go +++ b/consensus/istanbul/core/preprepare.go @@ -21,7 +21,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/consensus/istanbul/qbft/core/qbft_msg_set.go b/consensus/istanbul/core/qbft_msg_set.go similarity index 98% rename from consensus/istanbul/qbft/core/qbft_msg_set.go rename to consensus/istanbul/core/qbft_msg_set.go index 398be0bd3..8f0890807 100644 --- a/consensus/istanbul/qbft/core/qbft_msg_set.go +++ b/consensus/istanbul/core/qbft_msg_set.go @@ -25,7 +25,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/consensus/istanbul/qbft/core/request.go b/consensus/istanbul/core/request.go similarity index 100% rename from consensus/istanbul/qbft/core/request.go rename to consensus/istanbul/core/request.go diff --git a/consensus/istanbul/qbft/core/roundchange.go b/consensus/istanbul/core/roundchange.go similarity index 99% rename from consensus/istanbul/qbft/core/roundchange.go rename to consensus/istanbul/core/roundchange.go index 42b0af18f..ce3e1511b 100644 --- a/consensus/istanbul/qbft/core/roundchange.go +++ b/consensus/istanbul/core/roundchange.go @@ -24,7 +24,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" ) diff --git a/consensus/istanbul/qbft/core/roundstate.go b/consensus/istanbul/core/roundstate.go similarity index 97% rename from consensus/istanbul/qbft/core/roundstate.go rename to consensus/istanbul/core/roundstate.go index 6f5ca0392..9d667a661 100644 --- a/consensus/istanbul/qbft/core/roundstate.go +++ b/consensus/istanbul/core/roundstate.go @@ -22,7 +22,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" ) // newRoundState creates a new roundState instance with the given view and validatorSet diff --git a/consensus/istanbul/qbft/core/types.go b/consensus/istanbul/core/types.go similarity index 96% rename from consensus/istanbul/qbft/core/types.go rename to consensus/istanbul/core/types.go index e184d4880..ffacb02ef 100644 --- a/consensus/istanbul/qbft/core/types.go +++ b/consensus/istanbul/core/types.go @@ -21,7 +21,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/qbft/types" + qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" ) type State uint64 diff --git a/consensus/istanbul/qbft/engine/apply_extra.go b/consensus/istanbul/engine/apply_extra.go similarity index 100% rename from consensus/istanbul/qbft/engine/apply_extra.go rename to consensus/istanbul/engine/apply_extra.go diff --git a/consensus/istanbul/qbft/engine/engine.go b/consensus/istanbul/engine/engine.go similarity index 100% rename from consensus/istanbul/qbft/engine/engine.go rename to consensus/istanbul/engine/engine.go diff --git a/consensus/istanbul/qbft/engine/engine_test.go b/consensus/istanbul/engine/engine_test.go similarity index 100% rename from consensus/istanbul/qbft/engine/engine_test.go rename to consensus/istanbul/engine/engine_test.go diff --git a/consensus/istanbul/ibft/core/backlog.go b/consensus/istanbul/ibft/core/backlog.go deleted file mode 100644 index aa6659f9c..000000000 --- a/consensus/istanbul/ibft/core/backlog.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2017 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 core - -import ( - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" -) - -var ( - // msgPriority is defined for calculating processing priority to speedup consensus - // msgPreprepare > msgCommit > msgPrepare - msgPriority = map[uint64]int{ - ibfttypes.MsgPreprepare: 1, - ibfttypes.MsgCommit: 2, - ibfttypes.MsgPrepare: 3, - } -) - -// checkMessage checks the message state -// return errInvalidMessage if the message is invalid -// return errFutureMessage if the message view is larger than current view -// return errOldMessage if the message view is smaller than current view -func (c *core) checkMessage(msgCode uint64, view *istanbul.View) error { - if view == nil || view.Sequence == nil || view.Round == nil { - return istanbulcommon.ErrInvalidMessage - } - - if msgCode == ibfttypes.MsgRoundChange { - if view.Sequence.Cmp(c.currentView().Sequence) > 0 { - return istanbulcommon.ErrFutureMessage - } else if view.Cmp(c.currentView()) < 0 { - return istanbulcommon.ErrOldMessage - } - return nil - } - - if view.Cmp(c.currentView()) > 0 { - return istanbulcommon.ErrFutureMessage - } - - if view.Cmp(c.currentView()) < 0 { - return istanbulcommon.ErrOldMessage - } - - if c.waitingForRoundChange { - return istanbulcommon.ErrFutureMessage - } - - // StateAcceptRequest only accepts msgPreprepare - // other messages are future messages - if c.state == ibfttypes.StateAcceptRequest { - if msgCode > ibfttypes.MsgPreprepare { - return istanbulcommon.ErrFutureMessage - } - return nil - } - - // For states(StatePreprepared, StatePrepared, StateCommitted), - // can accept all message types if processing with same view - return nil -} - -func (c *core) storeBacklog(msg *ibfttypes.Message, src istanbul.Validator) { - logger := c.logger.New("from", src, "state", c.state) - - if src.Address() == c.Address() { - logger.Warn("Backlog from self") - return - } - - logger.Trace("Store future message") - - c.backlogsMu.Lock() - defer c.backlogsMu.Unlock() - - logger.Debug("Retrieving backlog queue", "for", src.Address(), "backlogs_size", len(c.backlogs)) - backlog := c.backlogs[src.Address()] - if backlog == nil { - backlog = prque.New() - } - switch msg.Code { - case ibfttypes.MsgPreprepare: - var p *istanbul.Preprepare - err := msg.Decode(&p) - if err == nil { - backlog.Push(msg, toPriority(msg.Code, p.View)) - } - // for msgRoundChange, msgPrepare and msgCommit cases - default: - var p *istanbul.Subject - err := msg.Decode(&p) - if err == nil { - backlog.Push(msg, toPriority(msg.Code, p.View)) - } - } - c.backlogs[src.Address()] = backlog -} - -func (c *core) processBacklog() { - c.backlogsMu.Lock() - defer c.backlogsMu.Unlock() - - for srcAddress, backlog := range c.backlogs { - if backlog == nil { - continue - } - _, src := c.valSet.GetByAddress(srcAddress) - if src == nil { - // validator is not available - delete(c.backlogs, srcAddress) - continue - } - logger := c.logger.New("from", src, "state", c.state) - isFuture := false - - // We stop processing if - // 1. backlog is empty - // 2. The first message in queue is a future message - for !(backlog.Empty() || isFuture) { - m, prio := backlog.Pop() - msg := m.(*ibfttypes.Message) - var view *istanbul.View - switch msg.Code { - case ibfttypes.MsgPreprepare: - var m *istanbul.Preprepare - err := msg.Decode(&m) - if err == nil { - view = m.View - } - // for msgRoundChange, msgPrepare and msgCommit cases - default: - var sub *istanbul.Subject - err := msg.Decode(&sub) - if err == nil { - view = sub.View - } - } - if view == nil { - logger.Debug("Nil view", "msg", msg) - continue - } - // Push back if it's a future message - err := c.checkMessage(msg.Code, view) - if err != nil { - if err == istanbulcommon.ErrFutureMessage { - logger.Trace("Stop processing backlog", "msg", msg) - backlog.Push(msg, prio) - isFuture = true - break - } - logger.Trace("Skip the backlog event", "msg", msg, "err", err) - continue - } - logger.Trace("Post backlog event", "msg", msg) - - go c.sendEvent(backlogEvent{ - src: src, - msg: msg, - }) - } - } -} - -func toPriority(msgCode uint64, view *istanbul.View) float32 { - if msgCode == ibfttypes.MsgRoundChange { - // For msgRoundChange, set the message priority based on its sequence - return -float32(view.Sequence.Uint64() * 1000) - } - // FIXME: round will be reset as 0 while new sequence - // 10 * Round limits the range of message code is from 0 to 9 - // 1000 * Sequence limits the range of round is from 0 to 99 - return -float32(view.Sequence.Uint64()*1000 + view.Round.Uint64()*10 + uint64(msgPriority[msgCode])) -} diff --git a/consensus/istanbul/ibft/core/backlog_test.go b/consensus/istanbul/ibft/core/backlog_test.go deleted file mode 100644 index 1febf28bd..000000000 --- a/consensus/istanbul/ibft/core/backlog_test.go +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "reflect" - "sync" - "testing" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" -) - -func TestCheckMessage(t *testing.T) { - c := &core{ - state: ibfttypes.StateAcceptRequest, - current: newRoundState(&istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(0), - }, newTestValidatorSet(4), common.Hash{}, nil, nil, nil), - } - - // invalid view format - err := c.checkMessage(ibfttypes.MsgPreprepare, nil) - if err != istanbulcommon.ErrInvalidMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrInvalidMessage) - } - - testStates := []ibfttypes.State{ibfttypes.StateAcceptRequest, ibfttypes.StatePreprepared, ibfttypes.StatePrepared, ibfttypes.StateCommitted} - testCode := []uint64{ibfttypes.MsgPreprepare, ibfttypes.MsgPrepare, ibfttypes.MsgCommit, ibfttypes.MsgRoundChange} - - // future sequence - v := &istanbul.View{ - Sequence: big.NewInt(2), - Round: big.NewInt(0), - } - for i := 0; i < len(testStates); i++ { - c.state = testStates[i] - for j := 0; j < len(testCode); j++ { - err := c.checkMessage(testCode[j], v) - if err != istanbulcommon.ErrFutureMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFutureMessage) - } - } - } - - // future round - v = &istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(1), - } - for i := 0; i < len(testStates); i++ { - c.state = testStates[i] - for j := 0; j < len(testCode); j++ { - err := c.checkMessage(testCode[j], v) - if testCode[j] == ibfttypes.MsgRoundChange { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else if err != istanbulcommon.ErrFutureMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFutureMessage) - } - } - } - - // current view but waiting for round change - v = &istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(0), - } - c.waitingForRoundChange = true - for i := 0; i < len(testStates); i++ { - c.state = testStates[i] - for j := 0; j < len(testCode); j++ { - err := c.checkMessage(testCode[j], v) - if testCode[j] == ibfttypes.MsgRoundChange { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else if err != istanbulcommon.ErrFutureMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFutureMessage) - } - } - } - c.waitingForRoundChange = false - - v = c.currentView() - // current view, state = ibfttypes.StateAcceptRequest - c.state = ibfttypes.StateAcceptRequest - for i := 0; i < len(testCode); i++ { - err = c.checkMessage(testCode[i], v) - if testCode[i] == ibfttypes.MsgRoundChange { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else if testCode[i] == ibfttypes.MsgPreprepare { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else { - if err != istanbulcommon.ErrFutureMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFutureMessage) - } - } - } - - // current view, state = StatePreprepared - c.state = ibfttypes.StatePreprepared - for i := 0; i < len(testCode); i++ { - err = c.checkMessage(testCode[i], v) - if testCode[i] == ibfttypes.MsgRoundChange { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } - - // current view, state = ibfttypes.StatePrepared - c.state = ibfttypes.StatePrepared - for i := 0; i < len(testCode); i++ { - err = c.checkMessage(testCode[i], v) - if testCode[i] == ibfttypes.MsgRoundChange { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } - - // current view, state = ibfttypes.StateCommitted - c.state = ibfttypes.StateCommitted - for i := 0; i < len(testCode); i++ { - err = c.checkMessage(testCode[i], v) - if testCode[i] == ibfttypes.MsgRoundChange { - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } else if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - } - -} - -func TestStoreBacklog(t *testing.T) { - c := &core{ - logger: log.New("backend", "test", "id", 0), - valSet: newTestValidatorSet(1), - backlogs: make(map[common.Address]*prque.Prque), - backlogsMu: new(sync.Mutex), - } - v := &istanbul.View{ - Round: big.NewInt(10), - Sequence: big.NewInt(10), - } - p := c.valSet.GetByIndex(0) - // push preprepare msg - preprepare := &istanbul.Preprepare{ - View: v, - Proposal: makeBlock(1), - } - prepreparePayload, _ := ibfttypes.Encode(preprepare) - m := &ibfttypes.Message{ - Code: ibfttypes.MsgPreprepare, - Msg: prepreparePayload, - } - c.storeBacklog(m, p) - msg := c.backlogs[p.Address()].PopItem() - if !reflect.DeepEqual(msg, m) { - t.Errorf("message mismatch: have %v, want %v", msg, m) - } - - // push prepare msg - subject := &istanbul.Subject{ - View: v, - Digest: common.StringToHash("1234567890"), - } - subjectPayload, _ := ibfttypes.Encode(subject) - - m = &ibfttypes.Message{ - Code: ibfttypes.MsgPrepare, - Msg: subjectPayload, - } - c.storeBacklog(m, p) - msg = c.backlogs[p.Address()].PopItem() - if !reflect.DeepEqual(msg, m) { - t.Errorf("message mismatch: have %v, want %v", msg, m) - } - - // push commit msg - m = &ibfttypes.Message{ - Code: ibfttypes.MsgCommit, - Msg: subjectPayload, - } - c.storeBacklog(m, p) - msg = c.backlogs[p.Address()].PopItem() - if !reflect.DeepEqual(msg, m) { - t.Errorf("message mismatch: have %v, want %v", msg, m) - } - - // push roundChange msg - m = &ibfttypes.Message{ - Code: ibfttypes.MsgRoundChange, - Msg: subjectPayload, - } - c.storeBacklog(m, p) - msg = c.backlogs[p.Address()].PopItem() - if !reflect.DeepEqual(msg, m) { - t.Errorf("message mismatch: have %v, want %v", msg, m) - } -} - -func TestProcessFutureBacklog(t *testing.T) { - backend := &testSystemBackend{ - events: new(event.TypeMux), - } - c := &core{ - logger: log.New("backend", "test", "id", 0), - valSet: newTestValidatorSet(1), - backlogs: make(map[common.Address]*prque.Prque), - backlogsMu: new(sync.Mutex), - backend: backend, - current: newRoundState(&istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(0), - }, newTestValidatorSet(4), common.Hash{}, nil, nil, nil), - state: ibfttypes.StateAcceptRequest, - } - c.subscribeEvents() - defer c.unsubscribeEvents() - - v := &istanbul.View{ - Round: big.NewInt(10), - Sequence: big.NewInt(10), - } - p := c.valSet.GetByIndex(0) - // push a future msg - subject := &istanbul.Subject{ - View: v, - Digest: common.StringToHash("1234567890"), - } - subjectPayload, _ := ibfttypes.Encode(subject) - m := &ibfttypes.Message{ - Code: ibfttypes.MsgCommit, - Msg: subjectPayload, - } - c.storeBacklog(m, p) - c.processBacklog() - - const timeoutDura = 2 * time.Second - timeout := time.NewTimer(timeoutDura) - select { - case e, ok := <-c.events.Chan(): - if !ok { - return - } - t.Errorf("unexpected events comes: %v", e) - case <-timeout.C: - // success - } -} - -func TestProcessBacklog(t *testing.T) { - v := &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(1), - } - preprepare := &istanbul.Preprepare{ - View: v, - Proposal: makeBlock(1), - } - prepreparePayload, _ := ibfttypes.Encode(preprepare) - - subject := &istanbul.Subject{ - View: v, - Digest: common.StringToHash("1234567890"), - } - subjectPayload, _ := ibfttypes.Encode(subject) - - msgs := []*ibfttypes.Message{ - { - Code: ibfttypes.MsgPreprepare, - Msg: prepreparePayload, - }, - { - Code: ibfttypes.MsgPrepare, - Msg: subjectPayload, - }, - { - Code: ibfttypes.MsgCommit, - Msg: subjectPayload, - }, - { - Code: ibfttypes.MsgRoundChange, - Msg: subjectPayload, - }, - } - for i := 0; i < len(msgs); i++ { - testProcessBacklog(t, msgs[i]) - } -} - -func testProcessBacklog(t *testing.T, msg *ibfttypes.Message) { - vset := newTestValidatorSet(1) - backend := &testSystemBackend{ - events: new(event.TypeMux), - peers: vset, - } - c := &core{ - logger: log.New("backend", "test", "id", 0), - backlogs: make(map[common.Address]*prque.Prque), - backlogsMu: new(sync.Mutex), - valSet: vset, - backend: backend, - state: ibfttypes.State(msg.Code), - current: newRoundState(&istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(0), - }, newTestValidatorSet(4), common.Hash{}, nil, nil, nil), - } - c.subscribeEvents() - defer c.unsubscribeEvents() - - c.storeBacklog(msg, vset.GetByIndex(0)) - c.processBacklog() - - const timeoutDura = 2 * time.Second - timeout := time.NewTimer(timeoutDura) - select { - case ev := <-c.events.Chan(): - e, ok := ev.Data.(backlogEvent) - if !ok { - t.Errorf("unexpected event comes: %v", reflect.TypeOf(ev.Data)) - } - if e.msg.Code != msg.Code { - t.Errorf("message code mismatch: have %v, want %v", e.msg.Code, msg.Code) - } - // success - case <-timeout.C: - t.Error("unexpected timeout occurs") - } -} diff --git a/consensus/istanbul/ibft/core/commit.go b/consensus/istanbul/ibft/core/commit.go deleted file mode 100644 index 5fa979332..000000000 --- a/consensus/istanbul/ibft/core/commit.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2017 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 core - -import ( - "reflect" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -func (c *core) sendCommit() { - sub := c.current.Subject() - c.broadcastCommit(sub) -} - -func (c *core) sendCommitForOldBlock(view *istanbul.View, digest common.Hash) { - sub := &istanbul.Subject{ - View: view, - Digest: digest, - } - c.broadcastCommit(sub) -} - -func (c *core) broadcastCommit(sub *istanbul.Subject) { - logger := c.logger.New("state", c.state) - - encodedSubject, err := ibfttypes.Encode(sub) - if err != nil { - logger.Error("Failed to encode", "subject", sub) - return - } - c.broadcast(&ibfttypes.Message{ - Code: ibfttypes.MsgCommit, - Msg: encodedSubject, - }) -} - -func (c *core) handleCommit(msg *ibfttypes.Message, src istanbul.Validator) error { - // Decode COMMIT message - var commit *istanbul.Subject - err := msg.Decode(&commit) - if err != nil { - return istanbulcommon.ErrFailedDecodeCommit - } - - if err := c.checkMessage(ibfttypes.MsgCommit, commit.View); err != nil { - return err - } - - if err := c.verifyCommit(commit, src); err != nil { - return err - } - - c.acceptCommit(msg, src) - - // Commit the proposal once we have enough COMMIT messages and we are not in the Committed state. - // - // If we already have a proposal, we may have chance to speed up the consensus process - // by committing the proposal without PREPARE messages. - if c.current.Commits.Size() >= c.QuorumSize() && c.state.Cmp(ibfttypes.StateCommitted) < 0 { - // Still need to call LockHash here since state can skip Prepared state and jump directly to the Committed state. - c.current.LockHash() - c.commit() - } - - return nil -} - -// verifyCommit verifies if the received COMMIT message is equivalent to our subject -func (c *core) verifyCommit(commit *istanbul.Subject, src istanbul.Validator) error { - logger := c.logger.New("from", src, "state", c.state) - - sub := c.current.Subject() - if !reflect.DeepEqual(commit, sub) { - logger.Warn("Inconsistent subjects between commit and proposal", "expected", sub, "got", commit) - return istanbulcommon.ErrInconsistentSubject - } - - return nil -} - -func (c *core) acceptCommit(msg *ibfttypes.Message, src istanbul.Validator) error { - logger := c.logger.New("from", src, "state", c.state) - - // Add the COMMIT message to current round state - if err := c.current.Commits.Add(msg); err != nil { - logger.Error("Failed to record commit message", "msg", msg, "err", err) - return err - } - - return nil -} diff --git a/consensus/istanbul/ibft/core/commit_test.go b/consensus/istanbul/ibft/core/commit_test.go deleted file mode 100644 index ea9261745..000000000 --- a/consensus/istanbul/ibft/core/commit_test.go +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright 2017 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 core - -import ( - "bytes" - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/crypto" -) - -func TestHandleCommit(t *testing.T) { - N := uint64(4) - F := uint64(1) - - proposal := newTestProposal() - expectedSubject := &istanbul.Subject{ - View: &istanbul.View{ - Round: big.NewInt(0), - Sequence: proposal.Number(), - }, - Digest: proposal.Hash(), - } - - testCases := []struct { - system *testSystem - expectedErr error - }{ - { - // normal case - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(1), - }, - c.valSet, - ) - - if i == 0 { - // replica 0 is the proposer - c.state = ibfttypes.StatePrepared - } - } - return sys - }(), - nil, - }, - { - // future message - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i == 0 { - // replica 0 is the proposer - c.current = newTestRoundState( - expectedSubject.View, - c.valSet, - ) - c.state = ibfttypes.StatePreprepared - } else { - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(2), - Sequence: big.NewInt(3), - }, - c.valSet, - ) - } - } - return sys - }(), - istanbulcommon.ErrFutureMessage, - }, - { - // subject not match - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i == 0 { - // replica 0 is the proposer - c.current = newTestRoundState( - expectedSubject.View, - c.valSet, - ) - c.state = ibfttypes.StatePreprepared - } else { - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(0), - }, - c.valSet, - ) - } - } - return sys - }(), - istanbulcommon.ErrOldMessage, - }, - { - // jump state - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: proposal.Number(), - }, - c.valSet, - ) - - // only replica0 stays at ibfttypes.StatePreprepared - // other replicas are at ibfttypes.StatePrepared - if i != 0 { - c.state = ibfttypes.StatePrepared - } else { - c.state = ibfttypes.StatePreprepared - } - } - return sys - }(), - nil, - }, - // TODO: double send message - } - -OUTER: - for _, test := range testCases { - test.system.Run(false) - - v0 := test.system.backends[0] - r0 := v0.engine - - for i, v := range test.system.backends { - validator := r0.valSet.GetByIndex(uint64(i)) - m, _ := ibfttypes.Encode(v.engine.current.Subject()) - if err := r0.handleCommit(&ibfttypes.Message{ - Code: ibfttypes.MsgCommit, - Msg: m, - Address: validator.Address(), - Signature: []byte{}, - CommittedSeal: validator.Address().Bytes(), // small hack - }, validator); err != nil { - if err != test.expectedErr { - t.Errorf("error mismatch: have %v, want %v", err, test.expectedErr) - } - if r0.current.IsHashLocked() { - t.Errorf("block should not be locked") - } - continue OUTER - } - } - - // prepared is normal case - if r0.state != ibfttypes.StateCommitted { - // There are not enough commit messages in core - if r0.state != ibfttypes.StatePrepared { - t.Errorf("state mismatch: have %v, want %v", r0.state, ibfttypes.StatePrepared) - } - if r0.current.Commits.Size() >= r0.QuorumSize() { - t.Errorf("the size of commit messages should be less than %v", r0.QuorumSize()) - } - if r0.current.IsHashLocked() { - t.Errorf("block should not be locked") - } - continue - } - - // core should have Ceil(2N/3) prepare messages - if r0.current.Commits.Size() < r0.QuorumSize() { - t.Errorf("the size of commit messages should be larger than Ceil(2N/3): size %v", r0.QuorumSize()) - } - - // check signatures large than F - signedCount := 0 - committedSeals := v0.committedMsgs[0].committedSeals - for _, validator := range r0.valSet.List() { - for _, seal := range committedSeals { - if bytes.Equal(validator.Address().Bytes(), seal[:common.AddressLength]) { - signedCount++ - break - } - } - } - if signedCount <= r0.valSet.F() { - t.Errorf("the expected signed count should be larger than %v, but got %v", r0.valSet.F(), signedCount) - } - if !r0.current.IsHashLocked() { - t.Errorf("block should be locked") - } - } -} - -// round is not checked for now -func TestVerifyCommit(t *testing.T) { - // for log purpose - privateKey, _ := crypto.GenerateKey() - peer := validator.New(getPublicKeyAddress(privateKey)) - valSet := validator.NewSet([]common.Address{peer.Address()}, istanbul.NewRoundRobinProposerPolicy()) - - sys := NewTestSystemWithBackend(uint64(1), uint64(0)) - - testCases := []struct { - expected error - commit *istanbul.Subject - roundState *roundState - }{ - { - // normal case - expected: nil, - commit: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - valSet, - ), - }, - { - // old message - expected: istanbulcommon.ErrInconsistentSubject, - commit: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(1)}, - valSet, - ), - }, - { - // different digest - expected: istanbulcommon.ErrInconsistentSubject, - commit: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - Digest: common.StringToHash("1234567890"), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(1)}, - valSet, - ), - }, - { - // malicious package(lack of sequence) - expected: istanbulcommon.ErrInconsistentSubject, - commit: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: nil}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(1)}, - valSet, - ), - }, - { - // wrong prepare message with same sequence but different round - expected: istanbulcommon.ErrInconsistentSubject, - commit: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(0)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - valSet, - ), - }, - { - // wrong prepare message with same round but different sequence - expected: istanbulcommon.ErrInconsistentSubject, - commit: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(1)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - valSet, - ), - }, - } - for i, test := range testCases { - c := sys.backends[0].engine - c.current = test.roundState - - if err := c.verifyCommit(test.commit, peer); err != nil { - if err != test.expected { - t.Errorf("result %d: error mismatch: have %v, want %v", i, err, test.expected) - } - } - } -} diff --git a/consensus/istanbul/ibft/core/core.go b/consensus/istanbul/ibft/core/core.go deleted file mode 100644 index 795c88200..000000000 --- a/consensus/istanbul/ibft/core/core.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright 2017 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 core - -import ( - "bytes" - "math" - "math/big" - "sync" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - metrics "github.com/ethereum/go-ethereum/metrics" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" -) - -var ( - roundMeter = metrics.NewRegisteredMeter("consensus/istanbul/core/round", nil) - sequenceMeter = metrics.NewRegisteredMeter("consensus/istanbul/core/sequence", nil) - consensusTimer = metrics.NewRegisteredTimer("consensus/istanbul/core/consensus", nil) -) - -// New creates an Istanbul consensus core -func New(backend istanbul.Backend, config *istanbul.Config) *core { - c := &core{ - config: config, - address: backend.Address(), - state: ibfttypes.StateAcceptRequest, - handlerWg: new(sync.WaitGroup), - logger: log.New("address", backend.Address()), - backend: backend, - backlogs: make(map[common.Address]*prque.Prque), - backlogsMu: new(sync.Mutex), - pendingRequests: prque.New(), - pendingRequestsMu: new(sync.Mutex), - consensusTimestamp: time.Time{}, - } - - c.validateFn = c.checkValidatorSignature - return c -} - -// ---------------------------------------------------------------------------- - -type core struct { - config *istanbul.Config - address common.Address - state ibfttypes.State - logger log.Logger - - backend istanbul.Backend - events *event.TypeMuxSubscription - finalCommittedSub *event.TypeMuxSubscription - timeoutSub *event.TypeMuxSubscription - futurePreprepareTimer *time.Timer - - valSet istanbul.ValidatorSet - waitingForRoundChange bool - validateFn func([]byte, []byte) (common.Address, error) - - backlogs map[common.Address]*prque.Prque - backlogsMu *sync.Mutex - - current *roundState - handlerWg *sync.WaitGroup - - roundChangeSet *roundChangeSet - roundChangeTimer *time.Timer - - pendingRequests *prque.Prque - pendingRequestsMu *sync.Mutex - - consensusTimestamp time.Time -} - -func (c *core) finalizeMessage(msg *ibfttypes.Message) ([]byte, error) { - var err error - // Add sender address - msg.Address = c.Address() - - // Assign the CommittedSeal if it's a COMMIT message and proposal is not nil - if msg.Code == ibfttypes.MsgCommit && c.current.Proposal() != nil { - msg.CommittedSeal = []byte{} - seal := PrepareCommittedSeal(c.current.Proposal().Hash()) - // Add proof of consensus - msg.CommittedSeal, err = c.backend.Sign(seal) - if err != nil { - return nil, err - } - } - - // Sign message - data, err := msg.PayloadNoSig() - if err != nil { - return nil, err - } - msg.Signature, err = c.backend.Sign(data) - if err != nil { - return nil, err - } - - // Convert to payload - payload, err := msg.Payload() - if err != nil { - return nil, err - } - - return payload, nil -} - -func (c *core) broadcast(msg *ibfttypes.Message) { - logger := c.logger.New("state", c.state) - - payload, err := c.finalizeMessage(msg) - if err != nil { - logger.Error("Failed to finalize message", "msg", msg, "err", err) - return - } - - // Broadcast payload - if err = c.backend.Broadcast(c.valSet, msg.Code, payload); err != nil { - logger.Error("Failed to broadcast message", "msg", msg, "err", err) - return - } -} - -func (c *core) currentView() *istanbul.View { - return &istanbul.View{ - Sequence: new(big.Int).Set(c.current.Sequence()), - Round: new(big.Int).Set(c.current.Round()), - } -} - -func (c *core) IsProposer() bool { - v := c.valSet - if v == nil { - return false - } - return v.IsProposer(c.backend.Address()) -} - -func (c *core) IsCurrentProposal(blockHash common.Hash) bool { - return c.current != nil && c.current.pendingRequest != nil && c.current.pendingRequest.Proposal.Hash() == blockHash -} - -func (c *core) commit() { - c.setState(ibfttypes.StateCommitted) - - proposal := c.current.Proposal() - if proposal != nil { - committedSeals := make([][]byte, c.current.Commits.Size()) - for i, v := range c.current.Commits.Values() { - committedSeals[i] = make([]byte, types.IstanbulExtraSeal) - copy(committedSeals[i][:], v.CommittedSeal[:]) - } - - if err := c.backend.Commit(proposal, committedSeals, big.NewInt(-1)); err != nil { - c.current.UnlockHash() //Unlock block when insertion fails - c.sendNextRoundChange() - return - } - } -} - -// startNewRound starts a new round. if round equals to 0, it means to starts a new sequence -func (c *core) startNewRound(round *big.Int) { - var logger log.Logger - if c.current == nil { - logger = c.logger.New("old_round", -1, "old_seq", 0) - } else { - logger = c.logger.New("old_round", c.current.Round(), "old_seq", c.current.Sequence()) - } - - logger.Trace("Start new ibft round") - - roundChange := false - // Try to get last proposal - lastProposal, lastProposer := c.backend.LastProposal() - if c.current == nil { - logger.Trace("Start to the initial round") - } else if lastProposal.Number().Cmp(c.current.Sequence()) >= 0 { - diff := new(big.Int).Sub(lastProposal.Number(), c.current.Sequence()) - sequenceMeter.Mark(new(big.Int).Add(diff, common.Big1).Int64()) - - if !c.consensusTimestamp.IsZero() { - consensusTimer.UpdateSince(c.consensusTimestamp) - c.consensusTimestamp = time.Time{} - } - logger.Trace("Catch up latest proposal", "number", lastProposal.Number().Uint64(), "hash", lastProposal.Hash()) - } else if lastProposal.Number().Cmp(big.NewInt(c.current.Sequence().Int64()-1)) == 0 { - if round.Cmp(common.Big0) == 0 { - // same seq and round, don't need to start new round - return - } else if round.Cmp(c.current.Round()) < 0 { - logger.Warn("New round should not be smaller than current round", "seq", lastProposal.Number().Int64(), "new_round", round, "old_round", c.current.Round()) - return - } - roundChange = true - } else { - logger.Warn("New sequence should be larger than current sequence", "new_seq", lastProposal.Number().Int64()) - return - } - - var newView *istanbul.View - if roundChange { - newView = &istanbul.View{ - Sequence: new(big.Int).Set(c.current.Sequence()), - Round: new(big.Int).Set(round), - } - } else { - newView = &istanbul.View{ - Sequence: new(big.Int).Add(lastProposal.Number(), common.Big1), - Round: new(big.Int), - } - c.valSet = c.backend.Validators(lastProposal) - } - - // If new round is 0, then enable qbft consensus - if round.Uint64() == 0 { - logger.Trace("Starting qbft consensus as qbftBlock has passed") - if err := c.backend.StartQBFTConsensus(); err != nil { - // If err is returned, then QBFT consensus is started for the next block - logger.Error("Unable to start QBFT Consensus, retrying for the next block", "error", err) - } - return - } - - // Update logger - logger = logger.New("old_proposer", c.valSet.GetProposer()) - // Clear invalid ROUND CHANGE messages - c.roundChangeSet = newRoundChangeSet(c.valSet) - // New snapshot for new round - c.updateRoundState(newView, c.valSet, roundChange) - // Calculate new proposer - c.valSet.CalcProposer(lastProposer, newView.Round.Uint64()) - c.waitingForRoundChange = false - c.setState(ibfttypes.StateAcceptRequest) - if roundChange && c.IsProposer() && c.current != nil { - // If it is locked, propose the old proposal - // If we have pending request, propose pending request - if c.current.IsHashLocked() { - r := &istanbul.Request{ - Proposal: c.current.Proposal(), //c.current.Proposal would be the locked proposal by previous proposer, see updateRoundState - } - c.sendPreprepare(r) - } else if c.current.pendingRequest != nil { - c.sendPreprepare(c.current.pendingRequest) - } - } - c.newRoundChangeTimer() - - logger.Debug("New round", "new_round", newView.Round, "new_seq", newView.Sequence, "new_proposer", c.valSet.GetProposer(), "valSet", c.valSet.List(), "size", c.valSet.Size(), "IsProposer", c.IsProposer()) -} - -func (c *core) catchUpRound(view *istanbul.View) { - logger := c.logger.New("old_round", c.current.Round(), "old_seq", c.current.Sequence(), "old_proposer", c.valSet.GetProposer()) - - if view.Round.Cmp(c.current.Round()) > 0 { - roundMeter.Mark(new(big.Int).Sub(view.Round, c.current.Round()).Int64()) - } - c.waitingForRoundChange = true - - // Need to keep block locked for round catching up - c.updateRoundState(view, c.valSet, true) - c.roundChangeSet.Clear(view.Round) - c.newRoundChangeTimer() - - logger.Trace("Catch up round", "new_round", view.Round, "new_seq", view.Sequence, "new_proposer", c.valSet) -} - -// updateRoundState updates round state by checking if locking block is necessary -func (c *core) updateRoundState(view *istanbul.View, validatorSet istanbul.ValidatorSet, roundChange bool) { - // Lock only if both roundChange is true and it is locked - if roundChange && c.current != nil { - if c.current.IsHashLocked() { - c.current = newRoundState(view, validatorSet, c.current.GetLockedHash(), c.current.Preprepare, c.current.pendingRequest, c.backend.HasBadProposal) - } else { - c.current = newRoundState(view, validatorSet, common.Hash{}, nil, c.current.pendingRequest, c.backend.HasBadProposal) - } - } else { - c.current = newRoundState(view, validatorSet, common.Hash{}, nil, nil, c.backend.HasBadProposal) - } -} - -func (c *core) setState(state ibfttypes.State) { - if c.state != state { - c.state = state - } - if state == ibfttypes.StateAcceptRequest { - c.processPendingRequests() - } - c.processBacklog() -} - -func (c *core) Address() common.Address { - return c.address -} - -func (c *core) stopFuturePreprepareTimer() { - if c.futurePreprepareTimer != nil { - c.futurePreprepareTimer.Stop() - } -} - -func (c *core) stopTimer() { - c.stopFuturePreprepareTimer() - if c.roundChangeTimer != nil { - c.roundChangeTimer.Stop() - } -} - -func (c *core) newRoundChangeTimer() { - c.stopTimer() - - // set timeout based on the round number - timeout := time.Duration(c.config.RequestTimeout) * time.Millisecond - round := c.current.Round().Uint64() - if round > 0 { - timeout += time.Duration(math.Pow(2, float64(round))) * time.Second - } - c.roundChangeTimer = time.AfterFunc(timeout, func() { - c.sendEvent(timeoutEvent{}) - }) -} - -func (c *core) checkValidatorSignature(data []byte, sig []byte) (common.Address, error) { - return istanbul.CheckValidatorSignature(c.valSet, data, sig) -} - -func (c *core) QuorumSize() int { - return int(math.Ceil(float64(2*c.valSet.Size()) / 3)) -} - -// PrepareCommittedSeal returns a committed seal for the given hash -func PrepareCommittedSeal(hash common.Hash) []byte { - var buf bytes.Buffer - buf.Write(hash.Bytes()) - buf.Write([]byte{byte(ibfttypes.MsgCommit)}) - return buf.Bytes() -} diff --git a/consensus/istanbul/ibft/core/core_test.go b/consensus/istanbul/ibft/core/core_test.go deleted file mode 100644 index b2378d16d..000000000 --- a/consensus/istanbul/ibft/core/core_test.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2017 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 core - -import ( - "fmt" - "math/big" - "reflect" - "testing" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/core/types" - elog "github.com/ethereum/go-ethereum/log" -) - -func makeBlock(number int64) *types.Block { - header := &types.Header{ - Difficulty: big.NewInt(0), - Number: big.NewInt(number), - GasLimit: 0, - GasUsed: 0, - Time: 0, - } - block := &types.Block{} - return block.WithSeal(header) -} - -func newTestProposal() istanbul.Proposal { - return makeBlock(1) -} - -func TestNewRequest(t *testing.T) { - testLogger.SetHandler(elog.StdoutHandler) - - N := uint64(4) - F := uint64(1) - - sys := NewTestSystemWithBackend(N, F) - - close := sys.Run(true) - defer close() - - request1 := makeBlock(1) - sys.backends[0].NewRequest(request1) - - <-time.After(1 * time.Second) - - request2 := makeBlock(2) - sys.backends[0].NewRequest(request2) - - <-time.After(1 * time.Second) - - for _, backend := range sys.backends { - if len(backend.committedMsgs) != 2 { - t.Fatalf("the number of executed requests mismatch: have %v, want 2", len(backend.committedMsgs)) - } - if !reflect.DeepEqual(request1.Number(), backend.committedMsgs[0].commitProposal.Number()) { - t.Errorf("the number of requests mismatch: have %v, want %v", request1.Number(), backend.committedMsgs[0].commitProposal.Number()) - } - if !reflect.DeepEqual(request2.Number(), backend.committedMsgs[1].commitProposal.Number()) { - t.Errorf("the number of requests mismatch: have %v, want %v", request2.Number(), backend.committedMsgs[1].commitProposal.Number()) - } - } -} - -func TestQuorumSize(t *testing.T) { - N := uint64(4) - F := uint64(1) - - sys := NewTestSystemWithBackend(N, F) - backend := sys.backends[0] - c := backend.engine - - valSet := c.valSet - for i := 1; i <= 1000; i++ { - valSet.AddValidator(common.StringToAddress(fmt.Sprint(i))) - if 2*c.QuorumSize() <= (valSet.Size()+valSet.F()) || 2*c.QuorumSize() > (valSet.Size()+valSet.F()+2) { - t.Errorf("quorumSize constraint failed, expected value (2*QuorumSize > Size+F && 2*QuorumSize <= Size+F+2) to be:%v, got: %v, for size: %v", true, false, valSet.Size()) - } - } -} - -func TestNilCommittedSealWithEmptyProposal(t *testing.T) { - N := uint64(4) - F := uint64(1) - - sys := NewTestSystemWithBackend(N, F) - backend := sys.backends[0] - c := backend.engine - // Set the current round state with an empty proposal - preprepare := &istanbul.Preprepare{ - View: c.currentView(), - } - c.current.SetPreprepare(preprepare) - - // Create a Commit message - subject := &istanbul.Subject{ - View: c.currentView(), - Digest: common.StringToHash("1234567890"), - } - subjectPayload, err := ibfttypes.Encode(subject) - if err != nil { - t.Errorf("problem with encoding: %v", err) - } - msg := &ibfttypes.Message{ - Code: ibfttypes.MsgCommit, - Msg: subjectPayload, - } - - c.finalizeMessage(msg) - - if msg.CommittedSeal != nil { - t.Errorf("Unexpected committed seal: %s", msg.CommittedSeal) - } -} diff --git a/consensus/istanbul/ibft/core/events.go b/consensus/istanbul/ibft/core/events.go deleted file mode 100644 index f8f46facb..000000000 --- a/consensus/istanbul/ibft/core/events.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 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 core - -import ( - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -type backlogEvent struct { - src istanbul.Validator - msg *ibfttypes.Message -} - -type timeoutEvent struct{} diff --git a/consensus/istanbul/ibft/core/final_committed.go b/consensus/istanbul/ibft/core/final_committed.go deleted file mode 100644 index 4377f58a7..000000000 --- a/consensus/istanbul/ibft/core/final_committed.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 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 core - -import ( - "github.com/ethereum/go-ethereum/common" -) - -func (c *core) handleFinalCommitted() error { - logger := c.logger.New("state", c.state) - logger.Trace("Received a final committed proposal") - - go c.startNewRound(common.Big0) - return nil -} diff --git a/consensus/istanbul/ibft/core/handler.go b/consensus/istanbul/ibft/core/handler.go deleted file mode 100644 index 69486b404..000000000 --- a/consensus/istanbul/ibft/core/handler.go +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2017 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 core - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -// Start implements core.Engine.Start -func (c *core) Start() error { - // Tests will handle events itself, so we have to make subscribeEvents() - // be able to call in test. - c.subscribeEvents() - c.handlerWg.Add(1) - go c.handleEvents() - - // Start a new round from last sequence + 1 - c.startNewRound(common.Big0) - - return nil -} - -// Stop implements core.Engine.Stop -func (c *core) Stop() error { - c.stopTimer() - c.unsubscribeEvents() - - c.handlerWg.Wait() - return nil -} - -// ---------------------------------------------------------------------------- - -// Subscribe both internal and external events -func (c *core) subscribeEvents() { - c.events = c.backend.EventMux().Subscribe( - // external events - istanbul.RequestEvent{}, - istanbul.MessageEvent{}, - // internal events - backlogEvent{}, - ) - c.timeoutSub = c.backend.EventMux().Subscribe( - timeoutEvent{}, - ) - c.finalCommittedSub = c.backend.EventMux().Subscribe( - istanbul.FinalCommittedEvent{}, - ) -} - -// Unsubscribe all events -func (c *core) unsubscribeEvents() { - c.events.Unsubscribe() - c.timeoutSub.Unsubscribe() - c.finalCommittedSub.Unsubscribe() -} - -func (c *core) handleEvents() { - // Clear state - defer func() { - c.current = nil - c.handlerWg.Done() - }() - - for { - select { - case event, ok := <-c.events.Chan(): - if !ok { - return - } - - // A real event arrived, process interesting content - switch ev := event.Data.(type) { - case istanbul.RequestEvent: - - r := &istanbul.Request{ - Proposal: ev.Proposal, - } - err := c.handleRequest(r) - if err == istanbulcommon.ErrFutureMessage { - c.storeRequestMsg(r) - } - case istanbul.MessageEvent: - - if err := c.handleMsg(ev.Payload); err == nil { - c.backend.Gossip(c.valSet, ev.Code, ev.Payload) - } - case backlogEvent: - // No need to check signature for internal messages - if err := c.handleCheckedMsg(ev.msg, ev.src); err == nil { - p, err := ev.msg.Payload() - if err != nil { - c.logger.Warn("Get message payload failed", "err", err) - continue - } - c.backend.Gossip(c.valSet, ev.msg.Code, p) - } - } - case _, ok := <-c.timeoutSub.Chan(): - if !ok { - return - } - c.handleTimeoutMsg() - case event, ok := <-c.finalCommittedSub.Chan(): - if !ok { - return - } - switch event.Data.(type) { - case istanbul.FinalCommittedEvent: - c.handleFinalCommitted() - } - } - } -} - -// sendEvent sends events to mux -func (c *core) sendEvent(ev interface{}) { - c.backend.EventMux().Post(ev) -} - -func (c *core) handleMsg(payload []byte) error { - logger := c.logger.New() - - // Decode message and check its signature - msg := new(ibfttypes.Message) - if err := msg.FromPayload(payload, c.validateFn); err != nil { - logger.Error("Failed to decode message from payload", "err", err) - return err - } - - // Only accept message if the address is valid - _, src := c.valSet.GetByAddress(msg.Address) - if src == nil { - logger.Error("Invalid address in message", "msg", msg) - return istanbul.ErrUnauthorizedAddress - } - - return c.handleCheckedMsg(msg, src) -} - -func (c *core) handleCheckedMsg(msg *ibfttypes.Message, src istanbul.Validator) error { - logger := c.logger.New("address", c.address, "from", src) - - // Store the message if it's a future message - testBacklog := func(err error) error { - if err == istanbulcommon.ErrFutureMessage { - c.storeBacklog(msg, src) - } - - return err - } - - switch msg.Code { - case ibfttypes.MsgPreprepare: - err := c.handlePreprepare(msg, src) - return testBacklog(err) - case ibfttypes.MsgPrepare: - err := c.handlePrepare(msg, src) - return testBacklog(err) - case ibfttypes.MsgCommit: - err := c.handleCommit(msg, src) - return testBacklog(err) - case ibfttypes.MsgRoundChange: - err := c.handleRoundChange(msg, src) - return testBacklog(err) - default: - logger.Error("Invalid message", "msg", msg) - } - - return istanbulcommon.ErrInvalidMessage -} - -func (c *core) handleTimeoutMsg() { - // If we're not waiting for round change yet, we can try to catch up - // the max round with F+1 round change message. We only need to catch up - // if the max round is larger than current round. - if !c.waitingForRoundChange { - maxRound := c.roundChangeSet.MaxRound(c.valSet.F() + 1) - if maxRound != nil && maxRound.Cmp(c.current.Round()) > 0 { - c.sendRoundChange(maxRound) - return - } - } - - lastProposal, _ := c.backend.LastProposal() - if lastProposal != nil && lastProposal.Number().Cmp(c.current.Sequence()) >= 0 { - c.logger.Trace("round change timeout, catch up latest sequence", "number", lastProposal.Number().Uint64()) - c.startNewRound(common.Big0) - } else { - c.sendNextRoundChange() - } -} diff --git a/consensus/istanbul/ibft/core/handler_test.go b/consensus/istanbul/ibft/core/handler_test.go deleted file mode 100644 index 049a8ab68..000000000 --- a/consensus/istanbul/ibft/core/handler_test.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -// notice: the normal case have been tested in integration tests. -func TestHandleMsg(t *testing.T) { - N := uint64(4) - F := uint64(1) - sys := NewTestSystemWithBackend(N, F) - - closer := sys.Run(true) - defer closer() - - v0 := sys.backends[0] - r0 := v0.engine - - m, _ := ibfttypes.Encode(&istanbul.Subject{ - View: &istanbul.View{ - Sequence: big.NewInt(0), - Round: big.NewInt(0), - }, - Digest: common.StringToHash("1234567890"), - }) - // with a matched payload. msgPreprepare should match with *istanbul.Preprepare in normal case. - msg := &ibfttypes.Message{ - Code: ibfttypes.MsgPreprepare, - Msg: m, - Address: v0.Address(), - Signature: []byte{}, - CommittedSeal: []byte{}, - } - - _, val := v0.Validators(nil).GetByAddress(v0.Address()) - if err := r0.handleCheckedMsg(msg, val); err != istanbulcommon.ErrFailedDecodePreprepare { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFailedDecodePreprepare) - } - - m, _ = ibfttypes.Encode(&istanbul.Preprepare{ - View: &istanbul.View{ - Sequence: big.NewInt(0), - Round: big.NewInt(0), - }, - Proposal: makeBlock(1), - }) - // with a unmatched payload. msgPrepare should match with *istanbul.Subject in normal case. - msg = &ibfttypes.Message{ - Code: ibfttypes.MsgPrepare, - Msg: m, - Address: v0.Address(), - Signature: []byte{}, - CommittedSeal: []byte{}, - } - - _, val = v0.Validators(nil).GetByAddress(v0.Address()) - if err := r0.handleCheckedMsg(msg, val); err != istanbulcommon.ErrFailedDecodePrepare { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFailedDecodePreprepare) - } - - m, _ = ibfttypes.Encode(&istanbul.Preprepare{ - View: &istanbul.View{ - Sequence: big.NewInt(0), - Round: big.NewInt(0), - }, - Proposal: makeBlock(2), - }) - // with a unmatched payload. istanbul.MsgCommit should match with *istanbul.Subject in normal case. - msg = &ibfttypes.Message{ - Code: ibfttypes.MsgCommit, - Msg: m, - Address: v0.Address(), - Signature: []byte{}, - CommittedSeal: []byte{}, - } - - _, val = v0.Validators(nil).GetByAddress(v0.Address()) - if err := r0.handleCheckedMsg(msg, val); err != istanbulcommon.ErrFailedDecodeCommit { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFailedDecodeCommit) - } - - m, _ = ibfttypes.Encode(&istanbul.Preprepare{ - View: &istanbul.View{ - Sequence: big.NewInt(0), - Round: big.NewInt(0), - }, - Proposal: makeBlock(3), - }) - // invalid message code. message code is not exists in list - msg = &ibfttypes.Message{ - Code: uint64(99), - Msg: m, - Address: v0.Address(), - Signature: []byte{}, - CommittedSeal: []byte{}, - } - - _, val = v0.Validators(nil).GetByAddress(v0.Address()) - if err := r0.handleCheckedMsg(msg, val); err == nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - // with malicious payload - if err := r0.handleMsg([]byte{1}); err == nil { - t.Errorf("error mismatch: have %v, want nil", err) - } -} diff --git a/consensus/istanbul/ibft/core/message_set.go b/consensus/istanbul/ibft/core/message_set.go deleted file mode 100644 index 644c9d988..000000000 --- a/consensus/istanbul/ibft/core/message_set.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2017 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 core - -import ( - "fmt" - "math/big" - "strings" - "sync" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -// Construct a new message set to accumulate messages for given sequence/view number. -func newMessageSet(valSet istanbul.ValidatorSet) *messageSet { - return &messageSet{ - view: &istanbul.View{ - Round: new(big.Int), - Sequence: new(big.Int), - }, - messagesMu: new(sync.Mutex), - messages: make(map[common.Address]*ibfttypes.Message), - valSet: valSet, - } -} - -// ---------------------------------------------------------------------------- - -type messageSet struct { - view *istanbul.View - valSet istanbul.ValidatorSet - messagesMu *sync.Mutex - messages map[common.Address]*ibfttypes.Message -} - -func (ms *messageSet) View() *istanbul.View { - return ms.view -} - -func (ms *messageSet) Add(msg *ibfttypes.Message) error { - ms.messagesMu.Lock() - defer ms.messagesMu.Unlock() - - if err := ms.verify(msg); err != nil { - return err - } - - return ms.addVerifiedMessage(msg) -} - -func (ms *messageSet) Values() (result []*ibfttypes.Message) { - ms.messagesMu.Lock() - defer ms.messagesMu.Unlock() - - for _, v := range ms.messages { - result = append(result, v) - } - - return result -} - -func (ms *messageSet) Size() int { - ms.messagesMu.Lock() - defer ms.messagesMu.Unlock() - return len(ms.messages) -} - -func (ms *messageSet) Get(addr common.Address) *ibfttypes.Message { - ms.messagesMu.Lock() - defer ms.messagesMu.Unlock() - return ms.messages[addr] -} - -// ---------------------------------------------------------------------------- - -func (ms *messageSet) verify(msg *ibfttypes.Message) error { - // verify if the message comes from one of the validators - if _, v := ms.valSet.GetByAddress(msg.Address); v == nil { - return istanbul.ErrUnauthorizedAddress - } - - // TODO: check view number and sequence number - - return nil -} - -func (ms *messageSet) addVerifiedMessage(msg *ibfttypes.Message) error { - ms.messages[msg.Address] = msg - return nil -} - -func (ms *messageSet) String() string { - ms.messagesMu.Lock() - defer ms.messagesMu.Unlock() - addresses := make([]string, 0, len(ms.messages)) - for _, v := range ms.messages { - addresses = append(addresses, v.Address.String()) - } - return fmt.Sprintf("[%v]", strings.Join(addresses, ", ")) -} diff --git a/consensus/istanbul/ibft/core/message_set_test.go b/consensus/istanbul/ibft/core/message_set_test.go deleted file mode 100644 index 736eb8b88..000000000 --- a/consensus/istanbul/ibft/core/message_set_test.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/rlp" -) - -func TestMessageSetWithPreprepare(t *testing.T) { - valSet := newTestValidatorSet(4) - - ms := newMessageSet(valSet) - - view := &istanbul.View{ - Round: new(big.Int), - Sequence: new(big.Int), - } - pp := &istanbul.Preprepare{ - View: view, - Proposal: makeBlock(1), - } - - rawPP, err := rlp.EncodeToBytes(pp) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - msg := &ibfttypes.Message{ - Code: ibfttypes.MsgPreprepare, - Msg: rawPP, - Address: valSet.GetProposer().Address(), - } - - err = ms.Add(msg) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - err = ms.Add(msg) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - if ms.Size() != 1 { - t.Errorf("the size of message set mismatch: have %v, want 1", ms.Size()) - } -} - -func TestMessageSetWithSubject(t *testing.T) { - valSet := newTestValidatorSet(4) - - ms := newMessageSet(valSet) - - view := &istanbul.View{ - Round: new(big.Int), - Sequence: new(big.Int), - } - - sub := &istanbul.Subject{ - View: view, - Digest: common.StringToHash("1234567890"), - } - - rawSub, err := rlp.EncodeToBytes(sub) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - msg := &ibfttypes.Message{ - Code: ibfttypes.MsgPrepare, - Msg: rawSub, - Address: valSet.GetProposer().Address(), - } - - err = ms.Add(msg) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - err = ms.Add(msg) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - if ms.Size() != 1 { - t.Errorf("the size of message set mismatch: have %v, want 1", ms.Size()) - } -} diff --git a/consensus/istanbul/ibft/core/prepare.go b/consensus/istanbul/ibft/core/prepare.go deleted file mode 100644 index 20047e89f..000000000 --- a/consensus/istanbul/ibft/core/prepare.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2017 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 core - -import ( - "reflect" - - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -func (c *core) sendPrepare() { - logger := c.logger.New("state", c.state) - - sub := c.current.Subject() - encodedSubject, err := ibfttypes.Encode(sub) - if err != nil { - logger.Error("Failed to encode", "subject", sub) - return - } - c.broadcast(&ibfttypes.Message{ - Code: ibfttypes.MsgPrepare, - Msg: encodedSubject, - }) -} - -func (c *core) handlePrepare(msg *ibfttypes.Message, src istanbul.Validator) error { - // Decode PREPARE message - var prepare *istanbul.Subject - err := msg.Decode(&prepare) - if err != nil { - return istanbulcommon.ErrFailedDecodePrepare - } - - if err := c.checkMessage(ibfttypes.MsgPrepare, prepare.View); err != nil { - return err - } - - // If it is locked, it can only process on the locked block. - // Passing verifyPrepare and checkMessage implies it is processing on the locked block since it was verified in the Preprepared state. - if err := c.verifyPrepare(prepare, src); err != nil { - return err - } - - c.acceptPrepare(msg, src) - - // Change to Prepared state if we've received enough PREPARE messages or it is locked - // and we are in earlier state before Prepared state. - if ((c.current.IsHashLocked() && prepare.Digest == c.current.GetLockedHash()) || c.current.GetPrepareOrCommitSize() >= c.QuorumSize()) && - c.state.Cmp(ibfttypes.StatePrepared) < 0 { - c.current.LockHash() - c.setState(ibfttypes.StatePrepared) - c.sendCommit() - } - - return nil -} - -// verifyPrepare verifies if the received PREPARE message is equivalent to our subject -func (c *core) verifyPrepare(prepare *istanbul.Subject, src istanbul.Validator) error { - logger := c.logger.New("from", src, "state", c.state) - - sub := c.current.Subject() - if !reflect.DeepEqual(prepare, sub) { - logger.Warn("Inconsistent subjects between PREPARE and proposal", "expected", sub, "got", prepare) - return istanbulcommon.ErrInconsistentSubject - } - - return nil -} - -func (c *core) acceptPrepare(msg *ibfttypes.Message, src istanbul.Validator) error { - logger := c.logger.New("from", src, "state", c.state) - - // Add the PREPARE message to current round state - if err := c.current.Prepares.Add(msg); err != nil { - logger.Error("Failed to add PREPARE message to round state", "msg", msg, "err", err) - return err - } - - return nil -} diff --git a/consensus/istanbul/ibft/core/prepare_test.go b/consensus/istanbul/ibft/core/prepare_test.go deleted file mode 100644 index ff49e9c83..000000000 --- a/consensus/istanbul/ibft/core/prepare_test.go +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math" - "math/big" - "reflect" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/crypto" -) - -func TestHandlePrepare(t *testing.T) { - N := uint64(4) - F := uint64(1) - - proposal := newTestProposal() - expectedSubject := &istanbul.Subject{ - View: &istanbul.View{ - Round: big.NewInt(0), - Sequence: proposal.Number(), - }, - Digest: proposal.Hash(), - } - - testCases := []struct { - system *testSystem - expectedErr error - }{ - { - // normal case - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(1), - }, - c.valSet, - ) - - if i == 0 { - // replica 0 is the proposer - c.state = ibfttypes.StatePreprepared - } - } - return sys - }(), - nil, - }, - { - // future ibfttypes.Message - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i == 0 { - // replica 0 is the proposer - c.current = newTestRoundState( - expectedSubject.View, - c.valSet, - ) - c.state = ibfttypes.StatePreprepared - } else { - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(2), - Sequence: big.NewInt(3), - }, - c.valSet, - ) - } - } - return sys - }(), - istanbulcommon.ErrFutureMessage, - }, - { - // subject not match - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i == 0 { - // replica 0 is the proposer - c.current = newTestRoundState( - expectedSubject.View, - c.valSet, - ) - c.state = ibfttypes.StatePreprepared - } else { - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(0), - }, - c.valSet, - ) - } - } - return sys - }(), - istanbulcommon.ErrOldMessage, - }, - { - // subject not match - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i == 0 { - // replica 0 is the proposer - c.current = newTestRoundState( - expectedSubject.View, - c.valSet, - ) - c.state = ibfttypes.StatePreprepared - } else { - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(1)}, - c.valSet, - ) - } - } - return sys - }(), - istanbulcommon.ErrInconsistentSubject, - }, - { - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - // save less than Ceil(2*N/3) replica - sys.backends = sys.backends[int(math.Ceil(float64(2*N)/3)):] - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - c.current = newTestRoundState( - expectedSubject.View, - c.valSet, - ) - - if i == 0 { - // replica 0 is the proposer - c.state = ibfttypes.StatePreprepared - } - } - return sys - }(), - nil, - }, - // TODO: double send ibfttypes.Message - } - -OUTER: - for _, test := range testCases { - test.system.Run(false) - - v0 := test.system.backends[0] - r0 := v0.engine - - for i, v := range test.system.backends { - validator := r0.valSet.GetByIndex(uint64(i)) - m, _ := ibfttypes.Encode(v.engine.current.Subject()) - if err := r0.handlePrepare(&ibfttypes.Message{ - Code: ibfttypes.MsgPrepare, - Msg: m, - Address: validator.Address(), - }, validator); err != nil { - if err != test.expectedErr { - t.Errorf("error mismatch: have %v, want %v", err, test.expectedErr) - } - if r0.current.IsHashLocked() { - t.Errorf("block should not be locked") - } - continue OUTER - } - } - - // prepared is normal case - if r0.state != ibfttypes.StatePrepared { - // There are not enough PREPARE messages in core - if r0.state != ibfttypes.StatePreprepared { - t.Errorf("state mismatch: have %v, want %v", r0.state, ibfttypes.StatePreprepared) - } - if r0.current.Prepares.Size() >= r0.QuorumSize() { - t.Errorf("the size of PREPARE messages should be less than %v", r0.QuorumSize()) - } - if r0.current.IsHashLocked() { - t.Errorf("block should not be locked") - } - - continue - } - - // core should have Ceil(2N/3) PREPARE messages - if r0.current.Prepares.Size() < r0.QuorumSize() { - t.Errorf("the size of PREPARE messages should be larger than 2F+1 or ceil(2N/3): size %v", r0.current.Commits.Size()) - } - - // a ibfttypes.Message will be delivered to backend if ceil(2N/3) - if int64(len(v0.sentMsgs)) != 1 { - t.Errorf("the Send() should be called once: times %v", len(test.system.backends[0].sentMsgs)) - } - - // verify COMMIT messages - decodedMsg := new(ibfttypes.Message) - err := decodedMsg.FromPayload(v0.sentMsgs[0], nil) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - if decodedMsg.Code != ibfttypes.MsgCommit { - t.Errorf("ibfttypes.Message code mismatch: have %v, want %v", decodedMsg.Code, ibfttypes.MsgCommit) - } - var m *istanbul.Subject - err = decodedMsg.Decode(&m) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - if !reflect.DeepEqual(m, expectedSubject) { - t.Errorf("subject mismatch: have %v, want %v", m, expectedSubject) - } - if !r0.current.IsHashLocked() { - t.Errorf("block should be locked") - } - } -} - -// round is not checked for now -func TestVerifyPrepare(t *testing.T) { - // for log purpose - privateKey, _ := crypto.GenerateKey() - peer := validator.New(getPublicKeyAddress(privateKey)) - valSet := validator.NewSet([]common.Address{peer.Address()}, istanbul.NewRoundRobinProposerPolicy()) - - sys := NewTestSystemWithBackend(uint64(1), uint64(0)) - - testCases := []struct { - expected error - - prepare *istanbul.Subject - roundState *roundState - }{ - { - // normal case - expected: nil, - prepare: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - valSet, - ), - }, - { - // old ibfttypes.Message - expected: istanbulcommon.ErrInconsistentSubject, - prepare: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(1)}, - valSet, - ), - }, - { - // different digest - expected: istanbulcommon.ErrInconsistentSubject, - prepare: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - Digest: common.StringToHash("1234567890"), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(1)}, - valSet, - ), - }, - { - // malicious package(lack of sequence) - expected: istanbulcommon.ErrInconsistentSubject, - prepare: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: nil}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(1)}, - valSet, - ), - }, - { - // wrong PREPARE ibfttypes.Message with same sequence but different round - expected: istanbulcommon.ErrInconsistentSubject, - prepare: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(1), Sequence: big.NewInt(0)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - valSet, - ), - }, - { - // wrong PREPARE ibfttypes.Message with same round but different sequence - expected: istanbulcommon.ErrInconsistentSubject, - prepare: &istanbul.Subject{ - View: &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(1)}, - Digest: newTestProposal().Hash(), - }, - roundState: newTestRoundState( - &istanbul.View{Round: big.NewInt(0), Sequence: big.NewInt(0)}, - valSet, - ), - }, - } - for i, test := range testCases { - c := sys.backends[0].engine - c.current = test.roundState - - if err := c.verifyPrepare(test.prepare, peer); err != nil { - if err != test.expected { - t.Errorf("result %d: error mismatch: have %v, want %v", i, err, test.expected) - } - } - } -} diff --git a/consensus/istanbul/ibft/core/preprepare.go b/consensus/istanbul/ibft/core/preprepare.go deleted file mode 100644 index 487c5abf5..000000000 --- a/consensus/istanbul/ibft/core/preprepare.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2017 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 core - -import ( - "time" - - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -func (c *core) sendPreprepare(request *istanbul.Request) { - logger := c.logger.New("state", c.state) - // If I'm the proposer and I have the same sequence with the proposal - if c.current.Sequence().Cmp(request.Proposal.Number()) == 0 && c.IsProposer() { - curView := c.currentView() - preprepare, err := ibfttypes.Encode(&istanbul.Preprepare{ - View: curView, - Proposal: request.Proposal, - }) - if err != nil { - logger.Error("Failed to encode", "view", curView) - return - } - c.broadcast(&ibfttypes.Message{ - Code: ibfttypes.MsgPreprepare, - Msg: preprepare, - }) - } -} - -func (c *core) handlePreprepare(msg *ibfttypes.Message, src istanbul.Validator) error { - logger := c.logger.New("from", src, "state", c.state) - - // Decode PRE-PREPARE - var preprepare *istanbul.Preprepare - err := msg.Decode(&preprepare) - if err != nil { - return istanbulcommon.ErrFailedDecodePreprepare - } - - // Ensure we have the same view with the PRE-PREPARE message - // If it is old message, see if we need to broadcast COMMIT - if err := c.checkMessage(ibfttypes.MsgPreprepare, preprepare.View); err != nil { - if err == istanbulcommon.ErrOldMessage { - // Get validator set for the given proposal - valSet := c.backend.ParentValidators(preprepare.Proposal).Copy() - previousProposer := c.backend.GetProposer(preprepare.Proposal.Number().Uint64() - 1) - valSet.CalcProposer(previousProposer, preprepare.View.Round.Uint64()) - // Broadcast COMMIT if it is an existing block - // 1. The proposer needs to be a proposer matches the given (Sequence + Round) - // 2. The given block must exist - if valSet.IsProposer(src.Address()) && c.backend.HasPropsal(preprepare.Proposal.Hash(), preprepare.Proposal.Number()) { - c.sendCommitForOldBlock(preprepare.View, preprepare.Proposal.Hash()) - return nil - } - } - return err - } - - // Check if the message comes from current proposer - if !c.valSet.IsProposer(src.Address()) { - logger.Warn("Ignore preprepare messages from non-proposer") - return istanbulcommon.ErrNotFromProposer - } - - // Verify the proposal we received - if duration, err := c.backend.Verify(preprepare.Proposal); err != nil { - // if it's a future block, we will handle it again after the duration - if err == consensus.ErrFutureBlock { - logger.Info("Proposed block will be handled in the future", "err", err, "duration", duration) - c.stopFuturePreprepareTimer() - c.futurePreprepareTimer = time.AfterFunc(duration, func() { - c.sendEvent(backlogEvent{ - src: src, - msg: msg, - }) - }) - } else { - logger.Warn("Failed to verify proposal", "err", err, "duration", duration) - c.sendNextRoundChange() - } - return err - } - - // Here is about to accept the PRE-PREPARE - if c.state == ibfttypes.StateAcceptRequest { - // Send ROUND CHANGE if the locked proposal and the received proposal are different - if c.current.IsHashLocked() { - if preprepare.Proposal.Hash() == c.current.GetLockedHash() { - // Broadcast COMMIT and enters Prepared state directly - c.acceptPreprepare(preprepare) - c.setState(ibfttypes.StatePrepared) - c.sendCommit() - } else { - // Send round change - c.sendNextRoundChange() - } - } else { - // Either - // 1. the locked proposal and the received proposal match - // 2. we have no locked proposal - c.acceptPreprepare(preprepare) - c.setState(ibfttypes.StatePreprepared) - c.sendPrepare() - } - } - - return nil -} - -func (c *core) acceptPreprepare(preprepare *istanbul.Preprepare) { - c.consensusTimestamp = time.Now() - c.current.SetPreprepare(preprepare) -} diff --git a/consensus/istanbul/ibft/core/preprepare_test.go b/consensus/istanbul/ibft/core/preprepare_test.go deleted file mode 100644 index eda93d816..000000000 --- a/consensus/istanbul/ibft/core/preprepare_test.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "reflect" - "testing" - - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -func newTestPreprepare(v *istanbul.View) *istanbul.Preprepare { - return &istanbul.Preprepare{ - View: v, - Proposal: newTestProposal(), - } -} - -func TestHandlePreprepare(t *testing.T) { - N := uint64(4) // replica 0 is the proposer, it will send messages to others - F := uint64(1) // F does not affect tests - - testCases := []struct { - system *testSystem - expectedRequest istanbul.Proposal - expectedErr error - existingBlock bool - }{ - { - // normal case - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i != 0 { - c.state = ibfttypes.StateAcceptRequest - } - } - return sys - }(), - newTestProposal(), - nil, - false, - }, - { - // future message - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i != 0 { - c.state = ibfttypes.StateAcceptRequest - // hack: force set subject that future message can be simulated - c.current = newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(0), - }, - c.valSet, - ) - - } else { - c.current.SetSequence(big.NewInt(10)) - } - } - return sys - }(), - makeBlock(1), - istanbulcommon.ErrFutureMessage, - false, - }, - { - // non-proposer - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - // force remove replica 0, let replica 1 be the proposer - sys.backends = sys.backends[1:] - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i != 0 { - // replica 0 is the proposer - c.state = ibfttypes.StatePreprepared - } - } - return sys - }(), - makeBlock(1), - istanbulcommon.ErrNotFromProposer, - false, - }, - { - // errOldMessage - func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i != 0 { - c.state = ibfttypes.StatePreprepared - c.current.SetSequence(big.NewInt(10)) - c.current.SetRound(big.NewInt(10)) - } - } - return sys - }(), - makeBlock(1), - istanbulcommon.ErrOldMessage, - false, - }, - } - -OUTER: - for _, test := range testCases { - test.system.Run(false) - - v0 := test.system.backends[0] - r0 := v0.engine - - curView := r0.currentView() - - preprepare := &istanbul.Preprepare{ - View: curView, - Proposal: test.expectedRequest, - } - - for i, v := range test.system.backends { - // i == 0 is primary backend, it is responsible for send PRE-PREPARE messages to others. - if i == 0 { - continue - } - - c := v.engine - - m, _ := ibfttypes.Encode(preprepare) - _, val := r0.valSet.GetByAddress(v0.Address()) - // run each backends and verify handlePreprepare function. - if err := c.handlePreprepare(&ibfttypes.Message{ - Code: ibfttypes.MsgPreprepare, - Msg: m, - Address: v0.Address(), - }, val); err != nil { - if err != test.expectedErr { - t.Errorf("error mismatch: have %v, want %v", err, test.expectedErr) - } - continue OUTER - } - - if c.state != ibfttypes.StatePreprepared { - t.Errorf("state mismatch: have %v, want %v", c.state, ibfttypes.StatePreprepared) - } - - if !test.existingBlock && !reflect.DeepEqual(c.current.Subject().View, curView) { - t.Errorf("view mismatch: have %v, want %v", c.current.Subject().View, curView) - } - - // verify prepare messages - decodedMsg := new(ibfttypes.Message) - err := decodedMsg.FromPayload(v.sentMsgs[0], nil) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - expectedCode := ibfttypes.MsgPrepare - if test.existingBlock { - expectedCode = ibfttypes.MsgCommit - } - if decodedMsg.Code != expectedCode { - t.Errorf("message code mismatch: have %v, want %v", decodedMsg.Code, expectedCode) - } - - var subject *istanbul.Subject - err = decodedMsg.Decode(&subject) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - if !test.existingBlock && !reflect.DeepEqual(subject, c.current.Subject()) { - t.Errorf("subject mismatch: have %v, want %v", subject, c.current.Subject()) - } - - } - } -} - -func TestHandlePreprepareWithLock(t *testing.T) { - N := uint64(4) // replica 0 is the proposer, it will send messages to others - F := uint64(1) // F does not affect tests - proposal := newTestProposal() - mismatchProposal := makeBlock(10) - newSystem := func() *testSystem { - sys := NewTestSystemWithBackend(N, F) - - for i, backend := range sys.backends { - c := backend.engine - c.valSet = backend.peers - if i != 0 { - c.state = ibfttypes.StateAcceptRequest - } - c.roundChangeSet = newRoundChangeSet(c.valSet) - } - return sys - } - - testCases := []struct { - system *testSystem - proposal istanbul.Proposal - lockProposal istanbul.Proposal - }{ - { - newSystem(), - proposal, - proposal, - }, - { - newSystem(), - proposal, - mismatchProposal, - }, - } - - for _, test := range testCases { - test.system.Run(false) - v0 := test.system.backends[0] - r0 := v0.engine - curView := r0.currentView() - preprepare := &istanbul.Preprepare{ - View: curView, - Proposal: test.proposal, - } - lockPreprepare := &istanbul.Preprepare{ - View: curView, - Proposal: test.lockProposal, - } - - for i, v := range test.system.backends { - // i == 0 is primary backend, it is responsible for send PRE-PREPARE messages to others. - if i == 0 { - continue - } - - c := v.engine - c.current.SetPreprepare(lockPreprepare) - c.current.LockHash() - m, _ := ibfttypes.Encode(preprepare) - _, val := r0.valSet.GetByAddress(v0.Address()) - if err := c.handlePreprepare(&ibfttypes.Message{ - Code: ibfttypes.MsgPreprepare, - Msg: m, - Address: v0.Address(), - }, val); err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - if test.proposal == test.lockProposal { - if c.state != ibfttypes.StatePrepared { - t.Errorf("state mismatch: have %v, want %v", c.state, ibfttypes.StatePreprepared) - } - if !reflect.DeepEqual(curView, c.currentView()) { - t.Errorf("view mismatch: have %v, want %v", c.currentView(), curView) - } - } else { - // Should stay at ibfttypes.StateAcceptRequest - if c.state != ibfttypes.StateAcceptRequest { - t.Errorf("state mismatch: have %v, want %v", c.state, ibfttypes.StateAcceptRequest) - } - // Should have triggered a round change - expectedView := &istanbul.View{ - Sequence: curView.Sequence, - Round: big.NewInt(1), - } - if !reflect.DeepEqual(expectedView, c.currentView()) { - t.Errorf("view mismatch: have %v, want %v", c.currentView(), expectedView) - } - } - } - } -} diff --git a/consensus/istanbul/ibft/core/request.go b/consensus/istanbul/ibft/core/request.go deleted file mode 100644 index 21b8a69c6..000000000 --- a/consensus/istanbul/ibft/core/request.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2017 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 core - -import ( - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -func (c *core) handleRequest(request *istanbul.Request) error { - logger := c.logger.New("state", c.state, "seq", c.current.sequence) - if err := c.checkRequestMsg(request); err != nil { - if err == istanbulcommon.ErrInvalidMessage { - logger.Warn("invalid request") - return err - } - logger.Warn("unexpected request", "err", err, "number", request.Proposal.Number(), "hash", request.Proposal.Hash()) - return err - } - logger.Trace("handleRequest", "number", request.Proposal.Number(), "hash", request.Proposal.Hash()) - - c.current.pendingRequest = request - if c.state == ibfttypes.StateAcceptRequest { - c.sendPreprepare(request) - } - return nil -} - -// check request state -// return errInvalidMessage if the message is invalid -// return errFutureMessage if the sequence of proposal is larger than current sequence -// return errOldMessage if the sequence of proposal is smaller than current sequence -func (c *core) checkRequestMsg(request *istanbul.Request) error { - if request == nil || request.Proposal == nil { - return istanbulcommon.ErrInvalidMessage - } - - if c := c.current.sequence.Cmp(request.Proposal.Number()); c > 0 { - return istanbulcommon.ErrOldMessage - } else if c < 0 { - return istanbulcommon.ErrFutureMessage - } else { - return nil - } -} - -func (c *core) storeRequestMsg(request *istanbul.Request) { - logger := c.logger.New("state", c.state) - - logger.Trace("Store future request", "number", request.Proposal.Number(), "hash", request.Proposal.Hash()) - - c.pendingRequestsMu.Lock() - defer c.pendingRequestsMu.Unlock() - - c.pendingRequests.Push(request, float32(-request.Proposal.Number().Int64())) -} - -func (c *core) processPendingRequests() { - c.pendingRequestsMu.Lock() - defer c.pendingRequestsMu.Unlock() - - for !(c.pendingRequests.Empty()) { - m, prio := c.pendingRequests.Pop() - r, ok := m.(*istanbul.Request) - if !ok { - c.logger.Warn("Malformed request, skip", "msg", m) - continue - } - // Push back if it's a future message - err := c.checkRequestMsg(r) - if err != nil { - if err == istanbulcommon.ErrFutureMessage { - c.logger.Trace("Stop processing request", "number", r.Proposal.Number(), "hash", r.Proposal.Hash()) - c.pendingRequests.Push(m, prio) - break - } - c.logger.Trace("Skip the pending request", "number", r.Proposal.Number(), "hash", r.Proposal.Hash(), "err", err) - continue - } - c.logger.Trace("Post pending request", "number", r.Proposal.Number(), "hash", r.Proposal.Hash()) - - go c.sendEvent(istanbul.RequestEvent{ - Proposal: r.Proposal, - }) - } -} diff --git a/consensus/istanbul/ibft/core/request_test.go b/consensus/istanbul/ibft/core/request_test.go deleted file mode 100644 index 5cc183877..000000000 --- a/consensus/istanbul/ibft/core/request_test.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "reflect" - "sync" - "testing" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" -) - -func TestCheckRequestMsg(t *testing.T) { - c := &core{ - state: ibfttypes.StateAcceptRequest, - current: newRoundState(&istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(0), - }, newTestValidatorSet(4), common.Hash{}, nil, nil, nil), - } - - // invalid request - err := c.checkRequestMsg(nil) - if err != istanbulcommon.ErrInvalidMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrInvalidMessage) - } - r := &istanbul.Request{ - Proposal: nil, - } - err = c.checkRequestMsg(r) - if err != istanbulcommon.ErrInvalidMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrInvalidMessage) - } - - // old request - r = &istanbul.Request{ - Proposal: makeBlock(0), - } - err = c.checkRequestMsg(r) - if err != istanbulcommon.ErrOldMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrOldMessage) - } - - // future request - r = &istanbul.Request{ - Proposal: makeBlock(2), - } - err = c.checkRequestMsg(r) - if err != istanbulcommon.ErrFutureMessage { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrFutureMessage) - } - - // current request - r = &istanbul.Request{ - Proposal: makeBlock(1), - } - err = c.checkRequestMsg(r) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } -} - -func TestStoreRequestMsg(t *testing.T) { - backend := &testSystemBackend{ - events: new(event.TypeMux), - } - c := &core{ - logger: log.New("backend", "test", "id", 0), - backend: backend, - state: ibfttypes.StateAcceptRequest, - current: newRoundState(&istanbul.View{ - Sequence: big.NewInt(0), - Round: big.NewInt(0), - }, newTestValidatorSet(4), common.Hash{}, nil, nil, nil), - pendingRequests: prque.New(), - pendingRequestsMu: new(sync.Mutex), - } - requests := []istanbul.Request{ - { - Proposal: makeBlock(1), - }, - { - Proposal: makeBlock(2), - }, - { - Proposal: makeBlock(3), - }, - } - - c.storeRequestMsg(&requests[1]) - c.storeRequestMsg(&requests[0]) - c.storeRequestMsg(&requests[2]) - if c.pendingRequests.Size() != len(requests) { - t.Errorf("the size of pending requests mismatch: have %v, want %v", c.pendingRequests.Size(), len(requests)) - } - - c.current.sequence = big.NewInt(3) - - c.subscribeEvents() - defer c.unsubscribeEvents() - - c.processPendingRequests() - - const timeoutDura = 2 * time.Second - timeout := time.NewTimer(timeoutDura) - select { - case ev := <-c.events.Chan(): - e, ok := ev.Data.(istanbul.RequestEvent) - if !ok { - t.Errorf("unexpected event comes: %v", reflect.TypeOf(ev.Data)) - } - if e.Proposal.Number().Cmp(requests[2].Proposal.Number()) != 0 { - t.Errorf("the number of proposal mismatch: have %v, want %v", e.Proposal.Number(), requests[2].Proposal.Number()) - } - case <-timeout.C: - t.Error("unexpected timeout occurs") - } -} diff --git a/consensus/istanbul/ibft/core/roundchange.go b/consensus/istanbul/ibft/core/roundchange.go deleted file mode 100644 index 7379afa22..000000000 --- a/consensus/istanbul/ibft/core/roundchange.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "sync" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" -) - -// sendNextRoundChange sends the ROUND CHANGE message with current round + 1 -func (c *core) sendNextRoundChange() { - cv := c.currentView() - c.sendRoundChange(new(big.Int).Add(cv.Round, common.Big1)) -} - -// sendRoundChange sends the ROUND CHANGE message with the given round -func (c *core) sendRoundChange(round *big.Int) { - logger := c.logger.New("state", c.state) - - cv := c.currentView() - if cv.Round.Cmp(round) >= 0 { - logger.Error("Cannot send out the round change", "current round", cv.Round, "target round", round) - return - } - - c.catchUpRound(&istanbul.View{ - // The round number we'd like to transfer to. - Round: new(big.Int).Set(round), - Sequence: new(big.Int).Set(cv.Sequence), - }) - - // Now we have the new round number and sequence number - cv = c.currentView() - rc := &istanbul.Subject{ - View: cv, - Digest: common.Hash{}, - } - - payload, err := ibfttypes.Encode(rc) - if err != nil { - logger.Error("Failed to encode ROUND CHANGE", "rc", rc, "err", err) - return - } - - c.broadcast(&ibfttypes.Message{ - Code: ibfttypes.MsgRoundChange, - Msg: payload, - }) -} - -func (c *core) handleRoundChange(msg *ibfttypes.Message, src istanbul.Validator) error { - logger := c.logger.New("state", c.state, "from", src.Address().Hex()) - - // Decode ROUND CHANGE message - var rc *istanbul.Subject - if err := msg.Decode(&rc); err != nil { - logger.Error("Failed to decode ROUND CHANGE", "err", err) - return istanbulcommon.ErrInvalidMessage - } - - if err := c.checkMessage(ibfttypes.MsgRoundChange, rc.View); err != nil { - return err - } - - cv := c.currentView() - roundView := rc.View - - // Add the ROUND CHANGE message to its message set and return how many - // messages we've got with the same round number and sequence number. - num, err := c.roundChangeSet.Add(roundView.Round, msg) - if err != nil { - logger.Warn("Failed to add round change message", "from", src, "msg", msg, "err", err) - return err - } - - // Once we received f+1 ROUND CHANGE messages, those messages form a weak certificate. - // If our round number is smaller than the certificate's round number, we would - // try to catch up the round number. - if c.waitingForRoundChange && num == c.valSet.F()+1 { - if cv.Round.Cmp(roundView.Round) < 0 { - c.sendRoundChange(roundView.Round) - } - return nil - } else if num == c.QuorumSize() && (c.waitingForRoundChange || cv.Round.Cmp(roundView.Round) < 0) { - // We've received 2f+1/Ceil(2N/3) ROUND CHANGE messages, start a new round immediately. - c.startNewRound(roundView.Round) - return nil - } else if cv.Round.Cmp(roundView.Round) < 0 { - // Only gossip the message with current round to other validators. - return istanbulcommon.ErrIgnored - } - return nil -} - -// ---------------------------------------------------------------------------- - -func newRoundChangeSet(valSet istanbul.ValidatorSet) *roundChangeSet { - return &roundChangeSet{ - validatorSet: valSet, - roundChanges: make(map[uint64]*messageSet), - mu: new(sync.Mutex), - } -} - -type roundChangeSet struct { - validatorSet istanbul.ValidatorSet - roundChanges map[uint64]*messageSet - mu *sync.Mutex -} - -// Add adds the round and message into round change set -func (rcs *roundChangeSet) Add(r *big.Int, msg *ibfttypes.Message) (int, error) { - rcs.mu.Lock() - defer rcs.mu.Unlock() - - round := r.Uint64() - if rcs.roundChanges[round] == nil { - rcs.roundChanges[round] = newMessageSet(rcs.validatorSet) - } - err := rcs.roundChanges[round].Add(msg) - if err != nil { - return 0, err - } - return rcs.roundChanges[round].Size(), nil -} - -// Clear deletes the messages with smaller round -func (rcs *roundChangeSet) Clear(round *big.Int) { - rcs.mu.Lock() - defer rcs.mu.Unlock() - - for k, rms := range rcs.roundChanges { - if len(rms.Values()) == 0 || k < round.Uint64() { - delete(rcs.roundChanges, k) - } - } -} - -// MaxRound returns the max round which the number of messages is equal or larger than num -func (rcs *roundChangeSet) MaxRound(num int) *big.Int { - rcs.mu.Lock() - defer rcs.mu.Unlock() - - var maxRound *big.Int - for k, rms := range rcs.roundChanges { - if rms.Size() < num { - continue - } - r := big.NewInt(int64(k)) - if maxRound == nil || maxRound.Cmp(r) < 0 { - maxRound = r - } - } - return maxRound -} diff --git a/consensus/istanbul/ibft/core/roundchange_test.go b/consensus/istanbul/ibft/core/roundchange_test.go deleted file mode 100644 index 9321654a6..000000000 --- a/consensus/istanbul/ibft/core/roundchange_test.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" -) - -func TestRoundChangeSet(t *testing.T) { - vset := validator.NewSet(generateValidators(4), istanbul.NewRoundRobinProposerPolicy()) - rc := newRoundChangeSet(vset) - - view := &istanbul.View{ - Sequence: big.NewInt(1), - Round: big.NewInt(1), - } - r := &istanbul.Subject{ - View: view, - Digest: common.Hash{}, - } - m, _ := ibfttypes.Encode(r) - - // Test Add() - // Add message from all validators - for i, v := range vset.List() { - msg := &ibfttypes.Message{ - Code: ibfttypes.MsgRoundChange, - Msg: m, - Address: v.Address(), - } - rc.Add(view.Round, msg) - if rc.roundChanges[view.Round.Uint64()].Size() != i+1 { - t.Errorf("the size of round change messages mismatch: have %v, want %v", rc.roundChanges[view.Round.Uint64()].Size(), i+1) - } - } - - // Add message again from all validators, but the size should be the same - for _, v := range vset.List() { - msg := &ibfttypes.Message{ - Code: ibfttypes.MsgRoundChange, - Msg: m, - Address: v.Address(), - } - rc.Add(view.Round, msg) - if rc.roundChanges[view.Round.Uint64()].Size() != vset.Size() { - t.Errorf("the size of round change messages mismatch: have %v, want %v", rc.roundChanges[view.Round.Uint64()].Size(), vset.Size()) - } - } - - // Test MaxRound() - for i := 0; i < 10; i++ { - maxRound := rc.MaxRound(i) - if i <= vset.Size() { - if maxRound == nil || maxRound.Cmp(view.Round) != 0 { - t.Errorf("max round mismatch: have %v, want %v", maxRound, view.Round) - } - } else if maxRound != nil { - t.Errorf("max round mismatch: have %v, want nil", maxRound) - } - } - - // Test Clear() - for i := int64(0); i < 2; i++ { - rc.Clear(big.NewInt(i)) - if rc.roundChanges[view.Round.Uint64()].Size() != vset.Size() { - t.Errorf("the size of round change messages mismatch: have %v, want %v", rc.roundChanges[view.Round.Uint64()].Size(), vset.Size()) - } - } - rc.Clear(big.NewInt(2)) - if rc.roundChanges[view.Round.Uint64()] != nil { - t.Errorf("the change messages mismatch: have %v, want nil", rc.roundChanges[view.Round.Uint64()]) - } -} diff --git a/consensus/istanbul/ibft/core/roundstate.go b/consensus/istanbul/ibft/core/roundstate.go deleted file mode 100644 index 8f011bfea..000000000 --- a/consensus/istanbul/ibft/core/roundstate.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2017 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 core - -import ( - "io" - "math/big" - "sync" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/rlp" -) - -// newRoundState creates a new roundState instance with the given view and validatorSet -// lockedHash and preprepare are for round change when lock exists, -// we need to keep a reference of preprepare in order to propose locked proposal when there is a lock and itself is the proposer -func newRoundState(view *istanbul.View, validatorSet istanbul.ValidatorSet, lockedHash common.Hash, preprepare *istanbul.Preprepare, pendingRequest *istanbul.Request, hasBadProposal func(hash common.Hash) bool) *roundState { - return &roundState{ - round: view.Round, - sequence: view.Sequence, - Preprepare: preprepare, - Prepares: newMessageSet(validatorSet), - Commits: newMessageSet(validatorSet), - lockedHash: lockedHash, - mu: new(sync.RWMutex), - pendingRequest: pendingRequest, - hasBadProposal: hasBadProposal, - } -} - -// roundState stores the consensus state -type roundState struct { - round *big.Int - sequence *big.Int - Preprepare *istanbul.Preprepare - Prepares *messageSet - Commits *messageSet - lockedHash common.Hash - pendingRequest *istanbul.Request - - mu *sync.RWMutex - hasBadProposal func(hash common.Hash) bool -} - -func (s *roundState) GetPrepareOrCommitSize() int { - s.mu.RLock() - defer s.mu.RUnlock() - - result := s.Prepares.Size() + s.Commits.Size() - - // find duplicate one - for _, m := range s.Prepares.Values() { - if s.Commits.Get(m.Address) != nil { - result-- - } - } - return result -} - -func (s *roundState) Subject() *istanbul.Subject { - s.mu.RLock() - defer s.mu.RUnlock() - - if s.Preprepare == nil { - return nil - } - - return &istanbul.Subject{ - View: &istanbul.View{ - Round: new(big.Int).Set(s.round), - Sequence: new(big.Int).Set(s.sequence), - }, - Digest: s.Preprepare.Proposal.Hash(), - } -} - -func (s *roundState) SetPreprepare(preprepare *istanbul.Preprepare) { - s.mu.Lock() - defer s.mu.Unlock() - - s.Preprepare = preprepare -} - -func (s *roundState) Proposal() istanbul.Proposal { - s.mu.RLock() - defer s.mu.RUnlock() - - if s.Preprepare != nil { - return s.Preprepare.Proposal - } - - return nil -} - -func (s *roundState) SetRound(r *big.Int) { - s.mu.Lock() - defer s.mu.Unlock() - - s.round = new(big.Int).Set(r) -} - -func (s *roundState) Round() *big.Int { - s.mu.RLock() - defer s.mu.RUnlock() - - return s.round -} - -func (s *roundState) SetSequence(seq *big.Int) { - s.mu.Lock() - defer s.mu.Unlock() - - s.sequence = seq -} - -func (s *roundState) Sequence() *big.Int { - s.mu.RLock() - defer s.mu.RUnlock() - - return s.sequence -} - -func (s *roundState) LockHash() { - s.mu.Lock() - defer s.mu.Unlock() - - if s.Preprepare != nil { - s.lockedHash = s.Preprepare.Proposal.Hash() - } -} - -func (s *roundState) UnlockHash() { - s.mu.Lock() - defer s.mu.Unlock() - - s.lockedHash = common.Hash{} -} - -func (s *roundState) IsHashLocked() bool { - s.mu.RLock() - defer s.mu.RUnlock() - - if common.EmptyHash(s.lockedHash) { - return false - } - return !s.hasBadProposal(s.GetLockedHash()) -} - -func (s *roundState) GetLockedHash() common.Hash { - s.mu.RLock() - defer s.mu.RUnlock() - - return s.lockedHash -} - -// The DecodeRLP method should read one value from the given -// Stream. It is not forbidden to read less or more, but it might -// be confusing. -func (s *roundState) DecodeRLP(stream *rlp.Stream) error { - var ss struct { - Round *big.Int - Sequence *big.Int - Preprepare *istanbul.Preprepare - Prepares *messageSet - Commits *messageSet - lockedHash common.Hash - pendingRequest *istanbul.Request - } - - if err := stream.Decode(&ss); err != nil { - return err - } - s.round = ss.Round - s.sequence = ss.Sequence - s.Preprepare = ss.Preprepare - s.Prepares = ss.Prepares - s.Commits = ss.Commits - s.lockedHash = ss.lockedHash - s.pendingRequest = ss.pendingRequest - s.mu = new(sync.RWMutex) - - return nil -} - -// EncodeRLP should write the RLP encoding of its receiver to w. -// If the implementation is a pointer method, it may also be -// called for nil pointers. -// -// Implementations should generate valid RLP. The data written is -// not verified at the moment, but a future version might. It is -// recommended to write only a single value but writing multiple -// values or no value at all is also permitted. -func (s *roundState) EncodeRLP(w io.Writer) error { - s.mu.RLock() - defer s.mu.RUnlock() - - return rlp.Encode(w, []interface{}{ - s.round, - s.sequence, - s.Preprepare, - s.Prepares, - s.Commits, - s.lockedHash, - s.pendingRequest, - }) -} diff --git a/consensus/istanbul/ibft/core/roundstate_test.go b/consensus/istanbul/ibft/core/roundstate_test.go deleted file mode 100644 index 7cf1979c7..000000000 --- a/consensus/istanbul/ibft/core/roundstate_test.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2017 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 core - -import ( - "math/big" - "sync" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" -) - -func newTestRoundState(view *istanbul.View, validatorSet istanbul.ValidatorSet) *roundState { - return &roundState{ - round: view.Round, - sequence: view.Sequence, - Preprepare: newTestPreprepare(view), - Prepares: newMessageSet(validatorSet), - Commits: newMessageSet(validatorSet), - mu: new(sync.RWMutex), - hasBadProposal: func(hash common.Hash) bool { - return false - }, - } -} - -func TestLockHash(t *testing.T) { - sys := NewTestSystemWithBackend(1, 0) - rs := newTestRoundState( - &istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(0), - }, - sys.backends[0].peers, - ) - if !common.EmptyHash(rs.GetLockedHash()) { - t.Errorf("error mismatch: have %v, want empty", rs.GetLockedHash()) - } - if rs.IsHashLocked() { - t.Error("IsHashLocked should return false") - } - - // Lock - expected := rs.Proposal().Hash() - rs.LockHash() - if expected != rs.GetLockedHash() { - t.Errorf("error mismatch: have %v, want %v", rs.GetLockedHash(), expected) - } - if !rs.IsHashLocked() { - t.Error("IsHashLocked should return true") - } - - // Unlock - rs.UnlockHash() - if !common.EmptyHash(rs.GetLockedHash()) { - t.Errorf("error mismatch: have %v, want empty", rs.GetLockedHash()) - } - if rs.IsHashLocked() { - t.Error("IsHashLocked should return false") - } -} diff --git a/consensus/istanbul/ibft/core/testbackend_test.go b/consensus/istanbul/ibft/core/testbackend_test.go deleted file mode 100644 index 2a94d1437..000000000 --- a/consensus/istanbul/ibft/core/testbackend_test.go +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright 2017 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 core - -import ( - "crypto/ecdsa" - "math/big" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - elog "github.com/ethereum/go-ethereum/log" -) - -var testLogger = elog.New() - -type testSystemBackend struct { - id uint64 - sys *testSystem - - engine *core - peers istanbul.ValidatorSet - events *event.TypeMux - - committedMsgs []testCommittedMsgs - sentMsgs [][]byte // store the message when Send is called by core - - address common.Address - db ethdb.Database -} - -type testCommittedMsgs struct { - commitProposal istanbul.Proposal - committedSeals [][]byte -} - -// ============================================== -// -// define the functions that needs to be provided for Istanbul. - -func (self *testSystemBackend) Address() common.Address { - return self.address -} - -// Peers returns all connected peers -func (self *testSystemBackend) Validators(proposal istanbul.Proposal) istanbul.ValidatorSet { - return self.peers -} - -func (self *testSystemBackend) EventMux() *event.TypeMux { - return self.events -} - -func (self *testSystemBackend) Send(message []byte, code uint64, target common.Address) error { - testLogger.Info("enqueuing a message...", "address", self.Address()) - self.sentMsgs = append(self.sentMsgs, message) - self.sys.queuedMessage <- istanbul.MessageEvent{ - Code: code, - Payload: message, - } - return nil -} - -func (self *testSystemBackend) Broadcast(valSet istanbul.ValidatorSet, code uint64, message []byte) error { - testLogger.Info("enqueuing a message...", "address", self.Address()) - self.sentMsgs = append(self.sentMsgs, message) - self.sys.queuedMessage <- istanbul.MessageEvent{ - Code: code, - Payload: message, - } - return nil -} - -func (self *testSystemBackend) Gossip(valSet istanbul.ValidatorSet, code uint64, message []byte) error { - testLogger.Warn("not sign any data") - return nil -} - -func (self *testSystemBackend) Commit(proposal istanbul.Proposal, seals [][]byte, round *big.Int) error { - testLogger.Info("commit message", "address", self.Address()) - self.committedMsgs = append(self.committedMsgs, testCommittedMsgs{ - commitProposal: proposal, - committedSeals: seals, - }) - - // fake new head events - go self.events.Post(istanbul.FinalCommittedEvent{}) - return nil -} - -func (self *testSystemBackend) Verify(proposal istanbul.Proposal) (time.Duration, error) { - return 0, nil -} - -func (self *testSystemBackend) Sign(data []byte) ([]byte, error) { - testLogger.Info("returning current backend address so that CheckValidatorSignature returns the same value") - return self.address.Bytes(), nil -} - -func (self *testSystemBackend) SignWithoutHashing(data []byte) ([]byte, error) { - testLogger.Info("returning current backend address so that CheckValidatorSignature returns the same value") - return self.address.Bytes(), nil -} - -func (self *testSystemBackend) CheckSignature([]byte, common.Address, []byte) error { - return nil -} - -func (self *testSystemBackend) CheckValidatorSignature(data []byte, sig []byte) (common.Address, error) { - return common.BytesToAddress(sig), nil -} - -func (self *testSystemBackend) Hash(b interface{}) common.Hash { - return common.StringToHash("Test") -} - -func (self *testSystemBackend) NewRequest(request istanbul.Proposal) { - go self.events.Post(istanbul.RequestEvent{ - Proposal: request, - }) -} - -func (self *testSystemBackend) HasBadProposal(hash common.Hash) bool { - return false -} - -func (self *testSystemBackend) LastProposal() (istanbul.Proposal, common.Address) { - l := len(self.committedMsgs) - if l > 0 { - return self.committedMsgs[l-1].commitProposal, common.Address{} - } - return makeBlock(0), common.Address{} -} - -// Only block height 5 will return true -func (self *testSystemBackend) HasPropsal(hash common.Hash, number *big.Int) bool { - return number.Cmp(big.NewInt(5)) == 0 -} - -func (self *testSystemBackend) GetProposer(number uint64) common.Address { - return common.Address{} -} - -func (self *testSystemBackend) ParentValidators(proposal istanbul.Proposal) istanbul.ValidatorSet { - return self.peers -} - -func (sb *testSystemBackend) Close() error { - return nil -} - -func (sb *testSystemBackend) StartQBFTConsensus() error { - return nil -} - -// ============================================== -// -// define the struct that need to be provided for integration tests. - -type testSystem struct { - backends []*testSystemBackend - - queuedMessage chan istanbul.MessageEvent - quit chan struct{} -} - -func newTestSystem(n uint64) *testSystem { - testLogger.SetHandler(elog.StdoutHandler) - return &testSystem{ - backends: make([]*testSystemBackend, n), - - queuedMessage: make(chan istanbul.MessageEvent), - quit: make(chan struct{}), - } -} - -func generateValidators(n int) []common.Address { - vals := make([]common.Address, 0) - for i := 0; i < n; i++ { - privateKey, _ := crypto.GenerateKey() - vals = append(vals, crypto.PubkeyToAddress(privateKey.PublicKey)) - } - return vals -} - -func newTestValidatorSet(n int) istanbul.ValidatorSet { - return validator.NewSet(generateValidators(n), istanbul.NewRoundRobinProposerPolicy()) -} - -// FIXME: int64 is needed for N and F -func NewTestSystemWithBackend(n, f uint64) *testSystem { - testLogger.SetHandler(elog.StdoutHandler) - - addrs := generateValidators(int(n)) - sys := newTestSystem(n) - config := istanbul.DefaultConfig - - for i := uint64(0); i < n; i++ { - vset := validator.NewSet(addrs, istanbul.NewRoundRobinProposerPolicy()) - backend := sys.NewBackend(i) - backend.peers = vset - backend.address = vset.GetByIndex(i).Address() - - core := New(backend, config) - core.state = ibfttypes.StateAcceptRequest - core.current = newRoundState(&istanbul.View{ - Round: big.NewInt(0), - Sequence: big.NewInt(1), - }, vset, common.Hash{}, nil, nil, func(hash common.Hash) bool { - return false - }) - core.valSet = vset - core.logger = testLogger - core.validateFn = backend.CheckValidatorSignature - - backend.engine = core - } - - return sys -} - -// listen will consume messages from queue and deliver a message to core -func (t *testSystem) listen() { - for { - select { - case <-t.quit: - return - case queuedMessage := <-t.queuedMessage: - testLogger.Info("consuming a queue message...") - for _, backend := range t.backends { - go backend.EventMux().Post(queuedMessage) - } - } - } -} - -// Run will start system components based on given flag, and returns a closer -// function that caller can control lifecycle -// -// Given a true for core if you want to initialize core engine. -func (t *testSystem) Run(core bool) func() { - for _, b := range t.backends { - if core { - b.engine.Start() // start Istanbul core - } - } - - go t.listen() - closer := func() { t.stop(core) } - return closer -} - -func (t *testSystem) stop(core bool) { - close(t.quit) - - for _, b := range t.backends { - if core { - b.engine.Stop() - } - } -} - -func (t *testSystem) NewBackend(id uint64) *testSystemBackend { - // assume always success - ethDB := rawdb.NewMemoryDatabase() - backend := &testSystemBackend{ - id: id, - sys: t, - events: new(event.TypeMux), - db: ethDB, - } - - t.backends[id] = backend - return backend -} - -// ============================================== -// -// helper functions. - -func getPublicKeyAddress(privateKey *ecdsa.PrivateKey) common.Address { - return crypto.PubkeyToAddress(privateKey.PublicKey) -} diff --git a/consensus/istanbul/ibft/engine/engine.go b/consensus/istanbul/ibft/engine/engine.go deleted file mode 100644 index b31b3bcef..000000000 --- a/consensus/istanbul/ibft/engine/engine.go +++ /dev/null @@ -1,515 +0,0 @@ -package ibftengine - -import ( - "bytes" - "math/big" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - ibfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/ibft/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" - "golang.org/x/crypto/sha3" -) - -var ( - nilUncleHash = types.CalcUncleHash(nil) // Always Keccak256(RLP([])) as uncles are meaningless outside of PoW. - nonceAuthVote = hexutil.MustDecode("0xffffffffffffffff") // Magic nonce number to vote on adding a new validator - nonceDropVote = hexutil.MustDecode("0x0000000000000000") // Magic nonce number to vote on removing a validator. -) - -type SignerFn func(data []byte) ([]byte, error) - -type Engine struct { - cfg *istanbul.Config - - signer common.Address // Ethereum address of the signing key - sign SignerFn // Signer function to authorize hashes with -} - -func NewEngine(cfg *istanbul.Config, signer common.Address, sign SignerFn) *Engine { - return &Engine{ - cfg: cfg, - signer: signer, - sign: sign, - } -} - -func (e *Engine) Author(header *types.Header) (common.Address, error) { - // Retrieve the signature from the header extra-data - extra, err := types.ExtractIstanbulExtra(header) - if err != nil { - return common.Address{}, err - } - - addr, err := istanbul.GetSignatureAddress(sigHash(header).Bytes(), extra.Seal) - if err != nil { - return addr, err - } - - return addr, nil -} - -func (e *Engine) CommitHeader(header *types.Header, seals [][]byte, round *big.Int) error { - // Append seals into extra-data - return writeCommittedSeals(header, seals) -} - -func (e *Engine) VerifyBlockProposal(chain consensus.ChainHeaderReader, block *types.Block, validators istanbul.ValidatorSet) (time.Duration, error) { - // check block body - txnHash := types.DeriveSha(block.Transactions(), new(trie.Trie)) - if txnHash != block.Header().TxHash { - return 0, istanbulcommon.ErrMismatchTxhashes - } - - uncleHash := types.CalcUncleHash(block.Uncles()) - if uncleHash != nilUncleHash { - return 0, istanbulcommon.ErrInvalidUncleHash - } - - // verify the header of proposed block - err := e.VerifyHeader(chain, block.Header(), nil, validators) - if err == nil || err == istanbulcommon.ErrEmptyCommittedSeals { - // ignore errEmptyCommittedSeals error because we don't have the committed seals yet - return 0, nil - } else if err == consensus.ErrFutureBlock { - return time.Until(time.Unix(int64(block.Header().Time), 0)), consensus.ErrFutureBlock - } - - return 0, err -} - -func (e *Engine) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, parents []*types.Header, validators istanbul.ValidatorSet) error { - return e.verifyHeader(chain, header, parents, validators) -} - -// verifyHeader checks whether a header conforms to the consensus rules.The -// caller may optionally pass in a batch of parents (ascending order) to avoid -// looking those up from the database. This is useful for concurrently verifying -// a batch of new headers. -func (e *Engine) verifyHeader(chain consensus.ChainHeaderReader, header *types.Header, parents []*types.Header, validators istanbul.ValidatorSet) error { - if header.Number == nil { - return istanbulcommon.ErrUnknownBlock - } - - // Don't waste time checking blocks from the future (adjusting for allowed threshold) - adjustedTimeNow := time.Now().Add(time.Duration(e.cfg.AllowedFutureBlockTime) * time.Second).Unix() - if header.Time > uint64(adjustedTimeNow) { - return consensus.ErrFutureBlock - } - - if _, err := types.ExtractIstanbulExtra(header); err != nil { - return istanbulcommon.ErrInvalidExtraDataFormat - } - - if header.Nonce != (istanbulcommon.EmptyBlockNonce) && !bytes.Equal(header.Nonce[:], nonceAuthVote) && !bytes.Equal(header.Nonce[:], nonceDropVote) { - return istanbulcommon.ErrInvalidNonce - } - - // Ensure that the mix digest is zero as we don't have fork protection currently - if header.MixDigest != types.IstanbulDigest { - return istanbulcommon.ErrInvalidMixDigest - } - - // Ensure that the block doesn't contain any uncles which are meaningless in Istanbul - if header.UncleHash != nilUncleHash { - return istanbulcommon.ErrInvalidUncleHash - } - - // Ensure that the block's difficulty is meaningful (may not be correct at this point) - if header.Difficulty == nil || header.Difficulty.Cmp(istanbulcommon.DefaultDifficulty) != 0 { - return istanbulcommon.ErrInvalidDifficulty - } - - return e.verifyCascadingFields(chain, header, validators, parents) -} - -// verifyCascadingFields verifies all the header fields that are not standalone, -// rather depend on a batch of previous headers. The caller may optionally pass -// in a batch of parents (ascending order) to avoid looking those up from the -// database. This is useful for concurrently verifying a batch of new headers. -func (e *Engine) verifyCascadingFields(chain consensus.ChainHeaderReader, header *types.Header, validators istanbul.ValidatorSet, parents []*types.Header) error { - // The genesis block is the always valid dead-end - number := header.Number.Uint64() - if number == 0 { - return nil - } - - // Check parent - var parent *types.Header - if len(parents) > 0 { - parent = parents[len(parents)-1] - } else { - parent = chain.GetHeader(header.ParentHash, number-1) - } - - // Ensure that the block's parent has right number and hash - if parent == nil || parent.Number.Uint64() != number-1 || parent.Hash() != header.ParentHash { - return consensus.ErrUnknownAncestor - } - - // Ensure that the block's timestamp isn't too close to it's parent - if parent.Time+e.cfg.BlockPeriod > header.Time { - return istanbulcommon.ErrInvalidTimestamp - } - - // Verify signer - if err := e.verifySigner(chain, header, parents, validators); err != nil { - return err - } - - return e.verifyCommittedSeals(chain, header, parents, validators) -} - -func (e *Engine) verifySigner(chain consensus.ChainHeaderReader, header *types.Header, parents []*types.Header, validators istanbul.ValidatorSet) error { - // Verifying the genesis block is not supported - number := header.Number.Uint64() - if number == 0 { - return istanbulcommon.ErrUnknownBlock - } - - // Resolve the authorization key and check against signers - signer, err := e.Author(header) - if err != nil { - return err - } - - // Signer should be in the validator set of previous block's extraData. - if _, v := validators.GetByAddress(signer); v == nil { - return istanbulcommon.ErrUnauthorized - } - - return nil -} - -// verifyCommittedSeals checks whether every committed seal is signed by one of the parent's validators -func (e *Engine) verifyCommittedSeals(chain consensus.ChainHeaderReader, header *types.Header, parents []*types.Header, validators istanbul.ValidatorSet) error { - number := header.Number.Uint64() - - if number == 0 { - // We don't need to verify committed seals in the genesis block - return nil - } - - extra, err := types.ExtractIstanbulExtra(header) - if err != nil { - return err - } - committedSeal := extra.CommittedSeal - - // The length of Committed seals should be larger than 0 - if len(committedSeal) == 0 { - return istanbulcommon.ErrEmptyCommittedSeals - } - - validatorsCpy := validators.Copy() - - // Check whether the committed seals are generated by validators - validSeal := 0 - committers, err := e.Signers(header) - if err != nil { - return err - } - - for _, addr := range committers { - if validatorsCpy.RemoveValidator(addr) { - validSeal++ - continue - } - return istanbulcommon.ErrInvalidCommittedSeals - } - - // The length of validSeal should be larger than number of faulty node + 1 - if validSeal <= validators.F() { - return istanbulcommon.ErrInvalidCommittedSeals - } - - return nil -} - -// VerifyUncles verifies that the given block's uncles conform to the consensus -// rules of a given engine. -func (e *Engine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error { - if len(block.Uncles()) > 0 { - return istanbulcommon.ErrInvalidUncleHash - } - return nil -} - -// VerifySeal checks whether the crypto seal on a header is valid according to -// the consensus rules of the given engine. -func (e *Engine) VerifySeal(chain consensus.ChainHeaderReader, header *types.Header, validators istanbul.ValidatorSet) error { - - // get parent header and ensure the signer is in parent's validator set - number := header.Number.Uint64() - if number == 0 { - return istanbulcommon.ErrUnknownBlock - } - - // ensure that the difficulty equals to istanbulcommon.DefaultDifficulty - if header.Difficulty.Cmp(istanbulcommon.DefaultDifficulty) != 0 { - return istanbulcommon.ErrInvalidDifficulty - } - - return e.verifySigner(chain, header, nil, validators) -} - -func (e *Engine) Prepare(chain consensus.ChainHeaderReader, header *types.Header, validators istanbul.ValidatorSet) error { - header.Coinbase = common.Address{} - header.Nonce = istanbulcommon.EmptyBlockNonce - header.MixDigest = types.IstanbulDigest - - // copy the parent extra data as the header extra data - number := header.Number.Uint64() - parent := chain.GetHeader(header.ParentHash, number-1) - if parent == nil { - return consensus.ErrUnknownAncestor - } - - // use the same difficulty for all blocks - header.Difficulty = istanbulcommon.DefaultDifficulty - - // add validators in snapshot to extraData's validators section - extra, err := prepareExtra(header, validator.SortedAddresses(validators.List())) - if err != nil { - return err - } - header.Extra = extra - - // set header's timestamp - header.Time = parent.Time + e.cfg.BlockPeriod - if header.Time < uint64(time.Now().Unix()) { - header.Time = uint64(time.Now().Unix()) - } - - return nil -} - -// Finalize runs any post-transaction state modifications (e.g. block rewards) -// and assembles the final block. -// -// Note, the block header and state database might be updated to reflect any -// consensus rules that happen at finalization (e.g. block rewards). -func (e *Engine) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header) { - // No block rewards in Istanbul, so the state remains as is and uncles are dropped - header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number)) - header.UncleHash = nilUncleHash -} - -// FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set, -// nor block rewards given, and returns the final block. -func (e *Engine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) { - /// No block rewards in Istanbul, so the state remains as is and uncles are dropped - header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number)) - header.UncleHash = nilUncleHash - - // Assemble and return the final block for sealing - return types.NewBlock(header, txs, nil, receipts, new(trie.Trie)), nil -} - -// Seal generates a new block for the given input block with the local miner's -// seal place on top. -func (e *Engine) Seal(chain consensus.ChainHeaderReader, block *types.Block, validators istanbul.ValidatorSet) (*types.Block, error) { - // update the block header timestamp and signature and propose the block to core engine - header := block.Header() - number := header.Number.Uint64() - - if _, v := validators.GetByAddress(e.signer); v == nil { - return block, istanbulcommon.ErrUnauthorized - } - - parent := chain.GetHeader(header.ParentHash, number-1) - if parent == nil { - return block, consensus.ErrUnknownAncestor - } - - return e.updateBlock(parent, block) -} - -// update timestamp and signature of the block based on its number of transactions -func (e *Engine) updateBlock(parent *types.Header, block *types.Block) (*types.Block, error) { - // sign the hash - header := block.Header() - seal, err := e.sign(sigHash(header).Bytes()) - if err != nil { - return nil, err - } - - err = writeSeal(header, seal) - if err != nil { - return nil, err - } - - return block.WithSeal(header), nil -} - -// writeSeal writes the extra-data field of the given header with the given seals. -// suggest to rename to writeSeal. -func writeSeal(h *types.Header, seal []byte) error { - if len(seal)%types.IstanbulExtraSeal != 0 { - return istanbulcommon.ErrInvalidSignature - } - - istanbulExtra, err := types.ExtractIstanbulExtra(h) - if err != nil { - return err - } - - istanbulExtra.Seal = seal - payload, err := rlp.EncodeToBytes(&istanbulExtra) - if err != nil { - return err - } - - h.Extra = append(h.Extra[:types.IstanbulExtraVanity], payload...) - return nil -} - -func (e *Engine) SealHash(header *types.Header) common.Hash { - return sigHash(header) -} - -func (e *Engine) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64, parent *types.Header) *big.Int { - return new(big.Int) -} - -func (e *Engine) Validators(header *types.Header) ([]common.Address, error) { - extra, err := types.ExtractIstanbulExtra(header) - if err != nil { - return nil, err - } - - return extra.Validators, nil -} - -func (e *Engine) Signers(header *types.Header) ([]common.Address, error) { - extra, err := types.ExtractIstanbulExtra(header) - if err != nil { - return []common.Address{}, err - } - committedSeal := extra.CommittedSeal - proposalSeal := PrepareCommittedSeal(header.Hash()) - - var addrs []common.Address - // 1. Get committed seals from current header - for _, seal := range committedSeal { - // 2. Get the original address by seal and parent block hash - addr, err := istanbulcommon.GetSignatureAddress(proposalSeal, seal) - if err != nil { - return nil, istanbulcommon.ErrInvalidSignature - } - addrs = append(addrs, addr) - } - - return addrs, nil -} - -func (e *Engine) Address() common.Address { - return e.signer -} - -func (e *Engine) WriteVote(header *types.Header, candidate common.Address, authorize bool) error { - header.Coinbase = candidate - if authorize { - copy(header.Nonce[:], nonceAuthVote) - } else { - copy(header.Nonce[:], nonceDropVote) - } - - return nil -} - -func (e *Engine) ReadVote(header *types.Header) (candidate common.Address, authorize bool, err error) { - switch { - case bytes.Equal(header.Nonce[:], nonceAuthVote): - authorize = true - case bytes.Equal(header.Nonce[:], nonceDropVote): - authorize = false - default: - return common.Address{}, false, istanbulcommon.ErrInvalidVote - } - - return header.Coinbase, authorize, nil -} - -// FIXME: Need to update this for Istanbul -// sigHash returns the hash which is used as input for the Istanbul -// signing. It is the hash of the entire header apart from the 65 byte signature -// contained at the end of the extra data. -// -// Note, the method requires the extra data to be at least 65 bytes, otherwise it -// panics. This is done to avoid accidentally using both forms (signature present -// or not), which could be abused to produce different hashes for the same header. -func sigHash(header *types.Header) (hash common.Hash) { - hasher := sha3.NewLegacyKeccak256() - rlp.Encode(hasher, types.IstanbulFilteredHeader(header, false)) - hasher.Sum(hash[:0]) - return hash -} - -// prepareExtra returns a extra-data of the given header and validators -func prepareExtra(header *types.Header, vals []common.Address) ([]byte, error) { - var buf bytes.Buffer - - // compensate the lack bytes if header.Extra is not enough IstanbulExtraVanity bytes. - if len(header.Extra) < types.IstanbulExtraVanity { - header.Extra = append(header.Extra, bytes.Repeat([]byte{0x00}, types.IstanbulExtraVanity-len(header.Extra))...) - } - buf.Write(header.Extra[:types.IstanbulExtraVanity]) - - ist := &types.IstanbulExtra{ - Validators: vals, - Seal: []byte{}, - CommittedSeal: [][]byte{}, - } - - payload, err := rlp.EncodeToBytes(&ist) - if err != nil { - return nil, err - } - - return append(buf.Bytes(), payload...), nil -} - -func writeCommittedSeals(h *types.Header, committedSeals [][]byte) error { - if len(committedSeals) == 0 { - return istanbulcommon.ErrInvalidCommittedSeals - } - - for _, seal := range committedSeals { - if len(seal) != types.IstanbulExtraSeal { - return istanbulcommon.ErrInvalidCommittedSeals - } - } - - istanbulExtra, err := types.ExtractIstanbulExtra(h) - if err != nil { - return err - } - - istanbulExtra.CommittedSeal = make([][]byte, len(committedSeals)) - copy(istanbulExtra.CommittedSeal, committedSeals) - - payload, err := rlp.EncodeToBytes(&istanbulExtra) - if err != nil { - return err - } - - h.Extra = append(h.Extra[:types.IstanbulExtraVanity], payload...) - return nil -} - -// PrepareCommittedSeal returns a committed seal for the given hash -func PrepareCommittedSeal(hash common.Hash) []byte { - var buf bytes.Buffer - buf.Write(hash.Bytes()) - buf.Write([]byte{byte(ibfttypes.MsgCommit)}) - return buf.Bytes() -} diff --git a/consensus/istanbul/ibft/engine/engine_test.go b/consensus/istanbul/ibft/engine/engine_test.go deleted file mode 100644 index 08fa09017..000000000 --- a/consensus/istanbul/ibft/engine/engine_test.go +++ /dev/null @@ -1,138 +0,0 @@ -package ibftengine - -import ( - "bytes" - "reflect" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestEngine(t *testing.T) { - engine := NewEngine(nil, common.Address{}, nil) - require.NotNil(t, engine, "Constructor") - assert.Implements(t, new(istanbul.Engine), engine) -} - -func TestPrepareExtra(t *testing.T) { - validators := make([]common.Address, 4) - validators[0] = common.BytesToAddress(hexutil.MustDecode("0x44add0ec310f115a0e603b2d7db9f067778eaf8a")) - validators[1] = common.BytesToAddress(hexutil.MustDecode("0x294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212")) - validators[2] = common.BytesToAddress(hexutil.MustDecode("0x6beaaed781d2d2ab6350f5c4566a2c6eaac407a6")) - validators[3] = common.BytesToAddress(hexutil.MustDecode("0x8be76812f765c24641ec63dc2852b378aba2b440")) - - vanity := make([]byte, types.IstanbulExtraVanity) - expectedResult := append(vanity, hexutil.MustDecode("0xf858f8549444add0ec310f115a0e603b2d7db9f067778eaf8a94294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212946beaaed781d2d2ab6350f5c4566a2c6eaac407a6948be76812f765c24641ec63dc2852b378aba2b44080c0")...) - - h := &types.Header{ - Extra: vanity, - } - - payload, err := prepareExtra(h, validators) - if err != nil { - t.Errorf("error mismatch: have %v, want: nil", err) - } - if !reflect.DeepEqual(payload, expectedResult) { - t.Errorf("payload mismatch: have %v, want %v", payload, expectedResult) - } - - // append useless information to extra-data - h.Extra = append(vanity, make([]byte, 15)...) - - payload, _ = prepareExtra(h, validators) - if !reflect.DeepEqual(payload, expectedResult) { - t.Errorf("payload mismatch: have %v, want %v", payload, expectedResult) - } -} - -func TestWriteSeal(t *testing.T) { - vanity := bytes.Repeat([]byte{0x00}, types.IstanbulExtraVanity) - istRawData := hexutil.MustDecode("0xf858f8549444add0ec310f115a0e603b2d7db9f067778eaf8a94294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212946beaaed781d2d2ab6350f5c4566a2c6eaac407a6948be76812f765c24641ec63dc2852b378aba2b44080c0") - expectedSeal := append([]byte{1, 2, 3}, bytes.Repeat([]byte{0x00}, types.IstanbulExtraSeal-3)...) - expectedIstExtra := &types.IstanbulExtra{ - Validators: []common.Address{ - common.BytesToAddress(hexutil.MustDecode("0x44add0ec310f115a0e603b2d7db9f067778eaf8a")), - common.BytesToAddress(hexutil.MustDecode("0x294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212")), - common.BytesToAddress(hexutil.MustDecode("0x6beaaed781d2d2ab6350f5c4566a2c6eaac407a6")), - common.BytesToAddress(hexutil.MustDecode("0x8be76812f765c24641ec63dc2852b378aba2b440")), - }, - Seal: expectedSeal, - CommittedSeal: [][]byte{}, - } - var expectedErr error - - h := &types.Header{ - Extra: append(vanity, istRawData...), - } - - // normal case - err := writeSeal(h, expectedSeal) - if err != expectedErr { - t.Errorf("error mismatch: have %v, want %v", err, expectedErr) - } - - // verify istanbul extra-data - istExtra, err := types.ExtractIstanbulExtra(h) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - if !reflect.DeepEqual(istExtra, expectedIstExtra) { - t.Errorf("extra data mismatch: have %v, want %v", istExtra, expectedIstExtra) - } - - // invalid seal - unexpectedSeal := append(expectedSeal, make([]byte, 1)...) - err = writeSeal(h, unexpectedSeal) - if err != istanbulcommon.ErrInvalidSignature { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrInvalidSignature) - } -} - -func TestWriteCommittedSeals(t *testing.T) { - vanity := bytes.Repeat([]byte{0x00}, types.IstanbulExtraVanity) - istRawData := hexutil.MustDecode("0xf858f8549444add0ec310f115a0e603b2d7db9f067778eaf8a94294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212946beaaed781d2d2ab6350f5c4566a2c6eaac407a6948be76812f765c24641ec63dc2852b378aba2b44080c0") - expectedCommittedSeal := append([]byte{1, 2, 3}, bytes.Repeat([]byte{0x00}, types.IstanbulExtraSeal-3)...) - expectedIstExtra := &types.IstanbulExtra{ - Validators: []common.Address{ - common.BytesToAddress(hexutil.MustDecode("0x44add0ec310f115a0e603b2d7db9f067778eaf8a")), - common.BytesToAddress(hexutil.MustDecode("0x294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212")), - common.BytesToAddress(hexutil.MustDecode("0x6beaaed781d2d2ab6350f5c4566a2c6eaac407a6")), - common.BytesToAddress(hexutil.MustDecode("0x8be76812f765c24641ec63dc2852b378aba2b440")), - }, - Seal: []byte{}, - CommittedSeal: [][]byte{expectedCommittedSeal}, - } - var expectedErr error - - h := &types.Header{ - Extra: append(vanity, istRawData...), - } - - // normal case - err := writeCommittedSeals(h, [][]byte{expectedCommittedSeal}) - if err != expectedErr { - t.Errorf("error mismatch: have %v, want %v", err, expectedErr) - } - - // verify istanbul extra-data - istExtra, err := types.ExtractIstanbulExtra(h) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - if !reflect.DeepEqual(istExtra, expectedIstExtra) { - t.Errorf("extra data mismatch: have %v, want %v", istExtra, expectedIstExtra) - } - - // invalid seal - unexpectedCommittedSeal := append(expectedCommittedSeal, make([]byte, 1)...) - err = writeCommittedSeals(h, [][]byte{unexpectedCommittedSeal}) - if err != istanbulcommon.ErrInvalidCommittedSeals { - t.Errorf("error mismatch: have %v, want %v", err, istanbulcommon.ErrInvalidCommittedSeals) - } -} diff --git a/consensus/istanbul/ibft/types/message.go b/consensus/istanbul/ibft/types/message.go deleted file mode 100644 index f00c42c5f..000000000 --- a/consensus/istanbul/ibft/types/message.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2017 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 ibfttypes - -import ( - "bytes" - "fmt" - "io" - - "github.com/ethereum/go-ethereum/common" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/rlp" -) - -const ( - MsgPreprepare uint64 = iota - MsgPrepare - MsgCommit - MsgRoundChange - // msgAll -) - -type Message struct { - Code uint64 - Msg []byte - Address common.Address - Signature []byte - CommittedSeal []byte -} - -// ============================================== -// -// define the functions that needs to be provided for rlp Encoder/Decoder. - -// EncodeRLP serializes m into the Ethereum RLP format. -func (m *Message) EncodeRLP(w io.Writer) error { - return rlp.Encode(w, []interface{}{m.Code, m.Msg, m.Address, m.Signature, m.CommittedSeal}) -} - -// DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream. -func (m *Message) DecodeRLP(s *rlp.Stream) error { - var msg struct { - Code uint64 - Msg []byte - Address common.Address - Signature []byte - CommittedSeal []byte - } - - if err := s.Decode(&msg); err != nil { - return err - } - m.Code, m.Msg, m.Address, m.Signature, m.CommittedSeal = msg.Code, msg.Msg, msg.Address, msg.Signature, msg.CommittedSeal - return nil -} - -// ============================================== -// -// define the functions that needs to be provided for core. - -func (m *Message) FromPayload(b []byte, validateFn func([]byte, []byte) (common.Address, error)) error { - // Decode message - err := rlp.DecodeBytes(b, &m) - if err != nil { - return err - } - - // Validate message (on a message without Signature) - if validateFn != nil { - var payload []byte - payload, err = m.PayloadNoSig() - if err != nil { - return err - } - - signerAdd, err := validateFn(payload, m.Signature) - if err != nil { - return err - } - if !bytes.Equal(signerAdd.Bytes(), m.Address.Bytes()) { - return istanbulcommon.ErrInvalidSigner - } - } - return nil -} - -func (m *Message) Payload() ([]byte, error) { - return rlp.EncodeToBytes(m) -} - -func (m *Message) PayloadNoSig() ([]byte, error) { - return rlp.EncodeToBytes(&Message{ - Code: m.Code, - Msg: m.Msg, - Address: m.Address, - Signature: []byte{}, - CommittedSeal: m.CommittedSeal, - }) -} - -func (m *Message) Decode(val interface{}) error { - return rlp.DecodeBytes(m.Msg, val) -} - -func (m *Message) String() string { - return fmt.Sprintf("{Code: %v, Address: %v}", m.Code, m.Address.String()) -} - -// ============================================== -// -// helper functions - -func Encode(val interface{}) ([]byte, error) { - return rlp.EncodeToBytes(val) -} diff --git a/consensus/istanbul/ibft/types/message_test.go b/consensus/istanbul/ibft/types/message_test.go deleted file mode 100644 index 2b1cdc008..000000000 --- a/consensus/istanbul/ibft/types/message_test.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2017 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 ibfttypes - -import ( - "math/big" - "reflect" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/core/types" -) - -func makeBlock(number int64) *types.Block { - header := &types.Header{ - Difficulty: big.NewInt(0), - Number: big.NewInt(number), - GasLimit: 0, - GasUsed: 0, - Time: 0, - } - block := &types.Block{} - return block.WithSeal(header) -} - -func testPreprepare(t *testing.T) { - pp := &istanbul.Preprepare{ - View: &istanbul.View{ - Round: big.NewInt(1), - Sequence: big.NewInt(2), - }, - Proposal: makeBlock(1), - } - prepreparePayload, _ := Encode(pp) - - m := &Message{ - Code: MsgPreprepare, - Msg: prepreparePayload, - Address: common.HexToAddress("0x1234567890"), - } - - msgPayload, err := m.Payload() - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - decodedMsg := new(Message) - err = decodedMsg.FromPayload(msgPayload, nil) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - var decodedPP *istanbul.Preprepare - err = decodedMsg.Decode(&decodedPP) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - // if block is encoded/decoded by rlp, we cannot to compare interface data type using reflect.DeepEqual. (like istanbul.Proposal) - // so individual comparison here. - if !reflect.DeepEqual(pp.Proposal.Hash(), decodedPP.Proposal.Hash()) { - t.Errorf("proposal hash mismatch: have %v, want %v", decodedPP.Proposal.Hash(), pp.Proposal.Hash()) - } - - if !reflect.DeepEqual(pp.View, decodedPP.View) { - t.Errorf("view mismatch: have %v, want %v", decodedPP.View, pp.View) - } - - if !reflect.DeepEqual(pp.Proposal.Number(), decodedPP.Proposal.Number()) { - t.Errorf("proposal number mismatch: have %v, want %v", decodedPP.Proposal.Number(), pp.Proposal.Number()) - } -} - -func testSubject(t *testing.T) { - s := &istanbul.Subject{ - View: &istanbul.View{ - Round: big.NewInt(1), - Sequence: big.NewInt(2), - }, - Digest: common.StringToHash("1234567890"), - } - - subjectPayload, _ := Encode(s) - - m := &Message{ - Code: MsgPreprepare, - Msg: subjectPayload, - Address: common.HexToAddress("0x1234567890"), - } - - msgPayload, err := m.Payload() - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - decodedMsg := new(Message) - err = decodedMsg.FromPayload(msgPayload, nil) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - var decodedSub *istanbul.Subject - err = decodedMsg.Decode(&decodedSub) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - if !reflect.DeepEqual(s, decodedSub) { - t.Errorf("subject mismatch: have %v, want %v", decodedSub, s) - } -} - -func testSubjectWithSignature(t *testing.T) { - s := &istanbul.Subject{ - View: &istanbul.View{ - Round: big.NewInt(1), - Sequence: big.NewInt(2), - }, - Digest: common.StringToHash("1234567890"), - } - expectedSig := []byte{0x01} - - subjectPayload, _ := Encode(s) - // 1. Encode test - address := common.HexToAddress("0x1234567890") - m := &Message{ - Code: MsgPreprepare, - Msg: subjectPayload, - Address: address, - Signature: expectedSig, - CommittedSeal: []byte{}, - } - - msgPayload, err := m.Payload() - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - // 2. Decode test - // 2.1 Test normal validate func - decodedMsg := new(Message) - err = decodedMsg.FromPayload(msgPayload, func(data []byte, sig []byte) (common.Address, error) { - return address, nil - }) - if err != nil { - t.Errorf("error mismatch: have %v, want nil", err) - } - - if !reflect.DeepEqual(decodedMsg, m) { - t.Errorf("error mismatch: have %v, want nil", err) - } - - // 2.2 Test nil validate func - decodedMsg = new(Message) - err = decodedMsg.FromPayload(msgPayload, nil) - if err != nil { - t.Error(err) - } - - if !reflect.DeepEqual(decodedMsg, m) { - t.Errorf("Message mismatch: have %v, want %v", decodedMsg, m) - } - - // 2.3 Test failed validate func - decodedMsg = new(Message) - err = decodedMsg.FromPayload(msgPayload, func(data []byte, sig []byte) (common.Address, error) { - return common.Address{}, istanbul.ErrUnauthorizedAddress - }) - if err != istanbul.ErrUnauthorizedAddress { - t.Errorf("error mismatch: have %v, want %v", err, istanbul.ErrUnauthorizedAddress) - } -} - -func TestMessageEncodeDecode(t *testing.T) { - testPreprepare(t) - testSubject(t) - testSubjectWithSignature(t) -} diff --git a/consensus/istanbul/ibft/types/state.go b/consensus/istanbul/ibft/types/state.go deleted file mode 100644 index fc21d6731..000000000 --- a/consensus/istanbul/ibft/types/state.go +++ /dev/null @@ -1,38 +0,0 @@ -package ibfttypes - -type State uint64 - -const ( - StateAcceptRequest State = iota - StatePreprepared - StatePrepared - StateCommitted -) - -func (s State) String() string { - if s == StateAcceptRequest { - return "Accept request" - } else if s == StatePreprepared { - return "Preprepared" - } else if s == StatePrepared { - return "Prepared" - } else if s == StateCommitted { - return "Committed" - } else { - return "Unknown" - } -} - -// Cmp compares s and y and returns: -// -1 if s is the previous state of y -// 0 if s and y are the same state -// +1 if s is the next state of y -func (s State) Cmp(y State) int { - if uint64(s) < uint64(y) { - return -1 - } - if uint64(s) > uint64(y) { - return 1 - } - return 0 -} diff --git a/consensus/istanbul/ibft/types/state_test.go b/consensus/istanbul/ibft/types/state_test.go deleted file mode 100644 index 95445aa5f..000000000 --- a/consensus/istanbul/ibft/types/state_test.go +++ /dev/null @@ -1 +0,0 @@ -package ibfttypes diff --git a/consensus/istanbul/qbft/types/commit.go b/consensus/istanbul/types/commit.go similarity index 100% rename from consensus/istanbul/qbft/types/commit.go rename to consensus/istanbul/types/commit.go diff --git a/consensus/istanbul/qbft/types/common.go b/consensus/istanbul/types/common.go similarity index 100% rename from consensus/istanbul/qbft/types/common.go rename to consensus/istanbul/types/common.go diff --git a/consensus/istanbul/qbft/types/decode.go b/consensus/istanbul/types/decode.go similarity index 100% rename from consensus/istanbul/qbft/types/decode.go rename to consensus/istanbul/types/decode.go diff --git a/consensus/istanbul/qbft/types/message.go b/consensus/istanbul/types/message.go similarity index 100% rename from consensus/istanbul/qbft/types/message.go rename to consensus/istanbul/types/message.go diff --git a/consensus/istanbul/qbft/types/prepare.go b/consensus/istanbul/types/prepare.go similarity index 100% rename from consensus/istanbul/qbft/types/prepare.go rename to consensus/istanbul/types/prepare.go diff --git a/consensus/istanbul/qbft/types/preprepare.go b/consensus/istanbul/types/preprepare.go similarity index 100% rename from consensus/istanbul/qbft/types/preprepare.go rename to consensus/istanbul/types/preprepare.go diff --git a/consensus/istanbul/qbft/types/roundchange.go b/consensus/istanbul/types/roundchange.go similarity index 100% rename from consensus/istanbul/qbft/types/roundchange.go rename to consensus/istanbul/types/roundchange.go diff --git a/eth/backend.go b/eth/backend.go index b82234495..fbeb01c11 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -147,11 +147,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { log.Error("Failed to recover state", "error", err) } - if chainConfig.Istanbul != nil && (chainConfig.IBFT != nil || chainConfig.QBFT != nil) { - return nil, errors.New("the attributes config.Istanbul and config.[IBFT|QBFT] are mutually exclusive on the genesis file") - } - if chainConfig.IBFT != nil && chainConfig.QBFT != nil { - return nil, errors.New("the attributes config.IBFT and config.QBFT are mutually exclusive on the genesis file") + if chainConfig.Istanbul != nil && chainConfig.QBFT != nil { + return nil, errors.New("the attributes config.Istanbul and config.QBFT are mutually exclusive on the genesis file") } merger := consensus.NewMerger(chainDb) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index e15fb45b9..4f12d26b5 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -231,7 +231,7 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, co //Quorum // If Istanbul is requested, set it up if chainConfig.Istanbul != nil { - log.Warn("WARNING: The attribute config.istanbul is deprecated and will be removed in the future, please use config.ibft on genesis file") + log.Warn("WARNING: The attribute config.istanbul is deprecated and will be removed in the future, please use config.qbft on genesis file") if chainConfig.Istanbul.Epoch != 0 { config.Istanbul.Epoch = chainConfig.Istanbul.Epoch } @@ -240,10 +240,6 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, co return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) } - if chainConfig.IBFT != nil { - setBFTConfig(&config.Istanbul, chainConfig.IBFT.BFTConfig) - return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) - } if chainConfig.QBFT != nil { setBFTConfig(&config.Istanbul, chainConfig.QBFT.BFTConfig) return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) diff --git a/params/config.go b/params/config.go index a1cb4bf4c..798e5351f 100644 --- a/params/config.go +++ b/params/config.go @@ -91,16 +91,16 @@ var ( // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil, nil} + AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil} // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Clique consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, nil, nil} + AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, nil} - TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil, nil} + TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil} TestRules = TestChainConfig.Rules(new(big.Int), false) ) @@ -190,7 +190,6 @@ type ChainConfig struct { Ethash *EthashConfig `json:"ethash,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"` Istanbul *IstanbulConfig `json:"istanbul,omitempty"` // Quorum - IBFT *IBFTConfig `json:"ibft,omitempty"` // Quorum QBFT *QBFTConfig `json:"qbft,omitempty"` // Quorum } From 910c431e37d97e52c93bf1beefd41759145062c6 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Sun, 19 Jun 2022 02:20:16 -0300 Subject: [PATCH 09/30] cmd/consensus/core/eth/miner/params: replace QBFT with IBFT chain config (name), remove "Istanbul" chain config Plus some house keeping --- cmd/geth/config.go | 13 ++-- cmd/geth/main.go | 11 +--- cmd/geth/usage.go | 9 --- cmd/utils/flags.go | 28 --------- consensus/istanbul/backend/backend.go | 26 ++++---- consensus/istanbul/backend/engine.go | 30 ++++----- consensus/istanbul/backend/engine_test.go | 6 +- consensus/istanbul/backend/handler.go | 6 +- consensus/istanbul/backend/snapshot_test.go | 9 ++- consensus/istanbul/core/backlog.go | 12 ++-- consensus/istanbul/core/commit.go | 24 ++++---- consensus/istanbul/core/core.go | 18 +++--- consensus/istanbul/core/final_committed.go | 2 +- consensus/istanbul/core/handler.go | 22 +++---- consensus/istanbul/core/justification.go | 4 +- consensus/istanbul/core/prepare.go | 22 +++---- consensus/istanbul/core/preprepare.go | 28 ++++----- consensus/istanbul/core/request.go | 18 +++--- consensus/istanbul/core/roundchange.go | 26 ++++---- consensus/istanbul/testutils/genesis.go | 2 +- consensus/istanbul/types/roundchange.go | 48 +++++++-------- core/genesis_test.go | 2 +- eth/backend.go | 24 ++++---- eth/ethconfig/config.go | 44 +++----------- eth/handler.go | 44 ++++---------- eth/ibft_protocol.go | 67 +++++++++++++++++++++ eth/quorum_protocol.go | 67 --------------------- miner/worker.go | 2 +- params/config.go | 61 +++++++------------ 29 files changed, 287 insertions(+), 388 deletions(-) create mode 100644 eth/ibft_protocol.go delete mode 100644 eth/quorum_protocol.go diff --git a/cmd/geth/config.go b/cmd/geth/config.go index c7a262e17..1d8f66421 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -266,9 +266,8 @@ func applyMetricConfig(ctx *cli.Context, cfg *gethConfig) { } } -// Quorum -// quorumValidateEthService checks quorum features that depend on the ethereum service -func quorumValidateEthService(stack *node.Node) { +// ibftValidateEthService checks ibft features that depend on the ethereum service +func ibftValidateEthService(stack *node.Node) { var ethereum *eth.Ethereum err := stack.Lifecycle(ðereum) @@ -276,12 +275,12 @@ func quorumValidateEthService(stack *node.Node) { utils.Fatalf("Error retrieving Ethereum service: %v", err) } - quorumValidateConsensus(ethereum) + ibftValidateConsensus(ethereum) } -// quorumValidateConsensus checks if a consensus was used. The node is killed if consensus was not used -func quorumValidateConsensus(ethereum *eth.Ethereum) { - if ethereum.BlockChain().Config().Istanbul == nil && ethereum.BlockChain().Config().QBFT == nil && ethereum.BlockChain().Config().Clique == nil { +// ibftValidateConsensus checks if a consensus was used. The node is killed if consensus was not used +func ibftValidateConsensus(ethereum *eth.Ethereum) { + if ethereum.BlockChain().Config().IBFT == nil && ethereum.BlockChain().Config().Clique == nil { utils.Fatalf("Consensus not specified. Exiting!!") } } diff --git a/cmd/geth/main.go b/cmd/geth/main.go index dbd6ed8d4..94eac584e 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -152,10 +152,6 @@ var ( utils.GpoIgnoreGasPriceFlag, utils.MinerNotifyFullFlag, configFileFlag, - // Quorum - utils.IstanbulRequestTimeoutFlag, - utils.IstanbulBlockPeriodFlag, - // End-Quorum }, utils.NetworkFlags, utils.DatabasePathFlags) rpcFlags = []cli.Flag{ @@ -437,10 +433,9 @@ func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isCon } } - // Quorum - // checks quorum features that depend on the ethereum service - if backend.ChainConfig().Istanbul != nil { - quorumValidateEthService(stack) + // checks ibft features that depend on the ethereum service + if backend.ChainConfig().IBFT != nil { + ibftValidateEthService(stack) } } diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 90f41fbd5..731992ff7 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -230,15 +230,6 @@ var AppHelpFlagGroups = []flags.FlagGroup{ cli.HelpFlag, }, }, - // QUORUM - { - Name: "ISTANBUL", - Flags: []cli.Flag{ - utils.IstanbulRequestTimeoutFlag, - utils.IstanbulBlockPeriodFlag, - }, - }, - // END QUORUM } func init() { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 945b69b34..ab7caf092 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -809,19 +809,6 @@ var ( Usage: "InfluxDB organization name (v2 only)", Value: metrics.DefaultConfig.InfluxDBOrganization, } - - // Quorum - // Istanbul settings - IstanbulRequestTimeoutFlag = cli.Uint64Flag{ - Name: "istanbul.requesttimeout", - Usage: "[Deprecated] Timeout for each Istanbul round in milliseconds", - Value: ethconfig.Defaults.Istanbul.RequestTimeout, - } - IstanbulBlockPeriodFlag = cli.Uint64Flag{ - Name: "istanbul.blockperiod", - Usage: "[Deprecated] Default minimum difference between two consecutive block's timestamps in seconds", - Value: ethconfig.Defaults.Istanbul.BlockPeriod, - } ) var ( @@ -1487,18 +1474,6 @@ func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) { } } -// Quorum -func setIstanbul(ctx *cli.Context, cfg *eth.Config) { - if ctx.GlobalIsSet(IstanbulRequestTimeoutFlag.Name) { - log.Warn("WARNING: The flag --istanbul.requesttimeout is deprecated and will be removed in the future, please use ibft.requesttimeoutseconds on genesis file") - cfg.Istanbul.RequestTimeout = ctx.GlobalUint64(IstanbulRequestTimeoutFlag.Name) - } - if ctx.GlobalIsSet(IstanbulBlockPeriodFlag.Name) { - log.Warn("WARNING: The flag --istanbul.blockperiod is deprecated and will be removed in the future, please use ibft.blockperiodseconds on genesis file") - cfg.Istanbul.BlockPeriod = ctx.GlobalUint64(IstanbulBlockPeriodFlag.Name) - } -} - // CheckExclusive verifies that only a single instance of the provided flags was // set by the user. Each flag might optionally be followed by a string type to // specialize it further. @@ -1565,9 +1540,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { setRequiredBlocks(ctx, cfg) setLes(ctx, cfg) - // Quorum - setIstanbul(ctx, cfg) - // Cap the cache allowance and tune the garbage collector mem, err := gopsutil.VirtualMemory() if err == nil { diff --git a/consensus/istanbul/backend/backend.go b/consensus/istanbul/backend/backend.go index 049d7b867..07052f057 100644 --- a/consensus/istanbul/backend/backend.go +++ b/consensus/istanbul/backend/backend.go @@ -45,14 +45,14 @@ const ( ) // New creates an Ethereum backend for Istanbul core engine. -func New(config *istanbul.Config, privateKey *ecdsa.PrivateKey, db ethdb.Database) *Backend { +func New(config istanbul.Config, privateKey *ecdsa.PrivateKey, db ethdb.Database) *Backend { // Allocate the snapshot caches and create the engine recents, _ := lru.NewARC(inmemorySnapshots) recentMessages, _ := lru.NewARC(inmemoryPeers) knownMessages, _ := lru.NewARC(inmemoryMessages) sb := &Backend{ - config: config, + config: &config, istanbulEventMux: new(event.TypeMux), privateKey: privateKey, address: crypto.PubkeyToAddress(privateKey.PublicKey), @@ -194,7 +194,7 @@ func (sb *Backend) Commit(proposal istanbul.Proposal, seals [][]byte, round *big // Check if the proposal is a valid block block, ok := proposal.(*types.Block) if !ok { - sb.logger.Error("BFT: invalid block proposal", "proposal", proposal) + sb.logger.Error("IBFT: invalid block proposal", "proposal", proposal) return istanbulcommon.ErrInvalidProposal } @@ -211,7 +211,7 @@ func (sb *Backend) Commit(proposal istanbul.Proposal, seals [][]byte, round *big // update block's header block = block.WithSeal(h) - sb.logger.Info("BFT: block proposal committed", "author", sb.Address(), "hash", proposal.Hash(), "number", proposal.Number().Uint64()) + sb.logger.Info("IBFT: block proposal committed", "author", sb.Address(), "hash", proposal.Hash(), "number", proposal.Number().Uint64()) // - if the proposed and committed blocks are the same, send the proposed hash // to commit channel, which is being watched inside the engine.Seal() function. @@ -242,13 +242,13 @@ func (sb *Backend) Verify(proposal istanbul.Proposal) (time.Duration, error) { // Check if the proposal is a valid block block, ok := proposal.(*types.Block) if !ok { - sb.logger.Error("BFT: invalid block proposal", "proposal", proposal) + sb.logger.Error("IBFT: invalid block proposal", "proposal", proposal) return 0, istanbulcommon.ErrInvalidProposal } // check bad block if sb.HasBadProposal(block.Hash()) { - sb.logger.Warn("BFT: bad block proposal", "proposal", proposal) + sb.logger.Warn("IBFT: bad block proposal", "proposal", proposal) return 0, core.ErrBannedHash } @@ -324,7 +324,7 @@ func (sb *Backend) LastProposal() (istanbul.Proposal, common.Address) { var err error proposer, err = sb.Author(block.Header()) if err != nil { - sb.logger.Error("BFT: last block proposal invalid", "err", err) + sb.logger.Error("IBFT: last block proposal invalid", "err", err) return nil, common.Address{} } } @@ -345,13 +345,13 @@ func (sb *Backend) Close() error { } func (sb *Backend) startQBFT() error { - sb.logger.Info("BFT: activate QBFT") - sb.logger.Trace("BFT: set ProposerPolicy sorter to ValidatorSortByByteFunc") + sb.logger.Info("IBFT: activate QBFT") + sb.logger.Trace("IBFT: set ProposerPolicy sorter to ValidatorSortByByteFunc") sb.config.ProposerPolicy.Use(istanbul.ValidatorSortByByte()) sb.core = qbftcore.New(sb, sb.config) if err := sb.core.Start(); err != nil { - sb.logger.Error("BFT: failed to activate QBFT", "err", err) + sb.logger.Error("IBFT: failed to activate QBFT", "err", err) return err } @@ -363,9 +363,9 @@ func (sb *Backend) stop() error { sb.core = nil if core != nil { - sb.logger.Info("BFT: deactivate") + sb.logger.Info("IBFT: deactivate") if err := core.Stop(); err != nil { - sb.logger.Error("BFT: failed to deactivate", "err", err) + sb.logger.Error("IBFT: failed to deactivate", "err", err) return err } } @@ -375,7 +375,7 @@ func (sb *Backend) stop() error { // StartQBFTConsensus stops existing legacy ibft consensus and starts the new qbft consensus func (sb *Backend) StartQBFTConsensus() error { - sb.logger.Info("BFT: switch from IBFT to QBFT") + sb.logger.Info("IBFT: switch from IBFT to QBFT") if err := sb.stop(); err != nil { return err } diff --git a/consensus/istanbul/backend/engine.go b/consensus/istanbul/backend/engine.go index de581b2c0..11367ecce 100644 --- a/consensus/istanbul/backend/engine.go +++ b/consensus/istanbul/backend/engine.go @@ -157,7 +157,7 @@ func (sb *Backend) Prepare(chain consensus.ChainHeaderReader, header *types.Head err = sb.EngineForBlockNumber(header.Number).WriteVote(header, addresses[index], authorizes[index]) if err != nil { - log.Error("BFT: error writing validator vote", "err", err) + log.Error("IBFT: error writing validator vote", "err", err) return err } } @@ -313,9 +313,9 @@ func (sb *Backend) snapLogger(snap *Snapshot) log.Logger { func (sb *Backend) storeSnap(snap *Snapshot) error { logger := sb.snapLogger(snap) - logger.Debug("BFT: store snapshot to database") + logger.Debug("IBFT: store snapshot to database") if err := snap.store(sb.db); err != nil { - logger.Error("BFT: failed to store snapshot to database", "err", err) + logger.Error("IBFT: failed to store snapshot to database", "err", err) return err } @@ -333,14 +333,14 @@ func (sb *Backend) snapshot(chain consensus.ChainHeaderReader, number uint64, ha // If an in-memory snapshot was found, use that if s, ok := sb.recents.Get(hash); ok { snap = s.(*Snapshot) - sb.snapLogger(snap).Trace("BFT: loaded voting snapshot from cache") + sb.snapLogger(snap).Trace("IBFT: loaded voting snapshot from cache") break } // If an on-disk checkpoint snapshot can be found, use that if number%checkpointInterval == 0 { if s, err := loadSnapshot(sb.config.Epoch, sb.db, hash); err == nil { snap = s - sb.snapLogger(snap).Trace("BFT: loaded voting snapshot from database") + sb.snapLogger(snap).Trace("IBFT: loaded voting snapshot from database") break } } @@ -349,14 +349,14 @@ func (sb *Backend) snapshot(chain consensus.ChainHeaderReader, number uint64, ha if number == 0 { genesis := chain.GetHeaderByNumber(0) if err := sb.EngineForBlockNumber(big.NewInt(0)).VerifyHeader(chain, genesis, nil, nil); err != nil { - sb.logger.Error("BFT: invalid genesis block", "err", err) + sb.logger.Error("IBFT: invalid genesis block", "err", err) return nil, err } // Get the validators from genesis to create a snapshot validators, err := sb.EngineForBlockNumber(big.NewInt(0)).Validators(genesis) if err != nil { - sb.logger.Error("BFT: invalid genesis block", "err", err) + sb.logger.Error("IBFT: invalid genesis block", "err", err) return nil, err } @@ -446,7 +446,7 @@ func (sb *Backend) snapApply(snap *Snapshot, headers []*types.Header) (*Snapshot func (sb *Backend) snapApplyHeader(snap *Snapshot, header *types.Header) error { logger := sb.snapLogger(snap).New("header.number", header.Number.Uint64(), "header.hash", header.Hash().String()) - logger.Trace("BFT: apply header to voting snapshot") + logger.Trace("IBFT: apply header to voting snapshot") // Remove any votes on checkpoint blocks number := header.Number.Uint64() @@ -458,21 +458,21 @@ func (sb *Backend) snapApplyHeader(snap *Snapshot, header *types.Header) error { // Resolve the authorization key and check against validators validator, err := sb.EngineForBlockNumber(header.Number).Author(header) if err != nil { - logger.Error("BFT: invalid header author", "err", err) + logger.Error("IBFT: invalid header author", "err", err) return err } logger = logger.New("header.author", validator) if _, v := snap.ValSet.GetByAddress(validator); v == nil { - logger.Error("BFT: header author is not a validator") + logger.Error("IBFT: header author is not a validator") return istanbulcommon.ErrUnauthorized } // Read vote from header candidate, authorize, err := sb.EngineForBlockNumber(header.Number).ReadVote(header) if err != nil { - logger.Error("BFT: invalid header vote", "err", err) + logger.Error("IBFT: invalid header vote", "err", err) return err } @@ -480,7 +480,7 @@ func (sb *Backend) snapApplyHeader(snap *Snapshot, header *types.Header) error { // Header authorized, discard any previous votes from the validator for i, vote := range snap.Votes { if vote.Validator == validator && vote.Address == candidate { - logger.Trace("BFT: discard previous vote from tally", "old.authorize", vote.Authorize) + logger.Trace("IBFT: discard previous vote from tally", "old.authorize", vote.Authorize) // Uncast the vote from the cached tally snap.uncast(vote.Address, vote.Authorize) @@ -490,7 +490,7 @@ func (sb *Backend) snapApplyHeader(snap *Snapshot, header *types.Header) error { } } - logger.Debug("BFT: add vote to tally") + logger.Debug("IBFT: add vote to tally") if snap.cast(candidate, authorize) { snap.Votes = append(snap.Votes, &Vote{ Validator: validator, @@ -504,10 +504,10 @@ func (sb *Backend) snapApplyHeader(snap *Snapshot, header *types.Header) error { if tally := snap.Tally[candidate]; tally.Votes > snap.ValSet.Size()/2 { if tally.Authorize { - logger.Info("BFT: reached majority to add validator") + logger.Info("IBFT: reached majority to add validator") snap.ValSet.AddValidator(candidate) } else { - logger.Info("BFT: reached majority to remove validator") + logger.Info("IBFT: reached majority to remove validator") snap.ValSet.RemoveValidator(candidate) // Discard any previous votes the deauthorized validator cast diff --git a/consensus/istanbul/backend/engine_test.go b/consensus/istanbul/backend/engine_test.go index 45e193923..a18128015 100644 --- a/consensus/istanbul/backend/engine_test.go +++ b/consensus/istanbul/backend/engine_test.go @@ -36,7 +36,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" ) -func newBlockchainFromConfig(genesis *core.Genesis, nodeKeys []*ecdsa.PrivateKey, cfg *istanbul.Config) (*core.BlockChain, *Backend) { +func newBlockchainFromConfig(genesis *core.Genesis, nodeKeys []*ecdsa.PrivateKey, cfg istanbul.Config) (*core.BlockChain, *Backend) { memDB := rawdb.NewMemoryDatabase() // Use the first key as private key @@ -83,9 +83,9 @@ func newBlockChain(n int) (*core.BlockChain, *Backend) { } // copyConfig create a copy of istanbul.Config, so that changing it does not update the original -func copyConfig(config *istanbul.Config) *istanbul.Config { +func copyConfig(config *istanbul.Config) istanbul.Config { cpy := *config - return &cpy + return cpy } func makeHeader(parent *types.Block, config *istanbul.Config) *types.Header { diff --git a/consensus/istanbul/backend/handler.go b/consensus/istanbul/backend/handler.go index 462e8578e..b3813a8a9 100644 --- a/consensus/istanbul/backend/handler.go +++ b/consensus/istanbul/backend/handler.go @@ -99,7 +99,7 @@ func (sb *Backend) HandleMsg(addr common.Address, msg p2p.Msg) (bool, error) { if msg.Code == NewBlockMsg && sb.core != nil && sb.core.IsProposer() { // eth.NewBlockMsg: import cycle // this case is to safeguard the race of similar block which gets propagated from other node while this node is proposing // as p2p.Msg can only be decoded once (get EOF for any subsequence read), we need to make sure the payload is restored after we decode it - sb.logger.Debug("BFT: received NewBlockMsg", "size", msg.Size, "payload.type", reflect.TypeOf(msg.Payload), "sender", addr) + sb.logger.Debug("IBFT: received NewBlockMsg", "size", msg.Size, "payload.type", reflect.TypeOf(msg.Payload), "sender", addr) if reader, ok := msg.Payload.(*bytes.Reader); ok { payload, err := ioutil.ReadAll(reader) if err != nil { @@ -112,12 +112,12 @@ func (sb *Backend) HandleMsg(addr common.Address, msg p2p.Msg) (bool, error) { TD *big.Int } if err := msg.Decode(&request); err != nil { - sb.logger.Error("BFT: unable to decode the NewBlockMsg", "error", err) + sb.logger.Error("IBFT: unable to decode the NewBlockMsg", "error", err) return false, nil } newRequestedBlock := request.Block if newRequestedBlock.Header().MixDigest == types.IstanbulDigest && sb.core.IsCurrentProposal(newRequestedBlock.Hash()) { - sb.logger.Debug("BFT: block already proposed", "hash", newRequestedBlock.Hash(), "sender", addr) + sb.logger.Debug("IBFT: block already proposed", "hash", newRequestedBlock.Hash(), "sender", addr) return true, nil } } diff --git a/consensus/istanbul/backend/snapshot_test.go b/consensus/istanbul/backend/snapshot_test.go index 6e7cab532..1bcdfe875 100644 --- a/consensus/istanbul/backend/snapshot_test.go +++ b/consensus/istanbul/backend/snapshot_test.go @@ -329,8 +329,13 @@ func TestVoting(t *testing.T) { } genesis := testutils.Genesis(validators) - config := new(istanbul.Config) - *config = *istanbul.DefaultConfig + config := istanbul.Config{ + RequestTimeout: istanbul.DefaultConfig.RequestTimeout, + BlockPeriod: istanbul.DefaultConfig.BlockPeriod, + ProposerPolicy: istanbul.DefaultConfig.ProposerPolicy, + Epoch: istanbul.DefaultConfig.Epoch, + AllowedFutureBlockTime: istanbul.DefaultConfig.AllowedFutureBlockTime, + } if tt.epoch != 0 { config.Epoch = tt.epoch } diff --git a/consensus/istanbul/core/backlog.go b/consensus/istanbul/core/backlog.go index 13874b799..a8e0bcf97 100644 --- a/consensus/istanbul/core/backlog.go +++ b/consensus/istanbul/core/backlog.go @@ -109,11 +109,11 @@ func (c *core) addToBacklog(msg qbfttypes.QBFTMessage) { src := msg.Source() if src == c.Address() { - logger.Warn("QBFT: backlog from self") + logger.Warn("IBFT: backlog from self") return } - logger.Trace("QBFT: new backlog message", "backlogs_size", len(c.backlogs)) + logger.Trace("IBFT: new backlog message", "backlogs_size", len(c.backlogs)) c.backlogsMu.Lock() defer c.backlogsMu.Unlock() @@ -148,7 +148,7 @@ func (c *core) processBacklog() { logger := c.logger.New("from", src, "state", c.state) isFuture := false - logger.Trace("QBFT: process backlog") + logger.Trace("IBFT: process backlog") // We stop processing if // 1. backlog is empty @@ -170,15 +170,15 @@ func (c *core) processBacklog() { if err != nil { if err == errFutureMessage { // this is still a future message - logger.Trace("QBFT: stop processing backlog", "msg", m) + logger.Trace("IBFT: stop processing backlog", "msg", m) backlog.Push(m, prio) isFuture = true break } - logger.Trace("QBFT: skip backlog message", "msg", m, "err", err) + logger.Trace("IBFT: skip backlog message", "msg", m, "err", err) continue } - logger.Trace("QBFT: post backlog event", "msg", m) + logger.Trace("IBFT: post backlog event", "msg", m) event.src = src go c.sendEvent(event) diff --git a/consensus/istanbul/core/commit.go b/consensus/istanbul/core/commit.go index 8a63c24d5..fc26d2509 100644 --- a/consensus/istanbul/core/commit.go +++ b/consensus/istanbul/core/commit.go @@ -42,7 +42,7 @@ func (c *core) broadcastCommit() { // Create Commit Seal commitSeal, err := c.backend.SignWithoutHashing(PrepareCommittedSeal(header, uint32(c.currentView().Round.Uint64()))) if err != nil { - logger.Error("QBFT: failed to create COMMIT seal", "sub", sub, "err", err) + logger.Error("IBFT: failed to create COMMIT seal", "sub", sub, "err", err) return } @@ -52,13 +52,13 @@ func (c *core) broadcastCommit() { // Sign Message encodedPayload, err := commit.EncodePayloadForSigning() if err != nil { - withMsg(logger, commit).Error("QBFT: failed to encode payload of COMMIT message", "err", err) + withMsg(logger, commit).Error("IBFT: failed to encode payload of COMMIT message", "err", err) return } signature, err := c.backend.Sign(encodedPayload) if err != nil { - withMsg(logger, commit).Error("QBFT: failed to sign COMMIT message", "err", err) + withMsg(logger, commit).Error("IBFT: failed to sign COMMIT message", "err", err) return } commit.SetSignature(signature) @@ -66,15 +66,15 @@ func (c *core) broadcastCommit() { // RLP-encode message payload, err := rlp.EncodeToBytes(&commit) if err != nil { - withMsg(logger, commit).Error("QBFT: failed to encode COMMIT message", "err", err) + withMsg(logger, commit).Error("IBFT: failed to encode COMMIT message", "err", err) return } - withMsg(logger, commit).Info("QBFT: broadcast COMMIT message", "payload", hexutil.Encode(payload)) + withMsg(logger, commit).Info("IBFT: broadcast COMMIT message", "payload", hexutil.Encode(payload)) // Broadcast RLP-encoded message if err = c.backend.Broadcast(c.valSet, commit.Code(), payload); err != nil { - withMsg(logger, commit).Error("QBFT: failed to broadcast COMMIT message", "err", err) + withMsg(logger, commit).Error("IBFT: failed to broadcast COMMIT message", "err", err) return } } @@ -88,17 +88,17 @@ func (c *core) broadcastCommit() { func (c *core) handleCommitMsg(commit *qbfttypes.Commit) error { logger := c.currentLogger(true, commit) - logger.Info("QBFT: handle COMMIT message", "commits.count", c.current.QBFTCommits.Size(), "quorum", c.QuorumSize()) + logger.Info("IBFT: handle COMMIT message", "commits.count", c.current.QBFTCommits.Size(), "quorum", c.QuorumSize()) // Check digest if commit.Digest != c.current.Proposal().Hash() { - logger.Error("QBFT: invalid COMMIT message digest", "digest", commit.Digest, "proposal", c.current.Proposal().Hash().String()) + logger.Error("IBFT: invalid COMMIT message digest", "digest", commit.Digest, "proposal", c.current.Proposal().Hash().String()) return errInvalidMessage } // Add to received msgs if err := c.current.QBFTCommits.Add(commit); err != nil { - c.logger.Error("QBFT: failed to save COMMIT message", "err", err) + c.logger.Error("IBFT: failed to save COMMIT message", "err", err) return err } @@ -106,10 +106,10 @@ func (c *core) handleCommitMsg(commit *qbfttypes.Commit) error { // If we reached thresho if c.current.QBFTCommits.Size() >= c.QuorumSize() { - logger.Info("QBFT: received quorum of COMMIT messages") + logger.Info("IBFT: received quorum of COMMIT messages") c.commitQBFT() } else { - logger.Debug("QBFT: accepted new COMMIT messages") + logger.Debug("IBFT: accepted new COMMIT messages") } return nil @@ -134,7 +134,7 @@ func (c *core) commitQBFT() { // Commit proposal to database if err := c.backend.Commit(proposal, committedSeals, c.currentView().Round); err != nil { - c.currentLogger(true, nil).Error("QBFT: error committing proposal", "err", err) + c.currentLogger(true, nil).Error("IBFT: error committing proposal", "err", err) c.broadcastNextRoundChange() return } diff --git a/consensus/istanbul/core/core.go b/consensus/istanbul/core/core.go index 0e3544aec..7c19e495a 100644 --- a/consensus/istanbul/core/core.go +++ b/consensus/istanbul/core/core.go @@ -129,10 +129,10 @@ func (c *core) startNewRound(round *big.Int) { logger = logger.New("lastProposal.number", lastProposal.Number().Uint64(), "lastProposal.hash", lastProposal.Hash()) } - logger.Info("QBFT: initialize new round") + logger.Info("IBFT: initialize new round") if c.current == nil { - logger.Debug("QBFT: start at the initial round") + logger.Debug("IBFT: start at the initial round") } else if lastProposal.Number().Cmp(c.current.Sequence()) >= 0 { diff := new(big.Int).Sub(lastProposal.Number(), c.current.Sequence()) sequenceMeter.Mark(new(big.Int).Add(diff, common.Big1).Int64()) @@ -141,19 +141,19 @@ func (c *core) startNewRound(round *big.Int) { consensusTimer.UpdateSince(c.consensusTimestamp) c.consensusTimestamp = time.Time{} } - logger.Debug("QBFT: catch up last block proposal") + logger.Debug("IBFT: catch up last block proposal") } else if lastProposal.Number().Cmp(big.NewInt(c.current.Sequence().Int64()-1)) == 0 { if round.Cmp(common.Big0) == 0 { // same seq and round, don't need to start new round - logger.Debug("QBFT: same round, no need to start new round") + logger.Debug("IBFT: same round, no need to start new round") return } else if round.Cmp(c.current.Round()) < 0 { - logger.Warn("QBFT: next round is inferior to current round") + logger.Warn("IBFT: next round is inferior to current round") return } roundChange = true } else { - logger.Warn("QBFT: next sequence is before last block proposal") + logger.Warn("IBFT: next sequence is before last block proposal") return } @@ -204,7 +204,7 @@ func (c *core) startNewRound(round *big.Int) { c.newRoundChangeTimer() } - oldLogger.Info("QBFT: start new round", "next.round", newView.Round, "next.seq", newView.Sequence, "next.proposer", c.valSet.GetProposer(), "next.valSet", c.valSet.List(), "next.size", c.valSet.Size(), "next.IsProposer", c.IsProposer()) + oldLogger.Info("IBFT: start new round", "next.round", newView.Round, "next.seq", newView.Sequence, "next.proposer", c.valSet.GetProposer(), "next.valSet", c.valSet.List(), "next.size", c.valSet.Size(), "next.IsProposer", c.IsProposer()) } // updateRoundState updates round state by checking if locking block is necessary @@ -220,7 +220,7 @@ func (c *core) setState(state State) { if c.state != state { oldState := c.state c.state = state - c.currentLogger(false, nil).Info("QBFT: changed state", "old.state", oldState.String(), "new.state", state.String()) + c.currentLogger(false, nil).Info("IBFT: changed state", "old.state", oldState.String(), "new.state", state.String()) } if state == StateAcceptRequest { c.processPendingRequests() @@ -257,7 +257,7 @@ func (c *core) newRoundChangeTimer() { timeout := baseTimeout * time.Duration(math.Pow(2, float64(round))) - c.currentLogger(true, nil).Trace("QBFT: start new ROUND-CHANGE timer", "timeout", timeout.Seconds()) + c.currentLogger(true, nil).Trace("IBFT: start new ROUND-CHANGE timer", "timeout", timeout.Seconds()) c.roundChangeTimer = time.AfterFunc(timeout, func() { c.sendEvent(timeoutEvent{}) }) diff --git a/consensus/istanbul/core/final_committed.go b/consensus/istanbul/core/final_committed.go index 9157d7201..a0cfa85d6 100644 --- a/consensus/istanbul/core/final_committed.go +++ b/consensus/istanbul/core/final_committed.go @@ -19,7 +19,7 @@ package core import "github.com/ethereum/go-ethereum/common" func (c *core) handleFinalCommitted() error { - c.currentLogger(true, nil).Info("QBFT: handle final committed") + c.currentLogger(true, nil).Info("IBFT: handle final committed") // Stopping the timer, so that round changes do not happen c.stopTimer() diff --git a/consensus/istanbul/core/handler.go b/consensus/istanbul/core/handler.go index 2bed75587..65d765aa6 100644 --- a/consensus/istanbul/core/handler.go +++ b/consensus/istanbul/core/handler.go @@ -29,7 +29,7 @@ import ( // Start implements core.Engine.Start func (c *core) Start() error { - c.logger.Info("QBFT: start") + c.logger.Info("IBFT: start") // Tests will handle events itself, so we have to make subscribeEvents() // be able to call in test. c.subscribeEvents() @@ -44,13 +44,13 @@ func (c *core) Start() error { // Stop implements core.Engine.Stop func (c *core) Stop() error { - c.logger.Info("QBFT: stopping...") + c.logger.Info("IBFT: stopping...") c.stopTimer() c.unsubscribeEvents() // Make sure the handler goroutine exits c.handlerWg.Wait() - c.logger.Info("QBFT: stopped") + c.logger.Info("IBFT: stopped") return nil } @@ -134,7 +134,7 @@ func (c *core) handleEvents() { data, err := rlp.EncodeToBytes(ev.msg) if err != nil { - c.logger.Error("QBFT: can not encode backlog message", "err", err) + c.logger.Error("IBFT: can not encode backlog message", "err", err) continue } @@ -169,14 +169,14 @@ func (c *core) handleEncodedMsg(code uint64, data []byte) error { logger := c.logger.New("code", code, "data", data) if _, ok := qbfttypes.MessageCodes()[code]; !ok { - logger.Error("QBFT: invalid message event code") + logger.Error("IBFT: invalid message event code") return fmt.Errorf("invalid message event code %v", code) } // Decode data into a QBFTMessage m, err := qbfttypes.Decode(code, data) if err != nil { - logger.Error("QBFT: invalid message", "err", err) + logger.Error("IBFT: invalid message", "err", err) return err } @@ -216,7 +216,7 @@ func (c *core) deliverMessage(m qbfttypes.QBFTMessage) error { case qbfttypes.RoundChangeCode: err = c.handleRoundChange(m.(*qbfttypes.RoundChange)) default: - c.logger.Error("QBFT: invalid message code", "code", m.Code()) + c.logger.Error("IBFT: invalid message code", "code", m.Code()) return errInvalidMessage } @@ -229,9 +229,9 @@ func (c *core) handleTimeoutMsg() { round := c.current.Round() nextRound := new(big.Int).Add(round, common.Big1) - logger.Warn("QBFT: TIMER CHANGING ROUND", "pr", c.current.preparedRound) + logger.Warn("IBFT: TIMER CHANGING ROUND", "pr", c.current.preparedRound) c.startNewRound(nextRound) - logger.Warn("QBFT: TIMER CHANGED ROUND", "pr", c.current.preparedRound) + logger.Warn("IBFT: TIMER CHANGED ROUND", "pr", c.current.preparedRound) // Send Round Change c.broadcastRoundChange(nextRound) @@ -247,12 +247,12 @@ func (c *core) verifySignatures(m qbfttypes.QBFTMessage) error { verify := func(m qbfttypes.QBFTMessage) error { payload, err := m.EncodePayloadForSigning() if err != nil { - logger.Error("QBFT: invalid message payload", "err", err) + logger.Error("IBFT: invalid message payload", "err", err) return err } source, err := c.validateFn(payload, m.Signature()) if err != nil { - logger.Error("QBFT: invalid message signature", "err", err) + logger.Error("IBFT: invalid message signature", "err", err) return errInvalidSigner } m.SetSource(source) diff --git a/consensus/istanbul/core/justification.go b/consensus/istanbul/core/justification.go index 5537e9c84..5dac6b5a7 100644 --- a/consensus/istanbul/core/justification.go +++ b/consensus/istanbul/core/justification.go @@ -56,7 +56,7 @@ func isJustified( func hasQuorumOfRoundChangeMessagesForNil(roundChangeMessages []*qbfttypes.SignedRoundChangePayload, quorumSize int) error { nilCount := 0 for _, m := range roundChangeMessages { - log.Trace("QBFT: hasQuorumOfRoundChangeMessagesForNil", "rc", m) + log.Trace("IBFT: hasQuorumOfRoundChangeMessagesForNil", "rc", m) if (m.PreparedRound == nil || m.PreparedRound.Cmp(common.Big0) == 0) && common.EmptyHash(m.PreparedDigest) { nilCount++ if nilCount == quorumSize { @@ -73,7 +73,7 @@ func hasQuorumOfRoundChangeMessagesForPreparedRoundAndBlock(roundChangeMessages lowerOrEqualRoundCount := 0 hasMatchingMessage := false for _, m := range roundChangeMessages { - log.Trace("QBFT: hasQuorumOfRoundChangeMessagesForPreparedRoundAndBlock", "rc", m) + log.Trace("IBFT: hasQuorumOfRoundChangeMessagesForPreparedRoundAndBlock", "rc", m) if m.PreparedRound == nil || m.PreparedRound.Cmp(preparedRound) <= 0 { lowerOrEqualRoundCount++ if m.PreparedRound != nil && m.PreparedRound.Cmp(preparedRound) == 0 && m.PreparedDigest == preparedBlock.Hash() { diff --git a/consensus/istanbul/core/prepare.go b/consensus/istanbul/core/prepare.go index 7cae14905..023525fc6 100644 --- a/consensus/istanbul/core/prepare.go +++ b/consensus/istanbul/core/prepare.go @@ -38,12 +38,12 @@ func (c *core) broadcastPrepare() { // Sign Message encodedPayload, err := prepare.EncodePayloadForSigning() if err != nil { - withMsg(logger, prepare).Error("QBFT: failed to encode payload of PREPARE message", "err", err) + withMsg(logger, prepare).Error("IBFT: failed to encode payload of PREPARE message", "err", err) return } signature, err := c.backend.Sign(encodedPayload) if err != nil { - withMsg(logger, prepare).Error("QBFT: failed to sign PREPARE message", "err", err) + withMsg(logger, prepare).Error("IBFT: failed to sign PREPARE message", "err", err) return } prepare.SetSignature(signature) @@ -51,15 +51,15 @@ func (c *core) broadcastPrepare() { // RLP-encode message payload, err := rlp.EncodeToBytes(&prepare) if err != nil { - withMsg(logger, prepare).Error("QBFT: failed to encode PREPARE message", "err", err) + withMsg(logger, prepare).Error("IBFT: failed to encode PREPARE message", "err", err) return } - withMsg(logger, prepare).Info("QBFT: broadcast PREPARE message", "payload", hexutil.Encode(payload)) + withMsg(logger, prepare).Info("IBFT: broadcast PREPARE message", "payload", hexutil.Encode(payload)) // Broadcast RLP-encoded message if err = c.backend.Broadcast(c.valSet, prepare.Code(), payload); err != nil { - withMsg(logger, prepare).Error("QBFT: failed to broadcast PREPARE message", "err", err) + withMsg(logger, prepare).Error("IBFT: failed to broadcast PREPARE message", "err", err) return } } @@ -73,17 +73,17 @@ func (c *core) broadcastPrepare() { func (c *core) handlePrepare(prepare *qbfttypes.Prepare) error { logger := c.currentLogger(true, prepare).New() - logger.Info("QBFT: handle PREPARE message", "prepares.count", c.current.QBFTPrepares.Size(), "quorum", c.QuorumSize()) + logger.Info("IBFT: handle PREPARE message", "prepares.count", c.current.QBFTPrepares.Size(), "quorum", c.QuorumSize()) // Check digest if prepare.Digest != c.current.Proposal().Hash() { - logger.Error("QBFT: invalid PREPARE message digest") + logger.Error("IBFT: invalid PREPARE message digest") return errInvalidMessage } // Save PREPARE messages if err := c.current.QBFTPrepares.Add(prepare); err != nil { - logger.Error("QBFT: failed to save PREPARE message", "err", err) + logger.Error("IBFT: failed to save PREPARE message", "err", err) return err } @@ -92,7 +92,7 @@ func (c *core) handlePrepare(prepare *qbfttypes.Prepare) error { // Change to "Prepared" state if we've received quorum of PREPARE messages // and we are in earlier state than "Prepared" if (c.current.QBFTPrepares.Size() >= c.QuorumSize()) && c.state.Cmp(StatePrepared) < 0 { - logger.Info("QBFT: received quorum of PREPARE messages") + logger.Info("IBFT: received quorum of PREPARE messages") // Accumulates PREPARE messages c.current.preparedRound = c.currentView().Round @@ -105,14 +105,14 @@ func (c *core) handlePrepare(prepare *qbfttypes.Prepare) error { } if c.current.Proposal() != nil && c.current.Proposal().Hash() == prepare.Digest { - logger.Debug("QBFT: PREPARE message matches proposal", "proposal", c.current.Proposal().Hash(), "prepare", prepare.Digest) + logger.Debug("IBFT: PREPARE message matches proposal", "proposal", c.current.Proposal().Hash(), "prepare", prepare.Digest) c.current.preparedBlock = c.current.Proposal() } c.setState(StatePrepared) c.broadcastCommit() } else { - logger.Debug("QBFT: accepted PREPARE messages") + logger.Debug("IBFT: accepted PREPARE messages") } return nil diff --git a/consensus/istanbul/core/preprepare.go b/consensus/istanbul/core/preprepare.go index 300a7dbef..3e1cff26c 100644 --- a/consensus/istanbul/core/preprepare.go +++ b/consensus/istanbul/core/preprepare.go @@ -46,12 +46,12 @@ func (c *core) sendPreprepareMsg(request *Request) { // Sign payload encodedPayload, err := preprepare.EncodePayloadForSigning() if err != nil { - withMsg(logger, preprepare).Error("QBFT: failed to encode payload of PRE-PREPARE message", "err", err) + withMsg(logger, preprepare).Error("IBFT: failed to encode payload of PRE-PREPARE message", "err", err) return } signature, err := c.backend.Sign(encodedPayload) if err != nil { - withMsg(logger, preprepare).Error("QBFT: failed to sign PRE-PREPARE message", "err", err) + withMsg(logger, preprepare).Error("IBFT: failed to sign PRE-PREPARE message", "err", err) return } preprepare.SetSignature(signature) @@ -61,31 +61,31 @@ func (c *core) sendPreprepareMsg(request *Request) { preprepare.JustificationRoundChanges = make([]*qbfttypes.SignedRoundChangePayload, 0) for _, m := range request.RCMessages.Values() { preprepare.JustificationRoundChanges = append(preprepare.JustificationRoundChanges, &m.(*qbfttypes.RoundChange).SignedRoundChangePayload) - withMsg(logger, preprepare).Trace("QBFT: add ROUND-CHANGE justification", "rc", m.(*qbfttypes.RoundChange).SignedRoundChangePayload) + withMsg(logger, preprepare).Trace("IBFT: add ROUND-CHANGE justification", "rc", m.(*qbfttypes.RoundChange).SignedRoundChangePayload) } - withMsg(logger, preprepare).Trace("QBFT: extended PRE-PREPARE message with ROUND-CHANGE justifications", "justifications", preprepare.JustificationRoundChanges) + withMsg(logger, preprepare).Trace("IBFT: extended PRE-PREPARE message with ROUND-CHANGE justifications", "justifications", preprepare.JustificationRoundChanges) } // Extend PRE-PREPARE message with PREPARE justification if request.PrepareMessages != nil { preprepare.JustificationPrepares = request.PrepareMessages - withMsg(logger, preprepare).Trace("QBFT: extended PRE-PREPARE message with PREPARE justification", "justification", preprepare.JustificationPrepares) + withMsg(logger, preprepare).Trace("IBFT: extended PRE-PREPARE message with PREPARE justification", "justification", preprepare.JustificationPrepares) } // RLP-encode message payload, err := rlp.EncodeToBytes(&preprepare) if err != nil { - withMsg(logger, preprepare).Error("QBFT: failed to encode PRE-PREPARE message", "err", err) + withMsg(logger, preprepare).Error("IBFT: failed to encode PRE-PREPARE message", "err", err) return } logger = withMsg(logger, preprepare).New("block.number", preprepare.Proposal.Number().Uint64(), "block.hash", preprepare.Proposal.Hash().String()) - logger.Info("QBFT: broadcast PRE-PREPARE message", "payload", hexutil.Encode(payload)) + logger.Info("IBFT: broadcast PRE-PREPARE message", "payload", hexutil.Encode(payload)) // Broadcast RLP-encoded message if err = c.backend.Broadcast(c.valSet, preprepare.Code(), payload); err != nil { - logger.Error("QBFT: failed to broadcast PRE-PREPARE message", "err", err) + logger.Error("IBFT: failed to broadcast PRE-PREPARE message", "err", err) return } @@ -105,18 +105,18 @@ func (c *core) handlePreprepareMsg(preprepare *qbfttypes.Preprepare) error { logger = logger.New("proposal.number", preprepare.Proposal.Number().Uint64(), "proposal.hash", preprepare.Proposal.Hash().String()) - c.logger.Info("QBFT: handle PRE-PREPARE message") + c.logger.Info("IBFT: handle PRE-PREPARE message") // Validates PRE-PREPARE message comes from current proposer if !c.valSet.IsProposer(preprepare.Source()) { - logger.Warn("QBFT: ignore PRE-PREPARE message from non proposer", "proposer", c.valSet.GetProposer().Address()) + logger.Warn("IBFT: ignore PRE-PREPARE message from non proposer", "proposer", c.valSet.GetProposer().Address()) return errNotFromProposer } // Validates PRE-PREPARE message justification if preprepare.Round.Uint64() > 0 { if err := isJustified(preprepare.Proposal, preprepare.JustificationRoundChanges, preprepare.JustificationPrepares, c.QuorumSize()); err != nil { - logger.Warn("QBFT: invalid PRE-PREPARE message justification", "err", err) + logger.Warn("IBFT: invalid PRE-PREPARE message justification", "err", err) return errInvalidPreparedBlock } } @@ -125,7 +125,7 @@ func (c *core) handlePreprepareMsg(preprepare *qbfttypes.Preprepare) error { if duration, err := c.backend.Verify(preprepare.Proposal); err != nil { // if it's a future block, we will handle it again after the duration if err == consensus.ErrFutureBlock { - logger.Info("QBFT: PRE-PREPARE block proposal is in the future (will be treated again later)", "duration", duration) + logger.Info("IBFT: PRE-PREPARE block proposal is in the future (will be treated again later)", "duration", duration) // start a timer to re-input PRE-PREPARE message as a backlog event c.stopFuturePreprepareTimer() @@ -137,7 +137,7 @@ func (c *core) handlePreprepareMsg(preprepare *qbfttypes.Preprepare) error { }) }) } else { - logger.Warn("QBFT: invalid PRE-PREPARE block proposal", "err", err) + logger.Warn("IBFT: invalid PRE-PREPARE block proposal", "err", err) } return err @@ -145,7 +145,7 @@ func (c *core) handlePreprepareMsg(preprepare *qbfttypes.Preprepare) error { // Here is about to accept the PRE-PREPARE if c.state == StateAcceptRequest { - c.logger.Info("QBFT: accepted PRE-PREPARE message") + c.logger.Info("IBFT: accepted PRE-PREPARE message") // Re-initialize ROUND-CHANGE timer c.newRoundChangeTimer() diff --git a/consensus/istanbul/core/request.go b/consensus/istanbul/core/request.go index 639954837..0cc12c0c0 100644 --- a/consensus/istanbul/core/request.go +++ b/consensus/istanbul/core/request.go @@ -29,14 +29,14 @@ import ( func (c *core) handleRequest(request *Request) error { logger := c.currentLogger(true, nil) - logger.Info("QBFT: handle block proposal request") + logger.Info("IBFT: handle block proposal request") if err := c.checkRequestMsg(request); err != nil { if err == errInvalidMessage { - logger.Error("QBFT: invalid request") + logger.Error("IBFT: invalid request") return err } - logger.Error("QBFT: unexpected request", "err", err, "number", request.Proposal.Number(), "hash", request.Proposal.Hash()) + logger.Error("IBFT: unexpected request", "err", err, "number", request.Proposal.Number(), "hash", request.Proposal.Hash()) return err } @@ -73,7 +73,7 @@ func (c *core) checkRequestMsg(request *Request) error { func (c *core) storeRequestMsg(request *Request) { logger := c.currentLogger(true, nil).New("proposal.number", request.Proposal.Number(), "proposal.hash", request.Proposal.Hash()) - logger.Trace("QBFT: store block proposal request for future treatment") + logger.Trace("IBFT: store block proposal request for future treatment") c.pendingRequestsMu.Lock() defer c.pendingRequestsMu.Unlock() @@ -88,27 +88,27 @@ func (c *core) processPendingRequests() { defer c.pendingRequestsMu.Unlock() logger := c.currentLogger(true, nil) - logger.Debug("QBFT: lookup for pending block proposal requests") + logger.Debug("IBFT: lookup for pending block proposal requests") for !(c.pendingRequests.Empty()) { m, prio := c.pendingRequests.Pop() r, ok := m.(*Request) if !ok { - logger.Error("QBFT: malformed pending block proposal request, skip", "msg", m) + logger.Error("IBFT: malformed pending block proposal request, skip", "msg", m) continue } // Push back if it's a future message err := c.checkRequestMsg(r) if err != nil { if err == errFutureMessage { - logger.Trace("QBFT: stop looking up for pending block proposal request") + logger.Trace("IBFT: stop looking up for pending block proposal request") c.pendingRequests.Push(m, prio) break } - logger.Trace("QBFT: skip pending invalid block proposal request", "number", r.Proposal.Number(), "hash", r.Proposal.Hash(), "err", err) + logger.Trace("IBFT: skip pending invalid block proposal request", "number", r.Proposal.Number(), "hash", r.Proposal.Hash(), "err", err) continue } - logger.Debug("QBFT: found pending block proposal request", "proposal.number", r.Proposal.Number(), "proposal.hash", r.Proposal.Hash()) + logger.Debug("IBFT: found pending block proposal request", "proposal.number", r.Proposal.Number(), "proposal.hash", r.Proposal.Hash()) go c.sendEvent(istanbul.RequestEvent{ Proposal: r.Proposal, diff --git a/consensus/istanbul/core/roundchange.go b/consensus/istanbul/core/roundchange.go index ce3e1511b..cf17d669d 100644 --- a/consensus/istanbul/core/roundchange.go +++ b/consensus/istanbul/core/roundchange.go @@ -48,7 +48,7 @@ func (c *core) broadcastRoundChange(round *big.Int) { // Validates new round corresponds to current view cv := c.currentView() if cv.Round.Cmp(round) > 0 { - logger.Error("QBFT: invalid past target round", "target", round) + logger.Error("IBFT: invalid past target round", "target", round) return } @@ -57,12 +57,12 @@ func (c *core) broadcastRoundChange(round *big.Int) { // Sign message encodedPayload, err := roundChange.EncodePayloadForSigning() if err != nil { - withMsg(logger, roundChange).Error("QBFT: failed to encode ROUND-CHANGE message", "err", err) + withMsg(logger, roundChange).Error("IBFT: failed to encode ROUND-CHANGE message", "err", err) return } signature, err := c.backend.Sign(encodedPayload) if err != nil { - withMsg(logger, roundChange).Error("QBFT: failed to sign ROUND-CHANGE message", "err", err) + withMsg(logger, roundChange).Error("IBFT: failed to sign ROUND-CHANGE message", "err", err) return } roundChange.SetSignature(signature) @@ -70,21 +70,21 @@ func (c *core) broadcastRoundChange(round *big.Int) { // Extend ROUND-CHANGE message with PREPARE justification if c.QBFTPreparedPrepares != nil { roundChange.Justification = c.QBFTPreparedPrepares - withMsg(logger, roundChange).Debug("QBFT: extended ROUND-CHANGE message with PREPARE justification", "justification", roundChange.Justification) + withMsg(logger, roundChange).Debug("IBFT: extended ROUND-CHANGE message with PREPARE justification", "justification", roundChange.Justification) } // RLP-encode message data, err := rlp.EncodeToBytes(roundChange) if err != nil { - withMsg(logger, roundChange).Error("QBFT: failed to encode ROUND-CHANGE message", "err", err) + withMsg(logger, roundChange).Error("IBFT: failed to encode ROUND-CHANGE message", "err", err) return } - withMsg(logger, roundChange).Info("QBFT: broadcast ROUND-CHANGE message", "payload", hexutil.Encode(data)) + withMsg(logger, roundChange).Info("IBFT: broadcast ROUND-CHANGE message", "payload", hexutil.Encode(data)) // Broadcast RLP-encoded message if err = c.backend.Broadcast(c.valSet, roundChange.Code(), data); err != nil { - withMsg(logger, roundChange).Error("QBFT: failed to broadcast ROUND-CHANGE message", "err", err) + withMsg(logger, roundChange).Error("IBFT: failed to broadcast ROUND-CHANGE message", "err", err) return } } @@ -104,7 +104,7 @@ func (c *core) handleRoundChange(roundChange *qbfttypes.RoundChange) error { // number of validators we received ROUND-CHANGE from for the current round currentRoundMessages := c.roundChangeSet.getRCMessagesForGivenRound(currentRound) - logger.Info("QBFT: handle ROUND-CHANGE message", "higherRoundChanges.count", num, "currentRoundChanges.count", currentRoundMessages) + logger.Info("IBFT: handle ROUND-CHANGE message", "higherRoundChanges.count", num, "currentRoundChanges.count", currentRoundMessages) // Add ROUND-CHANGE message to message set if view.Round.Cmp(currentRound) >= 0 { @@ -118,7 +118,7 @@ func (c *core) handleRoundChange(roundChange *qbfttypes.RoundChange) error { } err := c.roundChangeSet.Add(view.Round, roundChange, pr, pb, prepareMessages, c.QuorumSize()) if err != nil { - logger.Warn("QBFT: failed to add ROUND-CHANGE message", "err", err) + logger.Warn("IBFT: failed to add ROUND-CHANGE message", "err", err) return err } } @@ -136,12 +136,12 @@ func (c *core) handleRoundChange(roundChange *qbfttypes.RoundChange) error { // we start new round and broadcast ROUND-CHANGE message newRound := c.roundChangeSet.getMinRoundChange(currentRound) - logger.Info("QBFT: received F+1 ROUND-CHANGE messages", "F", c.valSet.F()) + logger.Info("IBFT: received F+1 ROUND-CHANGE messages", "F", c.valSet.F()) c.startNewRound(newRound) c.broadcastRoundChange(newRound) } else if currentRoundMessages >= c.QuorumSize() && c.IsProposer() && c.current.preprepareSent.Cmp(currentRound) < 0 { - logger.Info("QBFT: received quorum of ROUND-CHANGE messages") + logger.Info("IBFT: received quorum of ROUND-CHANGE messages") // We received quorum of ROUND-CHANGE for current round and we are proposer @@ -163,7 +163,7 @@ func (c *core) handleRoundChange(roundChange *qbfttypes.RoundChange) error { prepareMessages := c.roundChangeSet.prepareMessages[currentRound.Uint64()] if err := isJustified(proposal, rcSignedPayloads, prepareMessages, c.QuorumSize()); err != nil { - logger.Error("QBFT: invalid ROUND-CHANGE message justification", "err", err) + logger.Error("IBFT: invalid ROUND-CHANGE message justification", "err", err) return nil } @@ -174,7 +174,7 @@ func (c *core) handleRoundChange(roundChange *qbfttypes.RoundChange) error { } c.sendPreprepareMsg(r) } else { - logger.Debug("QBFT: accepted ROUND-CHANGE messages") + logger.Debug("IBFT: accepted ROUND-CHANGE messages") } return nil } diff --git a/consensus/istanbul/testutils/genesis.go b/consensus/istanbul/testutils/genesis.go index b43ba57a1..1024e6220 100644 --- a/consensus/istanbul/testutils/genesis.go +++ b/consensus/istanbul/testutils/genesis.go @@ -18,7 +18,7 @@ func Genesis(validators []common.Address) *core.Genesis { genesis := core.DefaultGenesisBlock() genesis.Config = params.TestChainConfig // force enable Istanbul engine - genesis.Config.Istanbul = ¶ms.IstanbulConfig{} + genesis.Config.IBFT = ¶ms.IBFTConfig{} genesis.Config.Ethash = nil genesis.ExtraData = nil genesis.Difficulty = istanbulcommon.DefaultDifficulty diff --git a/consensus/istanbul/types/roundchange.go b/consensus/istanbul/types/roundchange.go index 62d594752..630475eba 100644 --- a/consensus/istanbul/types/roundchange.go +++ b/consensus/istanbul/types/roundchange.go @@ -69,46 +69,46 @@ func (p *SignedRoundChangePayload) EncodeRLP(w io.Writer) error { func (p *SignedRoundChangePayload) DecodeRLP(stream *rlp.Stream) error { // Signed Payload if _, err := stream.List(); err != nil { - log.Error("QBFT: Error List() Signed Payload", "err", err) + log.Error("IBFT: Error List() Signed Payload", "err", err) return err } // Payload encodedPayload, err := stream.Raw() if err != nil { - log.Error("QBFT: Error Raw()", "err", err) + log.Error("IBFT: Error Raw()", "err", err) return err } payloadStream := rlp.NewStream(bytes.NewReader(encodedPayload), 0) if _, err = payloadStream.List(); err != nil { - log.Error("QBFT: Error List() Payload", "err", err) + log.Error("IBFT: Error List() Payload", "err", err) return err } if err = payloadStream.Decode(&p.Sequence); err != nil { - log.Error("QBFT: Error Decode(&m.Sequence)", "err", err) + log.Error("IBFT: Error Decode(&m.Sequence)", "err", err) return err } if err = payloadStream.Decode(&p.Round); err != nil { - log.Error("QBFT: Error Decode(&m.Round)", "err", err) + log.Error("IBFT: Error Decode(&m.Round)", "err", err) return err } // Prepared var size uint64 if size, err = payloadStream.List(); err != nil { - log.Error("QBFT: Error List() Prepared", "err", err) + log.Error("IBFT: Error List() Prepared", "err", err) return err } if size > 0 { if err = payloadStream.Decode(&p.PreparedRound); err != nil { - log.Error("QBFT: Error Decode(&m.PreparedRound)", "err", err) + log.Error("IBFT: Error Decode(&m.PreparedRound)", "err", err) return err } if err = payloadStream.Decode(&p.PreparedDigest); err != nil { - log.Error("QBFT: Error Decode(&p.PreparedDigest)", "err", err) + log.Error("IBFT: Error Decode(&p.PreparedDigest)", "err", err) return err } } @@ -132,7 +132,7 @@ func (p *SignedRoundChangePayload) DecodeRLP(stream *rlp.Stream) error { p.code = RoundChangeCode - log.Info("QBFT: Correctly decoded SignedRoundChangePayload", "p", p) + log.Info("IBFT: Correctly decoded SignedRoundChangePayload", "p", p) return nil } @@ -191,46 +191,46 @@ func (m *RoundChange) DecodeRLP(stream *rlp.Stream) error { // Signed Payload if _, err = stream.List(); err != nil { - log.Error("QBFT: Error List() Signed Payload", "err", err) + log.Error("IBFT: Error List() Signed Payload", "err", err) return err } // Payload encodedPayload, err := stream.Raw() if err != nil { - log.Error("QBFT: Error Raw()", "err", err) + log.Error("IBFT: Error Raw()", "err", err) return err } payloadStream := rlp.NewStream(bytes.NewReader(encodedPayload), 0) if _, err = payloadStream.List(); err != nil { - log.Error("QBFT: Error List() Payload", "err", err) + log.Error("IBFT: Error List() Payload", "err", err) return err } if err = payloadStream.Decode(&m.Sequence); err != nil { - log.Error("QBFT: Error Decode(&m.Sequence)", "err", err) + log.Error("IBFT: Error Decode(&m.Sequence)", "err", err) return err } if err = payloadStream.Decode(&m.Round); err != nil { - log.Error("QBFT: Error Decode(&m.Round)", "err", err) + log.Error("IBFT: Error Decode(&m.Round)", "err", err) return err } // Prepared var size uint64 if size, err = payloadStream.List(); err != nil { - log.Error("QBFT: Error List() Prepared", "err", err) + log.Error("IBFT: Error List() Prepared", "err", err) return err } if size > 0 { if err = payloadStream.Decode(&m.PreparedRound); err != nil { - log.Error("QBFT: Error Decode(&m.PreparedRound)", "err", err) + log.Error("IBFT: Error Decode(&m.PreparedRound)", "err", err) return err } if err = payloadStream.Decode(&m.PreparedDigest); err != nil { - log.Error("QBFT: Error Decode(&m.PreparedDigest)", "err", err) + log.Error("IBFT: Error Decode(&m.PreparedDigest)", "err", err) return err } } @@ -253,37 +253,37 @@ func (m *RoundChange) DecodeRLP(stream *rlp.Stream) error { } if _, size, err = stream.Kind(); err != nil { - log.Error("QBFT: Error Kind()", "err", err) + log.Error("IBFT: Error Kind()", "err", err) return err } if size == 0 { if _, err = stream.Raw(); err != nil { - log.Error("QBFT: Error Raw()", "err", err) + log.Error("IBFT: Error Raw()", "err", err) return err } } else { if err = stream.Decode(&m.PreparedBlock); err != nil { - log.Error("QBFT: Error Decode(&m.PreparedDigest)", "err", err) + log.Error("IBFT: Error Decode(&m.PreparedDigest)", "err", err) return err } if m.PreparedBlock.Hash() != m.PreparedDigest { - log.Error("QBFT: Error m.PreparedDigest.Hash() != digest") + log.Error("IBFT: Error m.PreparedDigest.Hash() != digest") return istanbulcommon.ErrFailedDecodePreprepare } } if _, size, err = stream.Kind(); err != nil { - log.Error("QBFT: Error Kind()", "err", err) + log.Error("IBFT: Error Kind()", "err", err) return err } if size == 0 { if _, err = stream.Raw(); err != nil { - log.Error("QBFT: Error Raw()", "err", err) + log.Error("IBFT: Error Raw()", "err", err) return err } } else { if err = stream.Decode(&m.Justification); err != nil { - log.Error("QBFT: Error Decode(&m.Justification)", "err", err) + log.Error("IBFT: Error Decode(&m.Justification)", "err", err) return err } } diff --git a/core/genesis_test.go b/core/genesis_test.go index 26141480d..eb3c29fdc 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -32,7 +32,7 @@ import ( func TestInvalidCliqueConfig(t *testing.T) { block := DefaultTestnetGenesisBlock() - block.Config.Istanbul = ¶ms.IstanbulConfig{} + block.Config.IBFT = ¶ms.IBFTConfig{} block.Config.Clique = ¶ms.CliqueConfig{ Period: 15, Epoch: 30000, diff --git a/eth/backend.go b/eth/backend.go index fbeb01c11..cc33055fe 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -147,8 +147,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { log.Error("Failed to recover state", "error", err) } - if chainConfig.Istanbul != nil && chainConfig.QBFT != nil { - return nil, errors.New("the attributes config.Istanbul and config.QBFT are mutually exclusive on the genesis file") + if chainConfig.Ethash != nil && chainConfig.Clique != nil && chainConfig.IBFT != nil { + return nil, errors.New("the attributes config.Etash, config.Clique and config.IBFT are mutually exclusive on the genesis file") } merger := consensus.NewMerger(chainDb) @@ -177,12 +177,12 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { // communicate over the "eth" subprotocol, e.g. "eth" or "istanbul/99" but not eth" and "istanbul/99". // With this change, support is added so that the "eth" subprotocol remains and optionally a consensus subprotocol // can be added allowing the node to communicate over "eth" and an optional consensus subprotocol, e.g. "eth" and "istanbul/100" - if chainConfig.Istanbul != nil { - quorumProtocol := eth.engine.Protocol() - // set the quorum specific consensus devp2p subprotocol, eth subprotocol remains set to protocolName as in upstream geth. - quorumConsensusProtocolName = quorumProtocol.Name - quorumConsensusProtocolVersions = quorumProtocol.Versions - quorumConsensusProtocolLengths = quorumProtocol.Lengths + if chainConfig.IBFT != nil { + ibftProtocol := eth.engine.Protocol() + // set the ibft specific consensus devp2p subprotocol, eth subprotocol remains set to protocolName as in upstream geth. + ibftConsensusProtocolName = ibftProtocol.Name + ibftConsensusProtocolVersions = ibftProtocol.Versions + ibftConsensusProtocolLengths = ibftProtocol.Lengths // force to set the istanbul etherbase to node key address eth.etherbase = crypto.PubkeyToAddress(stack.GetNodeKey().PublicKey) @@ -194,7 +194,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { dbVer = fmt.Sprintf("%d", *bcVersion) } - log.Info("Initialising protocol", "name", quorumConsensusProtocolName, "versions", quorumConsensusProtocolVersions, "network", config.NetworkId, "dbversion", dbVer) + log.Info("Initialising protocol", "name", ibftConsensusProtocolName, "versions", ibftConsensusProtocolVersions, "network", config.NetworkId, "dbversion", dbVer) if !config.SkipBcVersionCheck { if bcVersion != nil && *bcVersion > core.BlockChainVersion { @@ -262,7 +262,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { } eth.miner = miner.New(eth, &config.Miner, chainConfig, eth.EventMux(), eth.engine, eth.isLocalBlock) - eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData, eth.blockchain.Config().Istanbul != nil)) + eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData, eth.blockchain.Config().IBFT != nil)) eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil} if eth.APIBackend.allowUnprotectedTxs { @@ -566,8 +566,8 @@ func (s *Ethereum) Protocols() []p2p.Protocol { // /Quorum // add additional quorum consensus protocol if set and if not set to "eth", e.g. istanbul - if quorumConsensusProtocolName != "" && quorumConsensusProtocolName != eth.ProtocolName { - quorumProtos := s.quorumConsensusProtocols() + if ibftConsensusProtocolName != "" && ibftConsensusProtocolName != eth.ProtocolName { + quorumProtos := s.ibftConsensusProtocols() protos = append(protos, quorumProtos...) } // /end Quorum diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 4f12d26b5..847a50280 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -224,27 +224,18 @@ type Config struct { func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, config *Config, notify []string, noverify bool, db ethdb.Database) consensus.Engine { // If proof-of-authority is requested, set it up var engine consensus.Engine - if chainConfig.Clique != nil { + + if chainConfig.IBFT != nil { + return istanbulBackend.New(istanbul.Config{ + BlockPeriod: chainConfig.IBFT.BlockPeriodSeconds, + Epoch: chainConfig.IBFT.EpochLength, + ProposerPolicy: istanbul.NewProposerPolicy(istanbul.ProposerPolicyId(chainConfig.IBFT.ProposerPolicy)), + RequestTimeout: chainConfig.IBFT.RequestTimeoutSeconds * 1000, + AllowedFutureBlockTime: 0, + }, stack.GetNodeKey(), db) + } else if chainConfig.Clique != nil { engine = clique.New(chainConfig.Clique, db) } else { - - //Quorum - // If Istanbul is requested, set it up - if chainConfig.Istanbul != nil { - log.Warn("WARNING: The attribute config.istanbul is deprecated and will be removed in the future, please use config.qbft on genesis file") - if chainConfig.Istanbul.Epoch != 0 { - config.Istanbul.Epoch = chainConfig.Istanbul.Epoch - } - config.Istanbul.ProposerPolicy = istanbul.NewProposerPolicy(istanbul.ProposerPolicyId(chainConfig.Istanbul.ProposerPolicy)) - config.Istanbul.AllowedFutureBlockTime = 0 //Quorum - - return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) - } - if chainConfig.QBFT != nil { - setBFTConfig(&config.Istanbul, chainConfig.QBFT.BFTConfig) - return istanbulBackend.New(&config.Istanbul, stack.GetNodeKey(), db) - } - switch config.Ethash.PowMode { case ethash.ModeFake: log.Warn("Ethash used in fake mode") @@ -269,18 +260,3 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, co } return beacon.New(engine) } - -func setBFTConfig(istanbulConfig *istanbul.Config, bftConfig *params.BFTConfig) { - if bftConfig.BlockPeriodSeconds != 0 { - istanbulConfig.BlockPeriod = bftConfig.BlockPeriodSeconds - } - if bftConfig.RequestTimeoutSeconds != 0 { - istanbulConfig.RequestTimeout = bftConfig.RequestTimeoutSeconds - } - if bftConfig.EpochLength != 0 { - istanbulConfig.Epoch = bftConfig.EpochLength - } - if bftConfig.ProposerPolicy != 0 { - istanbulConfig.ProposerPolicy = istanbul.NewProposerPolicy(istanbul.ProposerPolicyId(bftConfig.ProposerPolicy)) - } -} diff --git a/eth/handler.go b/eth/handler.go index f556d9c5a..66f2c9f06 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -96,7 +96,6 @@ type handlerConfig struct { RequiredBlocks map[uint64]common.Hash // Hard coded map of required block hashes for sync challenges - // Quorum Engine consensus.Engine } @@ -135,7 +134,6 @@ type handler struct { wg sync.WaitGroup peerWG sync.WaitGroup - // Quorum engine consensus.Engine } @@ -159,11 +157,9 @@ func newHandler(config *handlerConfig) (*handler, error) { engine: config.Engine, } - // Quorum if handler, ok := h.engine.(consensus.Handler); ok { handler.SetBroadcaster(h) } - // /Quorum if config.Sync == downloader.FullSync { // The database seems empty as the current block is the genesis. Yet the snap @@ -346,10 +342,8 @@ func (h *handler) runEthPeer(peer *eth.Peer, handler eth.Handler) error { if err := peer.Handshake(h.networkID, td, hash, genesis.Hash(), forkID, h.forkFilter); err != nil { peer.Log().Debug("Ethereum handshake failed", "err", err) - // Quorum // When the Handshake() returns an error, the Run method corresponding to `eth` protocol returns with the error, causing the peer to drop, signal subprotocol as well to exit the `Run` method peer.EthPeerDisconnected <- struct{}{} - // End Quorum return err } reject := false // reserved peer slots @@ -375,10 +369,8 @@ func (h *handler) runEthPeer(peer *eth.Peer, handler eth.Handler) error { if err := h.peers.registerPeer(peer, snap); err != nil { peer.Log().Error("Ethereum peer registration failed", "err", err) - // Quorum // When the Register() returns an error, the Run method corresponding to `eth` protocol returns with the error, causing the peer to drop, signal subprotocol as well to exit the `Run` method peer.EthPeerDisconnected <- struct{}{} - // End Quorum return err } defer h.unregisterPeer(peer.ID()) @@ -493,9 +485,7 @@ func (h *handler) runEthPeer(peer *eth.Peer, handler eth.Handler) error { }(number, hash) } - // Quorum notify other subprotocols that the eth peer is ready, and has been added to the peerset. p.EthPeerRegistered <- struct{}{} - // Quorum // Handle incoming messages until the connection is torn down return handler(peer) @@ -593,7 +583,6 @@ func (h *handler) Stop() { log.Info("Ethereum protocol stopped") } -// Quorum func (h *handler) Enqueue(id string, block *types.Block) { h.blockFetcher.Enqueue(id, block) } @@ -661,7 +650,7 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) { for _, tx := range txs { peers := h.peers.peersWithoutTransaction(tx.Hash()) // Send the tx unconditionally to a subset of our peers - // Quorum changes for broadcasting to all peers not only Sqrt + // Ibft protocol changes for broadcasting to all peers not only Sqrt //numDirect := int(math.Sqrt(float64(len(peers)))) for _, peer := range peers { txset[peer] = append(txset[peer], tx.Hash()) @@ -712,7 +701,6 @@ func (h *handler) txBroadcastLoop() { } } -// Quorum // NodeInfo represents a short summary of the Ethereum sub-protocol metadata // known about the host peer. type NodeInfo struct { @@ -727,11 +715,6 @@ type NodeInfo struct { // NodeInfo retrieves some protocol metadata about the running host node. func (h *handler) NodeInfo() *NodeInfo { currentBlock := h.chain.CurrentBlock() - // //Quorum - // - // changes done to fetch maxCodeSize dynamically based on the - // maxCodeSizeConfig changes - // /Quorum chainConfig := h.chain.Config() return &NodeInfo{ @@ -744,12 +727,11 @@ func (h *handler) NodeInfo() *NodeInfo { } } -// Quorum func (h *handler) getConsensusAlgorithm() string { var consensusAlgo string switch h.engine.(type) { case consensus.Istanbul: - consensusAlgo = "istanbul" + consensusAlgo = "IBFT" case *clique.Clique: consensusAlgo = "clique" case *ethash.Ethash: @@ -772,12 +754,12 @@ func (h *handler) FindPeers(targets map[common.Address]bool) map[common.Address] return m } -// makeQuorumConsensusProtocol is similar to eth/handler.go -> makeProtocol. Called from eth/handler.go -> Protocols. +// makeIbftConsensusProtocol is similar to eth/handler.go -> makeProtocol. Called from eth/handler.go -> Protocols. // returns the supported subprotocol to the p2p server. -// The Run method starts the protocol and is called by the p2p server. The quorum consensus subprotocol, +// The Run method starts the protocol and is called by the p2p server. The ibft consensus subprotocol, // leverages the peer created and managed by the "eth" subprotocol. -// The quorum consensus protocol requires that the "eth" protocol is running as well. -func (h *handler) makeQuorumConsensusProtocol(ProtoName string, version uint, length uint64) p2p.Protocol { +// The ibft consensus protocol requires that the "eth" protocol is running as well. +func (h *handler) makeIbftConsensusProtocol(ProtoName string, version uint, length uint64) p2p.Protocol { return p2p.Protocol{ Name: ProtoName, @@ -788,9 +770,9 @@ func (h *handler) makeQuorumConsensusProtocol(ProtoName string, version uint, le /* * 1. wait for the eth protocol to create and register an eth peer. * 2. get the associate eth peer that was registered by he "eth" protocol. - * 3. add the rw protocol for the quorum subprotocol to the eth peer. + * 3. add the rw protocol for the ibft subprotocol to the eth peer. * 4. start listening for incoming messages. - * 5. the incoming message will be sent on the quorum specific subprotocol, e.g. "istanbul/100". + * 5. the incoming message will be sent on the ibft specific subprotocol, e.g. "istanbul/100". * 6. send messages to the consensus engine handler. * 7. messages to other to other peers listening to the subprotocol can be sent using the * (eth)peer.ConsensusSend() which will write to the protoRW. @@ -808,7 +790,7 @@ func (h *handler) makeQuorumConsensusProtocol(ProtoName string, version uint, le } if ethPeer != nil { p.Log().Debug("consensus subprotocol retrieved eth peer from peerset", "ethPeer.id", p2pPeerId, "ProtoName", ProtoName) - // add the rw protocol for the quorum subprotocol to the eth peer. + // add the rw protocol for the ibft subprotocol to the eth peer. ethPeer.AddConsensusProtoRW(rw) return h.handleConsensusLoop(p, rw) } @@ -837,7 +819,7 @@ func (h *handler) handleConsensusLoop(p *p2p.Peer, protoRW p2p.MsgReadWriter) er // Handle incoming messages until the connection is torn down for { if err := h.handleConsensus(p, protoRW); err != nil { - p.Log().Debug("Ethereum quorum message handling failed", "err", err) + p.Log().Debug("Ethereum ibft message handling failed", "err", err) return err } } @@ -860,7 +842,7 @@ func (h *handler) handleConsensus(p *p2p.Peer, protoRW p2p.MsgReadWriter) error handled, err := h.handleConsensusMsg(p, msg) if handled { p.Log().Debug("consensus message was handled by consensus engine", "handled", handled, - "quorumConsensusProtocolName", quorumConsensusProtocolName, "err", err) + "ibftConsensusProtocolName", ibftConsensusProtocolName, "err", err) return err } @@ -879,7 +861,7 @@ func (h *handler) handleConsensusMsg(p *p2p.Peer, msg p2p.Msg) (bool, error) { // makeLegacyProtocol is basically a copy of the eth makeProtocol, but for legacy subprotocols, e.g. "istanbul/99" "istabnul/64" // If support legacy subprotocols is removed, remove this and associated code as well. -// If quorum is using a legacy protocol then the "eth" subprotocol should not be available. +// If ibft protocol is using a legacy protocol then the "eth" subprotocol should not be available. func (h *handler) makeLegacyProtocol(protoName string, version uint, length uint64) p2p.Protocol { log.Debug("registering a legacy protocol ", "protoName", protoName) return p2p.Protocol{ @@ -907,5 +889,3 @@ func (h *handler) makeLegacyProtocol(protoName string, version uint, length uint }, } } - -// End Quorum diff --git a/eth/ibft_protocol.go b/eth/ibft_protocol.go new file mode 100644 index 000000000..3879f6582 --- /dev/null +++ b/eth/ibft_protocol.go @@ -0,0 +1,67 @@ +package eth + +import ( + "errors" + + "github.com/ethereum/go-ethereum/p2p" +) + +// ibft_protocol enables the eth service to return two different protocols, one for the eth mainnet "eth" service, +// and one for the ibft specific consensus algo, obtained from engine.consensus +// 2021 Jan in the future consensus (istanbul) may run from its own service and use a single subprotocol there, +// instead of overloading the eth service. + +var ( + // errEthPeerNil is returned when no eth peer is found to be associated with a p2p peer. + errEthPeerNil = errors.New("eth peer was nil") + errEthPeerNotRegistered = errors.New("eth peer was not registered") +) + +// ibft consensus Protocol variables are optionally set in addition to the "eth" protocol variables (eth/protocol.go). +var ibftConsensusProtocolName = "" + +// ProtocolVersions are the supported versions of the ibft consensus protocol (first is primary), e.g. []uint{Istanbul64, Istanbul99, Istanbul100}. +var ibftConsensusProtocolVersions []uint + +// protocol Length describe the number of messages support by the protocol/version map[uint]uint64{Istanbul64: 18, Istanbul99: 18, Istanbul100: 18} +var ibftConsensusProtocolLengths map[uint]uint64 + +func (s *Ethereum) ibftConsensusProtocols() []p2p.Protocol { + protos := make([]p2p.Protocol, len(ibftConsensusProtocolVersions)) + for i, vsn := range ibftConsensusProtocolVersions { + // if we have a legacy protocol, e.g. istanbul/99, istanbul/64 then the protocol handler is will be the "eth" + // protocol handler, and the subprotocol "eth" will not be used, but rather the legacy subprotocol will handle + // both eth messages and consensus messages. + if isLegacyProtocol(ibftConsensusProtocolName, vsn) { + length, ok := ibftConsensusProtocolLengths[vsn] + if !ok { + panic("makeProtocol for unknown version") + } + lp := s.handler.makeLegacyProtocol(ibftConsensusProtocolName, vsn, length) + protos[i] = lp + } else { + length, ok := ibftConsensusProtocolLengths[vsn] + if !ok { + panic("makeIbftConsensusProtocol for unknown version") + } + protos[i] = s.handler.makeIbftConsensusProtocol(ibftConsensusProtocolName, vsn, length) + } + } + return protos +} + +// istanbul/64, istanbul/99, clique/63, clique/64 all override the "eth" subprotocol. +func isLegacyProtocol(name string, version uint) bool { + // protocols that override "eth" subprotocol and run only the ibft subprotocol. + ibftLegacyProtocols := map[string][]uint{"istanbul": {64, 99}, "clique": {63, 64}} + for lpName, lpVersions := range ibftLegacyProtocols { + if lpName == name { + for _, v := range lpVersions { + if v == version { + return true + } + } + } + } + return false +} diff --git a/eth/quorum_protocol.go b/eth/quorum_protocol.go deleted file mode 100644 index fb6ef8da4..000000000 --- a/eth/quorum_protocol.go +++ /dev/null @@ -1,67 +0,0 @@ -package eth - -import ( - "errors" - - "github.com/ethereum/go-ethereum/p2p" -) - -// Quorum: quorum_protocol enables the eth service to return two different protocols, one for the eth mainnet "eth" service, -// and one for the quorum specific consensus algo, obtained from engine.consensus -// 2021 Jan in the future consensus (istanbul) may run from its own service and use a single subprotocol there, -// instead of overloading the eth service. - -var ( - // errEthPeerNil is returned when no eth peer is found to be associated with a p2p peer. - errEthPeerNil = errors.New("eth peer was nil") - errEthPeerNotRegistered = errors.New("eth peer was not registered") -) - -// quorum consensus Protocol variables are optionally set in addition to the "eth" protocol variables (eth/protocol.go). -var quorumConsensusProtocolName = "" - -// ProtocolVersions are the supported versions of the quorum consensus protocol (first is primary), e.g. []uint{Istanbul64, Istanbul99, Istanbul100}. -var quorumConsensusProtocolVersions []uint - -// protocol Length describe the number of messages support by the protocol/version map[uint]uint64{Istanbul64: 18, Istanbul99: 18, Istanbul100: 18} -var quorumConsensusProtocolLengths map[uint]uint64 - -func (s *Ethereum) quorumConsensusProtocols() []p2p.Protocol { - protos := make([]p2p.Protocol, len(quorumConsensusProtocolVersions)) - for i, vsn := range quorumConsensusProtocolVersions { - // if we have a legacy protocol, e.g. istanbul/99, istanbul/64 then the protocol handler is will be the "eth" - // protocol handler, and the subprotocol "eth" will not be used, but rather the legacy subprotocol will handle - // both eth messages and consensus messages. - if isLegacyProtocol(quorumConsensusProtocolName, vsn) { - length, ok := quorumConsensusProtocolLengths[vsn] - if !ok { - panic("makeProtocol for unknown version") - } - lp := s.handler.makeLegacyProtocol(quorumConsensusProtocolName, vsn, length) - protos[i] = lp - } else { - length, ok := quorumConsensusProtocolLengths[vsn] - if !ok { - panic("makeQuorumConsensusProtocol for unknown version") - } - protos[i] = s.handler.makeQuorumConsensusProtocol(quorumConsensusProtocolName, vsn, length) - } - } - return protos -} - -// istanbul/64, istanbul/99, clique/63, clique/64 all override the "eth" subprotocol. -func isLegacyProtocol(name string, version uint) bool { - // protocols that override "eth" subprotocol and run only the quorum subprotocol. - quorumLegacyProtocols := map[string][]uint{"istanbul": {64, 99}, "clique": {63, 64}} - for lpName, lpVersions := range quorumLegacyProtocols { - if lpName == name { - for _, v := range lpVersions { - if v == version { - return true - } - } - } - } - return false -} diff --git a/miner/worker.go b/miner/worker.go index a15e5c81c..9bb529cf4 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -277,7 +277,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus resubmitIntervalCh: make(chan time.Duration), resubmitAdjustCh: make(chan *intervalAdjust, resubmitAdjustChanSize), } - if _, ok := engine.(consensus.Istanbul); ok || chainConfig.Istanbul == nil || chainConfig.Clique != nil { + if _, ok := engine.(consensus.Istanbul); ok || chainConfig.IBFT == nil || chainConfig.Clique != nil { // Subscribe NewTxsEvent for tx pool worker.txsSub = eth.TxPool().SubscribeNewTxsEvent(worker.txsCh) // Subscribe events for blockchain diff --git a/params/config.go b/params/config.go index 798e5351f..6f13c1b62 100644 --- a/params/config.go +++ b/params/config.go @@ -57,9 +57,11 @@ var ( BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), ArrowGlacierBlock: nil, - Istanbul: &IstanbulConfig{ - ProposerPolicy: 2, - Epoch: 30000, + IBFT: &IBFTConfig{ + BlockPeriodSeconds: 5, + EpochLength: 30000, + ProposerPolicy: 0, + RequestTimeoutSeconds: 10, }, } @@ -80,9 +82,11 @@ var ( BerlinBlock: big.NewInt(0), LondonBlock: big.NewInt(0), ArrowGlacierBlock: nil, - Istanbul: &IstanbulConfig{ - ProposerPolicy: 2, - Epoch: 30000, + IBFT: &IBFTConfig{ + BlockPeriodSeconds: 5, + EpochLength: 30000, + ProposerPolicy: 0, + RequestTimeoutSeconds: 10, }, } @@ -91,16 +95,16 @@ var ( // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil} + AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil} // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Clique consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil, nil} + AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil} - TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil, nil} + TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil, nil} TestRules = TestChainConfig.Rules(new(big.Int), false) ) @@ -187,10 +191,9 @@ type ChainConfig struct { TerminalTotalDifficulty *big.Int `json:"terminalTotalDifficulty,omitempty"` // Various consensus engines - Ethash *EthashConfig `json:"ethash,omitempty"` - Clique *CliqueConfig `json:"clique,omitempty"` - Istanbul *IstanbulConfig `json:"istanbul,omitempty"` // Quorum - QBFT *QBFTConfig `json:"qbft,omitempty"` // Quorum + Ethash *EthashConfig `json:"ethash,omitempty"` + Clique *CliqueConfig `json:"clique,omitempty"` + IBFT *IBFTConfig `json:"ibft,omitempty"` } // EthashConfig is the consensus engine configs for proof-of-work based sealing. @@ -212,38 +215,16 @@ func (c *CliqueConfig) String() string { return "clique" } -// IstanbulConfig is the consensus engine configs for Istanbul based sealing. -type IstanbulConfig struct { - Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint - ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection -} - -// String implements the stringer interface, returning the consensus engine details. -func (c *IstanbulConfig) String() string { - return "istanbul" -} - -type BFTConfig struct { +// IBFTConfig is the consensus engine configs for Istanbul based sealing. +type IBFTConfig struct { EpochLength uint64 `json:"epochlength"` // Number of blocks that should pass before pending validator votes are reset BlockPeriodSeconds uint64 `json:"blockperiodseconds"` // Minimum time between two consecutive IBFT or QBFT blocks’ timestamps in seconds RequestTimeoutSeconds uint64 `json:"requesttimeoutseconds"` // Minimum request timeout for each IBFT or QBFT round in milliseconds ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection } -type IBFTConfig struct { - *BFTConfig -} - func (c IBFTConfig) String() string { - return "istanbul" -} - -type QBFTConfig struct { - *BFTConfig -} - -func (c QBFTConfig) String() string { - return "qbft" + return "IBFT" } // String implements the fmt.Stringer interface. @@ -254,8 +235,8 @@ func (c *ChainConfig) String() string { engine = c.Ethash case c.Clique != nil: engine = c.Clique - case c.Istanbul != nil: - engine = c.Istanbul + case c.IBFT != nil: + engine = c.IBFT default: engine = "unknown" } From 13f75cd910bf2d7bb8e9b0ba3fbd92333f804dd1 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Sun, 19 Jun 2022 02:21:52 -0300 Subject: [PATCH 10/30] miner: instantly make block canonical if using IBFT consensus --- miner/worker.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index 9bb529cf4..a108628e8 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -253,6 +253,12 @@ type worker struct { } func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus.Engine, eth Backend, mux *event.TypeMux, isLocalBlock func(header *types.Header) bool, init bool) *worker { + var sealingDepth uint + if _, ok := engine.(consensus.Istanbul); ok && chainConfig.IBFT != nil { + sealingDepth = 0 + } else { + sealingDepth = sealingLogAtDepth + } worker := &worker{ config: config, chainConfig: chainConfig, @@ -263,7 +269,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus isLocalBlock: isLocalBlock, localUncles: make(map[common.Hash]*types.Block), remoteUncles: make(map[common.Hash]*types.Block), - unconfirmed: newUnconfirmedBlocks(eth.BlockChain(), sealingLogAtDepth), + unconfirmed: newUnconfirmedBlocks(eth.BlockChain(), sealingDepth), pendingTasks: make(map[common.Hash]*task), txsCh: make(chan core.NewTxsEvent, txChanSize), chainHeadCh: make(chan core.ChainHeadEvent, chainHeadChanSize), From b1642fbbfe243e0dd16c07c9b05eb5c968f62c91 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Thu, 23 Jun 2022 09:43:13 -0300 Subject: [PATCH 11/30] core: update testnet genesis with validator addresses --- core/genesis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/genesis.go b/core/genesis.go index 90213e822..98539e40a 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -438,7 +438,7 @@ func DefaultTestnetGenesisBlock() *Genesis { Config: params.TestnetChainConfig, Nonce: 0, Timestamp: 1492009146, - ExtraData: hexutil.MustDecode("0xf87aa00000000000000000000000000000000000000000000000000000000000000000f854944c7968f79c1a414c34cd4d3c1ac7a3a8413da50c946c3d358156962440424c8c2bd5a8c79664b9956d94f27ed0217ec98beec0478a221e07471885d639a2944dd607ce3b4ec9e22fd3ce59c672fafee09cf332c080c0"), + ExtraData: hexutil.MustDecode("0xf88fa00000000000000000000000000000000000000000000000000000000000000000f86994c21ee98b5a90a6a45aba37fa5eddf90f5e8e181694ff0d56bd960c455a71f908496c79e8eafec34ccf9407afbe0d7d36b80454be1e185f55e02b9453625a944f9a82d7e094de7fb70d9ce2033ec0d65ac311249497f060952b1008c75cb030e3599725ad5cc306a2c080c0"), GasLimit: 16234336, Difficulty: big.NewInt(1), Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), From b8b6ab8507e7581179b9207f60d1d0c7853a91a7 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Thu, 23 Jun 2022 09:46:44 -0300 Subject: [PATCH 12/30] core: update testnet genesis with correct timestamp --- core/genesis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/genesis.go b/core/genesis.go index 98539e40a..4a36f21ac 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -437,7 +437,7 @@ func DefaultTestnetGenesisBlock() *Genesis { return &Genesis{ Config: params.TestnetChainConfig, Nonce: 0, - Timestamp: 1492009146, + Timestamp: 1655988353, ExtraData: hexutil.MustDecode("0xf88fa00000000000000000000000000000000000000000000000000000000000000000f86994c21ee98b5a90a6a45aba37fa5eddf90f5e8e181694ff0d56bd960c455a71f908496c79e8eafec34ccf9407afbe0d7d36b80454be1e185f55e02b9453625a944f9a82d7e094de7fb70d9ce2033ec0d65ac311249497f060952b1008c75cb030e3599725ad5cc306a2c080c0"), GasLimit: 16234336, Difficulty: big.NewInt(1), From 740563e57b5866e125ba7101632f27d87b13c7e9 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Thu, 23 Jun 2022 10:08:04 -0300 Subject: [PATCH 13/30] params: update testnet genesis hash --- params/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/config.go b/params/config.go index 6f13c1b62..94b7a8464 100644 --- a/params/config.go +++ b/params/config.go @@ -28,7 +28,7 @@ import ( // Genesis hashes to enforce below configs on. var ( MainnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") - TestnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") + TestnetGenesisHash = common.HexToHash("0x7919efba9544bda159e29c22a36831befbcc07bb0edbac45eef065beea115079") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of From 58ff524d3b7068c584866fd63adaec80b3f6a45e Mon Sep 17 00:00:00 2001 From: andrepatta Date: Thu, 23 Jun 2022 10:49:48 -0300 Subject: [PATCH 14/30] cmd: update geth/cmd tests with the new testnet genesis timestamp --- cmd/geth/consolecmd_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index f76202648..dd35fe15c 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -62,7 +62,7 @@ func TestConsoleWelcome(t *testing.T) { geth.SetTemplateFunc("gover", runtime.Version) geth.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) geth.SetTemplateFunc("niltime", func() string { - return time.Unix(1492009146, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") + return time.Unix(1655988353, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") }) geth.SetTemplateFunc("apis", func() string { return ipcAPIs }) @@ -132,7 +132,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { attach.SetTemplateFunc("gover", runtime.Version) attach.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) attach.SetTemplateFunc("niltime", func() string { - return time.Unix(1492009146, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") + return time.Unix(1655988353, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) attach.SetTemplateFunc("datadir", func() string { return geth.Datadir }) From 327c86c86993434e6fb3dde1414f26412f3c87f1 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Fri, 24 Jun 2022 13:50:35 -0300 Subject: [PATCH 15/30] cmd/core/mobile/params: add support for stagenet chain configuration --- cmd/devp2p/nodesetcmd.go | 2 ++ cmd/faucet/faucet.go | 8 ++++++-- cmd/geth/consolecmd.go | 4 +++- cmd/geth/main.go | 4 ++++ cmd/utils/flags.go | 22 +++++++++++++++++++++- core/genesis.go | 19 +++++++++++++++++++ mobile/geth.go | 8 +++++++- mobile/params.go | 9 +++++++++ params/bootnodes.go | 6 ++++++ params/config.go | 30 ++++++++++++++++++++++++++++-- 10 files changed, 105 insertions(+), 7 deletions(-) diff --git a/cmd/devp2p/nodesetcmd.go b/cmd/devp2p/nodesetcmd.go index 8ebe51a81..2a296109b 100644 --- a/cmd/devp2p/nodesetcmd.go +++ b/cmd/devp2p/nodesetcmd.go @@ -229,6 +229,8 @@ func ethFilter(args []string) (nodeFilter, error) { switch args[0] { case "mainnet": filter = forkid.NewStaticFilter(params.MainnetChainConfig, params.MainnetGenesisHash) + case "stagenet": + filter = forkid.NewStaticFilter(params.StagenetChainConfig, params.StagenetGenesisHash) case "testnet": filter = forkid.NewStaticFilter(params.TestnetChainConfig, params.TestnetGenesisHash) default: diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 8b2b13058..e5862ea85 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -84,6 +84,8 @@ var ( twitterTokenFlag = flag.String("twitter.token", "", "Bearer token to authenticate with the v2 Twitter API") twitterTokenV1Flag = flag.String("twitter.token.v1", "", "Bearer token to authenticate with the v1.1 Twitter API") + stagenetFlag = flag.Bool("stagenet", false, "Initializes the faucet with Electroneum test network config") + testnetFlag = flag.Bool("testnet", false, "Initializes the faucet with Electroneum test network config") ) @@ -142,7 +144,7 @@ func main() { log.Crit("Failed to render the faucet template", "err", err) } // Load and parse the genesis block requested by the user - genesis, err := getGenesis(*genesisFlag, *testnetFlag) + genesis, err := getGenesis(*genesisFlag, *testnetFlag, *stagenetFlag) if err != nil { log.Crit("Failed to parse genesis config", "err", err) } @@ -881,12 +883,14 @@ func authNoAuth(url string) (string, string, common.Address, error) { } // getGenesis returns a genesis based on input args -func getGenesis(genesisFlag string, TestnetFlag bool) (*core.Genesis, error) { +func getGenesis(genesisFlag string, TestnetFlag bool, StagenetFlag bool) (*core.Genesis, error) { switch { case genesisFlag != "": var genesis core.Genesis err := common.LoadJSON(genesisFlag, &genesis) return &genesis, err + case StagenetFlag: + return core.DefaultStagenetGenesisBlock(), nil case TestnetFlag: return core.DefaultTestnetGenesisBlock(), nil default: diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 4b0e25e6b..e51edff88 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -125,7 +125,9 @@ func remoteConsole(ctx *cli.Context) error { path = ctx.GlobalString(utils.DataDirFlag.Name) } if path != "" { - if ctx.GlobalBool(utils.TestnetFlag.Name) { + if ctx.GlobalBool(utils.StagenetFlag.Name) { + path = filepath.Join(path, "stagenet") + } else if ctx.GlobalBool(utils.TestnetFlag.Name) { path = filepath.Join(path, "testnet") } } diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 94eac584e..3f3cbd18a 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -290,6 +290,9 @@ func prepare(ctx *cli.Context) { case ctx.GlobalIsSet(utils.TestnetFlag.Name): log.Info("Starting Geth on Electroneum testnet...") + case ctx.GlobalIsSet(utils.StagenetFlag.Name): + log.Info("Starting Geth on Electroneum stagenet...") + case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name): log.Info("Starting Geth on Electroneum mainnet...") } @@ -297,6 +300,7 @@ func prepare(ctx *cli.Context) { if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) { // Make sure we're not on any supported preconfigured testnet either if !ctx.GlobalIsSet(utils.TestnetFlag.Name) && + !ctx.GlobalIsSet(utils.StagenetFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) { // Nope, we're really on mainnet. Bump that cache up! log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index ab7caf092..f8750af6c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -148,6 +148,10 @@ var ( Name: "mainnet", Usage: "Electroneum mainnet", } + StagenetFlag = cli.BoolFlag{ + Name: "stagenet", + Usage: "Electroneum Test network: pre-configured IBFT test network", + } TestnetFlag = cli.BoolFlag{ Name: "testnet", Usage: "Electroneum Test network: pre-configured IBFT test network", @@ -814,6 +818,7 @@ var ( var ( // TestnetFlags is the flag group of all built-in supported testnets. TestnetFlags = []cli.Flag{ + StagenetFlag, TestnetFlag, } // NetworkFlags is the flag group of all built-in supported networks. @@ -843,6 +848,9 @@ func GroupFlags(groups ...[]cli.Flag) []cli.Flag { // then a subdirectory of the specified datadir will be used. func MakeDataDir(ctx *cli.Context) string { if path := ctx.GlobalString(DataDirFlag.Name); path != "" { + if ctx.GlobalBool(StagenetFlag.Name) { + return filepath.Join(path, "stagenet") + } if ctx.GlobalBool(TestnetFlag.Name) { return filepath.Join(path, "testnet") } @@ -892,6 +900,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { switch { case ctx.GlobalIsSet(BootnodesFlag.Name): urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name)) + case ctx.GlobalBool(StagenetFlag.Name): + urls = params.StagenetBootnodes case ctx.GlobalBool(TestnetFlag.Name): urls = params.TestnetBootnodes case cfg.BootstrapNodes != nil: @@ -1326,6 +1336,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = ctx.GlobalString(DataDirFlag.Name) case ctx.GlobalBool(DeveloperFlag.Name): cfg.DataDir = "" // unless explicitly requested, use memory databases + case ctx.GlobalBool(StagenetFlag.Name) && cfg.DataDir == node.DefaultDataDir(): + cfg.DataDir = filepath.Join(node.DefaultDataDir(), "stagenet") case ctx.GlobalBool(TestnetFlag.Name) && cfg.DataDir == node.DefaultDataDir(): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet") } @@ -1518,7 +1530,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) { // SetEthConfig applies eth-related command line flags to the config. func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Avoid conflicting network flags - CheckExclusive(ctx, MainnetFlag, TestnetFlag, DeveloperFlag) + CheckExclusive(ctx, MainnetFlag, StagenetFlag, TestnetFlag, DeveloperFlag) CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { @@ -1656,6 +1668,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) + case ctx.GlobalBool(StagenetFlag.Name): + if !ctx.GlobalIsSet(NetworkIdFlag.Name) { + cfg.NetworkId = 5201419 + } + cfg.Genesis = core.DefaultStagenetGenesisBlock() + SetDNSDiscoveryDefaults(cfg, params.StagenetGenesisHash) case ctx.GlobalBool(TestnetFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 5201420 @@ -1894,6 +1912,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { switch { case ctx.GlobalBool(MainnetFlag.Name): genesis = core.DefaultGenesisBlock() + case ctx.GlobalBool(StagenetFlag.Name): + genesis = core.DefaultStagenetGenesisBlock() case ctx.GlobalBool(TestnetFlag.Name): genesis = core.DefaultTestnetGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): diff --git a/core/genesis.go b/core/genesis.go index 4a36f21ac..ec8e3944f 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -134,6 +134,8 @@ func CommitGenesisState(db ethdb.Database, hash common.Hash) error { switch hash { case params.MainnetGenesisHash: genesis = DefaultGenesisBlock() + case params.StagenetGenesisHash: + genesis = DefaultStagenetGenesisBlock() case params.TestnetGenesisHash: genesis = DefaultTestnetGenesisBlock() } @@ -320,6 +322,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { return g.Config case ghash == params.MainnetGenesisHash: return params.MainnetChainConfig + case ghash == params.StagenetGenesisHash: + return params.StagenetChainConfig case ghash == params.TestnetGenesisHash: return params.TestnetChainConfig default: @@ -432,6 +436,21 @@ func DefaultGenesisBlock() *Genesis { } } +// DefaultGoerliGenesisBlock returns the Görli network genesis block. +func DefaultStagenetGenesisBlock() *Genesis { + return &Genesis{ + Config: params.StagenetChainConfig, + Nonce: 0, + Timestamp: 1655988355, + ExtraData: hexutil.MustDecode("0xf88fa00000000000000000000000000000000000000000000000000000000000000000f86994c21ee98b5a90a6a45aba37fa5eddf90f5e8e181694ff0d56bd960c455a71f908496c79e8eafec34ccf9407afbe0d7d36b80454be1e185f55e02b9453625a944f9a82d7e094de7fb70d9ce2033ec0d65ac311249497f060952b1008c75cb030e3599725ad5cc306a2c080c0"), + GasLimit: 16234336, + Difficulty: big.NewInt(1), + Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), + Coinbase: common.Address{}, + Alloc: GenesisAlloc{}, + } +} + // DefaultGoerliGenesisBlock returns the Görli network genesis block. func DefaultTestnetGenesisBlock() *Genesis { return &Genesis{ diff --git a/mobile/geth.go b/mobile/geth.go index ef1e4478e..1cdc82e5a 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -158,13 +158,19 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) { if err := json.Unmarshal([]byte(config.EthereumGenesis), genesis); err != nil { return nil, fmt.Errorf("invalid genesis spec: %v", err) } - // If we have the Ropsten testnet, hard code the chain configs too + // If we have the testnet, hard code the chain configs too if config.EthereumGenesis == TestnetGenesis() { genesis.Config = params.TestnetChainConfig if config.EthereumNetworkID == 1 { config.EthereumNetworkID = 5201420 } } + if config.EthereumGenesis == StagenetGenesis() { + genesis.Config = params.StagenetChainConfig + if config.EthereumNetworkID == 1 { + config.EthereumNetworkID = 5201419 + } + } } // Register the Ethereum protocol if requested if config.EthereumEnabled { diff --git a/mobile/params.go b/mobile/params.go index 17f3df334..8834fee95 100644 --- a/mobile/params.go +++ b/mobile/params.go @@ -41,6 +41,15 @@ func TestnetGenesis() string { return string(enc) } +// StagenetGenesis returns the JSON spec to use for the Testnet network. +func StagenetGenesis() string { + enc, err := json.Marshal(core.DefaultStagenetGenesisBlock()) + if err != nil { + panic(err) + } + return string(enc) +} + // FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated // by the foundation running the V5 discovery protocol. func FoundationBootnodes() *Enodes { diff --git a/params/bootnodes.go b/params/bootnodes.go index 124bff392..82098c7be 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -22,6 +22,10 @@ import "github.com/ethereum/go-ethereum/common" // the main Electroneum network. var MainnetBootnodes = []string{} +// StagenetBootnodes are the enode URLs of the P2P bootstrap nodes running on +// the stage Electroneum Testnet network. +var StagenetBootnodes = []string{} + // TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on // the main Electroneum Testnet network. var TestnetBootnodes = []string{} @@ -38,6 +42,8 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string { switch genesis { case MainnetGenesisHash: net = "mainnet" + case TestnetGenesisHash: + net = "stagenet" case TestnetGenesisHash: net = "testnet" default: diff --git a/params/config.go b/params/config.go index 94b7a8464..860144b96 100644 --- a/params/config.go +++ b/params/config.go @@ -27,8 +27,9 @@ import ( // Genesis hashes to enforce below configs on. var ( - MainnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") - TestnetGenesisHash = common.HexToHash("0x7919efba9544bda159e29c22a36831befbcc07bb0edbac45eef065beea115079") + MainnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") + StagenetGenesisHash = common.HexToHash("0xbcb4821a2574f010af9e0c84a5a349c583038fe7778704297ad2f0ff70d6142d") + TestnetGenesisHash = common.HexToHash("0x7919efba9544bda159e29c22a36831befbcc07bb0edbac45eef065beea115079") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of @@ -65,6 +66,31 @@ var ( }, } + // StagenetChainConfig is the chain parameters to run a node on the test network. + StagenetChainConfig = &ChainConfig{ + ChainID: big.NewInt(5201419), + HomesteadBlock: big.NewInt(0), + DAOForkBlock: nil, + DAOForkSupport: true, + EIP150Block: big.NewInt(0), + EIP155Block: big.NewInt(0), + EIP158Block: big.NewInt(0), + ByzantiumBlock: big.NewInt(0), + ConstantinopleBlock: big.NewInt(0), + PetersburgBlock: big.NewInt(0), + IstanbulBlock: big.NewInt(0), + MuirGlacierBlock: nil, + BerlinBlock: big.NewInt(0), + LondonBlock: big.NewInt(0), + ArrowGlacierBlock: nil, + IBFT: &IBFTConfig{ + BlockPeriodSeconds: 5, + EpochLength: 30000, + ProposerPolicy: 0, + RequestTimeoutSeconds: 10, + }, + } + // TestnetChainConfig is the chain parameters to run a node on the test network. TestnetChainConfig = &ChainConfig{ ChainID: big.NewInt(5201420), From ea1f129537a3be86b597513703154b7629006c15 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 04:16:12 -0300 Subject: [PATCH 16/30] core/params: pre-alloc funds in testnet and stagenet --- core/genesis.go | 10 ++++++++-- params/config.go | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index ec8e3944f..91e9398bb 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -447,7 +447,10 @@ func DefaultStagenetGenesisBlock() *Genesis { Difficulty: big.NewInt(1), Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), Coinbase: common.Address{}, - Alloc: GenesisAlloc{}, + Alloc: GenesisAlloc{ + common.HexToAddress("0x72f1a0bAA7f1C79129A391C2F32bCD8247A18a63"): {Balance: big.NewInt(math.MaxInt64)}, + common.HexToAddress("0xf29A0844926Fe8d63e5B211978B26E3f6d9e9fd5"): {Balance: big.NewInt(math.MaxInt64)}, + }, } } @@ -462,7 +465,10 @@ func DefaultTestnetGenesisBlock() *Genesis { Difficulty: big.NewInt(1), Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), Coinbase: common.Address{}, - Alloc: GenesisAlloc{}, + Alloc: GenesisAlloc{ + common.HexToAddress("0x72f1a0bAA7f1C79129A391C2F32bCD8247A18a63"): {Balance: big.NewInt(math.MaxInt64)}, + common.HexToAddress("0xf29A0844926Fe8d63e5B211978B26E3f6d9e9fd5"): {Balance: big.NewInt(math.MaxInt64)}, + }, } } diff --git a/params/config.go b/params/config.go index 860144b96..44f6cf48b 100644 --- a/params/config.go +++ b/params/config.go @@ -28,8 +28,8 @@ import ( // Genesis hashes to enforce below configs on. var ( MainnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") - StagenetGenesisHash = common.HexToHash("0xbcb4821a2574f010af9e0c84a5a349c583038fe7778704297ad2f0ff70d6142d") - TestnetGenesisHash = common.HexToHash("0x7919efba9544bda159e29c22a36831befbcc07bb0edbac45eef065beea115079") + StagenetGenesisHash = common.HexToHash("0xb40d104645676c4e738e440d2cc57e0a900cfba3feb3eb8eeb92ec6d7515730d") + TestnetGenesisHash = common.HexToHash("0x1f088de945b278c0131967e5d32f569bdeaa1052a8a0e38f887f58fbcbba0fe8") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of From 2f0ff4ddb7e4813e31608ec3999ba538cc2d5f41 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 04:17:21 -0300 Subject: [PATCH 17/30] params: don't use DNS to fetch peers for now, need to setup etn dns first --- params/bootnodes.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/params/bootnodes.go b/params/bootnodes.go index 82098c7be..0767bd9cf 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -38,16 +38,17 @@ const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUD // genesis hash and protocol. See https://github.com/ethereum/discv4-dns-lists for more // information. func KnownDNSNetwork(genesis common.Hash, protocol string) string { - var net string + /*var net string switch genesis { case MainnetGenesisHash: net = "mainnet" - case TestnetGenesisHash: + case StagenetGenesisHash: net = "stagenet" case TestnetGenesisHash: net = "testnet" default: return "" } - return dnsPrefix + protocol + "." + net + ".ethdisco.net" + return dnsPrefix + protocol + "." + net + ".ethdisco.net"*/ + return "" } From 5fc1b6f0c24192010aa7289530d366755090e5a8 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 04:20:18 -0300 Subject: [PATCH 18/30] cmd/les/mobile: set missing networkids to the correct value --- cmd/geth/config.go | 10 +--------- cmd/utils/flags.go | 2 +- les/protocol.go | 2 +- mobile/geth.go | 6 +++--- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 1d8f66421..a64f921c3 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -32,7 +32,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/scwallet" "github.com/ethereum/go-ethereum/accounts/usbwallet" "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/internal/ethapi" @@ -166,14 +165,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { backend, eth := utils.RegisterEthService(stack, &cfg.Eth) // Warn users to migrate if they have a legacy freezer format. if eth != nil { - firstIdx := uint64(0) - // Hack to speed up check for mainnet because we know - // the first non-empty block. - ghash := rawdb.ReadCanonicalHash(eth.ChainDb(), 0) - if cfg.Eth.NetworkId == 1 && ghash == params.MainnetGenesisHash { - firstIdx = 46147 - } - isLegacy, _, err := dbHasLegacyReceipts(eth.ChainDb(), firstIdx) + isLegacy, _, err := dbHasLegacyReceipts(eth.ChainDb(), uint64(0)) if err != nil { log.Error("Failed to check db for legacy receipts", "err", err) } else if isLegacy { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index f8750af6c..ab4d40379 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1734,7 +1734,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.Miner.GasPrice = big.NewInt(1) } default: - if cfg.NetworkId == 1 { + if cfg.NetworkId == 52014 { SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) } } diff --git a/les/protocol.go b/les/protocol.go index 06db9024e..09706c356 100644 --- a/les/protocol.go +++ b/les/protocol.go @@ -49,7 +49,7 @@ var ( var ProtocolLengths = map[uint]uint64{lpv2: 22, lpv3: 24, lpv4: 24} const ( - NetworkId = 1 + NetworkId = 52014 ProtocolMaxMsgSize = 10 * 1024 * 1024 // Maximum cap on the size of a protocol message blockSafetyMargin = 4 // safety margin applied to block ranges specified relative to head block diff --git a/mobile/geth.go b/mobile/geth.go index 1cdc82e5a..cbbe29c60 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -80,7 +80,7 @@ var defaultNodeConfig = &NodeConfig{ BootstrapNodes: FoundationBootnodes(), MaxPeers: 25, EthereumEnabled: true, - EthereumNetworkID: 1, + EthereumNetworkID: 52014, EthereumDatabaseCache: 16, } @@ -161,13 +161,13 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) { // If we have the testnet, hard code the chain configs too if config.EthereumGenesis == TestnetGenesis() { genesis.Config = params.TestnetChainConfig - if config.EthereumNetworkID == 1 { + if config.EthereumNetworkID == 52014 { config.EthereumNetworkID = 5201420 } } if config.EthereumGenesis == StagenetGenesis() { genesis.Config = params.StagenetChainConfig - if config.EthereumNetworkID == 1 { + if config.EthereumNetworkID == 52014 { config.EthereumNetworkID = 5201419 } } From 0e0db41f827e9a561e19c997718457cb55bf2e88 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 04:21:02 -0300 Subject: [PATCH 19/30] cmd: fix custom bootstrap nodes for testnet and stagenet --- cmd/utils/flags.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index ab4d40379..410af9320 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -904,7 +904,9 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.StagenetBootnodes case ctx.GlobalBool(TestnetFlag.Name): urls = params.TestnetBootnodes - case cfg.BootstrapNodes != nil: + } + + if cfg.BootstrapNodes != nil { return // already set, don't apply defaults. } From 83d39ead921cf07c7ea62fc9f2576b61261590f7 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 04:22:17 -0300 Subject: [PATCH 20/30] params: comment out unused dnsPrefix variable makes lint happy :) --- params/bootnodes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/bootnodes.go b/params/bootnodes.go index 0767bd9cf..a8ed9f738 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -32,7 +32,7 @@ var TestnetBootnodes = []string{} var V5Bootnodes = []string{} -const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" +//const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" // KnownDNSNetwork returns the address of a public DNS-based node list for the given // genesis hash and protocol. See https://github.com/ethereum/discv4-dns-lists for more From 790f502ec3375d3cbb9af8ff8c88dea006dc5ade Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 18:47:21 -0300 Subject: [PATCH 21/30] params/version: set etn version --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index 41b4e46c3..141afa0f2 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 10 // Minor version component of the current release - VersionPatch = 18 // Patch version component of the current release - VersionMeta = "stable" // Version metadata to append to the version string + VersionMajor = 5 // Major version component of the current release + VersionMinor = 0 // Minor version component of the current release + VersionPatch = 0 // Patch version component of the current release + VersionMeta = "unstable" // Version metadata to append to the version string ) // Version holds the textual version string. From eed2b317a61388eed68a151b680f87cb4de636c8 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 19:30:53 -0300 Subject: [PATCH 22/30] cmd/ethkey: rename ethkey to etnkey --- cmd/{ethkey => etnkey}/README.md | 0 cmd/{ethkey => etnkey}/changepassword.go | 0 cmd/{ethkey => etnkey}/generate.go | 0 cmd/{ethkey => etnkey}/inspect.go | 0 cmd/{ethkey => etnkey}/main.go | 0 cmd/{ethkey => etnkey}/message.go | 0 cmd/{ethkey => etnkey}/message_test.go | 0 cmd/{ethkey => etnkey}/run_test.go | 0 cmd/{ethkey => etnkey}/utils.go | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename cmd/{ethkey => etnkey}/README.md (100%) rename cmd/{ethkey => etnkey}/changepassword.go (100%) rename cmd/{ethkey => etnkey}/generate.go (100%) rename cmd/{ethkey => etnkey}/inspect.go (100%) rename cmd/{ethkey => etnkey}/main.go (100%) rename cmd/{ethkey => etnkey}/message.go (100%) rename cmd/{ethkey => etnkey}/message_test.go (100%) rename cmd/{ethkey => etnkey}/run_test.go (100%) rename cmd/{ethkey => etnkey}/utils.go (100%) diff --git a/cmd/ethkey/README.md b/cmd/etnkey/README.md similarity index 100% rename from cmd/ethkey/README.md rename to cmd/etnkey/README.md diff --git a/cmd/ethkey/changepassword.go b/cmd/etnkey/changepassword.go similarity index 100% rename from cmd/ethkey/changepassword.go rename to cmd/etnkey/changepassword.go diff --git a/cmd/ethkey/generate.go b/cmd/etnkey/generate.go similarity index 100% rename from cmd/ethkey/generate.go rename to cmd/etnkey/generate.go diff --git a/cmd/ethkey/inspect.go b/cmd/etnkey/inspect.go similarity index 100% rename from cmd/ethkey/inspect.go rename to cmd/etnkey/inspect.go diff --git a/cmd/ethkey/main.go b/cmd/etnkey/main.go similarity index 100% rename from cmd/ethkey/main.go rename to cmd/etnkey/main.go diff --git a/cmd/ethkey/message.go b/cmd/etnkey/message.go similarity index 100% rename from cmd/ethkey/message.go rename to cmd/etnkey/message.go diff --git a/cmd/ethkey/message_test.go b/cmd/etnkey/message_test.go similarity index 100% rename from cmd/ethkey/message_test.go rename to cmd/etnkey/message_test.go diff --git a/cmd/ethkey/run_test.go b/cmd/etnkey/run_test.go similarity index 100% rename from cmd/ethkey/run_test.go rename to cmd/etnkey/run_test.go diff --git a/cmd/ethkey/utils.go b/cmd/etnkey/utils.go similarity index 100% rename from cmd/ethkey/utils.go rename to cmd/etnkey/utils.go From 3ed05c139770acb9f8164fdec6af51c3122fc068 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 19:31:58 -0300 Subject: [PATCH 23/30] cmd/geth: rename geth to etn-sc --- .github/workflows/build-test.yml | 2 +- Makefile | 14 ++-- build/ci.go | 78 +++++++++--------- cmd/{geth => etn-sc}/accountcmd.go | 0 cmd/{geth => etn-sc}/accountcmd_test.go | 0 cmd/{geth => etn-sc}/chaincmd.go | 0 cmd/{geth => etn-sc}/config.go | 2 +- cmd/{geth => etn-sc}/consolecmd.go | 0 cmd/{geth => etn-sc}/consolecmd_test.go | 8 +- cmd/{geth => etn-sc}/dao_test.go | 2 +- cmd/{geth => etn-sc}/dbcmd.go | 0 cmd/{geth => etn-sc}/genesis_test.go | 0 cmd/{geth => etn-sc}/les_test.go | 0 cmd/{geth => etn-sc}/main.go | 12 +-- cmd/{geth => etn-sc}/misccmd.go | 0 cmd/{geth => etn-sc}/run_test.go | 0 cmd/{geth => etn-sc}/snapshot.go | 0 .../testdata/blockchain.blocks | Bin cmd/{geth => etn-sc}/testdata/clique.json | 0 cmd/{geth => etn-sc}/testdata/empty.js | 0 cmd/{geth => etn-sc}/testdata/guswallet.json | 0 cmd/{geth => etn-sc}/testdata/key.prv | 0 cmd/{geth => etn-sc}/testdata/password.txt | 0 cmd/{geth => etn-sc}/testdata/passwords.txt | 0 .../testdata/vcheck/data.json | 0 .../vulnerabilities.json.minisig.1 | 0 .../vulnerabilities.json.minisig.2 | 0 .../vulnerabilities.json.minisig.3 | 0 .../testdata/vcheck/minisign.pub | 0 .../testdata/vcheck/minisign.sec | 0 .../vcheck/signify-sigs/data.json.sig | 0 .../testdata/vcheck/signifykey.pub | 0 .../testdata/vcheck/signifykey.sec | 0 .../sigs/vulnerabilities.json.minisig.1 | 0 .../sigs/vulnerabilities.json.minisig.2 | 0 .../sigs/vulnerabilities.json.minisig.3 | 0 .../testdata/vcheck/vulnerabilities.json | 0 .../testdata/wrong-passwords.txt | 0 cmd/{geth => etn-sc}/usage.go | 0 cmd/{geth => etn-sc}/version_check.go | 0 cmd/{geth => etn-sc}/version_check_test.go | 0 console/console.go | 2 +- 42 files changed, 60 insertions(+), 60 deletions(-) rename cmd/{geth => etn-sc}/accountcmd.go (100%) rename cmd/{geth => etn-sc}/accountcmd_test.go (100%) rename cmd/{geth => etn-sc}/chaincmd.go (100%) rename cmd/{geth => etn-sc}/config.go (99%) rename cmd/{geth => etn-sc}/consolecmd.go (100%) rename cmd/{geth => etn-sc}/consolecmd_test.go (96%) rename cmd/{geth => etn-sc}/dao_test.go (99%) rename cmd/{geth => etn-sc}/dbcmd.go (100%) rename cmd/{geth => etn-sc}/genesis_test.go (100%) rename cmd/{geth => etn-sc}/les_test.go (100%) rename cmd/{geth => etn-sc}/main.go (97%) rename cmd/{geth => etn-sc}/misccmd.go (100%) rename cmd/{geth => etn-sc}/run_test.go (100%) rename cmd/{geth => etn-sc}/snapshot.go (100%) rename cmd/{geth => etn-sc}/testdata/blockchain.blocks (100%) rename cmd/{geth => etn-sc}/testdata/clique.json (100%) rename cmd/{geth => etn-sc}/testdata/empty.js (100%) rename cmd/{geth => etn-sc}/testdata/guswallet.json (100%) rename cmd/{geth => etn-sc}/testdata/key.prv (100%) rename cmd/{geth => etn-sc}/testdata/password.txt (100%) rename cmd/{geth => etn-sc}/testdata/passwords.txt (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/data.json (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.1 (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.2 (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.3 (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/minisign.pub (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/minisign.sec (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/signify-sigs/data.json.sig (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/signifykey.pub (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/signifykey.sec (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/sigs/vulnerabilities.json.minisig.1 (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/sigs/vulnerabilities.json.minisig.2 (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/sigs/vulnerabilities.json.minisig.3 (100%) rename cmd/{geth => etn-sc}/testdata/vcheck/vulnerabilities.json (100%) rename cmd/{geth => etn-sc}/testdata/wrong-passwords.txt (100%) rename cmd/{geth => etn-sc}/usage.go (100%) rename cmd/{geth => etn-sc}/version_check.go (100%) rename cmd/{geth => etn-sc}/version_check_test.go (100%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0c98cec40..0f9b13fc5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -45,5 +45,5 @@ jobs: - name: Test Build run: | - make geth + make etn-sc diff --git a/Makefile b/Makefile index e97acbef2..87ddfb41d 100644 --- a/Makefile +++ b/Makefile @@ -2,16 +2,16 @@ # with Go source code. If you know what GOPATH is then you probably # don't need to bother with make. -.PHONY: geth android ios evm all test clean +.PHONY: etn-sc android ios evm all test clean GOBIN = ./build/bin GO ?= latest GORUN = env GO111MODULE=on go run -geth: - $(GORUN) build/ci.go install ./cmd/geth +etn-sc: + $(GORUN) build/ci.go install ./cmd/etn-sc @echo "Done building." - @echo "Run \"$(GOBIN)/geth\" to launch geth." + @echo "Run \"$(GOBIN)/etn-sc\" to launch etn-sc." all: $(GORUN) build/ci.go install @@ -19,14 +19,14 @@ all: android: $(GORUN) build/ci.go aar --local @echo "Done building." - @echo "Import \"$(GOBIN)/geth.aar\" to use the library." - @echo "Import \"$(GOBIN)/geth-sources.jar\" to add javadocs" + @echo "Import \"$(GOBIN)/etn-sc.aar\" to use the library." + @echo "Import \"$(GOBIN)/etn-sc-sources.jar\" to add javadocs" @echo "For more info see https://stackoverflow.com/questions/20994336/android-studio-how-to-attach-javadoc" ios: $(GORUN) build/ci.go xcode --local @echo "Done building." - @echo "Import \"$(GOBIN)/Geth.framework\" to use the library." + @echo "Import \"$(GOBIN)/Etn-SC.framework\" to use the library." test: all $(GORUN) build/ci.go test diff --git a/build/ci.go b/build/ci.go index 4129168be..14598401f 100644 --- a/build/ci.go +++ b/build/ci.go @@ -68,7 +68,7 @@ var ( // Files that end up in the geth*.zip archive. gethArchiveFiles = []string{ "COPYING", - executablePath("geth"), + executablePath("etn-sc"), } // Files that end up in the geth-alltools*.zip archive. @@ -77,7 +77,7 @@ var ( executablePath("abigen"), executablePath("bootnode"), executablePath("evm"), - executablePath("geth"), + executablePath("etn-sc"), executablePath("puppeth"), executablePath("rlpdump"), executablePath("clef"), @@ -91,15 +91,15 @@ var ( }, { BinaryName: "bootnode", - Description: "Ethereum bootnode.", + Description: "Electroneum bootnode.", }, { BinaryName: "evm", Description: "Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode.", }, { - BinaryName: "geth", - Description: "Ethereum CLI client.", + BinaryName: "etn-sc", + Description: "Electroneum CLI client.", }, { BinaryName: "puppeth", @@ -111,13 +111,13 @@ var ( }, { BinaryName: "clef", - Description: "Ethereum account management tool.", + Description: "Electroneum account management tool.", }, } // A debian package is created for all executables listed here. debEthereum = debPackage{ - Name: "ethereum", + Name: "Electroneum", Version: params.Version, Executables: debExecutables, } @@ -132,12 +132,12 @@ var ( // Note: the following Ubuntu releases have been officially deprecated on Launchpad: // wily, yakkety, zesty, artful, cosmic, disco, eoan, groovy, hirsuite debDistroGoBoots = map[string]string{ - "trusty": "golang-1.11", // EOL: 04/2024 - "xenial": "golang-go", // EOL: 04/2026 - "bionic": "golang-go", // EOL: 04/2028 - "focal": "golang-go", // EOL: 04/2030 - "impish": "golang-go", // EOL: 07/2022 - "jammy": "golang-go", // EOL: 04/2032 + "trusty": "golang-1.11", // EOL: 04/2024 + "xenial": "golang-go", // EOL: 04/2026 + "bionic": "golang-go", // EOL: 04/2028 + "focal": "golang-go", // EOL: 04/2030 + "impish": "golang-go", // EOL: 07/2022 + "jammy": "golang-go", // EOL: 04/2032 //"kinetic": "golang-go", // EOL: 07/2023 } @@ -364,7 +364,7 @@ func doArchive(cmdline []string) { atype = flag.String("type", "zip", "Type of archive to write (zip|tar)") signer = flag.String("signer", "", `Environment variable holding the signing key (e.g. LINUX_SIGNING_KEY)`) signify = flag.String("signify", "", `Environment variable holding the signify key (e.g. LINUX_SIGNIFY_KEY)`) - upload = flag.String("upload", "", `Destination to upload the archives (usually "gethstore/builds")`) + upload = flag.String("upload", "", `Destination to upload the archives (usually "etn-sc-store/builds")`) ext string ) flag.CommandLine.Parse(cmdline) @@ -380,8 +380,8 @@ func doArchive(cmdline []string) { var ( env = build.Env() basegeth = archiveBasename(*arch, params.ArchiveVersion(env.Commit)) - geth = "geth-" + basegeth + ext - alltools = "geth-alltools-" + basegeth + ext + geth = "etn-sc-" + basegeth + ext + alltools = "etn-sc-alltools-" + basegeth + ext ) maybeSkipArchive(env) if err := build.WriteArchive(geth, gethArchiveFiles); err != nil { @@ -421,7 +421,7 @@ func archiveUpload(archive string, blobstore string, signer string, signifyVar s } if signifyVar != "" { key := os.Getenv(signifyVar) - untrustedComment := "verify with geth-release.pub" + untrustedComment := "verify with etn-sc-release.pub" trustedComment := fmt.Sprintf("%s (%s)", archive, time.Now().UTC().Format(time.RFC1123)) if err := signify.SignFile(archive, archive+".sig", key, untrustedComment, trustedComment); err != nil { return err @@ -472,7 +472,7 @@ func doDocker(cmdline []string) { var ( image = flag.Bool("image", false, `Whether to build and push an arch specific docker image`) manifest = flag.String("manifest", "", `Push a multi-arch docker image for the specified architectures (usually "amd64,arm64")`) - upload = flag.String("upload", "", `Where to upload the docker image (usually "ethereum/client-go")`) + upload = flag.String("upload", "", `Where to upload the docker image (usually "electroneum/client-go")`) ) flag.CommandLine.Parse(cmdline) @@ -638,8 +638,8 @@ func doDebianSource(cmdline []string) { var ( cachedir = flag.String("cachedir", "./build/cache", `Filesystem path to cache the downloaded Go bundles at`) signer = flag.String("signer", "", `Signing key name, also used as package author`) - upload = flag.String("upload", "", `Where to upload the source package (usually "ethereum/ethereum")`) - sshUser = flag.String("sftp-user", "", `Username for SFTP upload (usually "geth-ci")`) + upload = flag.String("upload", "", `Where to upload the source package (usually "electroneum/electroneum")`) + sshUser = flag.String("sftp-user", "", `Username for SFTP upload (usually "etn-sc-ci")`) workdir = flag.String("workdir", "", `Output directory for packages (uses temp dir if unset)`) now = time.Now() ) @@ -758,7 +758,7 @@ func makeWorkdir(wdflag string) string { if wdflag != "" { err = os.MkdirAll(wdflag, 0744) } else { - wdflag, err = os.MkdirTemp("", "geth-build-") + wdflag, err = os.MkdirTemp("", "etn-sc-build-") } if err != nil { log.Fatal(err) @@ -879,7 +879,7 @@ func (meta debMetadata) ExeConflicts(exe debExecutable) string { // be preferred and the conflicting files should be handled via // alternates. We might do this eventually but using a conflict is // easier now. - return "ethereum, " + exe.Package() + return "electroneum, " + exe.Package() } return "" } @@ -917,7 +917,7 @@ func doWindowsInstaller(cmdline []string) { arch = flag.String("arch", runtime.GOARCH, "Architecture for cross build packaging") signer = flag.String("signer", "", `Environment variable holding the signing key (e.g. WINDOWS_SIGNING_KEY)`) signify = flag.String("signify key", "", `Environment variable holding the signify signing key (e.g. WINDOWS_SIGNIFY_KEY)`) - upload = flag.String("upload", "", `Destination to upload the archives (usually "gethstore/builds")`) + upload = flag.String("upload", "", `Destination to upload the archives (usually "etn-sc-store/builds")`) workdir = flag.String("workdir", "", `Output directory for packages (uses temp dir if unset)`) ) flag.CommandLine.Parse(cmdline) @@ -936,7 +936,7 @@ func doWindowsInstaller(cmdline []string) { continue } allTools = append(allTools, filepath.Base(file)) - if filepath.Base(file) == "geth.exe" { + if filepath.Base(file) == "etn-sc.exe" { gethTool = file } else { devTools = append(devTools, file) @@ -947,10 +947,10 @@ func doWindowsInstaller(cmdline []string) { // first section contains the geth binary, second section holds the dev tools. templateData := map[string]interface{}{ "License": "COPYING", - "Geth": gethTool, + "Etn-SC": gethTool, "DevTools": devTools, } - build.Render("build/nsis.geth.nsi", filepath.Join(*workdir, "geth.nsi"), 0644, nil) + build.Render("build/nsis.etn-sc.nsi", filepath.Join(*workdir, "etn-sc.nsi"), 0644, nil) build.Render("build/nsis.install.nsh", filepath.Join(*workdir, "install.nsh"), 0644, templateData) build.Render("build/nsis.uninstall.nsh", filepath.Join(*workdir, "uninstall.nsh"), 0644, allTools) build.Render("build/nsis.pathupdate.nsh", filepath.Join(*workdir, "PathUpdate.nsh"), 0644, nil) @@ -968,14 +968,14 @@ func doWindowsInstaller(cmdline []string) { if env.Commit != "" { version[2] += "-" + env.Commit[:8] } - installer, _ := filepath.Abs("geth-" + archiveBasename(*arch, params.ArchiveVersion(env.Commit)) + ".exe") + installer, _ := filepath.Abs("etn-sc-" + archiveBasename(*arch, params.ArchiveVersion(env.Commit)) + ".exe") build.MustRunCommand("makensis.exe", "/DOUTPUTFILE="+installer, "/DMAJORVERSION="+version[0], "/DMINORVERSION="+version[1], "/DBUILDVERSION="+version[2], "/DARCH="+*arch, - filepath.Join(*workdir, "geth.nsi"), + filepath.Join(*workdir, "etn-sc.nsi"), ) // Sign and publish installer. if err := archiveUpload(installer, *upload, *signer, *signify); err != nil { @@ -991,7 +991,7 @@ func doAndroidArchive(cmdline []string) { signer = flag.String("signer", "", `Environment variable holding the signing key (e.g. ANDROID_SIGNING_KEY)`) signify = flag.String("signify", "", `Environment variable holding the signify signing key (e.g. ANDROID_SIGNIFY_KEY)`) deploy = flag.String("deploy", "", `Destination to deploy the archive (usually "https://oss.sonatype.org")`) - upload = flag.String("upload", "", `Destination to upload the archive (usually "gethstore/builds")`) + upload = flag.String("upload", "", `Destination to upload the archive (usually "etn-sc-store/builds")`) ) flag.CommandLine.Parse(cmdline) env := build.Env() @@ -1016,8 +1016,8 @@ func doAndroidArchive(cmdline []string) { if *local { // If we're building locally, copy bundle to build dir and skip Maven - os.Rename("geth.aar", filepath.Join(GOBIN, "geth.aar")) - os.Rename("geth-sources.jar", filepath.Join(GOBIN, "geth-sources.jar")) + os.Rename("etn-sc.aar", filepath.Join(GOBIN, "etn-sc.aar")) + os.Rename("etn-sc-sources.jar", filepath.Join(GOBIN, "etn-sc-sources.jar")) return } meta := newMavenMetadata(env) @@ -1027,8 +1027,8 @@ func doAndroidArchive(cmdline []string) { maybeSkipArchive(env) // Sign and upload the archive to Azure - archive := "geth-" + archiveBasename("android", params.ArchiveVersion(env.Commit)) + ".aar" - os.Rename("geth.aar", archive) + archive := "etn-sc-" + archiveBasename("android", params.ArchiveVersion(env.Commit)) + ".aar" + os.Rename("etn-sc.aar", archive) if err := archiveUpload(archive, *upload, *signer, *signify); err != nil { log.Fatal(err) @@ -1113,7 +1113,7 @@ func newMavenMetadata(env build.Environment) mavenMetadata { } return mavenMetadata{ Version: version, - Package: "geth-" + version, + Package: "etn-sc-" + version, Develop: isUnstableBuild(env), Contributors: contribs, } @@ -1127,7 +1127,7 @@ func doXCodeFramework(cmdline []string) { signer = flag.String("signer", "", `Environment variable holding the signing key (e.g. IOS_SIGNING_KEY)`) signify = flag.String("signify", "", `Environment variable holding the signify signing key (e.g. IOS_SIGNIFY_KEY)`) deploy = flag.String("deploy", "", `Destination to deploy the archive (usually "trunk")`) - upload = flag.String("upload", "", `Destination to upload the archives (usually "gethstore/builds")`) + upload = flag.String("upload", "", `Destination to upload the archives (usually "etn-sc-store/builds")`) ) flag.CommandLine.Parse(cmdline) env := build.Env() @@ -1148,7 +1148,7 @@ func doXCodeFramework(cmdline []string) { // Create the archive. maybeSkipArchive(env) - archive := "geth-" + archiveBasename("ios", params.ArchiveVersion(env.Commit)) + archive := "etn-sc-" + archiveBasename("ios", params.ArchiveVersion(env.Commit)) if err := os.MkdirAll(archive, 0755); err != nil { log.Fatal(err) } @@ -1163,8 +1163,8 @@ func doXCodeFramework(cmdline []string) { // Prepare and upload a PodSpec to CocoaPods if *deploy != "" { meta := newPodMetadata(env, archive) - build.Render("build/pod.podspec", "Geth.podspec", 0755, meta) - build.MustRunCommand("pod", *deploy, "push", "Geth.podspec", "--allow-warnings") + build.Render("build/pod.podspec", "Etn-SC.podspec", 0755, meta) + build.MustRunCommand("pod", *deploy, "push", "Etn-SC.podspec", "--allow-warnings") } } @@ -1217,7 +1217,7 @@ func newPodMetadata(env build.Environment, archive string) podMetadata { func doPurge(cmdline []string) { var ( - store = flag.String("store", "", `Destination from where to purge archives (usually "gethstore/builds")`) + store = flag.String("store", "", `Destination from where to purge archives (usually "etn-sc-store/builds")`) limit = flag.Int("days", 30, `Age threshold above which to delete unstable archives`) ) flag.CommandLine.Parse(cmdline) diff --git a/cmd/geth/accountcmd.go b/cmd/etn-sc/accountcmd.go similarity index 100% rename from cmd/geth/accountcmd.go rename to cmd/etn-sc/accountcmd.go diff --git a/cmd/geth/accountcmd_test.go b/cmd/etn-sc/accountcmd_test.go similarity index 100% rename from cmd/geth/accountcmd_test.go rename to cmd/etn-sc/accountcmd_test.go diff --git a/cmd/geth/chaincmd.go b/cmd/etn-sc/chaincmd.go similarity index 100% rename from cmd/geth/chaincmd.go rename to cmd/etn-sc/chaincmd.go diff --git a/cmd/geth/config.go b/cmd/etn-sc/config.go similarity index 99% rename from cmd/geth/config.go rename to cmd/etn-sc/config.go index a64f921c3..13ad343f0 100644 --- a/cmd/geth/config.go +++ b/cmd/etn-sc/config.go @@ -113,7 +113,7 @@ func defaultNodeConfig() node.Config { cfg.Version = params.VersionWithCommit(gitCommit, gitDate) cfg.HTTPModules = append(cfg.HTTPModules, "eth") cfg.WSModules = append(cfg.WSModules, "eth") - cfg.IPCPath = "geth.ipc" + cfg.IPCPath = "etn-sc.ipc" return cfg } diff --git a/cmd/geth/consolecmd.go b/cmd/etn-sc/consolecmd.go similarity index 100% rename from cmd/geth/consolecmd.go rename to cmd/etn-sc/consolecmd.go diff --git a/cmd/geth/consolecmd_test.go b/cmd/etn-sc/consolecmd_test.go similarity index 96% rename from cmd/geth/consolecmd_test.go rename to cmd/etn-sc/consolecmd_test.go index dd35fe15c..8b859cbf2 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/etn-sc/consolecmd_test.go @@ -68,9 +68,9 @@ func TestConsoleWelcome(t *testing.T) { // Verify the actual welcome message to the required template geth.Expect(` -Welcome to the Geth JavaScript console! +Welcome to the ETN-SC JavaScript console! -instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} +instance: etn-sc/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} coinbase: 0x4c7968f79c1a414c34cd4d3c1ac7a3a8413da50c at block: 0 ({{niltime}}) datadir: {{.Datadir}} @@ -140,9 +140,9 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { // Verify the actual welcome message to the required template attach.Expect(` -Welcome to the Geth JavaScript console! +Welcome to the ETN-SC JavaScript console! -instance: Geth/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} +instance: etn-sc/v{{gethver}}/{{goos}}-{{goarch}}/{{gover}} coinbase: 0x4c7968f79c1a414c34cd4d3c1ac7a3a8413da50c at block: 0 ({{niltime}}){{if ipc}} datadir: {{datadir}}{{end}} diff --git a/cmd/geth/dao_test.go b/cmd/etn-sc/dao_test.go similarity index 99% rename from cmd/geth/dao_test.go rename to cmd/etn-sc/dao_test.go index b9b8cf24f..d8340a3fd 100644 --- a/cmd/geth/dao_test.go +++ b/cmd/etn-sc/dao_test.go @@ -120,7 +120,7 @@ func testDAOForkBlockNewChain(t *testing.T, test int, genesis string, expectBloc runGeth(t, append(args, []string{"--exec", "2+2", "console"}...)...).WaitExit() } // Retrieve the DAO config flag from the database - path := filepath.Join(datadir, "geth", "chaindata") + path := filepath.Join(datadir, "etn-sc", "chaindata") db, err := rawdb.NewLevelDBDatabase(path, 0, 0, "", false) if err != nil { t.Fatalf("test %d: failed to open test database: %v", test, err) diff --git a/cmd/geth/dbcmd.go b/cmd/etn-sc/dbcmd.go similarity index 100% rename from cmd/geth/dbcmd.go rename to cmd/etn-sc/dbcmd.go diff --git a/cmd/geth/genesis_test.go b/cmd/etn-sc/genesis_test.go similarity index 100% rename from cmd/geth/genesis_test.go rename to cmd/etn-sc/genesis_test.go diff --git a/cmd/geth/les_test.go b/cmd/etn-sc/les_test.go similarity index 100% rename from cmd/geth/les_test.go rename to cmd/etn-sc/les_test.go diff --git a/cmd/geth/main.go b/cmd/etn-sc/main.go similarity index 97% rename from cmd/geth/main.go rename to cmd/etn-sc/main.go index 3f3cbd18a..2945d175e 100644 --- a/cmd/geth/main.go +++ b/cmd/etn-sc/main.go @@ -48,7 +48,7 @@ import ( ) const ( - clientIdentifier = "geth" // Client identifier to advertise over the network + clientIdentifier = "etn-sc" // Client identifier to advertise over the network ) var ( @@ -270,8 +270,8 @@ func prepare(ctx *cli.Context) { // If we're running a known preset, log it for convenience. switch { case ctx.GlobalIsSet(utils.DeveloperFlag.Name): - log.Info("Starting Geth in ephemeral dev mode...") - log.Warn(`You are running Geth in --dev mode. Please note the following: + log.Info("Starting etn-sc in ephemeral dev mode...") + log.Warn(`You are running etn-sc in --dev mode. Please note the following: 1. This mode is only intended for fast, iterative development without assumptions on security or persistence. @@ -288,13 +288,13 @@ func prepare(ctx *cli.Context) { `) case ctx.GlobalIsSet(utils.TestnetFlag.Name): - log.Info("Starting Geth on Electroneum testnet...") + log.Info("Starting etn-sc on Electroneum testnet...") case ctx.GlobalIsSet(utils.StagenetFlag.Name): - log.Info("Starting Geth on Electroneum stagenet...") + log.Info("Starting etn-sc on Electroneum stagenet...") case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name): - log.Info("Starting Geth on Electroneum mainnet...") + log.Info("Starting etn-sc on Electroneum mainnet...") } // If we're a full node on mainnet without --cache specified, bump default cache allowance if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) { diff --git a/cmd/geth/misccmd.go b/cmd/etn-sc/misccmd.go similarity index 100% rename from cmd/geth/misccmd.go rename to cmd/etn-sc/misccmd.go diff --git a/cmd/geth/run_test.go b/cmd/etn-sc/run_test.go similarity index 100% rename from cmd/geth/run_test.go rename to cmd/etn-sc/run_test.go diff --git a/cmd/geth/snapshot.go b/cmd/etn-sc/snapshot.go similarity index 100% rename from cmd/geth/snapshot.go rename to cmd/etn-sc/snapshot.go diff --git a/cmd/geth/testdata/blockchain.blocks b/cmd/etn-sc/testdata/blockchain.blocks similarity index 100% rename from cmd/geth/testdata/blockchain.blocks rename to cmd/etn-sc/testdata/blockchain.blocks diff --git a/cmd/geth/testdata/clique.json b/cmd/etn-sc/testdata/clique.json similarity index 100% rename from cmd/geth/testdata/clique.json rename to cmd/etn-sc/testdata/clique.json diff --git a/cmd/geth/testdata/empty.js b/cmd/etn-sc/testdata/empty.js similarity index 100% rename from cmd/geth/testdata/empty.js rename to cmd/etn-sc/testdata/empty.js diff --git a/cmd/geth/testdata/guswallet.json b/cmd/etn-sc/testdata/guswallet.json similarity index 100% rename from cmd/geth/testdata/guswallet.json rename to cmd/etn-sc/testdata/guswallet.json diff --git a/cmd/geth/testdata/key.prv b/cmd/etn-sc/testdata/key.prv similarity index 100% rename from cmd/geth/testdata/key.prv rename to cmd/etn-sc/testdata/key.prv diff --git a/cmd/geth/testdata/password.txt b/cmd/etn-sc/testdata/password.txt similarity index 100% rename from cmd/geth/testdata/password.txt rename to cmd/etn-sc/testdata/password.txt diff --git a/cmd/geth/testdata/passwords.txt b/cmd/etn-sc/testdata/passwords.txt similarity index 100% rename from cmd/geth/testdata/passwords.txt rename to cmd/etn-sc/testdata/passwords.txt diff --git a/cmd/geth/testdata/vcheck/data.json b/cmd/etn-sc/testdata/vcheck/data.json similarity index 100% rename from cmd/geth/testdata/vcheck/data.json rename to cmd/etn-sc/testdata/vcheck/data.json diff --git a/cmd/geth/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.1 b/cmd/etn-sc/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.1 similarity index 100% rename from cmd/geth/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.1 rename to cmd/etn-sc/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.1 diff --git a/cmd/geth/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.2 b/cmd/etn-sc/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.2 similarity index 100% rename from cmd/geth/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.2 rename to cmd/etn-sc/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.2 diff --git a/cmd/geth/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.3 b/cmd/etn-sc/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.3 similarity index 100% rename from cmd/geth/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.3 rename to cmd/etn-sc/testdata/vcheck/minisig-sigs/vulnerabilities.json.minisig.3 diff --git a/cmd/geth/testdata/vcheck/minisign.pub b/cmd/etn-sc/testdata/vcheck/minisign.pub similarity index 100% rename from cmd/geth/testdata/vcheck/minisign.pub rename to cmd/etn-sc/testdata/vcheck/minisign.pub diff --git a/cmd/geth/testdata/vcheck/minisign.sec b/cmd/etn-sc/testdata/vcheck/minisign.sec similarity index 100% rename from cmd/geth/testdata/vcheck/minisign.sec rename to cmd/etn-sc/testdata/vcheck/minisign.sec diff --git a/cmd/geth/testdata/vcheck/signify-sigs/data.json.sig b/cmd/etn-sc/testdata/vcheck/signify-sigs/data.json.sig similarity index 100% rename from cmd/geth/testdata/vcheck/signify-sigs/data.json.sig rename to cmd/etn-sc/testdata/vcheck/signify-sigs/data.json.sig diff --git a/cmd/geth/testdata/vcheck/signifykey.pub b/cmd/etn-sc/testdata/vcheck/signifykey.pub similarity index 100% rename from cmd/geth/testdata/vcheck/signifykey.pub rename to cmd/etn-sc/testdata/vcheck/signifykey.pub diff --git a/cmd/geth/testdata/vcheck/signifykey.sec b/cmd/etn-sc/testdata/vcheck/signifykey.sec similarity index 100% rename from cmd/geth/testdata/vcheck/signifykey.sec rename to cmd/etn-sc/testdata/vcheck/signifykey.sec diff --git a/cmd/geth/testdata/vcheck/sigs/vulnerabilities.json.minisig.1 b/cmd/etn-sc/testdata/vcheck/sigs/vulnerabilities.json.minisig.1 similarity index 100% rename from cmd/geth/testdata/vcheck/sigs/vulnerabilities.json.minisig.1 rename to cmd/etn-sc/testdata/vcheck/sigs/vulnerabilities.json.minisig.1 diff --git a/cmd/geth/testdata/vcheck/sigs/vulnerabilities.json.minisig.2 b/cmd/etn-sc/testdata/vcheck/sigs/vulnerabilities.json.minisig.2 similarity index 100% rename from cmd/geth/testdata/vcheck/sigs/vulnerabilities.json.minisig.2 rename to cmd/etn-sc/testdata/vcheck/sigs/vulnerabilities.json.minisig.2 diff --git a/cmd/geth/testdata/vcheck/sigs/vulnerabilities.json.minisig.3 b/cmd/etn-sc/testdata/vcheck/sigs/vulnerabilities.json.minisig.3 similarity index 100% rename from cmd/geth/testdata/vcheck/sigs/vulnerabilities.json.minisig.3 rename to cmd/etn-sc/testdata/vcheck/sigs/vulnerabilities.json.minisig.3 diff --git a/cmd/geth/testdata/vcheck/vulnerabilities.json b/cmd/etn-sc/testdata/vcheck/vulnerabilities.json similarity index 100% rename from cmd/geth/testdata/vcheck/vulnerabilities.json rename to cmd/etn-sc/testdata/vcheck/vulnerabilities.json diff --git a/cmd/geth/testdata/wrong-passwords.txt b/cmd/etn-sc/testdata/wrong-passwords.txt similarity index 100% rename from cmd/geth/testdata/wrong-passwords.txt rename to cmd/etn-sc/testdata/wrong-passwords.txt diff --git a/cmd/geth/usage.go b/cmd/etn-sc/usage.go similarity index 100% rename from cmd/geth/usage.go rename to cmd/etn-sc/usage.go diff --git a/cmd/geth/version_check.go b/cmd/etn-sc/version_check.go similarity index 100% rename from cmd/geth/version_check.go rename to cmd/etn-sc/version_check.go diff --git a/cmd/geth/version_check_test.go b/cmd/etn-sc/version_check_test.go similarity index 100% rename from cmd/geth/version_check_test.go rename to cmd/etn-sc/version_check_test.go diff --git a/console/console.go b/console/console.go index 2f61c1d7a..abdc3d62c 100644 --- a/console/console.go +++ b/console/console.go @@ -313,7 +313,7 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str // Welcome show summary of current Geth instance and some metadata about the // console's available modules. func (c *Console) Welcome() { - message := "Welcome to the Geth JavaScript console!\n\n" + message := "Welcome to the ETN-SC JavaScript console!\n\n" // Print some generic Geth metadata if res, err := c.jsre.Run(` From c467b6ddbef95b0eea53162e7398cf253ad5e423 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Mon, 27 Jun 2022 23:47:53 -0300 Subject: [PATCH 24/30] dockerfile: update dockerfile entry point --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 70299190f..43d284bb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apk add --no-cache ca-certificates COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ EXPOSE 8545 8546 30303 30303/udp -ENTRYPOINT ["geth"] +ENTRYPOINT ["etn-sc"] # Add some metadata labels to help programatic image consumption ARG COMMIT="" From d86e3cc64c3e2956c88cb4fd1091296e6fb3dbcd Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 28 Jun 2022 00:46:38 -0300 Subject: [PATCH 25/30] all: change go package references to electroneum/electroneum-sc --- .travis.yml | 4 +- accounts/abi/abi.go | 4 +- accounts/abi/abi_test.go | 6 +- accounts/abi/bind/auth.go | 14 +- accounts/abi/bind/backend.go | 16 +- accounts/abi/bind/backends/simulated.go | 58 ++--- accounts/abi/bind/backends/simulated_test.go | 56 ++--- accounts/abi/bind/base.go | 20 +- accounts/abi/bind/base_test.go | 22 +- accounts/abi/bind/bind.go | 6 +- accounts/abi/bind/bind_test.go | 214 +++++++++--------- accounts/abi/bind/template.go | 18 +- accounts/abi/bind/util.go | 10 +- accounts/abi/bind/util_test.go | 12 +- accounts/abi/error.go | 4 +- accounts/abi/event.go | 4 +- accounts/abi/event_test.go | 4 +- accounts/abi/method.go | 2 +- accounts/abi/pack.go | 4 +- accounts/abi/pack_test.go | 2 +- accounts/abi/packing_test.go | 2 +- accounts/abi/topics.go | 4 +- accounts/abi/topics_test.go | 4 +- accounts/abi/type.go | 2 +- accounts/abi/type_test.go | 2 +- accounts/abi/unpack.go | 2 +- accounts/abi/unpack_test.go | 2 +- accounts/accounts.go | 10 +- accounts/accounts_test.go | 2 +- accounts/external/backend.go | 20 +- accounts/keystore/account_cache.go | 6 +- accounts/keystore/account_cache_test.go | 4 +- accounts/keystore/file_cache.go | 2 +- accounts/keystore/key.go | 6 +- accounts/keystore/keystore.go | 10 +- accounts/keystore/keystore_test.go | 8 +- accounts/keystore/passphrase.go | 10 +- accounts/keystore/passphrase_test.go | 2 +- accounts/keystore/plain.go | 2 +- accounts/keystore/plain_test.go | 4 +- accounts/keystore/presale.go | 4 +- accounts/keystore/wallet.go | 10 +- accounts/keystore/watch.go | 2 +- accounts/manager.go | 4 +- accounts/scwallet/hub.go | 8 +- accounts/scwallet/securechannel.go | 2 +- accounts/scwallet/wallet.go | 24 +- accounts/usbwallet/hub.go | 6 +- accounts/usbwallet/ledger.go | 14 +- accounts/usbwallet/trezor.go | 12 +- accounts/usbwallet/wallet.go | 24 +- build/ci.go | 12 +- build/deb/ethereum/deb.control | 4 +- build/mvn.pom | 6 +- build/nsis.install.nsh | 6 +- build/pod.podspec | 4 +- build/update-license.go | 2 +- cmd/abidump/main.go | 4 +- cmd/abigen/main.go | 12 +- cmd/bootnode/main.go | 14 +- cmd/checkpoint-admin/README.md | 6 +- cmd/checkpoint-admin/common.go | 18 +- cmd/checkpoint-admin/exec.go | 22 +- cmd/checkpoint-admin/main.go | 6 +- cmd/checkpoint-admin/status.go | 4 +- cmd/clef/main.go | 40 ++-- cmd/clef/tutorial.md | 6 +- cmd/devp2p/crawl.go | 4 +- cmd/devp2p/discv4cmd.go | 12 +- cmd/devp2p/discv5cmd.go | 6 +- cmd/devp2p/dns_cloudflare.go | 4 +- cmd/devp2p/dns_route53.go | 4 +- cmd/devp2p/dnscmd.go | 10 +- cmd/devp2p/enrcmd.go | 6 +- cmd/devp2p/internal/ethtest/chain.go | 12 +- cmd/devp2p/internal/ethtest/chain_test.go | 4 +- cmd/devp2p/internal/ethtest/helpers.go | 14 +- cmd/devp2p/internal/ethtest/large.go | 6 +- cmd/devp2p/internal/ethtest/snap.go | 12 +- cmd/devp2p/internal/ethtest/snapTypes.go | 2 +- cmd/devp2p/internal/ethtest/suite.go | 8 +- cmd/devp2p/internal/ethtest/suite_test.go | 10 +- cmd/devp2p/internal/ethtest/transaction.go | 10 +- cmd/devp2p/internal/ethtest/types.go | 8 +- cmd/devp2p/internal/v4test/discv4tests.go | 6 +- cmd/devp2p/internal/v4test/framework.go | 6 +- cmd/devp2p/internal/v5test/discv5tests.go | 8 +- cmd/devp2p/internal/v5test/framework.go | 10 +- cmd/devp2p/keycmd.go | 4 +- cmd/devp2p/main.go | 6 +- cmd/devp2p/nodeset.go | 4 +- cmd/devp2p/nodesetcmd.go | 8 +- cmd/devp2p/rlpxcmd.go | 12 +- cmd/devp2p/runtest.go | 6 +- cmd/etn-sc/accountcmd.go | 10 +- cmd/etn-sc/accountcmd_test.go | 2 +- cmd/etn-sc/chaincmd.go | 24 +- cmd/etn-sc/config.go | 24 +- cmd/etn-sc/consolecmd.go | 8 +- cmd/etn-sc/consolecmd_test.go | 2 +- cmd/etn-sc/dao_test.go | 6 +- cmd/etn-sc/dbcmd.go | 22 +- cmd/etn-sc/les_test.go | 4 +- cmd/etn-sc/main.go | 32 +-- cmd/etn-sc/misccmd.go | 6 +- cmd/etn-sc/run_test.go | 4 +- cmd/etn-sc/snapshot.go | 22 +- cmd/etn-sc/usage.go | 6 +- cmd/etn-sc/version_check.go | 2 +- cmd/etnkey/changepassword.go | 4 +- cmd/etnkey/generate.go | 6 +- cmd/etnkey/inspect.go | 6 +- cmd/etnkey/main.go | 2 +- cmd/etnkey/message.go | 8 +- cmd/etnkey/run_test.go | 2 +- cmd/etnkey/utils.go | 4 +- cmd/evm/compiler.go | 2 +- cmd/evm/disasm.go | 2 +- cmd/evm/internal/compiler/compiler.go | 2 +- cmd/evm/internal/t8ntool/block.go | 18 +- cmd/evm/internal/t8ntool/execution.go | 30 +-- cmd/evm/internal/t8ntool/flags.go | 4 +- cmd/evm/internal/t8ntool/gen_header.go | 8 +- cmd/evm/internal/t8ntool/gen_stenv.go | 4 +- cmd/evm/internal/t8ntool/transaction.go | 16 +- cmd/evm/internal/t8ntool/transition.go | 24 +- cmd/evm/main.go | 6 +- cmd/evm/runner.go | 22 +- cmd/evm/staterunner.go | 10 +- cmd/evm/t8n_test.go | 4 +- cmd/faucet/faucet.go | 36 +-- cmd/faucet/faucet_test.go | 2 +- cmd/p2psim/main.go | 12 +- cmd/puppeth/genesis.go | 14 +- cmd/puppeth/genesis_test.go | 2 +- cmd/puppeth/module.go | 2 +- cmd/puppeth/module_dashboard.go | 8 +- cmd/puppeth/module_ethstats.go | 2 +- cmd/puppeth/module_explorer.go | 2 +- cmd/puppeth/module_faucet.go | 4 +- cmd/puppeth/module_nginx.go | 2 +- cmd/puppeth/module_node.go | 4 +- cmd/puppeth/puppeth.go | 2 +- cmd/puppeth/ssh.go | 2 +- cmd/puppeth/wizard.go | 8 +- cmd/puppeth/wizard_dashboard.go | 2 +- cmd/puppeth/wizard_ethstats.go | 2 +- cmd/puppeth/wizard_explorer.go | 2 +- cmd/puppeth/wizard_faucet.go | 4 +- cmd/puppeth/wizard_genesis.go | 8 +- cmd/puppeth/wizard_intro.go | 2 +- cmd/puppeth/wizard_netstats.go | 4 +- cmd/puppeth/wizard_network.go | 2 +- cmd/puppeth/wizard_nginx.go | 2 +- cmd/puppeth/wizard_node.go | 6 +- cmd/rlpdump/main.go | 4 +- cmd/rlpdump/rlpdump_test.go | 4 +- cmd/utils/cmd.go | 22 +- cmd/utils/customflags.go | 2 +- cmd/utils/export_test.go | 4 +- cmd/utils/flags.go | 70 +++--- cmd/utils/flags_legacy.go | 2 +- cmd/utils/prompt.go | 2 +- common/bitutil/compress_test.go | 2 +- common/bytes.go | 2 +- common/debug.go | 2 +- common/hexutil/json_example_test.go | 2 +- common/math/big_test.go | 2 +- common/prque/lazyqueue.go | 2 +- common/prque/lazyqueue_test.go | 2 +- common/types.go | 2 +- consensus/beacon/consensus.go | 16 +- consensus/clique/api.go | 12 +- consensus/clique/clique.go | 28 +-- consensus/clique/clique_test.go | 14 +- consensus/clique/snapshot.go | 10 +- consensus/clique/snapshot_test.go | 16 +- consensus/consensus.go | 14 +- consensus/ethash/algorithm.go | 8 +- consensus/ethash/algorithm_test.go | 6 +- consensus/ethash/api.go | 6 +- consensus/ethash/consensus.go | 18 +- consensus/ethash/consensus_test.go | 8 +- consensus/ethash/difficulty.go | 2 +- consensus/ethash/ethash.go | 8 +- consensus/ethash/ethash_test.go | 8 +- consensus/ethash/sealer.go | 8 +- consensus/ethash/sealer_test.go | 8 +- consensus/istanbul/backend.go | 4 +- consensus/istanbul/backend/api.go | 10 +- consensus/istanbul/backend/backend.go | 28 +-- consensus/istanbul/backend/backend_test.go | 12 +- consensus/istanbul/backend/engine.go | 20 +- consensus/istanbul/backend/engine_test.go | 20 +- consensus/istanbul/backend/handler.go | 12 +- consensus/istanbul/backend/handler_test.go | 12 +- consensus/istanbul/backend/snapshot.go | 8 +- consensus/istanbul/backend/snapshot_test.go | 18 +- consensus/istanbul/common/constants.go | 4 +- consensus/istanbul/common/utils.go | 4 +- consensus/istanbul/core.go | 2 +- consensus/istanbul/core/backlog.go | 4 +- consensus/istanbul/core/commit.go | 8 +- consensus/istanbul/core/core.go | 14 +- consensus/istanbul/core/events.go | 4 +- consensus/istanbul/core/final_committed.go | 2 +- consensus/istanbul/core/handler.go | 10 +- consensus/istanbul/core/justification.go | 8 +- consensus/istanbul/core/justification_test.go | 12 +- consensus/istanbul/core/prepare.go | 6 +- consensus/istanbul/core/preprepare.go | 8 +- consensus/istanbul/core/qbft_msg_set.go | 8 +- consensus/istanbul/core/request.go | 2 +- consensus/istanbul/core/roundchange.go | 12 +- consensus/istanbul/core/roundstate.go | 6 +- consensus/istanbul/core/types.go | 6 +- consensus/istanbul/engine.go | 8 +- consensus/istanbul/engine/apply_extra.go | 2 +- consensus/istanbul/engine/engine.go | 18 +- consensus/istanbul/engine/engine_test.go | 8 +- consensus/istanbul/testutils/genesis.go | 14 +- consensus/istanbul/types.go | 6 +- consensus/istanbul/types/commit.go | 4 +- consensus/istanbul/types/common.go | 4 +- consensus/istanbul/types/decode.go | 4 +- consensus/istanbul/types/message.go | 4 +- consensus/istanbul/types/prepare.go | 4 +- consensus/istanbul/types/preprepare.go | 6 +- consensus/istanbul/types/roundchange.go | 12 +- consensus/istanbul/utils.go | 8 +- consensus/istanbul/validator.go | 2 +- consensus/istanbul/validator/default.go | 4 +- consensus/istanbul/validator/default_test.go | 6 +- .../istanbul/validator/proposerpolicy_test.go | 4 +- consensus/istanbul/validator/validator.go | 4 +- consensus/merger.go | 8 +- consensus/misc/dao.go | 6 +- consensus/misc/eip1559.go | 8 +- consensus/misc/eip1559_test.go | 6 +- consensus/misc/forks.go | 6 +- consensus/misc/gaslimit.go | 2 +- consensus/protocol.go | 4 +- console/bridge.go | 12 +- console/bridge_test.go | 2 +- console/console.go | 10 +- console/console_test.go | 18 +- contracts/checkpointoracle/contract/oracle.go | 16 +- contracts/checkpointoracle/oracle.go | 8 +- contracts/checkpointoracle/oracle_test.go | 14 +- core/asm/asm.go | 2 +- core/asm/compiler.go | 4 +- core/beacon/errors.go | 4 +- core/beacon/gen_blockparams.go | 4 +- core/beacon/gen_ed.go | 4 +- core/beacon/types.go | 8 +- core/bench_test.go | 18 +- core/block_validator.go | 10 +- core/block_validator_test.go | 20 +- core/blockchain.go | 32 +-- core/blockchain_insert.go | 8 +- core/blockchain_reader.go | 20 +- core/blockchain_repair_test.go | 14 +- core/blockchain_sethead_test.go | 12 +- core/blockchain_snapshot_test.go | 14 +- core/blockchain_test.go | 34 +-- core/blocks.go | 2 +- core/bloom_indexer.go | 12 +- core/bloombits/generator.go | 2 +- core/bloombits/generator_test.go | 2 +- core/bloombits/matcher.go | 4 +- core/bloombits/matcher_test.go | 4 +- core/chain_indexer.go | 12 +- core/chain_indexer_test.go | 6 +- core/chain_makers.go | 16 +- core/chain_makers_test.go | 12 +- core/dao_test.go | 8 +- core/error.go | 2 +- core/events.go | 4 +- core/evm.go | 8 +- core/forkchoice.go | 10 +- core/forkid/forkid.go | 8 +- core/forkid/forkid_test.go | 6 +- core/gen_genesis.go | 8 +- core/gen_genesis_account.go | 6 +- core/genesis.go | 22 +- core/genesis_test.go | 12 +- core/headerchain.go | 16 +- core/headerchain_test.go | 12 +- core/mkalloc.go | 4 +- core/rawdb/accessors_chain.go | 14 +- core/rawdb/accessors_chain_test.go | 10 +- core/rawdb/accessors_indexes.go | 12 +- core/rawdb/accessors_indexes_test.go | 10 +- core/rawdb/accessors_metadata.go | 10 +- core/rawdb/accessors_snapshot.go | 6 +- core/rawdb/accessors_state.go | 6 +- core/rawdb/accessors_sync.go | 8 +- core/rawdb/chain_freezer.go | 8 +- core/rawdb/chain_iterator.go | 12 +- core/rawdb/chain_iterator_test.go | 4 +- core/rawdb/database.go | 10 +- core/rawdb/freezer.go | 8 +- core/rawdb/freezer_batch.go | 4 +- core/rawdb/freezer_meta.go | 4 +- core/rawdb/freezer_table.go | 6 +- core/rawdb/freezer_table_test.go | 2 +- core/rawdb/freezer_test.go | 4 +- core/rawdb/key_length_iterator.go | 2 +- core/rawdb/schema.go | 4 +- core/rawdb/table.go | 2 +- core/rawdb/table_test.go | 2 +- core/rlp_test.go | 14 +- core/state/access_list.go | 2 +- core/state/database.go | 10 +- core/state/dump.go | 12 +- core/state/iterator.go | 8 +- core/state/iterator_test.go | 4 +- core/state/journal.go | 2 +- core/state/metrics.go | 2 +- core/state/pruner/bloom.go | 6 +- core/state/pruner/pruner.go | 18 +- core/state/snapshot/account.go | 4 +- core/state/snapshot/context.go | 12 +- core/state/snapshot/conversion.go | 12 +- core/state/snapshot/dangling.go | 10 +- core/state/snapshot/difflayer.go | 4 +- core/state/snapshot/difflayer_test.go | 6 +- core/state/snapshot/disklayer.go | 10 +- core/state/snapshot/disklayer_test.go | 10 +- core/state/snapshot/generate.go | 18 +- core/state/snapshot/generate_test.go | 14 +- core/state/snapshot/holdable_iterator.go | 4 +- core/state/snapshot/holdable_iterator_test.go | 4 +- core/state/snapshot/iterator.go | 6 +- core/state/snapshot/iterator_binary.go | 2 +- core/state/snapshot/iterator_fast.go | 2 +- core/state/snapshot/iterator_test.go | 4 +- core/state/snapshot/journal.go | 12 +- core/state/snapshot/metrics.go | 2 +- core/state/snapshot/snapshot.go | 14 +- core/state/snapshot/snapshot_test.go | 6 +- core/state/snapshot/sort.go | 2 +- core/state/state_object.go | 10 +- core/state/state_object_test.go | 2 +- core/state/state_test.go | 8 +- core/state/statedb.go | 20 +- core/state/statedb_test.go | 14 +- core/state/sync.go | 10 +- core/state/sync_test.go | 14 +- core/state/trie_prefetcher.go | 6 +- core/state/trie_prefetcher_test.go | 4 +- core/state_prefetcher.go | 10 +- core/state_processor.go | 16 +- core/state_processor_test.go | 22 +- core/state_transition.go | 12 +- core/tx_cacher.go | 2 +- core/tx_journal.go | 8 +- core/tx_list.go | 4 +- core/tx_list_test.go | 4 +- core/tx_noncer.go | 4 +- core/tx_pool.go | 18 +- core/tx_pool_test.go | 16 +- core/types.go | 6 +- core/types/access_list_tx.go | 2 +- core/types/block.go | 6 +- core/types/block_test.go | 10 +- core/types/bloom9.go | 4 +- core/types/bloom9_test.go | 4 +- core/types/dynamic_fee_tx.go | 2 +- core/types/gen_access_tuple.go | 2 +- core/types/gen_account_rlp.go | 2 +- core/types/gen_header_json.go | 4 +- core/types/gen_header_rlp.go | 2 +- core/types/gen_log_json.go | 4 +- core/types/gen_log_rlp.go | 2 +- core/types/gen_receipt_json.go | 4 +- core/types/hashing.go | 6 +- core/types/hashing_test.go | 14 +- core/types/istanbul.go | 4 +- core/types/legacy.go | 2 +- core/types/legacy_tx.go | 2 +- core/types/log.go | 6 +- core/types/log_test.go | 4 +- core/types/receipt.go | 10 +- core/types/receipt_test.go | 8 +- core/types/state_account.go | 2 +- core/types/transaction.go | 8 +- core/types/transaction_marshalling.go | 4 +- core/types/transaction_signing.go | 6 +- core/types/transaction_signing_test.go | 6 +- core/types/transaction_test.go | 6 +- core/types/types_test.go | 6 +- core/vm/analysis_test.go | 2 +- core/vm/common.go | 4 +- core/vm/contract.go | 2 +- core/vm/contracts.go | 14 +- core/vm/contracts_test.go | 2 +- core/vm/eips.go | 2 +- core/vm/evm.go | 6 +- core/vm/gas_table.go | 6 +- core/vm/gas_table_test.go | 10 +- core/vm/instructions.go | 6 +- core/vm/instructions_test.go | 6 +- core/vm/interface.go | 4 +- core/vm/interpreter.go | 6 +- core/vm/interpreter_test.go | 10 +- core/vm/jump_table.go | 2 +- core/vm/logger.go | 2 +- core/vm/operations_acl.go | 6 +- core/vm/runtime/env.go | 4 +- core/vm/runtime/runtime.go | 12 +- core/vm/runtime/runtime_example_test.go | 4 +- core/vm/runtime/runtime_test.go | 28 +-- core/vm/stack_table.go | 2 +- crypto/bls12381/g1_test.go | 2 +- crypto/bls12381/g2_test.go | 2 +- crypto/bls12381/pairing_test.go | 2 +- crypto/bls12381/utils.go | 2 +- crypto/bn256/bn256_fast.go | 2 +- crypto/bn256/bn256_slow.go | 2 +- crypto/crypto.go | 6 +- crypto/crypto_test.go | 4 +- crypto/ecies/ecies_test.go | 2 +- crypto/ecies/params.go | 2 +- crypto/secp256k1/dummy.go | 6 +- crypto/signature_cgo.go | 4 +- crypto/signature_test.go | 6 +- eth/api.go | 22 +- eth/api_backend.go | 34 +-- eth/api_test.go | 8 +- eth/backend.go | 64 +++--- eth/bloombits.go | 4 +- eth/catalyst/api.go | 18 +- eth/catalyst/api_test.go | 30 +-- eth/catalyst/queue.go | 6 +- eth/discovery.go | 8 +- eth/downloader/api.go | 10 +- eth/downloader/beaconsync.go | 6 +- eth/downloader/downloader.go | 24 +- eth/downloader/downloader_test.go | 60 ++--- eth/downloader/events.go | 2 +- eth/downloader/fetchers.go | 6 +- eth/downloader/fetchers_concurrent.go | 8 +- eth/downloader/fetchers_concurrent_bodies.go | 6 +- eth/downloader/fetchers_concurrent_headers.go | 6 +- .../fetchers_concurrent_receipts.go | 6 +- eth/downloader/metrics.go | 2 +- eth/downloader/peer.go | 10 +- eth/downloader/queue.go | 10 +- eth/downloader/queue_test.go | 16 +- eth/downloader/resultstore.go | 2 +- eth/downloader/skeleton.go | 12 +- eth/downloader/skeleton_test.go | 10 +- eth/downloader/statesync.go | 4 +- eth/downloader/testchain_test.go | 16 +- eth/ethconfig/config.go | 30 +-- eth/ethconfig/gen_config.go | 16 +- eth/fetcher/block_fetcher.go | 16 +- eth/fetcher/block_fetcher_test.go | 18 +- eth/fetcher/tx_fetcher.go | 12 +- eth/fetcher/tx_fetcher_test.go | 8 +- eth/filters/api.go | 16 +- eth/filters/api_test.go | 4 +- eth/filters/bench_test.go | 14 +- eth/filters/filter.go | 14 +- eth/filters/filter_system.go | 26 +-- eth/filters/filter_system_test.go | 46 ++-- eth/filters/filter_test.go | 14 +- eth/gasprice/feehistory.go | 10 +- eth/gasprice/feehistory_test.go | 2 +- eth/gasprice/gasprice.go | 14 +- eth/gasprice/gasprice_test.go | 20 +- eth/handler.go | 38 ++-- eth/handler_eth.go | 10 +- eth/handler_eth_test.go | 30 +-- eth/handler_snap.go | 6 +- eth/handler_test.go | 24 +- eth/ibft_protocol.go | 2 +- eth/peer.go | 4 +- eth/peerset.go | 8 +- eth/protocols/eth/broadcast.go | 4 +- eth/protocols/eth/discovery.go | 8 +- eth/protocols/eth/dispatcher.go | 2 +- eth/protocols/eth/handler.go | 16 +- eth/protocols/eth/handler_test.go | 24 +- eth/protocols/eth/handlers.go | 12 +- eth/protocols/eth/handshake.go | 6 +- eth/protocols/eth/handshake_test.go | 8 +- eth/protocols/eth/peer.go | 8 +- eth/protocols/eth/peer_test.go | 6 +- eth/protocols/eth/protocol.go | 8 +- eth/protocols/eth/protocol_test.go | 6 +- eth/protocols/eth/tracker.go | 2 +- eth/protocols/snap/discovery.go | 2 +- eth/protocols/snap/handler.go | 22 +- eth/protocols/snap/peer.go | 6 +- eth/protocols/snap/protocol.go | 6 +- eth/protocols/snap/range.go | 2 +- eth/protocols/snap/range_test.go | 2 +- eth/protocols/snap/sort_test.go | 4 +- eth/protocols/snap/sync.go | 28 +-- eth/protocols/snap/sync_test.go | 18 +- eth/protocols/snap/tracker.go | 2 +- eth/state_accessor.go | 14 +- eth/sync.go | 12 +- eth/sync_test.go | 10 +- eth/tracers/api.go | 30 +-- eth/tracers/api_test.go | 30 +-- .../internal/tracetest/calltrace_test.go | 28 +-- eth/tracers/js/goja.go | 12 +- eth/tracers/js/tracer_test.go | 10 +- eth/tracers/logger/access_list_tracer.go | 6 +- eth/tracers/logger/gen_structlog.go | 8 +- eth/tracers/logger/logger.go | 12 +- eth/tracers/logger/logger_json.go | 6 +- eth/tracers/logger/logger_test.go | 10 +- eth/tracers/native/4byte.go | 6 +- eth/tracers/native/call.go | 6 +- eth/tracers/native/noop.go | 6 +- eth/tracers/native/prestate.go | 10 +- eth/tracers/native/tracer.go | 2 +- eth/tracers/tracers.go | 4 +- eth/tracers/tracers_test.go | 20 +- ethclient/ethclient.go | 46 ++-- ethclient/ethclient_test.go | 70 +++--- ethclient/gethclient/gethclient.go | 18 +- ethclient/gethclient/gethclient_test.go | 32 +-- ethclient/signer.go | 4 +- ethdb/dbtest/testsuite.go | 2 +- ethdb/leveldb/leveldb.go | 8 +- ethdb/leveldb/leveldb_test.go | 4 +- ethdb/memorydb/memorydb.go | 4 +- ethdb/memorydb/memorydb_test.go | 4 +- ethdb/remotedb/remotedb.go | 6 +- ethstats/ethstats.go | 30 +-- event/example_feed_test.go | 2 +- event/example_scope_test.go | 2 +- event/example_subscription_test.go | 2 +- event/subscription.go | 2 +- go.mod | 2 +- graphql/graphql.go | 24 +- graphql/graphql_test.go | 20 +- graphql/service.go | 4 +- interfaces.go | 4 +- internal/debug/api.go | 2 +- internal/debug/flags.go | 6 +- internal/debug/trace.go | 2 +- internal/ethapi/addrlock.go | 2 +- internal/ethapi/api.go | 44 ++-- internal/ethapi/backend.go | 28 +-- internal/ethapi/dbapi.go | 4 +- internal/ethapi/transaction_args.go | 14 +- internal/flags/helpers.go | 2 +- internal/guide/guide_test.go | 6 +- internal/jsre/jsre.go | 2 +- internal/shutdowncheck/shutdown_tracker.go | 8 +- internal/testlog/testlog.go | 2 +- les/api.go | 8 +- les/api_backend.go | 34 +-- les/api_test.go | 28 +-- les/benchmark.go | 22 +- les/bloombits.go | 4 +- les/catalyst/api.go | 12 +- les/catalyst/api_test.go | 26 +-- les/checkpointoracle/oracle.go | 12 +- les/client.go | 54 ++--- les/client_handler.go | 20 +- les/commons.go | 28 +-- les/costtracker.go | 12 +- les/distributor.go | 4 +- les/distributor_test.go | 2 +- les/downloader/api.go | 10 +- les/downloader/downloader.go | 28 +-- les/downloader/downloader_test.go | 50 ++-- les/downloader/events.go | 2 +- les/downloader/metrics.go | 2 +- les/downloader/peer.go | 10 +- les/downloader/queue.go | 12 +- les/downloader/queue_test.go | 14 +- les/downloader/resultstore.go | 2 +- les/downloader/statesync.go | 12 +- les/downloader/testchain_test.go | 14 +- les/downloader/types.go | 2 +- les/enr_entry.go | 8 +- les/fetcher.go | 20 +- les/fetcher/block_fetcher.go | 14 +- les/fetcher/block_fetcher_test.go | 16 +- les/fetcher_test.go | 14 +- les/flowcontrol/control.go | 4 +- les/flowcontrol/logger.go | 2 +- les/flowcontrol/manager.go | 4 +- les/flowcontrol/manager_test.go | 2 +- les/handler_test.go | 26 +-- les/metrics.go | 4 +- les/odr.go | 8 +- les/odr_requests.go | 18 +- les/odr_test.go | 22 +- les/peer.go | 28 +-- les/peer_test.go | 16 +- les/protocol.go | 12 +- les/pruner.go | 8 +- les/pruner_test.go | 4 +- les/request_test.go | 10 +- les/retrieve.go | 2 +- les/server.go | 28 +-- les/server_handler.go | 28 +-- les/server_requests.go | 18 +- les/servingqueue.go | 4 +- les/state_accessor.go | 10 +- les/sync.go | 12 +- les/sync_test.go | 14 +- les/test_helper.go | 44 ++-- les/txrelay.go | 6 +- les/ulc.go | 4 +- les/ulc_test.go | 6 +- les/utils/expiredvalue.go | 2 +- les/utils/expiredvalue_test.go | 2 +- les/utils/limiter.go | 2 +- les/utils/limiter_test.go | 2 +- les/utils/timeutils.go | 2 +- les/utils/timeutils_test.go | 2 +- les/utils/weighted_select.go | 2 +- les/vflux/client/api.go | 6 +- les/vflux/client/fillset.go | 4 +- les/vflux/client/fillset_test.go | 8 +- les/vflux/client/queueiterator.go | 4 +- les/vflux/client/queueiterator_test.go | 8 +- les/vflux/client/requestbasket.go | 4 +- les/vflux/client/requestbasket_test.go | 2 +- les/vflux/client/serverpool.go | 18 +- les/vflux/client/serverpool_test.go | 10 +- les/vflux/client/timestats.go | 4 +- les/vflux/client/timestats_test.go | 2 +- les/vflux/client/valuetracker.go | 12 +- les/vflux/client/valuetracker_test.go | 8 +- les/vflux/client/wrsiterator.go | 6 +- les/vflux/client/wrsiterator_test.go | 4 +- les/vflux/requests.go | 2 +- les/vflux/server/balance.go | 8 +- les/vflux/server/balance_test.go | 14 +- les/vflux/server/balance_tracker.go | 12 +- les/vflux/server/clientdb.go | 14 +- les/vflux/server/clientdb_test.go | 8 +- les/vflux/server/clientpool.go | 16 +- les/vflux/server/clientpool_test.go | 10 +- les/vflux/server/metrics.go | 2 +- les/vflux/server/prioritypool.go | 10 +- les/vflux/server/prioritypool_test.go | 8 +- les/vflux/server/service.go | 10 +- les/vflux/server/status.go | 2 +- light/lightchain.go | 22 +- light/lightchain_test.go | 14 +- light/nodeset.go | 8 +- light/odr.go | 10 +- light/odr_test.go | 26 +-- light/odr_util.go | 10 +- light/postprocess.go | 20 +- light/trie.go | 16 +- light/trie_test.go | 14 +- light/txpool.go | 18 +- light/txpool_test.go | 14 +- log/format.go | 2 +- metrics/cpu_enabled.go | 2 +- metrics/cputime_unix.go | 2 +- metrics/exp/exp.go | 6 +- metrics/influxdb/influxdb.go | 4 +- metrics/influxdb/influxdbv2.go | 4 +- metrics/librato/librato.go | 2 +- metrics/metrics.go | 2 +- metrics/prometheus/collector.go | 2 +- metrics/prometheus/collector_test.go | 2 +- metrics/prometheus/prometheus.go | 4 +- miner/miner.go | 20 +- miner/miner_test.go | 22 +- miner/stress/1559/main.go | 30 +-- miner/stress/beacon/main.go | 40 ++-- miner/stress/clique/main.go | 30 +-- miner/stress/ethash/main.go | 30 +-- miner/unconfirmed.go | 6 +- miner/unconfirmed_test.go | 2 +- miner/worker.go | 24 +- miner/worker_test.go | 28 +-- mobile/accounts.go | 8 +- mobile/android_test.go | 2 +- mobile/big.go | 2 +- mobile/bind.go | 10 +- mobile/common.go | 4 +- mobile/discover.go | 2 +- mobile/ethclient.go | 4 +- mobile/ethereum.go | 12 +- mobile/geth.go | 22 +- mobile/init.go | 2 +- mobile/interface.go | 2 +- mobile/interface_test.go | 2 +- mobile/logger.go | 2 +- mobile/p2p.go | 2 +- mobile/params.go | 6 +- mobile/primitives.go | 2 +- mobile/types.go | 6 +- mobile/vm.go | 2 +- node/api.go | 14 +- node/api_test.go | 2 +- node/config.go | 12 +- node/config_test.go | 4 +- node/defaults.go | 6 +- node/endpoints.go | 4 +- node/node.go | 18 +- node/node_example_test.go | 2 +- node/node_test.go | 8 +- node/rpcstack.go | 4 +- node/rpcstack_test.go | 6 +- node/utils_test.go | 4 +- oss-fuzz.sh | 4 +- p2p/dial.go | 8 +- p2p/dial_test.go | 10 +- p2p/discover/common.go | 10 +- p2p/discover/lookup.go | 2 +- p2p/discover/node.go | 6 +- p2p/discover/ntp.go | 2 +- p2p/discover/table.go | 8 +- p2p/discover/table_test.go | 8 +- p2p/discover/table_util_test.go | 8 +- p2p/discover/v4_lookup_test.go | 8 +- p2p/discover/v4_udp.go | 10 +- p2p/discover/v4_udp_test.go | 10 +- p2p/discover/v4wire/v4wire.go | 10 +- p2p/discover/v4wire/v4wire_test.go | 4 +- p2p/discover/v5_udp.go | 12 +- p2p/discover/v5_udp_test.go | 12 +- p2p/discover/v5wire/crypto.go | 6 +- p2p/discover/v5wire/crypto_test.go | 6 +- p2p/discover/v5wire/encoding.go | 8 +- p2p/discover/v5wire/encoding_test.go | 8 +- p2p/discover/v5wire/msg.go | 8 +- p2p/discover/v5wire/session.go | 6 +- p2p/dnsdisc/client.go | 10 +- p2p/dnsdisc/client_test.go | 12 +- p2p/dnsdisc/sync.go | 4 +- p2p/dnsdisc/tree.go | 8 +- p2p/dnsdisc/tree_test.go | 4 +- p2p/enode/idscheme.go | 8 +- p2p/enode/idscheme_test.go | 6 +- p2p/enode/iter_test.go | 2 +- p2p/enode/localnode.go | 6 +- p2p/enode/localnode_test.go | 4 +- p2p/enode/node.go | 4 +- p2p/enode/node_test.go | 4 +- p2p/enode/nodedb.go | 2 +- p2p/enode/urlv4.go | 6 +- p2p/enode/urlv4_test.go | 4 +- p2p/enr/enr.go | 2 +- p2p/enr/enr_test.go | 2 +- p2p/enr/entries.go | 2 +- p2p/message.go | 6 +- p2p/metrics.go | 2 +- p2p/msgrate/msgrate.go | 2 +- p2p/nat/nat.go | 2 +- p2p/nat/natupnp_test.go | 2 +- p2p/netutil/iptrack.go | 2 +- p2p/netutil/iptrack_test.go | 2 +- p2p/nodestate/nodestate.go | 14 +- p2p/nodestate/nodestate_test.go | 10 +- p2p/peer.go | 14 +- p2p/peer_test.go | 6 +- p2p/protocol.go | 4 +- p2p/rlpx/buffer_test.go | 2 +- p2p/rlpx/rlpx.go | 6 +- p2p/rlpx/rlpx_test.go | 8 +- p2p/server.go | 20 +- p2p/server_test.go | 12 +- p2p/simulations/adapters/exec.go | 10 +- p2p/simulations/adapters/inproc.go | 14 +- p2p/simulations/adapters/inproc_test.go | 2 +- p2p/simulations/adapters/types.go | 14 +- p2p/simulations/connect.go | 2 +- p2p/simulations/connect_test.go | 6 +- p2p/simulations/examples/ping-pong.go | 12 +- p2p/simulations/http.go | 10 +- p2p/simulations/http_test.go | 14 +- p2p/simulations/mocker.go | 6 +- p2p/simulations/mocker_test.go | 2 +- p2p/simulations/network.go | 10 +- p2p/simulations/network_test.go | 8 +- p2p/simulations/simulation.go | 2 +- p2p/simulations/test.go | 8 +- p2p/tracker/tracker.go | 4 +- p2p/transport.go | 10 +- p2p/transport_test.go | 4 +- p2p/util.go | 2 +- p2p/util_test.go | 2 +- params/bootnodes.go | 2 +- params/config.go | 2 +- params/dao.go | 2 +- rlp/decode.go | 2 +- rlp/decode_test.go | 2 +- rlp/encbuffer_example_test.go | 2 +- rlp/encode.go | 2 +- rlp/encode_test.go | 2 +- rlp/encoder_example_test.go | 2 +- rlp/iterator_test.go | 2 +- rlp/rlpgen/gen.go | 2 +- rlp/rlpgen/main.go | 2 +- rlp/rlpgen/testdata/bigint.out.txt | 2 +- rlp/rlpgen/testdata/nil.out.txt | 2 +- rlp/rlpgen/testdata/optional.out.txt | 2 +- rlp/rlpgen/testdata/rawvalue.in.txt | 2 +- rlp/rlpgen/testdata/rawvalue.out.txt | 2 +- rlp/rlpgen/testdata/uints.out.txt | 2 +- rlp/typecache.go | 2 +- rpc/client.go | 2 +- rpc/client_example_test.go | 4 +- rpc/client_test.go | 6 +- rpc/doc.go | 2 +- rpc/endpoints.go | 2 +- rpc/handler.go | 2 +- rpc/ipc.go | 4 +- rpc/ipc_unix.go | 2 +- rpc/metrics.go | 2 +- rpc/server.go | 2 +- rpc/service.go | 2 +- rpc/types.go | 4 +- rpc/types_test.go | 4 +- rpc/websocket.go | 2 +- rpc/websocket_test.go | 2 +- signer/core/api.go | 22 +- signer/core/api_test.go | 22 +- .../apitypes/signed_data_internal_test.go | 2 +- signer/core/apitypes/types.go | 14 +- signer/core/auditlog.go | 10 +- signer/core/cliui.go | 8 +- signer/core/gnosis_safe.go | 8 +- signer/core/signed_data.go | 18 +- signer/core/signed_data_test.go | 14 +- signer/core/stdioui.go | 6 +- signer/core/uiapi.go | 10 +- signer/fourbyte/abi.go | 4 +- signer/fourbyte/abi_test.go | 4 +- signer/fourbyte/fourbyte_test.go | 4 +- signer/fourbyte/validation.go | 6 +- signer/fourbyte/validation_test.go | 6 +- signer/rules/rules.go | 10 +- signer/rules/rules_test.go | 16 +- signer/storage/aes_gcm_storage.go | 2 +- signer/storage/aes_gcm_storage_test.go | 4 +- tests/block_test_util.go | 24 +- tests/difficulty_test.go | 4 +- tests/difficulty_test_util.go | 10 +- tests/fuzzers/abi/abifuzzer.go | 2 +- tests/fuzzers/bitutil/compress_fuzz.go | 2 +- tests/fuzzers/bls12381/bls12381_fuzz.go | 2 +- tests/fuzzers/bls12381/precompile_fuzzer.go | 4 +- tests/fuzzers/bn256/bn256_fuzz.go | 4 +- tests/fuzzers/difficulty/debug/main.go | 2 +- tests/fuzzers/difficulty/difficulty-fuzz.go | 4 +- tests/fuzzers/keystore/keystore-fuzzer.go | 2 +- tests/fuzzers/les/debug/main.go | 2 +- tests/fuzzers/les/les-fuzzer.go | 22 +- tests/fuzzers/rangeproof/debug/main.go | 2 +- tests/fuzzers/rangeproof/rangeproof-fuzzer.go | 8 +- tests/fuzzers/rlp/rlp_fuzzer.go | 4 +- tests/fuzzers/runtime/runtime_fuzz.go | 2 +- tests/fuzzers/secp256k1/secp_fuzzer.go | 2 +- tests/fuzzers/snap/debug/main.go | 2 +- tests/fuzzers/snap/fuzz_handler.go | 20 +- tests/fuzzers/stacktrie/debug/main.go | 2 +- tests/fuzzers/stacktrie/trie_fuzzer.go | 6 +- tests/fuzzers/trie/trie-fuzzer.go | 6 +- tests/fuzzers/txfetcher/txfetcher_fuzzer.go | 8 +- tests/fuzzers/vflux/clientpool-fuzzer.go | 16 +- tests/fuzzers/vflux/debug/main.go | 4 +- tests/gen_btheader.go | 8 +- tests/gen_difficultytest.go | 4 +- tests/gen_stenv.go | 4 +- tests/gen_sttransaction.go | 6 +- tests/init.go | 2 +- tests/init_test.go | 2 +- tests/rlp_test_util.go | 2 +- tests/state_test.go | 10 +- tests/state_test_util.go | 26 +-- tests/transaction_test.go | 2 +- tests/transaction_test_util.go | 12 +- trie/committer.go | 2 +- trie/database.go | 12 +- trie/database_test.go | 4 +- trie/errors.go | 2 +- trie/hasher.go | 4 +- trie/iterator.go | 4 +- trie/iterator_test.go | 10 +- trie/node.go | 4 +- trie/node_enc.go | 2 +- trie/node_test.go | 2 +- trie/proof.go | 6 +- trie/proof_test.go | 8 +- trie/secure_trie.go | 8 +- trie/secure_trie_test.go | 6 +- trie/stacktrie.go | 6 +- trie/stacktrie_test.go | 6 +- trie/sync.go | 8 +- trie/sync_test.go | 6 +- trie/trie.go | 12 +- trie/trie_test.go | 16 +- trie/util_test.go | 4 +- 902 files changed, 4109 insertions(+), 4109 deletions(-) diff --git a/.travis.yml b/.travis.yml index e08e271f3..0a9b68baa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: go -go_import_path: github.com/ethereum/go-ethereum +go_import_path: github.com/electroneum/electroneum-sc sudo: false jobs: allow_failures: @@ -155,7 +155,7 @@ jobs: script: # Build the Android archive and upload it to Maven Central and Azure - mkdir -p $GOPATH/src/github.com/ethereum - - ln -s `pwd` $GOPATH/src/github.com/ethereum/go-ethereum + - ln -s `pwd` $GOPATH/src/github.com/electroneum/electroneum-sc - go run build/ci.go aar -signer ANDROID_SIGNING_KEY -signify SIGNIFY_KEY -deploy https://oss.sonatype.org -upload gethstore/builds # This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index cd2f4d797..3598fdb2e 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -23,8 +23,8 @@ import ( "fmt" "io" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) // The ABI holds information about a contract's context and available diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index cc8dfc61c..fae9c9e15 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -26,9 +26,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" ) const jsondata = ` diff --git a/accounts/abi/bind/auth.go b/accounts/abi/bind/auth.go index 494dc88a5..bc48a6b5c 100644 --- a/accounts/abi/bind/auth.go +++ b/accounts/abi/bind/auth.go @@ -23,13 +23,13 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/external" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/external" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" ) // ErrNoChainID is returned whenever the user failed to specify a chain id. diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go index c16990f39..06480ebbb 100644 --- a/accounts/abi/bind/backend.go +++ b/accounts/abi/bind/backend.go @@ -21,9 +21,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) var ( @@ -50,7 +50,7 @@ type ContractCaller interface { // CallContract executes an Ethereum contract call with the specified data as the // input. - CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error) } // PendingContractCaller defines methods to perform contract calls on the pending state. @@ -61,7 +61,7 @@ type PendingContractCaller interface { PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error) // PendingCallContract executes an Ethereum contract call against the pending state. - PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) + PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error) } // ContractTransactor defines the methods needed to allow operating with a contract @@ -92,7 +92,7 @@ type ContractTransactor interface { // There is no guarantee that this is the true gas limit requirement as other // transactions may be added or removed by miners, but it should provide a basis // for setting a reasonable default. - EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) + EstimateGas(ctx context.Context, call electroneum.CallMsg) (gas uint64, err error) // SendTransaction injects the transaction into the pending pool for execution. SendTransaction(ctx context.Context, tx *types.Transaction) error @@ -105,11 +105,11 @@ type ContractFilterer interface { // returning all the results in one batch. // // TODO(karalabe): Deprecate when the subscription one can return past data too. - FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) + FilterLogs(ctx context.Context, query electroneum.FilterQuery) ([]types.Log, error) // SubscribeFilterLogs creates a background log filtering operation, returning // a subscription immediately, which can be used to stream the found events. - SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + SubscribeFilterLogs(ctx context.Context, query electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error) } // DeployBackend wraps the operations needed by WaitMined and WaitDeployed. diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index ac696f446..2044eb6cc 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -24,25 +24,25 @@ import ( "sync" "time" - "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/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/filters" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) // This nil assignment ensures at compile time that SimulatedBackend implements bind.ContractBackend. @@ -231,7 +231,7 @@ func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash common receipt, _, _, _ := rawdb.ReadReceipt(b.database, txHash, b.config) if receipt == nil { - return nil, ethereum.NotFound + return nil, electroneum.NotFound } return receipt, nil } @@ -252,7 +252,7 @@ func (b *SimulatedBackend) TransactionByHash(ctx context.Context, txHash common. if tx != nil { return tx, false, nil } - return nil, false, ethereum.NotFound + return nil, false, electroneum.NotFound } // BlockByHash retrieves a block based on the block hash. @@ -414,7 +414,7 @@ func (e *revertError) ErrorData() interface{} { } // CallContract executes a contract call. -func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { +func (b *SimulatedBackend) CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error) { b.mu.Lock() defer b.mu.Unlock() @@ -437,7 +437,7 @@ func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallM } // PendingCallContract executes a contract call on the pending state. -func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) { +func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error) { b.mu.Lock() defer b.mu.Unlock() defer b.pendingState.RevertToSnapshot(b.pendingState.Snapshot()) @@ -482,7 +482,7 @@ func (b *SimulatedBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, erro // EstimateGas executes the requested code against the currently pending block/state and // returns the used amount of gas. -func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { +func (b *SimulatedBackend) EstimateGas(ctx context.Context, call electroneum.CallMsg) (uint64, error) { b.mu.Lock() defer b.mu.Unlock() @@ -586,7 +586,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs // callContract implements common code between normal and pending contract calls. // state is modified during execution, make sure to copy it if necessary. -func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallMsg, block *types.Block, stateDB *state.StateDB) (*core.ExecutionResult, error) { +func (b *SimulatedBackend) callContract(ctx context.Context, call electroneum.CallMsg, block *types.Block, stateDB *state.StateDB) (*core.ExecutionResult, error) { // Gas prices post 1559 need to be initialized if call.GasPrice != nil && (call.GasFeeCap != nil || call.GasTipCap != nil) { return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified") @@ -679,7 +679,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa // returning all the results in one batch. // // TODO(karalabe): Deprecate when the subscription one can return past data too. -func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) { +func (b *SimulatedBackend) FilterLogs(ctx context.Context, query electroneum.FilterQuery) ([]types.Log, error) { var filter *filters.Filter if query.BlockHash != nil { // Block filter requested, construct a single-shot filter @@ -711,7 +711,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter // SubscribeFilterLogs creates a background log filtering operation, returning a // subscription immediately, which can be used to stream the found events. -func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { +func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error) { // Subscribe to contract events sink := make(chan []*types.Log) @@ -744,7 +744,7 @@ func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethere } // SubscribeNewHead returns an event subscription for a new header. -func (b *SimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) { +func (b *SimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (electroneum.Subscription, error) { // subscribe to a new head sink := make(chan *types.Header) sub := b.events.SubscribeNewHeads(sink) @@ -798,7 +798,7 @@ func (b *SimulatedBackend) Blockchain() *core.BlockChain { // callMsg implements core.Message to allow passing it as a transaction simulator. type callMsg struct { - ethereum.CallMsg + electroneum.CallMsg } func (m callMsg) From() common.Address { return m.CallMsg.From } diff --git a/accounts/abi/bind/backends/simulated_test.go b/accounts/abi/bind/backends/simulated_test.go index 8a0cbe335..0c11861bd 100644 --- a/accounts/abi/bind/backends/simulated_test.go +++ b/accounts/abi/bind/backends/simulated_test.go @@ -27,14 +27,14 @@ import ( "testing" "time" - "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" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) func TestSimulatedBackend(t *testing.T) { @@ -54,7 +54,7 @@ func TestSimulatedBackend(t *testing.T) { if isPending { t.Fatal("transaction should not be pending") } - if err != ethereum.NotFound { + if err != electroneum.NotFound { t.Fatalf("err should be `ethereum.NotFound` but received %v", err) } @@ -439,12 +439,12 @@ func TestEstimateGas(t *testing.T) { var cases = []struct { name string - message ethereum.CallMsg + message electroneum.CallMsg expect uint64 expectError error expectData interface{} }{ - {"plain transfer(valid)", ethereum.CallMsg{ + {"plain transfer(valid)", electroneum.CallMsg{ From: addr, To: &addr, Gas: 0, @@ -453,7 +453,7 @@ func TestEstimateGas(t *testing.T) { Data: nil, }, params.TxGas, nil, nil}, - {"plain transfer(invalid)", ethereum.CallMsg{ + {"plain transfer(invalid)", electroneum.CallMsg{ From: addr, To: &contractAddr, Gas: 0, @@ -462,7 +462,7 @@ func TestEstimateGas(t *testing.T) { Data: nil, }, 0, errors.New("execution reverted"), nil}, - {"Revert", ethereum.CallMsg{ + {"Revert", electroneum.CallMsg{ From: addr, To: &contractAddr, Gas: 0, @@ -471,7 +471,7 @@ func TestEstimateGas(t *testing.T) { Data: common.Hex2Bytes("d8b98391"), }, 0, errors.New("execution reverted: revert reason"), "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d72657665727420726561736f6e00000000000000000000000000000000000000"}, - {"PureRevert", ethereum.CallMsg{ + {"PureRevert", electroneum.CallMsg{ From: addr, To: &contractAddr, Gas: 0, @@ -480,7 +480,7 @@ func TestEstimateGas(t *testing.T) { Data: common.Hex2Bytes("aa8b1d30"), }, 0, errors.New("execution reverted"), nil}, - {"OOG", ethereum.CallMsg{ + {"OOG", electroneum.CallMsg{ From: addr, To: &contractAddr, Gas: 100000, @@ -489,7 +489,7 @@ func TestEstimateGas(t *testing.T) { Data: common.Hex2Bytes("50f6fe34"), }, 0, errors.New("gas required exceeds allowance (100000)"), nil}, - {"Assert", ethereum.CallMsg{ + {"Assert", electroneum.CallMsg{ From: addr, To: &contractAddr, Gas: 100000, @@ -498,7 +498,7 @@ func TestEstimateGas(t *testing.T) { Data: common.Hex2Bytes("b9b046f9"), }, 0, errors.New("invalid opcode: INVALID"), nil}, - {"Valid", ethereum.CallMsg{ + {"Valid", electroneum.CallMsg{ From: addr, To: &contractAddr, Gas: 100000, @@ -541,11 +541,11 @@ func TestEstimateGasWithPrice(t *testing.T) { recipient := common.HexToAddress("deadbeef") var cases = []struct { name string - message ethereum.CallMsg + message electroneum.CallMsg expect uint64 expectError error }{ - {"EstimateWithoutPrice", ethereum.CallMsg{ + {"EstimateWithoutPrice", electroneum.CallMsg{ From: addr, To: &recipient, Gas: 0, @@ -554,7 +554,7 @@ func TestEstimateGasWithPrice(t *testing.T) { Data: nil, }, 21000, nil}, - {"EstimateWithPrice", ethereum.CallMsg{ + {"EstimateWithPrice", electroneum.CallMsg{ From: addr, To: &recipient, Gas: 0, @@ -563,7 +563,7 @@ func TestEstimateGasWithPrice(t *testing.T) { Data: nil, }, 21000, nil}, - {"EstimateWithVeryHighPrice", ethereum.CallMsg{ + {"EstimateWithVeryHighPrice", electroneum.CallMsg{ From: addr, To: &recipient, Gas: 0, @@ -572,7 +572,7 @@ func TestEstimateGasWithPrice(t *testing.T) { Data: nil, }, 21000, nil}, - {"EstimateWithSuperhighPrice", ethereum.CallMsg{ + {"EstimateWithSuperhighPrice", electroneum.CallMsg{ From: addr, To: &recipient, Gas: 0, @@ -581,7 +581,7 @@ func TestEstimateGasWithPrice(t *testing.T) { Data: nil, }, 21000, errors.New("gas required exceeds allowance (10999)")}, // 10999=(2.2ether-1000wei)/(2e14) - {"EstimateEIP1559WithHighFees", ethereum.CallMsg{ + {"EstimateEIP1559WithHighFees", electroneum.CallMsg{ From: addr, To: &addr, Gas: 0, @@ -591,7 +591,7 @@ func TestEstimateGasWithPrice(t *testing.T) { Data: nil, }, params.TxGas, nil}, - {"EstimateEIP1559WithSuperHighFees", ethereum.CallMsg{ + {"EstimateEIP1559WithSuperHighFees", electroneum.CallMsg{ From: addr, To: &addr, Gas: 0, @@ -1018,7 +1018,7 @@ func TestPendingAndCallContract(t *testing.T) { } // make sure you can call the contract in pending state - res, err := sim.PendingCallContract(bgCtx, ethereum.CallMsg{ + res, err := sim.PendingCallContract(bgCtx, electroneum.CallMsg{ From: testAddr, To: &addr, Data: input, @@ -1038,7 +1038,7 @@ func TestPendingAndCallContract(t *testing.T) { sim.Commit() // make sure you can call the contract - res, err = sim.CallContract(bgCtx, ethereum.CallMsg{ + res, err = sim.CallContract(bgCtx, electroneum.CallMsg{ From: testAddr, To: &addr, Data: input, @@ -1106,14 +1106,14 @@ func TestCallContractRevert(t *testing.T) { call := make([]func([]byte) ([]byte, error), 2) call[0] = func(input []byte) ([]byte, error) { - return sim.PendingCallContract(bgCtx, ethereum.CallMsg{ + return sim.PendingCallContract(bgCtx, electroneum.CallMsg{ From: testAddr, To: &addr, Data: input, }) } call[1] = func(input []byte) ([]byte, error) { - return sim.CallContract(bgCtx, ethereum.CallMsg{ + return sim.CallContract(bgCtx, electroneum.CallMsg{ From: testAddr, To: &addr, Data: input, diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index fe330014d..282c3e58c 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -24,12 +24,12 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/event" ) // SignerFn is a signer function callback when a contract requires a method to @@ -160,7 +160,7 @@ func (c *BoundContract) Call(opts *CallOpts, results *[]interface{}, method stri return err } var ( - msg = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input} + msg = electroneum.CallMsg{From: opts.From, To: &c.address, Data: input} ctx = ensureContext(opts.Context) code []byte output []byte @@ -338,7 +338,7 @@ func (c *BoundContract) estimateGasLimit(opts *TransactOpts, contract *common.Ad return 0, ErrNoCode } } - msg := ethereum.CallMsg{ + msg := electroneum.CallMsg{ From: opts.From, To: contract, GasPrice: gasPrice, @@ -419,7 +419,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int // Start the background filtering logs := make(chan types.Log, 128) - config := ethereum.FilterQuery{ + config := electroneum.FilterQuery{ Addresses: []common.Address{c.address}, Topics: topics, FromBlock: new(big.Int).SetUint64(opts.Start), @@ -468,7 +468,7 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter // Start the background filtering logs := make(chan types.Log, 128) - config := ethereum.FilterQuery{ + config := electroneum.FilterQuery{ Addresses: []common.Address{c.address}, Topics: topics, } diff --git a/accounts/abi/bind/base_test.go b/accounts/abi/bind/base_test.go index 25b2f8a86..7378e838d 100644 --- a/accounts/abi/bind/base_test.go +++ b/accounts/abi/bind/base_test.go @@ -24,14 +24,14 @@ import ( "strings" "testing" - "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/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" "github.com/stretchr/testify/assert" ) @@ -67,7 +67,7 @@ func (mt *mockTransactor) SuggestGasTipCap(ctx context.Context) (*big.Int, error return mt.gasTipCap, nil } -func (mt *mockTransactor) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) { +func (mt *mockTransactor) EstimateGas(ctx context.Context, call electroneum.CallMsg) (gas uint64, err error) { return 0, nil } @@ -89,7 +89,7 @@ func (mc *mockCaller) CodeAt(ctx context.Context, contract common.Address, block return mc.codeAtBytes, mc.codeAtErr } -func (mc *mockCaller) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { +func (mc *mockCaller) CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error) { mc.callContractBlockNumber = blockNumber return mc.callContractBytes, mc.callContractErr } @@ -109,7 +109,7 @@ func (mc *mockPendingCaller) PendingCodeAt(ctx context.Context, contract common. return mc.pendingCodeAtBytes, mc.pendingCodeAtErr } -func (mc *mockPendingCaller) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) { +func (mc *mockPendingCaller) PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error) { mc.pendingCallContractCalled = true return mc.pendingCallContractBytes, mc.pendingCallContractErr } diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index 2bd8b6dde..999b4896b 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -17,7 +17,7 @@ // Package bind generates Ethereum contract Go bindings. // // Detailed usage document and tutorial available on the go-ethereum Wiki page: -// https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts +// https://github.com/electroneum/electroneum-sc/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts package bind import ( @@ -30,8 +30,8 @@ import ( "text/template" "unicode" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/log" ) // Lang is a target programming language selector to generate bindings for. diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 87e8187f0..94e206e69 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -25,7 +25,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) var bindTests = []struct { @@ -46,7 +46,7 @@ var bindTests = []struct { `contract NilContract {}`, []string{`606060405260068060106000396000f3606060405200`}, []string{`[]`}, - `"github.com/ethereum/go-ethereum/common"`, + `"github.com/electroneum/electroneum-sc/common"`, ` if b, err := NewEmpty(common.Address{}, nil); b == nil || err != nil { t.Fatalf("combined binding (%v) nil or error (%v) not nil", b, nil) @@ -69,7 +69,7 @@ var bindTests = []struct { `https://ethereum.org/token`, []string{`60606040526040516107fd3803806107fd83398101604052805160805160a05160c051929391820192909101600160a060020a0333166000908152600360209081526040822086905581548551838052601f6002600019610100600186161502019093169290920482018390047f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56390810193919290918801908390106100e857805160ff19168380011785555b506101189291505b8082111561017157600081556001016100b4565b50506002805460ff19168317905550505050610658806101a56000396000f35b828001600101855582156100ac579182015b828111156100ac5782518260005055916020019190600101906100fa565b50508060016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061017557805160ff19168380011785555b506100c89291506100b4565b5090565b82800160010185558215610165579182015b8281111561016557825182600050559160200191906001019061018756606060405236156100775760e060020a600035046306fdde03811461007f57806323b872dd146100dc578063313ce5671461010e57806370a082311461011a57806395d89b4114610132578063a9059cbb1461018e578063cae9ca51146101bd578063dc3080f21461031c578063dd62ed3e14610341575b610365610002565b61036760008054602060026001831615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156104eb5780601f106104c0576101008083540402835291602001916104eb565b6103d5600435602435604435600160a060020a038316600090815260036020526040812054829010156104f357610002565b6103e760025460ff1681565b6103d560043560036020526000908152604090205481565b610367600180546020600282841615610100026000190190921691909104601f810182900490910260809081016040526060828152929190828280156104eb5780601f106104c0576101008083540402835291602001916104eb565b610365600435602435600160a060020a033316600090815260036020526040902054819010156103f157610002565b60806020604435600481810135601f8101849004909302840160405260608381526103d5948235946024803595606494939101919081908382808284375094965050505050505060006000836004600050600033600160a060020a03168152602001908152602001600020600050600087600160a060020a031681526020019081526020016000206000508190555084905080600160a060020a0316638f4ffcb1338630876040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102f25780820380516001836020036101000a031916815260200191505b50955050505050506000604051808303816000876161da5a03f11561000257505050509392505050565b6005602090815260043560009081526040808220909252602435815220546103d59081565b60046020818152903560009081526040808220909252602435815220546103d59081565b005b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156103c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051918252519081900360200190f35b6060908152602090f35b600160a060020a03821660009081526040902054808201101561041357610002565b806003600050600033600160a060020a03168152602001908152602001600020600082828250540392505081905550806003600050600084600160a060020a0316815260200190815260200160002060008282825054019250508190555081600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b820191906000526020600020905b8154815290600101906020018083116104ce57829003601f168201915b505050505081565b600160a060020a03831681526040812054808301101561051257610002565b600160a060020a0380851680835260046020908152604080852033949094168086529382528085205492855260058252808520938552929052908220548301111561055c57610002565b816003600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816003600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816005600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054019250508190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3939250505056`}, []string{`[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"spentAllowance","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"inputs":[{"name":"initialSupply","type":"uint256"},{"name":"tokenName","type":"string"},{"name":"decimalUnits","type":"uint8"},{"name":"tokenSymbol","type":"string"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]`}, - `"github.com/ethereum/go-ethereum/common"`, + `"github.com/electroneum/electroneum-sc/common"`, ` if b, err := NewToken(common.Address{}, nil); b == nil || err != nil { t.Fatalf("binding (%v) nil or error (%v) not nil", b, nil) @@ -85,7 +85,7 @@ var bindTests = []struct { `https://ethereum.org/crowdsale`, []string{`606060408190526007805460ff1916905560a0806105a883396101006040529051608051915160c05160e05160008054600160a060020a03199081169095178155670de0b6b3a7640000958602600155603c9093024201600355930260045560058054909216909217905561052f90819061007990396000f36060604052361561006c5760e060020a600035046301cb3b20811461008257806329dcb0cf1461014457806338af3eed1461014d5780636e66f6e91461015f5780637a3a0e84146101715780637b3e5e7b1461017a578063a035b1fe14610183578063dc0d3dff1461018c575b61020060075460009060ff161561032357610002565b61020060035460009042106103205760025460015490106103cb576002548154600160a060020a0316908290606082818181858883f150915460025460408051600160a060020a039390931683526020830191909152818101869052517fe842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf6945090819003909201919050a15b60405160008054600160a060020a039081169230909116319082818181858883f150506007805460ff1916600117905550505050565b6103a160035481565b6103ab600054600160a060020a031681565b6103ab600554600160a060020a031681565b6103a160015481565b6103a160025481565b6103a160045481565b6103be60043560068054829081101561000257506000526002027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101547ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d409190910154600160a060020a03919091169082565b005b505050815481101561000257906000526020600020906002020160005060008201518160000160006101000a815481600160a060020a030219169083021790555060208201518160010160005055905050806002600082828250540192505081905550600560009054906101000a9004600160a060020a0316600160a060020a031663a9059cbb3360046000505484046040518360e060020a0281526004018083600160a060020a03168152602001828152602001925050506000604051808303816000876161da5a03f11561000257505060408051600160a060020a03331681526020810184905260018183015290517fe842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf692509081900360600190a15b50565b5060a0604052336060908152346080819052600680546001810180835592939282908280158290116102025760020281600202836000526020600020918201910161020291905b8082111561039d57805473ffffffffffffffffffffffffffffffffffffffff19168155600060019190910190815561036a565b5090565b6060908152602090f35b600160a060020a03166060908152602090f35b6060918252608052604090f35b5b60065481101561010e576006805482908110156100025760009182526002027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0190600680549254600160a060020a0316928490811015610002576002027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d40015460405190915082818181858883f19350505050507fe842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf660066000508281548110156100025760008290526002027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01548154600160a060020a039190911691908490811015610002576002027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d40015460408051600160a060020a0394909416845260208401919091526000838201525191829003606001919050a16001016103cc56`}, []string{`[{"constant":false,"inputs":[],"name":"checkGoalReached","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"deadline","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"beneficiary","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"tokenReward","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"fundingGoal","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"amountRaised","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"funders","outputs":[{"name":"addr","type":"address"},{"name":"amount","type":"uint256"}],"type":"function"},{"inputs":[{"name":"ifSuccessfulSendTo","type":"address"},{"name":"fundingGoalInEthers","type":"uint256"},{"name":"durationInMinutes","type":"uint256"},{"name":"etherCostOfEachToken","type":"uint256"},{"name":"addressOfTokenUsedAsReward","type":"address"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"backer","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"isContribution","type":"bool"}],"name":"FundTransfer","type":"event"}]`}, - `"github.com/ethereum/go-ethereum/common"`, + `"github.com/electroneum/electroneum-sc/common"`, ` if b, err := NewCrowdsale(common.Address{}, nil); b == nil || err != nil { t.Fatalf("binding (%v) nil or error (%v) not nil", b, nil) @@ -101,7 +101,7 @@ var bindTests = []struct { `https://ethereum.org/dao`, []string{`606060405260405160808061145f833960e06040529051905160a05160c05160008054600160a060020a03191633179055600184815560028490556003839055600780549182018082558280158290116100b8576003028160030283600052602060002091820191016100b891906101c8565b50506060919091015160029190910155600160a060020a0381166000146100a65760008054600160a060020a031916821790555b505050506111f18061026e6000396000f35b505060408051608081018252600080825260208281018290528351908101845281815292820192909252426060820152600780549194509250811015610002579081527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6889050815181546020848101517401000000000000000000000000000000000000000002600160a060020a03199290921690921760a060020a60ff021916178255604083015180516001848101805460008281528690209195600293821615610100026000190190911692909204601f9081018390048201949192919091019083901061023e57805160ff19168380011785555b50610072929150610226565b5050600060028201556001015b8082111561023a578054600160a860020a031916815560018181018054600080835592600290821615610100026000190190911604601f81901061020c57506101bb565b601f0160209004906000526020600020908101906101bb91905b8082111561023a5760008155600101610226565b5090565b828001600101855582156101af579182015b828111156101af57825182600050559160200191906001019061025056606060405236156100b95760e060020a6000350463013cf08b81146100bb578063237e9492146101285780633910682114610281578063400e3949146102995780635daf08ca146102a257806369bd34361461032f5780638160f0b5146103385780638da5cb5b146103415780639644fcbd14610353578063aa02a90f146103be578063b1050da5146103c7578063bcca1fd3146104b5578063d3c0715b146104dc578063eceb29451461058d578063f2fde38b1461067b575b005b61069c6004356004805482908110156100025790600052602060002090600a02016000506005810154815460018301546003840154600485015460068601546007870154600160a060020a03959095169750929560020194919360ff828116946101009093041692919089565b60408051602060248035600481810135601f81018590048502860185019096528585526107759581359591946044949293909201918190840183828082843750949650505050505050600060006004600050848154811015610002575090527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e600a8402908101547f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101904210806101e65750600481015460ff165b8061026757508060000160009054906101000a9004600160a060020a03168160010160005054846040518084600160a060020a0316606060020a0281526014018381526020018280519060200190808383829060006004602084601f0104600f02600301f15090500193505050506040518091039020816007016000505414155b8061027757506001546005820154105b1561109257610002565b61077560043560066020526000908152604090205481565b61077560055481565b61078760043560078054829081101561000257506000526003026000805160206111d18339815191528101547fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a820154600160a060020a0382169260a060020a90920460ff16917fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689019084565b61077560025481565b61077560015481565b610830600054600160a060020a031681565b604080516020604435600481810135601f81018490048402850184019095528484526100b9948135946024803595939460649492939101918190840183828082843750949650505050505050600080548190600160a060020a03908116339091161461084d57610002565b61077560035481565b604080516020604435600481810135601f8101849004840285018401909552848452610775948135946024803595939460649492939101918190840183828082843750506040805160209735808a0135601f81018a90048a0283018a019093528282529698976084979196506024909101945090925082915084018382808284375094965050505050505033600160a060020a031660009081526006602052604081205481908114806104ab5750604081205460078054909190811015610002579082526003026000805160206111d1833981519152015460a060020a900460ff16155b15610ce557610002565b6100b960043560243560443560005433600160a060020a03908116911614610b1857610002565b604080516020604435600481810135601f810184900484028501840190955284845261077594813594602480359593946064949293910191819084018382808284375094965050505050505033600160a060020a031660009081526006602052604081205481908114806105835750604081205460078054909190811015610002579082526003026000805160206111d18339815191520181505460a060020a900460ff16155b15610f1d57610002565b604080516020606435600481810135601f81018490048402850184019095528484526107759481359460248035956044359560849492019190819084018382808284375094965050505050505060006000600460005086815481101561000257908252600a027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01815090508484846040518084600160a060020a0316606060020a0281526014018381526020018280519060200190808383829060006004602084601f0104600f02600301f150905001935050505060405180910390208160070160005054149150610cdc565b6100b960043560005433600160a060020a03908116911614610f0857610002565b604051808a600160a060020a031681526020018981526020018060200188815260200187815260200186815260200185815260200184815260200183815260200182810382528981815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561075e5780601f106107335761010080835404028352916020019161075e565b820191906000526020600020905b81548152906001019060200180831161074157829003601f168201915b50509a505050505050505050505060405180910390f35b60408051918252519081900360200190f35b60408051600160a060020a038616815260208101859052606081018390526080918101828152845460026001821615610100026000190190911604928201839052909160a08301908590801561081e5780601f106107f35761010080835404028352916020019161081e565b820191906000526020600020905b81548152906001019060200180831161080157829003601f168201915b50509550505050505060405180910390f35b60408051600160a060020a03929092168252519081900360200190f35b600160a060020a03851660009081526006602052604081205414156108a957604060002060078054918290556001820180825582801582901161095c5760030281600302836000526020600020918201910161095c9190610a4f565b600160a060020a03851660009081526006602052604090205460078054919350908390811015610002575060005250600381026000805160206111d183398151915201805474ff0000000000000000000000000000000000000000191660a060020a85021781555b60408051600160a060020a03871681526020810186905281517f27b022af4a8347100c7a041ce5ccf8e14d644ff05de696315196faae8cd50c9b929181900390910190a15050505050565b505050915081506080604051908101604052808681526020018581526020018481526020014281526020015060076000508381548110156100025790600052602060002090600302016000508151815460208481015160a060020a02600160a060020a03199290921690921774ff00000000000000000000000000000000000000001916178255604083015180516001848101805460008281528690209195600293821615610100026000190190911692909204601f90810183900482019491929190910190839010610ad357805160ff19168380011785555b50610b03929150610abb565b5050600060028201556001015b80821115610acf57805474ffffffffffffffffffffffffffffffffffffffffff1916815560018181018054600080835592600290821615610100026000190190911604601f819010610aa15750610a42565b601f016020900490600052602060002090810190610a4291905b80821115610acf5760008155600101610abb565b5090565b82800160010185558215610a36579182015b82811115610a36578251826000505591602001919060010190610ae5565b50506060919091015160029190910155610911565b600183905560028290556003819055604080518481526020810184905280820183905290517fa439d3fa452be5e0e1e24a8145e715f4fd8b9c08c96a42fd82a855a85e5d57de9181900360600190a1505050565b50508585846040518084600160a060020a0316606060020a0281526014018381526020018280519060200190808383829060006004602084601f0104600f02600301f150905001935050505060405180910390208160070160005081905550600260005054603c024201816003016000508190555060008160040160006101000a81548160ff0219169083021790555060008160040160016101000a81548160ff02191690830217905550600081600501600050819055507f646fec02522b41e7125cfc859a64fd4f4cefd5dc3b6237ca0abe251ded1fa881828787876040518085815260200184600160a060020a03168152602001838152602001806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f168015610cc45780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a1600182016005555b50949350505050565b6004805460018101808355909190828015829011610d1c57600a0281600a028360005260206000209182019101610d1c9190610db8565b505060048054929450918491508110156100025790600052602060002090600a02016000508054600160a060020a031916871781556001818101879055855160028381018054600082815260209081902096975091959481161561010002600019011691909104601f90810182900484019391890190839010610ed857805160ff19168380011785555b50610b6c929150610abb565b50506001015b80821115610acf578054600160a060020a03191681556000600182810182905560028381018054848255909281161561010002600019011604601f819010610e9c57505b5060006003830181905560048301805461ffff191690556005830181905560068301819055600783018190556008830180548282559082526020909120610db2916002028101905b80821115610acf57805474ffffffffffffffffffffffffffffffffffffffffff1916815560018181018054600080835592600290821615610100026000190190911604601f819010610eba57505b5050600101610e44565b601f016020900490600052602060002090810190610dfc9190610abb565b601f016020900490600052602060002090810190610e929190610abb565b82800160010185558215610da6579182015b82811115610da6578251826000505591602001919060010190610eea565b60008054600160a060020a0319168217905550565b600480548690811015610002576000918252600a027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01905033600160a060020a0316600090815260098201602052604090205490915060ff1660011415610f8457610002565b33600160a060020a031660009081526009820160205260409020805460ff1916600190811790915560058201805490910190558315610fcd576006810180546001019055610fda565b6006810180546000190190555b7fc34f869b7ff431b034b7b9aea9822dac189a685e0b015c7d1be3add3f89128e8858533866040518085815260200184815260200183600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16801561107a5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a1509392505050565b6006810154600354901315611158578060000160009054906101000a9004600160a060020a0316600160a060020a03168160010160005054670de0b6b3a76400000284604051808280519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156111225780820380516001836020036101000a031916815260200191505b5091505060006040518083038185876185025a03f15050505060048101805460ff191660011761ff00191661010017905561116d565b60048101805460ff191660011761ff00191690555b60068101546005820154600483015460408051888152602081019490945283810192909252610100900460ff166060830152517fd220b7272a8b6d0d7d6bcdace67b936a8f175e6d5c1b3ee438b72256b32ab3af9181900360800190a1509291505056a66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688`}, []string{`[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposals","outputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"},{"name":"description","type":"string"},{"name":"votingDeadline","type":"uint256"},{"name":"executed","type":"bool"},{"name":"proposalPassed","type":"bool"},{"name":"numberOfVotes","type":"uint256"},{"name":"currentResult","type":"int256"},{"name":"proposalHash","type":"bytes32"}],"type":"function"},{"constant":false,"inputs":[{"name":"proposalNumber","type":"uint256"},{"name":"transactionBytecode","type":"bytes"}],"name":"executeProposal","outputs":[{"name":"result","type":"int256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"memberId","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"numProposals","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"members","outputs":[{"name":"member","type":"address"},{"name":"canVote","type":"bool"},{"name":"name","type":"string"},{"name":"memberSince","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"debatingPeriodInMinutes","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"minimumQuorum","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"targetMember","type":"address"},{"name":"canVote","type":"bool"},{"name":"memberName","type":"string"}],"name":"changeMembership","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"majorityMargin","outputs":[{"name":"","type":"int256"}],"type":"function"},{"constant":false,"inputs":[{"name":"beneficiary","type":"address"},{"name":"etherAmount","type":"uint256"},{"name":"JobDescription","type":"string"},{"name":"transactionBytecode","type":"bytes"}],"name":"newProposal","outputs":[{"name":"proposalID","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"minimumQuorumForProposals","type":"uint256"},{"name":"minutesForDebate","type":"uint256"},{"name":"marginOfVotesForMajority","type":"int256"}],"name":"changeVotingRules","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"proposalNumber","type":"uint256"},{"name":"supportsProposal","type":"bool"},{"name":"justificationText","type":"string"}],"name":"vote","outputs":[{"name":"voteID","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"proposalNumber","type":"uint256"},{"name":"beneficiary","type":"address"},{"name":"etherAmount","type":"uint256"},{"name":"transactionBytecode","type":"bytes"}],"name":"checkProposalCode","outputs":[{"name":"codeChecksOut","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"type":"function"},{"inputs":[{"name":"minimumQuorumForProposals","type":"uint256"},{"name":"minutesForDebate","type":"uint256"},{"name":"marginOfVotesForMajority","type":"int256"},{"name":"congressLeader","type":"address"}],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"description","type":"string"}],"name":"ProposalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"position","type":"bool"},{"indexed":false,"name":"voter","type":"address"},{"indexed":false,"name":"justification","type":"string"}],"name":"Voted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"result","type":"int256"},{"indexed":false,"name":"quorum","type":"uint256"},{"indexed":false,"name":"active","type":"bool"}],"name":"ProposalTallied","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"member","type":"address"},{"indexed":false,"name":"isMember","type":"bool"}],"name":"MembershipChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"minimumQuorum","type":"uint256"},{"indexed":false,"name":"debatingPeriodInMinutes","type":"uint256"},{"indexed":false,"name":"majorityMargin","type":"int256"}],"name":"ChangeOfRules","type":"event"}]`}, - `"github.com/ethereum/go-ethereum/common"`, + `"github.com/electroneum/electroneum-sc/common"`, ` if b, err := NewDAO(common.Address{}, nil); b == nil || err != nil { t.Fatalf("binding (%v) nil or error (%v) not nil", b, nil) @@ -128,7 +128,7 @@ var bindTests = []struct { ` "fmt" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" `, `if b, err := NewInputChecker(common.Address{}, nil); b == nil || err != nil { t.Fatalf("binding (%v) nil or error (%v) not nil", b, nil) @@ -166,7 +166,7 @@ var bindTests = []struct { ` "fmt" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" `, `if b, err := NewOutputChecker(common.Address{}, nil); b == nil || err != nil { t.Fatalf("binding (%v) nil or error (%v) not nil", b, nil) @@ -207,7 +207,7 @@ var bindTests = []struct { "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" `, `if e, err := NewEventChecker(common.Address{}, nil); e == nil || err != nil { t.Fatalf("binding (%v) nil or error (%v) not nil", e, nil) @@ -287,10 +287,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -342,10 +342,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -388,10 +388,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -445,11 +445,11 @@ var bindTests = []struct { "math/big" "reflect" - "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -494,10 +494,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -560,10 +560,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -605,10 +605,10 @@ var bindTests = []struct { []string{`6060604052609f8060106000396000f3606060405260e060020a6000350463f97a60058114601a575b005b600060605260c0604052600d60809081527f4920646f6e27742065786973740000000000000000000000000000000000000060a052602060c0908152600d60e081905281906101009060a09080838184600060046012f15050815172ffffffffffffffffffffffffffffffffffffff1916909152505060405161012081900392509050f3`}, []string{`[{"constant":true,"inputs":[],"name":"String","outputs":[{"name":"","type":"string"}],"type":"function"}]`}, ` - "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" `, ` // Create a simulator and wrap a non-deployed contract @@ -644,10 +644,10 @@ var bindTests = []struct { []string{`6080604052348015600f57600080fd5b5060888061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063d5f6622514602d575b600080fd5b6033604c565b6040805192835260208301919091528051918290030190f35b600a809156fea264697066735822beefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef64736f6c6343decafe0033`}, []string{`[{"inputs":[],"name":"Struct","outputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"stateMutability":"pure","type":"function"}]`}, ` - "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" `, ` // Create a simulator and wrap a non-deployed contract @@ -692,10 +692,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -741,11 +741,11 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -817,10 +817,10 @@ var bindTests = []struct { "fmt" "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -910,11 +910,11 @@ var bindTests = []struct { "math/big" "time" - "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -1101,10 +1101,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -1236,10 +1236,10 @@ var bindTests = []struct { "math/big" "reflect" - "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` @@ -1378,10 +1378,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -1444,10 +1444,10 @@ var bindTests = []struct { "math/big" "time" - "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Initialize test accounts @@ -1532,10 +1532,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/core" `, ` // Initialize test accounts @@ -1595,10 +1595,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/core" `, ` key, _ := crypto.GenerateKey() @@ -1657,10 +1657,10 @@ var bindTests = []struct { ` "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` // Generate a new random account and a funded simulator @@ -1718,10 +1718,10 @@ var bindTests = []struct { "bytes" "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/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" `, ` key, _ := crypto.GenerateKey() @@ -1806,11 +1806,11 @@ var bindTests = []struct { ` "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/eth/ethconfig" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/ethconfig" `, ` var ( @@ -1876,11 +1876,11 @@ var bindTests = []struct { ` "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/eth/ethconfig" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/ethconfig" `, ` var ( @@ -1928,11 +1928,11 @@ var bindTests = []struct { imports: ` "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/eth/ethconfig" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/ethconfig" `, tester: ` var ( @@ -2013,7 +2013,7 @@ func TestGolangBindings(t *testing.T) { t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out) } pwd, _ := os.Getwd() - replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/ethereum/go-ethereum@v0.0.0", "-replace", "github.com/ethereum/go-ethereum="+filepath.Join(pwd, "..", "..", "..")) // Repo root + replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/electroneum/electroneum-sc@v0.0.0", "-replace", "github.com/electroneum/electroneum-sc="+filepath.Join(pwd, "..", "..", "..")) // Repo root replacer.Dir = pkg if out, err := replacer.CombinedOutput(); err != nil { t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out) diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go index c9b001133..1a933a1f4 100644 --- a/accounts/abi/bind/template.go +++ b/accounts/abi/bind/template.go @@ -16,7 +16,7 @@ package bind -import "github.com/ethereum/go-ethereum/accounts/abi" +import "github.com/electroneum/electroneum-sc/accounts/abi" // tmplData is the data structure required to fill the binding template. type tmplData struct { @@ -92,12 +92,12 @@ import ( "strings" "errors" - 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" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" ) // Reference imports to suppress errors if they are not otherwise used. @@ -105,7 +105,7 @@ var ( _ = errors.New _ = big.NewInt _ = strings.NewReader - _ = ethereum.NotFound + _ = electroneum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup @@ -433,7 +433,7 @@ var ( 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 + sub electroneum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } diff --git a/accounts/abi/bind/util.go b/accounts/abi/bind/util.go index b931fbb04..5f758a9e1 100644 --- a/accounts/abi/bind/util.go +++ b/accounts/abi/bind/util.go @@ -21,10 +21,10 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" ) // WaitMined waits for tx to be mined on the blockchain. @@ -40,7 +40,7 @@ func WaitMined(ctx context.Context, b DeployBackend, tx *types.Transaction) (*ty return receipt, nil } - if errors.Is(err, ethereum.NotFound) { + if errors.Is(err, electroneum.NotFound) { logger.Trace("Transaction not yet mined") } else { logger.Trace("Receipt retrieval failed", "err", err) diff --git a/accounts/abi/bind/util_test.go b/accounts/abi/bind/util_test.go index 75fbc91ce..e1fb4daa7 100644 --- a/accounts/abi/bind/util_test.go +++ b/accounts/abi/bind/util_test.go @@ -23,12 +23,12 @@ import ( "testing" "time" - "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/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") diff --git a/accounts/abi/error.go b/accounts/abi/error.go index e564c10c2..ed5c5f7b4 100644 --- a/accounts/abi/error.go +++ b/accounts/abi/error.go @@ -22,8 +22,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) type Error struct { diff --git a/accounts/abi/event.go b/accounts/abi/event.go index b238a36d7..1bc0bcfc0 100644 --- a/accounts/abi/event.go +++ b/accounts/abi/event.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) // Event is an event potentially triggered by the EVM's LOG mechanism. The Event diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index 3332f8a07..17d04068c 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/accounts/abi/method.go b/accounts/abi/method.go index f69e3ee9b..a806c7c21 100644 --- a/accounts/abi/method.go +++ b/accounts/abi/method.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/crypto" ) // FunctionType represents different types of functions a contract might have. diff --git a/accounts/abi/pack.go b/accounts/abi/pack.go index 0cd91cb4f..e5faace5a 100644 --- a/accounts/abi/pack.go +++ b/accounts/abi/pack.go @@ -22,8 +22,8 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" ) // packBytesSlice packs the given bytes as [L, V] as the canonical representation diff --git a/accounts/abi/pack_test.go b/accounts/abi/pack_test.go index 5c7cb1cc1..e45ed1f69 100644 --- a/accounts/abi/pack_test.go +++ b/accounts/abi/pack_test.go @@ -27,7 +27,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // TestPack tests the general pack/unpack tests in packing_test.go diff --git a/accounts/abi/packing_test.go b/accounts/abi/packing_test.go index eae3b0df2..7b0d70c53 100644 --- a/accounts/abi/packing_test.go +++ b/accounts/abi/packing_test.go @@ -19,7 +19,7 @@ package abi import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) type packUnpackTest struct { diff --git a/accounts/abi/topics.go b/accounts/abi/topics.go index 360df7d5e..8a147194e 100644 --- a/accounts/abi/topics.go +++ b/accounts/abi/topics.go @@ -23,8 +23,8 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) // MakeTopics converts a filter query argument list into a filter topic set. diff --git a/accounts/abi/topics_test.go b/accounts/abi/topics_test.go index 30cf21d0b..801f99baf 100644 --- a/accounts/abi/topics_test.go +++ b/accounts/abi/topics_test.go @@ -21,8 +21,8 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) func TestMakeTopics(t *testing.T) { diff --git a/accounts/abi/type.go b/accounts/abi/type.go index fd75f586a..78ca2269e 100644 --- a/accounts/abi/type.go +++ b/accounts/abi/type.go @@ -26,7 +26,7 @@ import ( "unicode" "unicode/utf8" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // Type enumerator diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index 8c3aedca6..88fbff12e 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // typeWithoutStringer is a alias for the Type type which simply doesn't implement diff --git a/accounts/abi/unpack.go b/accounts/abi/unpack.go index 43cd6c645..cdd14eeeb 100644 --- a/accounts/abi/unpack.go +++ b/accounts/abi/unpack.go @@ -22,7 +22,7 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) var ( diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index bf40c301b..b12b737c7 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" "github.com/stretchr/testify/require" ) diff --git a/accounts/accounts.go b/accounts/accounts.go index 179a33c59..a6f7408da 100644 --- a/accounts/accounts.go +++ b/accounts/accounts.go @@ -21,10 +21,10 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" "golang.org/x/crypto/sha3" ) @@ -98,7 +98,7 @@ type Wallet interface { // // You can disable automatic account discovery by calling SelfDerive with a nil // chain state reader. - SelfDerive(bases []DerivationPath, chain ethereum.ChainStateReader) + SelfDerive(bases []DerivationPath, chain electroneum.ChainStateReader) // SignData requests the wallet to sign the hash of the given data // It looks up the account specified either solely via its address contained within, diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index e8274f9f0..4902e9c34 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" ) func TestTextHash(t *testing.T) { diff --git a/accounts/external/backend.go b/accounts/external/backend.go index e3f754eaf..a5bb25ba0 100644 --- a/accounts/external/backend.go +++ b/accounts/external/backend.go @@ -21,15 +21,15 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) type ExternalBackend struct { @@ -148,7 +148,7 @@ func (api *ExternalSigner) Derive(path accounts.DerivationPath, pin bool) (accou return accounts.Account{}, fmt.Errorf("operation not supported on external signers") } -func (api *ExternalSigner) SelfDerive(bases []accounts.DerivationPath, chain ethereum.ChainStateReader) { +func (api *ExternalSigner) SelfDerive(bases []accounts.DerivationPath, chain electroneum.ChainStateReader) { log.Error("operation SelfDerive not supported on external signers") } diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index a3ec6e9c5..5df35984b 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -28,9 +28,9 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" ) // Minimum amount of time between cache reloads. This limit applies if the platform does diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index fda0e5667..5fd731323 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -28,8 +28,8 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" ) var ( diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index b3ecf8946..c38731ed6 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -24,7 +24,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // fileCache is a cache of files seen during scan of keystore. diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 9b2ac1471..75b1a28e3 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -28,9 +28,9 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" "github.com/google/uuid" ) diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index 88dcfbeb6..b2d0c2fea 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -32,11 +32,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/event" ) var ( diff --git a/accounts/keystore/keystore_test.go b/accounts/keystore/keystore_test.go index 80c4d643e..08c0716ca 100644 --- a/accounts/keystore/keystore_test.go +++ b/accounts/keystore/keystore_test.go @@ -27,10 +27,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/event" ) var testSigData = make([]byte, 32) diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index 22772e931..b33f562e1 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -37,10 +37,10 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" "github.com/google/uuid" "golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/scrypt" @@ -120,7 +120,7 @@ func (ks keyStorePassphrase) StoreKey(filename string, key *Key, auth string) er "This indicates that the keystore is corrupted. \n" + "The corrupted file is stored at \n%v\n" + "Please file a ticket at:\n\n" + - "https://github.com/ethereum/go-ethereum/issues." + + "https://github.com/electroneum/electroneum-sc/issues." + "The error was : %s" //lint:ignore ST1005 This is a message for the user return fmt.Errorf(msg, tmpName, err) diff --git a/accounts/keystore/passphrase_test.go b/accounts/keystore/passphrase_test.go index b94fce8ed..a2c6513aa 100644 --- a/accounts/keystore/passphrase_test.go +++ b/accounts/keystore/passphrase_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) const ( diff --git a/accounts/keystore/plain.go b/accounts/keystore/plain.go index f62a133ce..f11b4a115 100644 --- a/accounts/keystore/plain.go +++ b/accounts/keystore/plain.go @@ -22,7 +22,7 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) type keyStorePlain struct { diff --git a/accounts/keystore/plain_test.go b/accounts/keystore/plain_test.go index 93165d5cd..ff28d321e 100644 --- a/accounts/keystore/plain_test.go +++ b/accounts/keystore/plain_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) func tmpKeyStoreIface(t *testing.T, encrypted bool) (dir string, ks keyStore) { diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index 0664dc2cd..99e336720 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,8 +25,8 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/crypto" "github.com/google/uuid" "golang.org/x/crypto/pbkdf2" ) diff --git a/accounts/keystore/wallet.go b/accounts/keystore/wallet.go index 1066095f6..000855196 100644 --- a/accounts/keystore/wallet.go +++ b/accounts/keystore/wallet.go @@ -19,10 +19,10 @@ package keystore import ( "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) // keystoreWallet implements the accounts.Wallet interface for the original @@ -77,7 +77,7 @@ func (w *keystoreWallet) Derive(path accounts.DerivationPath, pin bool) (account // SelfDerive implements accounts.Wallet, but is a noop for plain wallets since // there is no notion of hierarchical account derivation for plain keystore accounts. -func (w *keystoreWallet) SelfDerive(bases []accounts.DerivationPath, chain ethereum.ChainStateReader) { +func (w *keystoreWallet) SelfDerive(bases []accounts.DerivationPath, chain electroneum.ChainStateReader) { } // signHash attempts to sign the given hash with diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index ad176040d..cce1e782e 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -22,7 +22,7 @@ package keystore import ( "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "github.com/rjeczalik/notify" ) diff --git a/accounts/manager.go b/accounts/manager.go index 1e111d194..a35c87619 100644 --- a/accounts/manager.go +++ b/accounts/manager.go @@ -21,8 +21,8 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/event" ) // managerSubBufferSize determines how many incoming wallet events diff --git a/accounts/scwallet/hub.go b/accounts/scwallet/hub.go index f9dcf58e1..f5c1e825f 100644 --- a/accounts/scwallet/hub.go +++ b/accounts/scwallet/hub.go @@ -41,10 +41,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" pcsc "github.com/gballet/go-libpcsclite" ) diff --git a/accounts/scwallet/securechannel.go b/accounts/scwallet/securechannel.go index 10887a8b4..0b0cc1a91 100644 --- a/accounts/scwallet/securechannel.go +++ b/accounts/scwallet/securechannel.go @@ -26,7 +26,7 @@ import ( "crypto/sha512" "fmt" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/crypto" pcsc "github.com/gballet/go-libpcsclite" "golang.org/x/crypto/pbkdf2" "golang.org/x/text/unicode/norm" diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index 2a2b83bd1..bc0685fe6 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -33,12 +33,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" pcsc "github.com/gballet/go-libpcsclite" "github.com/status-im/keycard-go/derivationpath" ) @@ -119,11 +119,11 @@ type Wallet struct { session *Session // The secure communication session with the card log log.Logger // Contextual logger to tag the base with its id - deriveNextPaths []accounts.DerivationPath // Next derivation paths for account auto-discovery (multiple bases supported) - deriveNextAddrs []common.Address // Next derived account addresses for auto-discovery (multiple bases supported) - deriveChain ethereum.ChainStateReader // Blockchain state reader to discover used account with - deriveReq chan chan struct{} // Channel to request a self-derivation on - deriveQuit chan chan error // Channel to terminate the self-deriver with + deriveNextPaths []accounts.DerivationPath // Next derivation paths for account auto-discovery (multiple bases supported) + deriveNextAddrs []common.Address // Next derived account addresses for auto-discovery (multiple bases supported) + deriveChain electroneum.ChainStateReader // Blockchain state reader to discover used account with + deriveReq chan chan struct{} // Channel to request a self-derivation on + deriveQuit chan chan error // Channel to terminate the self-deriver with } // NewWallet constructs and returns a new Wallet instance. @@ -647,7 +647,7 @@ func (w *Wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Accoun // // You can disable automatic account discovery by calling SelfDerive with a nil // chain state reader. -func (w *Wallet) SelfDerive(bases []accounts.DerivationPath, chain ethereum.ChainStateReader) { +func (w *Wallet) SelfDerive(bases []accounts.DerivationPath, chain electroneum.ChainStateReader) { w.lock.Lock() defer w.lock.Unlock() diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 23be98a08..b6227c4af 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -23,9 +23,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" "github.com/karalabe/usb" ) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 3de3b4091..88e996cba 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -28,13 +28,13 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // ledgerOpcode is an enumeration encoding the supported Ledger opcodes. diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index c2182b88d..28d280949 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,12 +27,12 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/usbwallet/trezor" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/usbwallet/trezor" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" "github.com/golang/protobuf/proto" ) diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 382f3ddae..680c9aee2 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,12 +25,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" "github.com/karalabe/usb" ) @@ -85,11 +85,11 @@ type wallet struct { accounts []accounts.Account // List of derive accounts pinned on the hardware wallet paths map[common.Address]accounts.DerivationPath // Known derivation paths for signing operations - deriveNextPaths []accounts.DerivationPath // Next derivation paths for account auto-discovery (multiple bases supported) - deriveNextAddrs []common.Address // Next derived account addresses for auto-discovery (multiple bases supported) - deriveChain ethereum.ChainStateReader // Blockchain state reader to discover used account with - deriveReq chan chan struct{} // Channel to request a self-derivation on - deriveQuit chan chan error // Channel to terminate the self-deriver with + deriveNextPaths []accounts.DerivationPath // Next derivation paths for account auto-discovery (multiple bases supported) + deriveNextAddrs []common.Address // Next derived account addresses for auto-discovery (multiple bases supported) + deriveChain electroneum.ChainStateReader // Blockchain state reader to discover used account with + deriveReq chan chan struct{} // Channel to request a self-derivation on + deriveQuit chan chan error // Channel to terminate the self-deriver with healthQuit chan chan error @@ -505,7 +505,7 @@ func (w *wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Accoun // // You can disable automatic account discovery by calling SelfDerive with a nil // chain state reader. -func (w *wallet) SelfDerive(bases []accounts.DerivationPath, chain ethereum.ChainStateReader) { +func (w *wallet) SelfDerive(bases []accounts.DerivationPath, chain electroneum.ChainStateReader) { w.stateLock.Lock() defer w.stateLock.Unlock() diff --git a/build/ci.go b/build/ci.go index 14598401f..4eaaa1f1c 100644 --- a/build/ci.go +++ b/build/ci.go @@ -58,10 +58,10 @@ import ( "time" "github.com/cespare/cp" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto/signify" - "github.com/ethereum/go-ethereum/internal/build" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto/signify" + "github.com/electroneum/electroneum-sc/internal/build" + "github.com/electroneum/electroneum-sc/params" ) var ( @@ -1012,7 +1012,7 @@ func doAndroidArchive(cmdline []string) { build.MustRun(tc.Go("mod", "download")) // Build the Android archive and Maven resources - build.MustRun(gomobileTool("bind", "-ldflags", "-s -w", "--target", "android", "--javapkg", "org.ethereum", "-v", "github.com/ethereum/go-ethereum/mobile")) + build.MustRun(gomobileTool("bind", "-ldflags", "-s -w", "--target", "android", "--javapkg", "org.ethereum", "-v", "github.com/electroneum/electroneum-sc/mobile")) if *local { // If we're building locally, copy bundle to build dir and skip Maven @@ -1137,7 +1137,7 @@ func doXCodeFramework(cmdline []string) { build.MustRun(tc.Install(GOBIN, "golang.org/x/mobile/cmd/gomobile", "golang.org/x/mobile/cmd/gobind")) // Build the iOS XCode framework - bind := gomobileTool("bind", "-ldflags", "-s -w", "--target", "ios", "-v", "github.com/ethereum/go-ethereum/mobile") + bind := gomobileTool("bind", "-ldflags", "-s -w", "--target", "ios", "-v", "github.com/electroneum/electroneum-sc/mobile") if *local { // If we're building locally, use the build folder and stop afterwards diff --git a/build/deb/ethereum/deb.control b/build/deb/ethereum/deb.control index 3b759f2d0..4676da4e5 100644 --- a/build/deb/ethereum/deb.control +++ b/build/deb/ethereum/deb.control @@ -5,8 +5,8 @@ Maintainer: {{.Author}} Build-Depends: debhelper (>= 8.0.0), {{.GoBootPackage}} Standards-Version: 3.9.5 Homepage: https://ethereum.org -Vcs-Git: https://github.com/ethereum/go-ethereum.git -Vcs-Browser: https://github.com/ethereum/go-ethereum +Vcs-Git: https://github.com/electroneum/electroneum-sc.git +Vcs-Browser: https://github.com/electroneum/electroneum-sc Package: {{.Name}} Architecture: any diff --git a/build/mvn.pom b/build/mvn.pom index 7670246ba..66dcc2226 100644 --- a/build/mvn.pom +++ b/build/mvn.pom @@ -11,7 +11,7 @@ Android Ethereum Client Android port of the go-ethereum libraries and node - https://github.com/ethereum/go-ethereum + https://github.com/electroneum/electroneum-sc 2015 @@ -48,10 +48,10 @@ GitHub Issues - https://github.com/ethereum/go-ethereum/issues/ + https://github.com/electroneum/electroneum-sc/issues/ - https://github.com/ethereum/go-ethereum + https://github.com/electroneum/electroneum-sc diff --git a/build/nsis.install.nsh b/build/nsis.install.nsh index 9b73148a4..43d0324c2 100644 --- a/build/nsis.install.nsh +++ b/build/nsis.install.nsh @@ -3,9 +3,9 @@ InstallDir "$InstDir" OutFile "${OUTPUTFILE}" # set through command line arguments # Links for "Add/Remove Programs" -!define HELPURL "https://github.com/ethereum/go-ethereum/issues" -!define UPDATEURL "https://github.com/ethereum/go-ethereum/releases" -!define ABOUTURL "https://github.com/ethereum/go-ethereum#ethereum-go" +!define HELPURL "https://github.com/electroneum/electroneum-sc/issues" +!define UPDATEURL "https://github.com/electroneum/electroneum-sc/releases" +!define ABOUTURL "https://github.com/electroneum/electroneum-sc#ethereum-go" !define /date NOW "%Y%m%d" PageEx license diff --git a/build/pod.podspec b/build/pod.podspec index 2c14c280c..f94f55b54 100644 --- a/build/pod.podspec +++ b/build/pod.podspec @@ -2,12 +2,12 @@ Pod::Spec.new do |spec| spec.name = 'Geth' spec.version = '{{.Version}}' spec.license = { :type => 'GNU Lesser General Public License, Version 3.0' } - spec.homepage = 'https://github.com/ethereum/go-ethereum' + spec.homepage = 'https://github.com/electroneum/electroneum-sc' spec.authors = { {{range .Contributors}} '{{.Name}}' => '{{.Email}}',{{end}} } spec.summary = 'iOS Ethereum Client' - spec.source = { :git => 'https://github.com/ethereum/go-ethereum.git', :commit => '{{.Commit}}' } + spec.source = { :git => 'https://github.com/electroneum/electroneum-sc.git', :commit => '{{.Commit}}' } spec.platform = :ios spec.ios.deployment_target = '9.0' diff --git a/build/update-license.go b/build/update-license.go index 5bad996cc..173ab1ac1 100644 --- a/build/update-license.go +++ b/build/update-license.go @@ -79,7 +79,7 @@ var ( "signer/rules/deps", // skip special licenses - "crypto/secp256k1", // Relicensed to BSD-3 via https://github.com/ethereum/go-ethereum/pull/17225 + "crypto/secp256k1", // Relicensed to BSD-3 via https://github.com/electroneum/electroneum-sc/pull/17225 } // paths with this prefix are licensed as GPL. all other files are LGPL. diff --git a/cmd/abidump/main.go b/cmd/abidump/main.go index ae1ac6413..afc5b6035 100644 --- a/cmd/abidump/main.go +++ b/cmd/abidump/main.go @@ -23,8 +23,8 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/ethereum/go-ethereum/signer/fourbyte" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/signer/fourbyte" ) func init() { diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index 8f255143c..c8f3af566 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -24,12 +24,12 @@ import ( "regexp" "strings" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common/compiler" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/flags" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common/compiler" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/flags" + "github.com/electroneum/electroneum-sc/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 036b968ef..b382e1c0f 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -24,13 +24,13 @@ import ( "net" "os" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/discover" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nat" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) func main() { diff --git a/cmd/checkpoint-admin/README.md b/cmd/checkpoint-admin/README.md index 43e3785ec..8f4c97772 100644 --- a/cmd/checkpoint-admin/README.md +++ b/cmd/checkpoint-admin/README.md @@ -18,7 +18,7 @@ However, from a security perspective, the most critical step in a synchronizatio #### Hardcoded checkpoint -There are several hardcoded checkpoints in the [source code](https://github.com/ethereum/go-ethereum/blob/master/params/config.go#L38) of the go-ethereum project. These checkpoints are updated by go-ethereum developers when new versions of software are released. Because light client users trust Geth developers to some extent, hardcoded checkpoints in the code can also be considered correct. +There are several hardcoded checkpoints in the [source code](https://github.com/electroneum/electroneum-sc/blob/master/params/config.go#L38) of the go-ethereum project. These checkpoints are updated by go-ethereum developers when new versions of software are released. Because light client users trust Geth developers to some extent, hardcoded checkpoints in the code can also be considered correct. #### Checkpoint oracle @@ -35,7 +35,7 @@ Checkpoint-admin is a command line tool designed for checkpoint oracle. Users ca #### Install ```shell -go get github.com/ethereum/go-ethereum/cmd/checkpoint-admin +go get github.com/electroneum/electroneum-sc/cmd/checkpoint-admin ``` #### Deploy @@ -66,7 +66,7 @@ checkpoint-admin sign --clef --signer --signer --index --hash --oracle ``` -*CHECKPOINT_HASH is obtained based on this [calculation method](https://github.com/ethereum/go-ethereum/blob/master/params/config.go#L251).* +*CHECKPOINT_HASH is obtained based on this [calculation method](https://github.com/electroneum/electroneum-sc/blob/master/params/config.go#L251).* #### Publish diff --git a/cmd/checkpoint-admin/common.go b/cmd/checkpoint-admin/common.go index 05a45dfbf..44fea77cb 100644 --- a/cmd/checkpoint-admin/common.go +++ b/cmd/checkpoint-admin/common.go @@ -19,15 +19,15 @@ package main import ( "strconv" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/external" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/external" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/exec.go b/cmd/checkpoint-admin/exec.go index 352a96d9e..852095230 100644 --- a/cmd/checkpoint-admin/exec.go +++ b/cmd/checkpoint-admin/exec.go @@ -25,17 +25,17 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle/contract" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/main.go b/cmd/checkpoint-admin/main.go index 0fb553214..a257004f8 100644 --- a/cmd/checkpoint-admin/main.go +++ b/cmd/checkpoint-admin/main.go @@ -22,9 +22,9 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/internal/flags" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common/fdlimit" + "github.com/electroneum/electroneum-sc/internal/flags" + "github.com/electroneum/electroneum-sc/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/status.go b/cmd/checkpoint-admin/status.go index f613501eb..f06de9436 100644 --- a/cmd/checkpoint-admin/status.go +++ b/cmd/checkpoint-admin/status.go @@ -19,8 +19,8 @@ package main import ( "fmt" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/clef/main.go b/cmd/clef/main.go index b1ffa38ff..6c053e057 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -34,25 +34,25 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/internal/flags" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/ethereum/go-ethereum/signer/fourbyte" - "github.com/ethereum/go-ethereum/signer/rules" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/internal/flags" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" + "github.com/electroneum/electroneum-sc/signer/core" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/signer/fourbyte" + "github.com/electroneum/electroneum-sc/signer/rules" + "github.com/electroneum/electroneum-sc/signer/storage" "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" "gopkg.in/urfave/cli.v1" @@ -794,7 +794,7 @@ func checkFile(filename string) error { } // Check the unix permission bits // However, on windows, we cannot use the unix perm-bits, see - // https://github.com/ethereum/go-ethereum/issues/20123 + // https://github.com/electroneum/electroneum-sc/issues/20123 if runtime.GOOS != "windows" && info.Mode().Perm()&0377 != 0 { return fmt.Errorf("file (%v) has insecure file permissions (%v)", filename, info.Mode().String()) } diff --git a/cmd/clef/tutorial.md b/cmd/clef/tutorial.md index 3ea662b5d..cc1257a77 100644 --- a/cmd/clef/tutorial.md +++ b/cmd/clef/tutorial.md @@ -100,9 +100,9 @@ or {"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"Request denied"}} ``` -Apart from listing accounts, you can also *request* creating a new account; signing transactions and data; and recovering signatures. You can find the available methods in the Clef [External API Spec](https://github.com/ethereum/go-ethereum/tree/master/cmd/clef#external-api-1) and the [External API Changelog](https://github.com/ethereum/go-ethereum/blob/master/cmd/clef/extapi_changelog.md). +Apart from listing accounts, you can also *request* creating a new account; signing transactions and data; and recovering signatures. You can find the available methods in the Clef [External API Spec](https://github.com/electroneum/electroneum-sc/tree/master/cmd/clef#external-api-1) and the [External API Changelog](https://github.com/electroneum/electroneum-sc/blob/master/cmd/clef/extapi_changelog.md). -*Note, the number of things you can do from the External API is deliberately small, since we want to limit the power of remote calls by as much as possible! Clef has an [Internal API](https://github.com/ethereum/go-ethereum/tree/master/cmd/clef#ui-api-1) too for the UI (User Interface) which is much richer and can support custom interfaces on top. But that's out of scope here.* +*Note, the number of things you can do from the External API is deliberately small, since we want to limit the power of remote calls by as much as possible! Clef has an [Internal API](https://github.com/electroneum/electroneum-sc/tree/master/cmd/clef#ui-api-1) too for the UI (User Interface) which is much richer and can support custom interfaces on top. But that's out of scope here.* ## Automatic rules @@ -288,7 +288,7 @@ t=2019-07-01T15:52:23+0300 lvl=info msg=SignData api=signer type=request meta t=2019-07-01T15:52:23+0300 lvl=info msg=SignData api=signer type=response data= error="Request denied" ``` -For more details on writing automatic rules, please see the [rules spec](https://github.com/ethereum/go-ethereum/blob/master/cmd/clef/rules.md). +For more details on writing automatic rules, please see the [rules spec](https://github.com/electroneum/electroneum-sc/blob/master/cmd/clef/rules.md). ## Geth integration diff --git a/cmd/devp2p/crawl.go b/cmd/devp2p/crawl.go index 9259b4894..e319b3812 100644 --- a/cmd/devp2p/crawl.go +++ b/cmd/devp2p/crawl.go @@ -19,8 +19,8 @@ package main import ( "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" ) type crawler struct { diff --git a/cmd/devp2p/discv4cmd.go b/cmd/devp2p/discv4cmd.go index 5e4c5ed5d..b3183a325 100644 --- a/cmd/devp2p/discv4cmd.go +++ b/cmd/devp2p/discv4cmd.go @@ -22,12 +22,12 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/cmd/devp2p/internal/v4test" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/discover" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/cmd/devp2p/internal/v4test" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/discover" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/discv5cmd.go b/cmd/devp2p/discv5cmd.go index 873d41e70..3993a9495 100644 --- a/cmd/devp2p/discv5cmd.go +++ b/cmd/devp2p/discv5cmd.go @@ -20,9 +20,9 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/cmd/devp2p/internal/v5test" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/electroneum/electroneum-sc/cmd/devp2p/internal/v5test" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/p2p/discover" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/dns_cloudflare.go b/cmd/devp2p/dns_cloudflare.go index d67aaea1a..d8c672dc8 100644 --- a/cmd/devp2p/dns_cloudflare.go +++ b/cmd/devp2p/dns_cloudflare.go @@ -22,8 +22,8 @@ import ( "strings" "github.com/cloudflare/cloudflare-go" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/dnsdisc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/dns_route53.go b/cmd/devp2p/dns_route53.go index 1d4f975dd..c68afd31f 100644 --- a/cmd/devp2p/dns_route53.go +++ b/cmd/devp2p/dns_route53.go @@ -30,8 +30,8 @@ import ( "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/route53" "github.com/aws/aws-sdk-go-v2/service/route53/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/dnsdisc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/dnscmd.go b/cmd/devp2p/dnscmd.go index 21138efdc..b11cccf23 100644 --- a/cmd/devp2p/dnscmd.go +++ b/cmd/devp2p/dnscmd.go @@ -24,11 +24,11 @@ import ( "path/filepath" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/p2p/dnsdisc" + "github.com/electroneum/electroneum-sc/p2p/enode" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/enrcmd.go b/cmd/devp2p/enrcmd.go index 2a8f9d508..5fc1c00a1 100644 --- a/cmd/devp2p/enrcmd.go +++ b/cmd/devp2p/enrcmd.go @@ -27,9 +27,9 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/internal/ethtest/chain.go b/cmd/devp2p/internal/ethtest/chain.go index c1d696b40..021964db1 100644 --- a/cmd/devp2p/internal/ethtest/chain.go +++ b/cmd/devp2p/internal/ethtest/chain.go @@ -25,12 +25,12 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) type Chain struct { diff --git a/cmd/devp2p/internal/ethtest/chain_test.go b/cmd/devp2p/internal/ethtest/chain_test.go index 0f232b150..a9f335eec 100644 --- a/cmd/devp2p/internal/ethtest/chain_test.go +++ b/cmd/devp2p/internal/ethtest/chain_test.go @@ -21,8 +21,8 @@ import ( "strconv" "testing" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/p2p" "github.com/stretchr/testify/assert" ) diff --git a/cmd/devp2p/internal/ethtest/helpers.go b/cmd/devp2p/internal/ethtest/helpers.go index df754d6ce..9830426fd 100644 --- a/cmd/devp2p/internal/ethtest/helpers.go +++ b/cmd/devp2p/internal/ethtest/helpers.go @@ -24,13 +24,13 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/rlpx" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/rlpx" ) var ( diff --git a/cmd/devp2p/internal/ethtest/large.go b/cmd/devp2p/internal/ethtest/large.go index 40626c206..dd8277346 100644 --- a/cmd/devp2p/internal/ethtest/large.go +++ b/cmd/devp2p/internal/ethtest/large.go @@ -20,9 +20,9 @@ import ( "crypto/rand" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" ) // largeNumber returns a very large big.Int. diff --git a/cmd/devp2p/internal/ethtest/snap.go b/cmd/devp2p/internal/ethtest/snap.go index 2bfd29c75..d652e0112 100644 --- a/cmd/devp2p/internal/ethtest/snap.go +++ b/cmd/devp2p/internal/ethtest/snap.go @@ -22,12 +22,12 @@ import ( "fmt" "math/rand" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/cmd/devp2p/internal/ethtest/snapTypes.go b/cmd/devp2p/internal/ethtest/snapTypes.go index e18cd5925..7cb6f1d67 100644 --- a/cmd/devp2p/internal/ethtest/snapTypes.go +++ b/cmd/devp2p/internal/ethtest/snapTypes.go @@ -16,7 +16,7 @@ package ethtest -import "github.com/ethereum/go-ethereum/eth/protocols/snap" +import "github.com/electroneum/electroneum-sc/eth/protocols/snap" // GetAccountRange represents an account range query. type GetAccountRange snap.GetAccountRangePacket diff --git a/cmd/devp2p/internal/ethtest/suite.go b/cmd/devp2p/internal/ethtest/suite.go index 4ddd65b95..4df22f1bb 100644 --- a/cmd/devp2p/internal/ethtest/suite.go +++ b/cmd/devp2p/internal/ethtest/suite.go @@ -19,10 +19,10 @@ package ethtest import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // Suite represents a structure used to test a node's conformance diff --git a/cmd/devp2p/internal/ethtest/suite_test.go b/cmd/devp2p/internal/ethtest/suite_test.go index 924c80d01..a7927370e 100644 --- a/cmd/devp2p/internal/ethtest/suite_test.go +++ b/cmd/devp2p/internal/ethtest/suite_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" ) var ( diff --git a/cmd/devp2p/internal/ethtest/transaction.go b/cmd/devp2p/internal/ethtest/transaction.go index 5d722f417..4dda4ce17 100644 --- a/cmd/devp2p/internal/ethtest/transaction.go +++ b/cmd/devp2p/internal/ethtest/transaction.go @@ -22,11 +22,11 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/params" ) //var faucetAddr = common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7") diff --git a/cmd/devp2p/internal/ethtest/types.go b/cmd/devp2p/internal/ethtest/types.go index e92b54394..2cafd6ee4 100644 --- a/cmd/devp2p/internal/ethtest/types.go +++ b/cmd/devp2p/internal/ethtest/types.go @@ -21,10 +21,10 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/rlpx" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/rlpx" + "github.com/electroneum/electroneum-sc/rlp" ) type Message interface { diff --git a/cmd/devp2p/internal/v4test/discv4tests.go b/cmd/devp2p/internal/v4test/discv4tests.go index 5f340ed94..6b0b3d058 100644 --- a/cmd/devp2p/internal/v4test/discv4tests.go +++ b/cmd/devp2p/internal/v4test/discv4tests.go @@ -23,9 +23,9 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/p2p/discover/v4wire" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/p2p/discover/v4wire" ) const ( diff --git a/cmd/devp2p/internal/v4test/framework.go b/cmd/devp2p/internal/v4test/framework.go index 928659418..d65a8b795 100644 --- a/cmd/devp2p/internal/v4test/framework.go +++ b/cmd/devp2p/internal/v4test/framework.go @@ -22,9 +22,9 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/discover/v4wire" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/discover/v4wire" + "github.com/electroneum/electroneum-sc/p2p/enode" ) const waitTime = 300 * time.Millisecond diff --git a/cmd/devp2p/internal/v5test/discv5tests.go b/cmd/devp2p/internal/v5test/discv5tests.go index 7866498f7..b0e55e9cb 100644 --- a/cmd/devp2p/internal/v5test/discv5tests.go +++ b/cmd/devp2p/internal/v5test/discv5tests.go @@ -22,10 +22,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/p2p/discover/v5wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/p2p/discover/v5wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) // Suite is the discv5 test suite. diff --git a/cmd/devp2p/internal/v5test/framework.go b/cmd/devp2p/internal/v5test/framework.go index 9eac37520..655805686 100644 --- a/cmd/devp2p/internal/v5test/framework.go +++ b/cmd/devp2p/internal/v5test/framework.go @@ -24,11 +24,11 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/discover/v5wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/discover/v5wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) // readError represents an error during packet reading. diff --git a/cmd/devp2p/keycmd.go b/cmd/devp2p/keycmd.go index 869b8c2a4..706d62d63 100644 --- a/cmd/devp2p/keycmd.go +++ b/cmd/devp2p/keycmd.go @@ -20,8 +20,8 @@ import ( "fmt" "net" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/main.go b/cmd/devp2p/main.go index 4a4e905a4..fbd835eeb 100644 --- a/cmd/devp2p/main.go +++ b/cmd/devp2p/main.go @@ -22,9 +22,9 @@ import ( "path/filepath" "sort" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/internal/debug" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/nodeset.go b/cmd/devp2p/nodeset.go index 33c39f4b9..e7e62c29c 100644 --- a/cmd/devp2p/nodeset.go +++ b/cmd/devp2p/nodeset.go @@ -24,8 +24,8 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/p2p/enode" ) const jsonIndent = " " diff --git a/cmd/devp2p/nodesetcmd.go b/cmd/devp2p/nodesetcmd.go index 2a296109b..1737801d6 100644 --- a/cmd/devp2p/nodesetcmd.go +++ b/cmd/devp2p/nodesetcmd.go @@ -25,10 +25,10 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/rlpxcmd.go b/cmd/devp2p/rlpxcmd.go index 6557a239d..7400be4f7 100644 --- a/cmd/devp2p/rlpxcmd.go +++ b/cmd/devp2p/rlpxcmd.go @@ -20,12 +20,12 @@ import ( "fmt" "net" - "github.com/ethereum/go-ethereum/cmd/devp2p/internal/ethtest" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/rlpx" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/cmd/devp2p/internal/ethtest" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/rlpx" + "github.com/electroneum/electroneum-sc/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/runtest.go b/cmd/devp2p/runtest.go index 4168f8555..4da58ada0 100644 --- a/cmd/devp2p/runtest.go +++ b/cmd/devp2p/runtest.go @@ -19,9 +19,9 @@ package main import ( "os" - "github.com/ethereum/go-ethereum/cmd/devp2p/internal/v4test" - "github.com/ethereum/go-ethereum/internal/utesting" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/cmd/devp2p/internal/v4test" + "github.com/electroneum/electroneum-sc/internal/utesting" + "github.com/electroneum/electroneum-sc/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/accountcmd.go b/cmd/etn-sc/accountcmd.go index 0b7d58e88..48816414e 100644 --- a/cmd/etn-sc/accountcmd.go +++ b/cmd/etn-sc/accountcmd.go @@ -20,11 +20,11 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/accountcmd_test.go b/cmd/etn-sc/accountcmd_test.go index 0c22e8c9b..e36ce4723 100644 --- a/cmd/etn-sc/accountcmd_test.go +++ b/cmd/etn-sc/accountcmd_test.go @@ -216,7 +216,7 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could `) } -// https://github.com/ethereum/go-ethereum/issues/1785 +// https://github.com/electroneum/electroneum-sc/issues/1785 func TestUnlockFlagMultiIndex(t *testing.T) { geth := runMinimalGeth(t, "--port", "0", "--ipcdisable", "--datadir", tmpDatadirWithKeystore(t), "--unlock", "f466859ead1932d743d622cb74fc058882e8648a", "--unlock", "0,2", "js", "testdata/empty.js") diff --git a/cmd/etn-sc/chaincmd.go b/cmd/etn-sc/chaincmd.go index 5e1dfe725..290ddd042 100644 --- a/cmd/etn-sc/chaincmd.go +++ b/cmd/etn-sc/chaincmd.go @@ -26,18 +26,18 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/node" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/node" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/config.go b/cmd/etn-sc/config.go index 13ad343f0..6e43ee8b7 100644 --- a/cmd/etn-sc/config.go +++ b/cmd/etn-sc/config.go @@ -27,18 +27,18 @@ import ( "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts/external" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/accounts/usbwallet" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/external" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/accounts/scwallet" + "github.com/electroneum/electroneum-sc/accounts/usbwallet" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" "github.com/naoina/toml" ) diff --git a/cmd/etn-sc/consolecmd.go b/cmd/etn-sc/consolecmd.go index e51edff88..944876d25 100644 --- a/cmd/etn-sc/consolecmd.go +++ b/cmd/etn-sc/consolecmd.go @@ -21,10 +21,10 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/console" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/consolecmd_test.go b/cmd/etn-sc/consolecmd_test.go index 8b859cbf2..7fa87155e 100644 --- a/cmd/etn-sc/consolecmd_test.go +++ b/cmd/etn-sc/consolecmd_test.go @@ -26,7 +26,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/cmd/etn-sc/dao_test.go b/cmd/etn-sc/dao_test.go index d8340a3fd..c0601735e 100644 --- a/cmd/etn-sc/dao_test.go +++ b/cmd/etn-sc/dao_test.go @@ -22,9 +22,9 @@ import ( "path/filepath" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/params" ) // Genesis block for nodes which don't care about the DAO fork (i.e. not configured) diff --git a/cmd/etn-sc/dbcmd.go b/cmd/etn-sc/dbcmd.go index ace2849c9..b028d4c55 100644 --- a/cmd/etn-sc/dbcmd.go +++ b/cmd/etn-sc/dbcmd.go @@ -28,17 +28,17 @@ import ( "syscall" "time" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/trie" "github.com/olekukonko/tablewriter" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/les_test.go b/cmd/etn-sc/les_test.go index 73cc23e66..e0c237b01 100644 --- a/cmd/etn-sc/les_test.go +++ b/cmd/etn-sc/les_test.go @@ -27,8 +27,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rpc" ) type gethrpc struct { diff --git a/cmd/etn-sc/main.go b/cmd/etn-sc/main.go index 2945d175e..795471c20 100644 --- a/cmd/etn-sc/main.go +++ b/cmd/etn-sc/main.go @@ -25,24 +25,24 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/internal/flags" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/node" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/internal/debug" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/internal/flags" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/node" // Force-load the tracer engines to trigger registration - _ "github.com/ethereum/go-ethereum/eth/tracers/js" - _ "github.com/ethereum/go-ethereum/eth/tracers/native" + _ "github.com/electroneum/electroneum-sc/eth/tracers/js" + _ "github.com/electroneum/electroneum-sc/eth/tracers/native" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/misccmd.go b/cmd/etn-sc/misccmd.go index b347d31d9..cbf11ec60 100644 --- a/cmd/etn-sc/misccmd.go +++ b/cmd/etn-sc/misccmd.go @@ -23,9 +23,9 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/run_test.go b/cmd/etn-sc/run_test.go index 0588623ac..13f9a77fd 100644 --- a/cmd/etn-sc/run_test.go +++ b/cmd/etn-sc/run_test.go @@ -24,8 +24,8 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/internal/cmdtest" + "github.com/electroneum/electroneum-sc/rpc" ) type testgeth struct { diff --git a/cmd/etn-sc/snapshot.go b/cmd/etn-sc/snapshot.go index 286eeed8e..2ed1a928b 100644 --- a/cmd/etn-sc/snapshot.go +++ b/cmd/etn-sc/snapshot.go @@ -23,17 +23,17 @@ import ( "os" "time" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/state/pruner" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/state/pruner" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/usage.go b/cmd/etn-sc/usage.go index 731992ff7..79a0c93f0 100644 --- a/cmd/etn-sc/usage.go +++ b/cmd/etn-sc/usage.go @@ -22,9 +22,9 @@ import ( "io" "sort" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/internal/flags" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/internal/debug" + "github.com/electroneum/electroneum-sc/internal/flags" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etn-sc/version_check.go b/cmd/etn-sc/version_check.go index 6eaedf373..67f4700db 100644 --- a/cmd/etn-sc/version_check.go +++ b/cmd/etn-sc/version_check.go @@ -26,7 +26,7 @@ import ( "regexp" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "github.com/jedisct1/go-minisign" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etnkey/changepassword.go b/cmd/etnkey/changepassword.go index bd8745f6d..d2cd75e9a 100644 --- a/cmd/etnkey/changepassword.go +++ b/cmd/etnkey/changepassword.go @@ -21,8 +21,8 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etnkey/generate.go b/cmd/etnkey/generate.go index 1b70b130b..b5dd584c8 100644 --- a/cmd/etnkey/generate.go +++ b/cmd/etnkey/generate.go @@ -22,9 +22,9 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/crypto" "github.com/google/uuid" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etnkey/inspect.go b/cmd/etnkey/inspect.go index efcaecd38..a17f25a2d 100644 --- a/cmd/etnkey/inspect.go +++ b/cmd/etnkey/inspect.go @@ -21,9 +21,9 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etnkey/main.go b/cmd/etnkey/main.go index 6db39174c..4688cd824 100644 --- a/cmd/etnkey/main.go +++ b/cmd/etnkey/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/internal/flags" + "github.com/electroneum/electroneum-sc/internal/flags" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etnkey/message.go b/cmd/etnkey/message.go index 1a58eeb53..3690a449f 100644 --- a/cmd/etnkey/message.go +++ b/cmd/etnkey/message.go @@ -21,10 +21,10 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/etnkey/run_test.go b/cmd/etnkey/run_test.go index 6006f6b5b..4ce8a23b9 100644 --- a/cmd/etnkey/run_test.go +++ b/cmd/etnkey/run_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" + "github.com/electroneum/electroneum-sc/internal/cmdtest" ) type testEthkey struct { diff --git a/cmd/etnkey/utils.go b/cmd/etnkey/utils.go index b81e70913..10c5d1abd 100644 --- a/cmd/etnkey/utils.go +++ b/cmd/etnkey/utils.go @@ -22,8 +22,8 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/compiler.go b/cmd/evm/compiler.go index 880f995f0..ae8877baf 100644 --- a/cmd/evm/compiler.go +++ b/cmd/evm/compiler.go @@ -21,7 +21,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" + "github.com/electroneum/electroneum-sc/cmd/evm/internal/compiler" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 918b01376..5284f67f5 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,7 +22,7 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/core/asm" + "github.com/electroneum/electroneum-sc/core/asm" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/internal/compiler/compiler.go b/cmd/evm/internal/compiler/compiler.go index 54981b669..15289ae50 100644 --- a/cmd/evm/internal/compiler/compiler.go +++ b/cmd/evm/internal/compiler/compiler.go @@ -20,7 +20,7 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/core/asm" + "github.com/electroneum/electroneum-sc/core/asm" ) func Compile(fn string, src []byte, debug bool) (string, error) { diff --git a/cmd/evm/internal/t8ntool/block.go b/cmd/evm/internal/t8ntool/block.go index 9839afd5f..bac930972 100644 --- a/cmd/evm/internal/t8ntool/block.go +++ b/cmd/evm/internal/t8ntool/block.go @@ -24,15 +24,15 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/internal/t8ntool/execution.go b/cmd/evm/internal/t8ntool/execution.go index 83a002534..71605737c 100644 --- a/cmd/evm/internal/t8ntool/execution.go +++ b/cmd/evm/internal/t8ntool/execution.go @@ -21,21 +21,21 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "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/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/cmd/evm/internal/t8ntool/flags.go b/cmd/evm/internal/t8ntool/flags.go index de666f115..fab837ecc 100644 --- a/cmd/evm/internal/t8ntool/flags.go +++ b/cmd/evm/internal/t8ntool/flags.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/tests" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/tests" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/internal/t8ntool/gen_header.go b/cmd/evm/internal/t8ntool/gen_header.go index 196e49dd7..292a4a215 100644 --- a/cmd/evm/internal/t8ntool/gen_header.go +++ b/cmd/evm/internal/t8ntool/gen_header.go @@ -7,10 +7,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" ) var _ = (*headerMarshaling)(nil) diff --git a/cmd/evm/internal/t8ntool/gen_stenv.go b/cmd/evm/internal/t8ntool/gen_stenv.go index a6d774cda..36f1e1eb9 100644 --- a/cmd/evm/internal/t8ntool/gen_stenv.go +++ b/cmd/evm/internal/t8ntool/gen_stenv.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" ) var _ = (*stEnvMarshaling)(nil) diff --git a/cmd/evm/internal/t8ntool/transaction.go b/cmd/evm/internal/t8ntool/transaction.go index 6f1c964ad..6aacb0f16 100644 --- a/cmd/evm/internal/t8ntool/transaction.go +++ b/cmd/evm/internal/t8ntool/transaction.go @@ -24,14 +24,14 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/tests" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/tests" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/internal/t8ntool/transition.go b/cmd/evm/internal/t8ntool/transition.go index b254baa99..ff0374a75 100644 --- a/cmd/evm/internal/t8ntool/transition.go +++ b/cmd/evm/internal/t8ntool/transition.go @@ -26,18 +26,18 @@ import ( "path" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "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/eth/tracers/logger" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/tests" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/tests" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 2f404d48e..f47e60ac5 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,9 +22,9 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/cmd/evm/internal/t8ntool" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/internal/flags" + "github.com/electroneum/electroneum-sc/cmd/evm/internal/t8ntool" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/internal/flags" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 5680c07a4..12264e077 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -28,17 +28,17 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/core/vm/runtime" - "github.com/ethereum/go-ethereum/eth/tracers/logger" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/cmd/evm/internal/compiler" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/core/vm/runtime" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index fcdac33ee..9363eca5f 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -22,11 +22,11 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers/logger" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/tests" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/tests" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/t8n_test.go b/cmd/evm/t8n_test.go index 92c01398b..9d8536181 100644 --- a/cmd/evm/t8n_test.go +++ b/cmd/evm/t8n_test.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/cmd/evm/internal/t8ntool" - "github.com/ethereum/go-ethereum/internal/cmdtest" + "github.com/electroneum/electroneum-sc/cmd/evm/internal/t8ntool" + "github.com/electroneum/electroneum-sc/internal/cmdtest" ) func TestMain(m *testing.M) { diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index e5862ea85..249f4d9a5 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -39,23 +39,23 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/ethstats" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/cmd/utils" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/ethstats" + "github.com/electroneum/electroneum-sc/les" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nat" + "github.com/electroneum/electroneum-sc/params" "github.com/gorilla/websocket" ) @@ -466,7 +466,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) { id = username default: //lint:ignore ST1005 This error is to be displayed in the browser - err = errors.New("Something funky happened, please open an issue at https://github.com/ethereum/go-ethereum/issues") + err = errors.New("Something funky happened, please open an issue at https://github.com/electroneum/electroneum-sc/issues") } if err != nil { if err = sendError(wsconn, err); err != nil { diff --git a/cmd/faucet/faucet_test.go b/cmd/faucet/faucet_test.go index 58a1f22b5..2b6ca3734 100644 --- a/cmd/faucet/faucet_test.go +++ b/cmd/faucet/faucet_test.go @@ -19,7 +19,7 @@ package main import ( "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func TestFacebook(t *testing.T) { diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index eaa457200..bfbd38bd6 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,12 +45,12 @@ import ( "strings" "text/tabwriter" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/genesis.go b/cmd/puppeth/genesis.go index ef1f977bf..f5ad9eb29 100644 --- a/cmd/puppeth/genesis.go +++ b/cmd/puppeth/genesis.go @@ -22,13 +22,13 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - math2 "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + math2 "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) // alethGenesisSpec represents the genesis specification format used by the diff --git a/cmd/puppeth/genesis_test.go b/cmd/puppeth/genesis_test.go index 605c1070a..9ed359d75 100644 --- a/cmd/puppeth/genesis_test.go +++ b/cmd/puppeth/genesis_test.go @@ -25,7 +25,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/core" + "github.com/electroneum/electroneum-sc/core" ) // Tests the go-ethereum to Aleth chainspec conversion for the Stureby testnet. diff --git a/cmd/puppeth/module.go b/cmd/puppeth/module.go index b6a029a01..b8b378371 100644 --- a/cmd/puppeth/module.go +++ b/cmd/puppeth/module.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) var ( diff --git a/cmd/puppeth/module_dashboard.go b/cmd/puppeth/module_dashboard.go index 35cfada66..68e322b81 100644 --- a/cmd/puppeth/module_dashboard.go +++ b/cmd/puppeth/module_dashboard.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // dashboardContent is the actual dashboard HTML content to serve up when users @@ -202,7 +202,7 @@ var dashboardContent = `

Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for Java based Android projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from Android too.

Under the hood the Android library is backed by a go-ethereum light node, meaning that given a not-too-old Android device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.


-

The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in Mobile: Introduction – Android archive. +

The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in Mobile: Introduction – Android archive.

Before connecting to the Ethereum network, download the {{.GethGenesis}} genesis json file and either store it in your Android project as a resource file you can access, or save it as a string in a variable. You're going to need to initialize your client.

Inside your Java code you can now import the geth archive and connect to Ethereum:

import org.ethereum.geth.*;
@@ -233,7 +233,7 @@ node.start();

Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for ObjC/Swift based iOS projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from iOS too.

Under the hood the iOS library is backed by a go-ethereum light node, meaning that given a not-too-old Apple device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.


-

Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in Mobile: Introduction – iOS framework. +

Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in Mobile: Introduction – iOS framework.

Before connecting to the Ethereum network, download the {{.GethGenesis}} genesis json file and either store it in your iOS project as a resource file you can access, or save it as a string in a variable. You're going to need to initialize your client.

Inside your Swift code you can now import the geth framework and connect to Ethereum (ObjC should be analogous):

import Geth
@@ -365,7 +365,7 @@ try! node?.start();

Puppeth is a tool to aid you in creating a new Ethereum network down to the genesis block, bootnodes, signers, ethstats server, crypto faucet, block explorer, dashboard and more; without the hassle that it would normally entail to manually configure all these services one by one.

Puppeth uses ssh to dial in to remote servers, and builds its network components out of docker containers using docker-compose. The user is guided through the process via a command line wizard that does the heavy lifting and topology configuration automatically behind the scenes.


-

Puppeth is distributed as part of the Geth & Tools bundles, but can also be installed separately via:

go get github.com/ethereum/go-ethereum/cmd/puppeth

+

Puppeth is distributed as part of the Geth & Tools bundles, but can also be installed separately via:

go get github.com/electroneum/electroneum-sc/cmd/puppeth


Copyright 2017. The go-ethereum Authors.

diff --git a/cmd/puppeth/module_ethstats.go b/cmd/puppeth/module_ethstats.go index abed4db5f..7feff5e14 100644 --- a/cmd/puppeth/module_ethstats.go +++ b/cmd/puppeth/module_ethstats.go @@ -25,7 +25,7 @@ import ( "strings" "text/template" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // ethstatsDockerfile is the Dockerfile required to build an ethstats backend diff --git a/cmd/puppeth/module_explorer.go b/cmd/puppeth/module_explorer.go index 1165f70fc..772a68edc 100644 --- a/cmd/puppeth/module_explorer.go +++ b/cmd/puppeth/module_explorer.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // explorerDockerfile is the Dockerfile required to run a block explorer. diff --git a/cmd/puppeth/module_faucet.go b/cmd/puppeth/module_faucet.go index 88cb80ae4..d8157f812 100644 --- a/cmd/puppeth/module_faucet.go +++ b/cmd/puppeth/module_faucet.go @@ -26,8 +26,8 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" ) // faucetDockerfile is the Dockerfile required to build a faucet container to diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go index 1b1ae61ff..3c4b610a1 100644 --- a/cmd/puppeth/module_nginx.go +++ b/cmd/puppeth/module_nginx.go @@ -24,7 +24,7 @@ import ( "path/filepath" "strconv" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // nginxDockerfile is theis the Dockerfile required to build an nginx reverse- diff --git a/cmd/puppeth/module_node.go b/cmd/puppeth/module_node.go index 3ea96870d..cab5006f3 100644 --- a/cmd/puppeth/module_node.go +++ b/cmd/puppeth/module_node.go @@ -26,8 +26,8 @@ import ( "strings" "text/template" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" ) // nodeDockerfile is the Dockerfile required to run an Ethereum node. diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index c3de5f936..d7c454859 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index 95a36f327..a21cecc2c 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -27,7 +27,7 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "golang.org/x/crypto/ssh/terminal" diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index f7aafd4dd..be1d2f60d 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -29,10 +29,10 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/log" "github.com/peterh/liner" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/puppeth/wizard_dashboard.go b/cmd/puppeth/wizard_dashboard.go index b64bdca0b..28ff8dc0d 100644 --- a/cmd/puppeth/wizard_dashboard.go +++ b/cmd/puppeth/wizard_dashboard.go @@ -19,7 +19,7 @@ package main import ( "fmt" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // deployDashboard queries the user for various input on deploying a web-service diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index 95cab9da4..9ed9bdfdb 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -20,7 +20,7 @@ import ( "fmt" "sort" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // deployEthstats queries the user for various input on deploying an ethstats diff --git a/cmd/puppeth/wizard_explorer.go b/cmd/puppeth/wizard_explorer.go index 1df9cbc0f..67bdc40fe 100644 --- a/cmd/puppeth/wizard_explorer.go +++ b/cmd/puppeth/wizard_explorer.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // deployExplorer creates a new block explorer based on some user input. diff --git a/cmd/puppeth/wizard_faucet.go b/cmd/puppeth/wizard_faucet.go index 65d4e8b8e..6c1021bd4 100644 --- a/cmd/puppeth/wizard_faucet.go +++ b/cmd/puppeth/wizard_faucet.go @@ -20,8 +20,8 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/log" ) // deployFaucet queries the user for various input on deploying a faucet, after diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index cb056ab13..3f82f156c 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -28,10 +28,10 @@ import ( "path/filepath" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) // makeGenesis creates a new genesis struct based on some user input. diff --git a/cmd/puppeth/wizard_intro.go b/cmd/puppeth/wizard_intro.go index adac943cc..2a99a7c19 100644 --- a/cmd/puppeth/wizard_intro.go +++ b/cmd/puppeth/wizard_intro.go @@ -23,7 +23,7 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // makeWizard creates and returns a new puppeth wizard. diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 7b5671e6d..895277471 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/log" "github.com/olekukonko/tablewriter" ) diff --git a/cmd/puppeth/wizard_network.go b/cmd/puppeth/wizard_network.go index d015e06eb..f164e6131 100644 --- a/cmd/puppeth/wizard_network.go +++ b/cmd/puppeth/wizard_network.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // manageServers displays a list of servers the user can disconnect from, and an diff --git a/cmd/puppeth/wizard_nginx.go b/cmd/puppeth/wizard_nginx.go index 8397b7fd5..02b4ca47e 100644 --- a/cmd/puppeth/wizard_nginx.go +++ b/cmd/puppeth/wizard_nginx.go @@ -19,7 +19,7 @@ package main import ( "fmt" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // ensureVirtualHost checks whether a reverse-proxy is running on the specified diff --git a/cmd/puppeth/wizard_node.go b/cmd/puppeth/wizard_node.go index 2bae33214..eae5ce890 100644 --- a/cmd/puppeth/wizard_node.go +++ b/cmd/puppeth/wizard_node.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" ) // deployNode creates a new node configuration based on some user input. diff --git a/cmd/rlpdump/main.go b/cmd/rlpdump/main.go index 9c0af0124..02da18d49 100644 --- a/cmd/rlpdump/main.go +++ b/cmd/rlpdump/main.go @@ -28,8 +28,8 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/cmd/rlpdump/rlpdump_test.go b/cmd/rlpdump/rlpdump_test.go index 899beef32..38c3cb720 100644 --- a/cmd/rlpdump/rlpdump_test.go +++ b/cmd/rlpdump/rlpdump_test.go @@ -22,8 +22,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) func TestRoundtrip(t *testing.T) { diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 47ad3b22c..86e6a6122 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -30,17 +30,17 @@ import ( "syscall" "time" - "github.com/ethereum/go-ethereum/common" - "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/ethconfig" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/internal/debug" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index e5be085a5..3bc35f572 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -26,7 +26,7 @@ import ( "path" "strings" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common/math" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/utils/export_test.go b/cmd/utils/export_test.go index 445e3fac3..2b26e7380 100644 --- a/cmd/utils/export_test.go +++ b/cmd/utils/export_test.go @@ -23,8 +23,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/rlp" ) // TestExport does basic sanity checks on the export/import functionality diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 410af9320..e40df6e95 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -32,41 +32,41 @@ import ( "text/template" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/consensus" - "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/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - ethcatalyst "github.com/ethereum/go-ethereum/eth/catalyst" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/eth/tracers" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/remotedb" - "github.com/ethereum/go-ethereum/ethstats" - "github.com/ethereum/go-ethereum/graphql" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/internal/flags" - "github.com/ethereum/go-ethereum/les" - lescatalyst "github.com/ethereum/go-ethereum/les/catalyst" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/metrics/exp" - "github.com/ethereum/go-ethereum/metrics/influxdb" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/fdlimit" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + ethcatalyst "github.com/electroneum/electroneum-sc/eth/catalyst" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/eth/tracers" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/remotedb" + "github.com/electroneum/electroneum-sc/ethstats" + "github.com/electroneum/electroneum-sc/graphql" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/internal/flags" + "github.com/electroneum/electroneum-sc/les" + lescatalyst "github.com/electroneum/electroneum-sc/les/catalyst" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/metrics/exp" + "github.com/electroneum/electroneum-sc/metrics/influxdb" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nat" + "github.com/electroneum/electroneum-sc/p2p/netutil" + "github.com/electroneum/electroneum-sc/params" pcsclite "github.com/gballet/go-libpcsclite" gopsutil "github.com/shirou/gopsutil/mem" "gopkg.in/urfave/cli.v1" diff --git a/cmd/utils/flags_legacy.go b/cmd/utils/flags_legacy.go index a0f64f609..5e4ad8612 100644 --- a/cmd/utils/flags_legacy.go +++ b/cmd/utils/flags_legacy.go @@ -19,7 +19,7 @@ package utils import ( "fmt" - "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/electroneum/electroneum-sc/eth/ethconfig" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/utils/prompt.go b/cmd/utils/prompt.go index f513e3818..24dda00ab 100644 --- a/cmd/utils/prompt.go +++ b/cmd/utils/prompt.go @@ -20,7 +20,7 @@ package utils import ( "fmt" - "github.com/ethereum/go-ethereum/console/prompt" + "github.com/electroneum/electroneum-sc/console/prompt" ) // GetPassPhrase displays the given text(prompt) to the user and requests some textual diff --git a/common/bitutil/compress_test.go b/common/bitutil/compress_test.go index 13a13011d..a3d946a7d 100644 --- a/common/bitutil/compress_test.go +++ b/common/bitutil/compress_test.go @@ -21,7 +21,7 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // Tests that data bitset encoding and decoding works and is bijective. diff --git a/common/bytes.go b/common/bytes.go index d1f5c6c99..5d27e5833 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -21,7 +21,7 @@ import ( "encoding/hex" "errors" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // FromHex returns the bytes represented by the hexadecimal string s. diff --git a/common/debug.go b/common/debug.go index 28c52b4a9..3ede67614 100644 --- a/common/debug.go +++ b/common/debug.go @@ -26,7 +26,7 @@ import ( // Report gives off a warning requesting the user to submit an issue to the github tracker. func Report(extra ...interface{}) { - fmt.Fprintln(os.Stderr, "You've encountered a sought after, hard to reproduce bug. Please report this to the developers <3 https://github.com/ethereum/go-ethereum/issues") + fmt.Fprintln(os.Stderr, "You've encountered a sought after, hard to reproduce bug. Please report this to the developers <3 https://github.com/electroneum/electroneum-sc/issues") fmt.Fprintln(os.Stderr, extra...) _, file, line, _ := runtime.Caller(1) diff --git a/common/hexutil/json_example_test.go b/common/hexutil/json_example_test.go index 80180d918..894d42d5e 100644 --- a/common/hexutil/json_example_test.go +++ b/common/hexutil/json_example_test.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" ) type MyType [5]byte diff --git a/common/math/big_test.go b/common/math/big_test.go index f896ec65b..1c770d998 100644 --- a/common/math/big_test.go +++ b/common/math/big_test.go @@ -22,7 +22,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func TestHexOrDecimal256(t *testing.T) { diff --git a/common/prque/lazyqueue.go b/common/prque/lazyqueue.go index 37c2f3bd4..70d7159f0 100644 --- a/common/prque/lazyqueue.go +++ b/common/prque/lazyqueue.go @@ -20,7 +20,7 @@ import ( "container/heap" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) // LazyQueue is a priority queue data structure where priorities can change over diff --git a/common/prque/lazyqueue_test.go b/common/prque/lazyqueue_test.go index 9a831d628..67d8a27b1 100644 --- a/common/prque/lazyqueue_test.go +++ b/common/prque/lazyqueue_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) const ( diff --git a/common/types.go b/common/types.go index 55293d2e2..bf02f01eb 100644 --- a/common/types.go +++ b/common/types.go @@ -28,7 +28,7 @@ import ( "reflect" "strings" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" "golang.org/x/crypto/sha3" ) diff --git a/consensus/beacon/consensus.go b/consensus/beacon/consensus.go index 8e22e8d9b..d0f9d2c3c 100644 --- a/consensus/beacon/consensus.go +++ b/consensus/beacon/consensus.go @@ -21,14 +21,14 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" + "github.com/electroneum/electroneum-sc/trie" ) // Proof-of-stake protocol constants. diff --git a/consensus/clique/api.go b/consensus/clique/api.go index cb270d321..b9ede1056 100644 --- a/consensus/clique/api.go +++ b/consensus/clique/api.go @@ -20,12 +20,12 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" ) // API is a user facing RPC API to allow controlling the signer and voting diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 06a052b5c..2f7ef5e72 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -27,20 +27,20 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" + "github.com/electroneum/electroneum-sc/trie" lru "github.com/hashicorp/golang-lru" "golang.org/x/crypto/sha3" ) diff --git a/consensus/clique/clique_test.go b/consensus/clique/clique_test.go index 1bd32acd3..48383d3ff 100644 --- a/consensus/clique/clique_test.go +++ b/consensus/clique/clique_test.go @@ -20,13 +20,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // This test case is a repro of an annoying bug that took us forever to catch. diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 4ee731a90..fde428ad6 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -22,11 +22,11 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" lru "github.com/hashicorp/golang-lru" ) diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index 094868ca7..f6f9866d6 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -23,13 +23,13 @@ import ( "sort" "testing" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // testerAccountPool is a pool to maintain currently active tester accounts, @@ -364,7 +364,7 @@ func TestClique(t *testing.T) { failure: errRecentlySigned, }, { // Recent signatures should not reset on checkpoint blocks imported in a new - // batch (https://github.com/ethereum/go-ethereum/issues/17593). Whilst this + // batch (https://github.com/electroneum/electroneum-sc/issues/17593). Whilst this // seems overly specific and weird, it was a Rinkeby consensus split. epoch: 3, signers: []string{"A", "B", "C"}, diff --git a/consensus/consensus.go b/consensus/consensus.go index f317245d5..904476417 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -20,13 +20,13 @@ package consensus import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) // ChainHeaderReader defines a small collection of methods needed to access the local diff --git a/consensus/ethash/algorithm.go b/consensus/ethash/algorithm.go index 065e60b90..638ae604f 100644 --- a/consensus/ethash/algorithm.go +++ b/consensus/ethash/algorithm.go @@ -27,10 +27,10 @@ import ( "time" "unsafe" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" "golang.org/x/crypto/sha3" ) diff --git a/consensus/ethash/algorithm_test.go b/consensus/ethash/algorithm_test.go index 88769d277..491323cfd 100644 --- a/consensus/ethash/algorithm_test.go +++ b/consensus/ethash/algorithm_test.go @@ -25,9 +25,9 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" ) // prepare converts an ethash cache or dataset from a byte stream into the internal diff --git a/consensus/ethash/api.go b/consensus/ethash/api.go index f4d3802e0..22d4bb229 100644 --- a/consensus/ethash/api.go +++ b/consensus/ethash/api.go @@ -19,9 +19,9 @@ package ethash import ( "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" ) var errEthashStopped = errors.New("ethash stopped") diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 6a93fead2..3aaba0322 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -25,15 +25,15 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/consensus/ethash/consensus_test.go b/consensus/ethash/consensus_test.go index bca424af3..498ab7420 100644 --- a/consensus/ethash/consensus_test.go +++ b/consensus/ethash/consensus_test.go @@ -25,10 +25,10 @@ import ( "path/filepath" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) type diffTest struct { diff --git a/consensus/ethash/difficulty.go b/consensus/ethash/difficulty.go index 66a18059c..63e1df4c8 100644 --- a/consensus/ethash/difficulty.go +++ b/consensus/ethash/difficulty.go @@ -19,7 +19,7 @@ package ethash import ( "math/big" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" "github.com/holiman/uint256" ) diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 9e9caa808..65cf8075b 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -34,10 +34,10 @@ import ( "unsafe" "github.com/edsrzf/mmap-go" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/rpc" "github.com/hashicorp/golang-lru/simplelru" ) diff --git a/consensus/ethash/ethash_test.go b/consensus/ethash/ethash_test.go index eb6bad962..eed2124fc 100644 --- a/consensus/ethash/ethash_test.go +++ b/consensus/ethash/ethash_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" ) // Tests that ethash works correctly in test mode. @@ -54,7 +54,7 @@ func TestTestMode(t *testing.T) { } // This test checks that cache lru logic doesn't crash under load. -// It reproduces https://github.com/ethereum/go-ethereum/issues/14943 +// It reproduces https://github.com/electroneum/electroneum-sc/issues/14943 func TestCacheFileEvict(t *testing.T) { // TODO: t.TempDir fails to remove the directory on Windows // \AppData\Local\Temp\1\TestCacheFileEvict2179435125\001\cache-R23-0000000000000000: Access is denied. diff --git a/consensus/ethash/sealer.go b/consensus/ethash/sealer.go index 6fa60ef6a..71f7ceb2d 100644 --- a/consensus/ethash/sealer.go +++ b/consensus/ethash/sealer.go @@ -30,10 +30,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/types" ) const ( diff --git a/consensus/ethash/sealer_test.go b/consensus/ethash/sealer_test.go index e338f7529..d247983af 100644 --- a/consensus/ethash/sealer_test.go +++ b/consensus/ethash/sealer_test.go @@ -26,10 +26,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" ) // Tests whether remote HTTP servers are correctly notified of new work. diff --git a/consensus/istanbul/backend.go b/consensus/istanbul/backend.go index 5ded62701..b950487b6 100644 --- a/consensus/istanbul/backend.go +++ b/consensus/istanbul/backend.go @@ -20,8 +20,8 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/event" ) // Backend provides application specific functions for Istanbul core diff --git a/consensus/istanbul/backend/api.go b/consensus/istanbul/backend/api.go index 8d157de77..62af933c4 100644 --- a/consensus/istanbul/backend/api.go +++ b/consensus/istanbul/backend/api.go @@ -19,11 +19,11 @@ package backend import ( "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rpc" ) // API is a user facing RPC API to dump Istanbul state diff --git a/consensus/istanbul/backend/backend.go b/consensus/istanbul/backend/backend.go index 07052f057..82e0cd900 100644 --- a/consensus/istanbul/backend/backend.go +++ b/consensus/istanbul/backend/backend.go @@ -22,20 +22,20 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - qbftcore "github.com/ethereum/go-ethereum/consensus/istanbul/core" - qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/engine" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + qbftcore "github.com/electroneum/electroneum-sc/consensus/istanbul/core" + qbftengine "github.com/electroneum/electroneum-sc/consensus/istanbul/engine" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" lru "github.com/hashicorp/golang-lru" ) diff --git a/consensus/istanbul/backend/backend_test.go b/consensus/istanbul/backend/backend_test.go index 64ba9c7d8..bfb8819ba 100644 --- a/consensus/istanbul/backend/backend_test.go +++ b/consensus/istanbul/backend/backend_test.go @@ -25,12 +25,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) func TestSign(t *testing.T) { diff --git a/consensus/istanbul/backend/engine.go b/consensus/istanbul/backend/engine.go index 11367ecce..bf7aaeafc 100644 --- a/consensus/istanbul/backend/engine.go +++ b/consensus/istanbul/backend/engine.go @@ -21,16 +21,16 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" ) const ( diff --git a/consensus/istanbul/backend/engine_test.go b/consensus/istanbul/backend/engine_test.go index a18128015..d6be250e1 100644 --- a/consensus/istanbul/backend/engine_test.go +++ b/consensus/istanbul/backend/engine_test.go @@ -24,16 +24,16 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/consensus/istanbul/testutils" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul/testutils" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" ) func newBlockchainFromConfig(genesis *core.Genesis, nodeKeys []*ecdsa.PrivateKey, cfg istanbul.Config) (*core.BlockChain, *Backend) { diff --git a/consensus/istanbul/backend/handler.go b/consensus/istanbul/backend/handler.go index b3813a8a9..2846185e5 100644 --- a/consensus/istanbul/backend/handler.go +++ b/consensus/istanbul/backend/handler.go @@ -23,12 +23,12 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/p2p" lru "github.com/hashicorp/golang-lru" ) diff --git a/consensus/istanbul/backend/handler_test.go b/consensus/istanbul/backend/handler_test.go index 6d2e41296..e6511b8b4 100644 --- a/consensus/istanbul/backend/handler_test.go +++ b/consensus/istanbul/backend/handler_test.go @@ -23,12 +23,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) func tryUntilMessageIsHandled(backend *Backend, arbitraryAddress common.Address, arbitraryP2PMessage p2p.Msg) (handled bool, err error) { diff --git a/consensus/istanbul/backend/snapshot.go b/consensus/istanbul/backend/snapshot.go index 2ddf54443..a1c2d656c 100644 --- a/consensus/istanbul/backend/snapshot.go +++ b/consensus/istanbul/backend/snapshot.go @@ -20,10 +20,10 @@ import ( "bytes" "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/ethdb" ) const ( diff --git a/consensus/istanbul/backend/snapshot_test.go b/consensus/istanbul/backend/snapshot_test.go index 1bcdfe875..cad0d4d45 100644 --- a/consensus/istanbul/backend/snapshot_test.go +++ b/consensus/istanbul/backend/snapshot_test.go @@ -23,15 +23,15 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - qbftengine "github.com/ethereum/go-ethereum/consensus/istanbul/engine" - "github.com/ethereum/go-ethereum/consensus/istanbul/testutils" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + qbftengine "github.com/electroneum/electroneum-sc/consensus/istanbul/engine" + "github.com/electroneum/electroneum-sc/consensus/istanbul/testutils" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) type testerVote struct { diff --git a/consensus/istanbul/common/constants.go b/consensus/istanbul/common/constants.go index 6ec3375fa..ab44c7c9a 100644 --- a/consensus/istanbul/common/constants.go +++ b/consensus/istanbul/common/constants.go @@ -3,8 +3,8 @@ package istanbulcommon import ( "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" ) var ( diff --git a/consensus/istanbul/common/utils.go b/consensus/istanbul/common/utils.go index d92005922..5c03d3ae1 100644 --- a/consensus/istanbul/common/utils.go +++ b/consensus/istanbul/common/utils.go @@ -1,8 +1,8 @@ package istanbulcommon import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) // GetSignatureAddress gets the signer address from the signature diff --git a/consensus/istanbul/core.go b/consensus/istanbul/core.go index 9f57256ba..ca8a32a2d 100644 --- a/consensus/istanbul/core.go +++ b/consensus/istanbul/core.go @@ -1,6 +1,6 @@ package istanbul -import "github.com/ethereum/go-ethereum/common" +import "github.com/electroneum/electroneum-sc/common" type Core interface { Start() error diff --git a/consensus/istanbul/core/backlog.go b/consensus/istanbul/core/backlog.go index a8e0bcf97..d38926db3 100644 --- a/consensus/istanbul/core/backlog.go +++ b/consensus/istanbul/core/backlog.go @@ -17,8 +17,8 @@ package core import ( - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) diff --git a/consensus/istanbul/core/commit.go b/consensus/istanbul/core/commit.go index fc26d2509..329fb6b4c 100644 --- a/consensus/istanbul/core/commit.go +++ b/consensus/istanbul/core/commit.go @@ -17,10 +17,10 @@ package core import ( - "github.com/ethereum/go-ethereum/common/hexutil" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/hexutil" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) // broadcastCommit is called when receiving quorum of PREPARE message diff --git a/consensus/istanbul/core/core.go b/consensus/istanbul/core/core.go index 7c19e495a..a9d1ec1b9 100644 --- a/consensus/istanbul/core/core.go +++ b/consensus/istanbul/core/core.go @@ -22,13 +22,13 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - metrics "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + metrics "github.com/electroneum/electroneum-sc/metrics" "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) diff --git a/consensus/istanbul/core/events.go b/consensus/istanbul/core/events.go index 733d1a033..f6d00d1fd 100644 --- a/consensus/istanbul/core/events.go +++ b/consensus/istanbul/core/events.go @@ -17,8 +17,8 @@ package core import ( - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" ) type backlogEvent struct { diff --git a/consensus/istanbul/core/final_committed.go b/consensus/istanbul/core/final_committed.go index a0cfa85d6..7231c1ac4 100644 --- a/consensus/istanbul/core/final_committed.go +++ b/consensus/istanbul/core/final_committed.go @@ -16,7 +16,7 @@ package core -import "github.com/ethereum/go-ethereum/common" +import "github.com/electroneum/electroneum-sc/common" func (c *core) handleFinalCommitted() error { c.currentLogger(true, nil).Info("IBFT: handle final committed") diff --git a/consensus/istanbul/core/handler.go b/consensus/istanbul/core/handler.go index 65d765aa6..37496b18c 100644 --- a/consensus/istanbul/core/handler.go +++ b/consensus/istanbul/core/handler.go @@ -20,11 +20,11 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // Start implements core.Engine.Start diff --git a/consensus/istanbul/core/justification.go b/consensus/istanbul/core/justification.go index 5dac6b5a7..cfbc2aa35 100644 --- a/consensus/istanbul/core/justification.go +++ b/consensus/istanbul/core/justification.go @@ -4,10 +4,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/log" ) // Returns true if the `proposal` is justified by the set `roundChangeMessages` of ROUND-CHANGE messages diff --git a/consensus/istanbul/core/justification_test.go b/consensus/istanbul/core/justification_test.go index d598beb42..d519c558a 100644 --- a/consensus/istanbul/core/justification_test.go +++ b/consensus/istanbul/core/justification_test.go @@ -7,12 +7,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) // Tests combinations of justifications that evaluate to true. diff --git a/consensus/istanbul/core/prepare.go b/consensus/istanbul/core/prepare.go index 023525fc6..718aa63a6 100644 --- a/consensus/istanbul/core/prepare.go +++ b/consensus/istanbul/core/prepare.go @@ -17,9 +17,9 @@ package core import ( - "github.com/ethereum/go-ethereum/common/hexutil" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/hexutil" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/rlp" ) // broadcastPrepare is called after receiving PRE-PREPARE from proposer node diff --git a/consensus/istanbul/core/preprepare.go b/consensus/istanbul/core/preprepare.go index 3e1cff26c..124cfd04b 100644 --- a/consensus/istanbul/core/preprepare.go +++ b/consensus/istanbul/core/preprepare.go @@ -19,10 +19,10 @@ package core import ( "time" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/rlp" ) // sendPreprepareMsg is called either diff --git a/consensus/istanbul/core/qbft_msg_set.go b/consensus/istanbul/core/qbft_msg_set.go index 8f0890807..ef866a169 100644 --- a/consensus/istanbul/core/qbft_msg_set.go +++ b/consensus/istanbul/core/qbft_msg_set.go @@ -23,10 +23,10 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/rlp" ) // Construct a new message set to accumulate messages for given sequence/view number. diff --git a/consensus/istanbul/core/request.go b/consensus/istanbul/core/request.go index 0cc12c0c0..3e8759eb0 100644 --- a/consensus/istanbul/core/request.go +++ b/consensus/istanbul/core/request.go @@ -17,7 +17,7 @@ package core import ( - "github.com/ethereum/go-ethereum/consensus/istanbul" + "github.com/electroneum/electroneum-sc/consensus/istanbul" ) // handleRequest is called by proposer in reaction to `miner.Seal()` diff --git a/consensus/istanbul/core/roundchange.go b/consensus/istanbul/core/roundchange.go index cf17d669d..3004598e8 100644 --- a/consensus/istanbul/core/roundchange.go +++ b/consensus/istanbul/core/roundchange.go @@ -21,12 +21,12 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) // broadcastNextRoundChange sends the ROUND CHANGE message with current round + 1 diff --git a/consensus/istanbul/core/roundstate.go b/consensus/istanbul/core/roundstate.go index 9d667a661..eb706b34d 100644 --- a/consensus/istanbul/core/roundstate.go +++ b/consensus/istanbul/core/roundstate.go @@ -20,9 +20,9 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" ) // newRoundState creates a new roundState instance with the given view and validatorSet diff --git a/consensus/istanbul/core/types.go b/consensus/istanbul/core/types.go index ffacb02ef..e097773d9 100644 --- a/consensus/istanbul/core/types.go +++ b/consensus/istanbul/core/types.go @@ -19,9 +19,9 @@ package core import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - qbfttypes "github.com/ethereum/go-ethereum/consensus/istanbul/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + qbfttypes "github.com/electroneum/electroneum-sc/consensus/istanbul/types" ) type State uint64 diff --git a/consensus/istanbul/engine.go b/consensus/istanbul/engine.go index 45f90c880..ffbebee2d 100644 --- a/consensus/istanbul/engine.go +++ b/consensus/istanbul/engine.go @@ -4,10 +4,10 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" ) type Engine interface { diff --git a/consensus/istanbul/engine/apply_extra.go b/consensus/istanbul/engine/apply_extra.go index eded39fad..975d21e98 100644 --- a/consensus/istanbul/engine/apply_extra.go +++ b/consensus/istanbul/engine/apply_extra.go @@ -1,6 +1,6 @@ package qbftengine -import "github.com/ethereum/go-ethereum/core/types" +import "github.com/electroneum/electroneum-sc/core/types" type ApplyQBFTExtra func(*types.QBFTExtra) error diff --git a/consensus/istanbul/engine/engine.go b/consensus/istanbul/engine/engine.go index a931c1559..5ddd10b6e 100644 --- a/consensus/istanbul/engine/engine.go +++ b/consensus/istanbul/engine/engine.go @@ -5,15 +5,15 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/consensus/istanbul/validator" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul/validator" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/consensus/istanbul/engine/engine_test.go b/consensus/istanbul/engine/engine_test.go index 458c021a0..99f71ea1c 100644 --- a/consensus/istanbul/engine/engine_test.go +++ b/consensus/istanbul/engine/engine_test.go @@ -6,10 +6,10 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/core/types" ) func TestPrepareExtra(t *testing.T) { diff --git a/consensus/istanbul/testutils/genesis.go b/consensus/istanbul/testutils/genesis.go index 1024e6220..a19f14600 100644 --- a/consensus/istanbul/testutils/genesis.go +++ b/consensus/istanbul/testutils/genesis.go @@ -4,13 +4,13 @@ import ( "bytes" "crypto/ecdsa" - "github.com/ethereum/go-ethereum/common" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) func Genesis(validators []common.Address) *core.Genesis { diff --git a/consensus/istanbul/types.go b/consensus/istanbul/types.go index 86b586a2d..8449379ea 100644 --- a/consensus/istanbul/types.go +++ b/consensus/istanbul/types.go @@ -21,9 +21,9 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) // Proposal supports retrieving height and serialized block to be used during Istanbul consensus. diff --git a/consensus/istanbul/types/commit.go b/consensus/istanbul/types/commit.go index fcc1ab948..12e8107b0 100644 --- a/consensus/istanbul/types/commit.go +++ b/consensus/istanbul/types/commit.go @@ -4,8 +4,8 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" ) // A QBFT COMMIT message. diff --git a/consensus/istanbul/types/common.go b/consensus/istanbul/types/common.go index d9d28a079..c001ad845 100644 --- a/consensus/istanbul/types/common.go +++ b/consensus/istanbul/types/common.go @@ -3,8 +3,8 @@ package qbfttypes import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" ) // Data that is common to all QBFT messages. Used for composition. diff --git a/consensus/istanbul/types/decode.go b/consensus/istanbul/types/decode.go index 89ecf046c..040ca9523 100644 --- a/consensus/istanbul/types/decode.go +++ b/consensus/istanbul/types/decode.go @@ -1,8 +1,8 @@ package qbfttypes import ( - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/rlp" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/rlp" ) func Decode(code uint64, data []byte) (QBFTMessage, error) { diff --git a/consensus/istanbul/types/message.go b/consensus/istanbul/types/message.go index 33412b548..bd65dfe72 100644 --- a/consensus/istanbul/types/message.go +++ b/consensus/istanbul/types/message.go @@ -1,8 +1,8 @@ package qbfttypes import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" ) // QBFT message codes diff --git a/consensus/istanbul/types/prepare.go b/consensus/istanbul/types/prepare.go index 86ad4c29a..fca3c9ad4 100644 --- a/consensus/istanbul/types/prepare.go +++ b/consensus/istanbul/types/prepare.go @@ -5,8 +5,8 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" ) // A QBFT PREPARE message. diff --git a/consensus/istanbul/types/preprepare.go b/consensus/istanbul/types/preprepare.go index 18d1672ea..e85762ae3 100644 --- a/consensus/istanbul/types/preprepare.go +++ b/consensus/istanbul/types/preprepare.go @@ -5,9 +5,9 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) type Preprepare struct { diff --git a/consensus/istanbul/types/roundchange.go b/consensus/istanbul/types/roundchange.go index 630475eba..d1257fa59 100644 --- a/consensus/istanbul/types/roundchange.go +++ b/consensus/istanbul/types/roundchange.go @@ -6,12 +6,12 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulcommon "github.com/ethereum/go-ethereum/consensus/istanbul/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulcommon "github.com/electroneum/electroneum-sc/consensus/istanbul/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // ROUND-CHANGE diff --git a/consensus/istanbul/utils.go b/consensus/istanbul/utils.go index e622c4290..ad705e736 100644 --- a/consensus/istanbul/utils.go +++ b/consensus/istanbul/utils.go @@ -17,10 +17,10 @@ package istanbul import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/consensus/istanbul/validator.go b/consensus/istanbul/validator.go index cbefcecc0..f3171ddd1 100644 --- a/consensus/istanbul/validator.go +++ b/consensus/istanbul/validator.go @@ -21,7 +21,7 @@ import ( "sort" "strings" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) type Validator interface { diff --git a/consensus/istanbul/validator/default.go b/consensus/istanbul/validator/default.go index 4b0a4e6b1..41a5d279d 100644 --- a/consensus/istanbul/validator/default.go +++ b/consensus/istanbul/validator/default.go @@ -21,8 +21,8 @@ import ( "reflect" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" ) type defaultValidator struct { diff --git a/consensus/istanbul/validator/default_test.go b/consensus/istanbul/validator/default_test.go index c6291e6cc..97a61b999 100644 --- a/consensus/istanbul/validator/default_test.go +++ b/consensus/istanbul/validator/default_test.go @@ -22,9 +22,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + "github.com/electroneum/electroneum-sc/crypto" ) var ( diff --git a/consensus/istanbul/validator/proposerpolicy_test.go b/consensus/istanbul/validator/proposerpolicy_test.go index e6fb3bac8..a48db5b4b 100644 --- a/consensus/istanbul/validator/proposerpolicy_test.go +++ b/consensus/istanbul/validator/proposerpolicy_test.go @@ -19,8 +19,8 @@ package validator import ( "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" "github.com/stretchr/testify/assert" ) diff --git a/consensus/istanbul/validator/validator.go b/consensus/istanbul/validator/validator.go index 11615693a..642a420ad 100644 --- a/consensus/istanbul/validator/validator.go +++ b/consensus/istanbul/validator/validator.go @@ -19,8 +19,8 @@ package validator import ( "bytes" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/istanbul" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/istanbul" ) func New(addr common.Address) istanbul.Validator { diff --git a/consensus/merger.go b/consensus/merger.go index ffbcbf2b8..3ed7c27fb 100644 --- a/consensus/merger.go +++ b/consensus/merger.go @@ -20,10 +20,10 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // transitionStatus describes the status of eth1/2 transition. This switch diff --git a/consensus/misc/dao.go b/consensus/misc/dao.go index 36df036f2..e16ce35d1 100644 --- a/consensus/misc/dao.go +++ b/consensus/misc/dao.go @@ -21,9 +21,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/consensus/misc/eip1559.go b/consensus/misc/eip1559.go index e18340b0f..6ea0b454b 100644 --- a/consensus/misc/eip1559.go +++ b/consensus/misc/eip1559.go @@ -20,10 +20,10 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) // VerifyEip1559Header verifies some header attributes which were changed in EIP-1559, diff --git a/consensus/misc/eip1559_test.go b/consensus/misc/eip1559_test.go index 23cd9023d..515eb89cc 100644 --- a/consensus/misc/eip1559_test.go +++ b/consensus/misc/eip1559_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) // copyConfig does a _shallow_ copy of a given config. Safe to set new values, but diff --git a/consensus/misc/forks.go b/consensus/misc/forks.go index 4a5e7c37e..c810dd4db 100644 --- a/consensus/misc/forks.go +++ b/consensus/misc/forks.go @@ -19,9 +19,9 @@ package misc import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) // VerifyForkHashes verifies that blocks conforming to network hard-forks do have diff --git a/consensus/misc/gaslimit.go b/consensus/misc/gaslimit.go index 25f35300b..b2d7f1771 100644 --- a/consensus/misc/gaslimit.go +++ b/consensus/misc/gaslimit.go @@ -20,7 +20,7 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) // VerifyGaslimit verifies the header gas limit according increase/decrease diff --git a/consensus/protocol.go b/consensus/protocol.go index 17ad4944a..079b3d0b9 100644 --- a/consensus/protocol.go +++ b/consensus/protocol.go @@ -2,8 +2,8 @@ package consensus import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // Constants to match up protocol versions and messages diff --git a/console/bridge.go b/console/bridge.go index 21ef0e8e7..f426486dd 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -25,12 +25,12 @@ import ( "time" "github.com/dop251/goja" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/accounts/usbwallet" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts/scwallet" + "github.com/electroneum/electroneum-sc/accounts/usbwallet" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/internal/jsre" + "github.com/electroneum/electroneum-sc/rpc" ) // bridge is a collection of JavaScript utility methods to bride the .js runtime diff --git a/console/bridge_test.go b/console/bridge_test.go index e57e294fc..16b077b46 100644 --- a/console/bridge_test.go +++ b/console/bridge_test.go @@ -20,7 +20,7 @@ import ( "testing" "github.com/dop251/goja" - "github.com/ethereum/go-ethereum/internal/jsre" + "github.com/electroneum/electroneum-sc/internal/jsre" ) // TestUndefinedAsParam ensures that personal functions can receive diff --git a/console/console.go b/console/console.go index abdc3d62c..8c9872416 100644 --- a/console/console.go +++ b/console/console.go @@ -30,11 +30,11 @@ import ( "syscall" "github.com/dop251/goja" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/internal/jsre/deps" - "github.com/ethereum/go-ethereum/internal/web3ext" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/internal/jsre" + "github.com/electroneum/electroneum-sc/internal/jsre/deps" + "github.com/electroneum/electroneum-sc/internal/web3ext" + "github.com/electroneum/electroneum-sc/rpc" "github.com/mattn/go-colorable" "github.com/peterh/liner" ) diff --git a/console/console_test.go b/console/console_test.go index 04ba91d15..c584cbb8a 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -25,15 +25,15 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/internal/jsre" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" ) const ( diff --git a/contracts/checkpointoracle/contract/oracle.go b/contracts/checkpointoracle/contract/oracle.go index a4a308f5c..06a0ea7c1 100644 --- a/contracts/checkpointoracle/contract/oracle.go +++ b/contracts/checkpointoracle/contract/oracle.go @@ -7,19 +7,19 @@ 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" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" ) // Reference imports to suppress errors if they are not otherwise used. var ( _ = big.NewInt _ = strings.NewReader - _ = ethereum.NotFound + _ = electroneum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup @@ -288,7 +288,7 @@ type CheckpointOracleNewCheckpointVoteIterator struct { 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 + sub electroneum.Subscription // Subscription for errors, completion and termination done bool // Whether the subscription completed delivering logs fail error // Occurred error to stop iteration } diff --git a/contracts/checkpointoracle/oracle.go b/contracts/checkpointoracle/oracle.go index eff8ce2f2..9152c5168 100644 --- a/contracts/checkpointoracle/oracle.go +++ b/contracts/checkpointoracle/oracle.go @@ -23,10 +23,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle/contract" + "github.com/electroneum/electroneum-sc/core/types" ) // CheckpointOracle is a Go wrapper around an on-chain checkpoint oracle contract. diff --git a/contracts/checkpointoracle/oracle_test.go b/contracts/checkpointoracle/oracle_test.go index 61dd8aec7..17d8ad83d 100644 --- a/contracts/checkpointoracle/oracle_test.go +++ b/contracts/checkpointoracle/oracle_test.go @@ -27,13 +27,13 @@ import ( "testing" "time" - "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/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle/contract" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/core/asm/asm.go b/core/asm/asm.go index f3f129714..32012e067 100644 --- a/core/asm/asm.go +++ b/core/asm/asm.go @@ -21,7 +21,7 @@ import ( "encoding/hex" "fmt" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/core/vm" ) // Iterator for disassembled EVM instructions diff --git a/core/asm/compiler.go b/core/asm/compiler.go index ce2d23abd..61608c017 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -22,8 +22,8 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/vm" ) // Compiler contains information about the parsed source diff --git a/core/beacon/errors.go b/core/beacon/errors.go index 7a30d09bb..4b1741563 100644 --- a/core/beacon/errors.go +++ b/core/beacon/errors.go @@ -17,8 +17,8 @@ package beacon import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rpc" ) // EngineAPIError is a standardized error message between consensus and execution diff --git a/core/beacon/gen_blockparams.go b/core/beacon/gen_blockparams.go index 0e2ea4bb1..c971ac961 100644 --- a/core/beacon/gen_blockparams.go +++ b/core/beacon/gen_blockparams.go @@ -6,8 +6,8 @@ import ( "encoding/json" "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var _ = (*payloadAttributesMarshaling)(nil) diff --git a/core/beacon/gen_ed.go b/core/beacon/gen_ed.go index dcee3bf18..b13ba8463 100644 --- a/core/beacon/gen_ed.go +++ b/core/beacon/gen_ed.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var _ = (*executableDataMarshaling)(nil) diff --git a/core/beacon/types.go b/core/beacon/types.go index 18d5d2ab7..936fd32e5 100644 --- a/core/beacon/types.go +++ b/core/beacon/types.go @@ -20,10 +20,10 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/trie" ) //go:generate go run github.com/fjl/gencodec -type PayloadAttributesV1 -field-override payloadAttributesMarshaling -out gen_blockparams.go diff --git a/core/bench_test.go b/core/bench_test.go index 3006e5513..7aedf9f1e 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -21,15 +21,15 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "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/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" ) func BenchmarkInsertChain_empty_memdb(b *testing.B) { diff --git a/core/block_validator.go b/core/block_validator.go index 3763be0be..b0dae055c 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -19,11 +19,11 @@ package core import ( "fmt" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) // BlockValidator is responsible for validating block headers, uncles and diff --git a/core/block_validator_test.go b/core/block_validator_test.go index 0f183ba52..f1471d5c8 100644 --- a/core/block_validator_test.go +++ b/core/block_validator_test.go @@ -23,16 +23,16 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/beacon" - "github.com/ethereum/go-ethereum/consensus/clique" - "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" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/beacon" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // Tests that simple header verification works, for both good and bad blocks. diff --git a/core/blockchain.go b/core/blockchain.go index 5ac12303c..cf92f6fc3 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,22 +27,22 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/syncx" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/internal/syncx" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/blockchain_insert.go b/core/blockchain_insert.go index 479eccc83..7bebfa1f1 100644 --- a/core/blockchain_insert.go +++ b/core/blockchain_insert.go @@ -19,10 +19,10 @@ package core import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" ) // insertStats tracks and reports on block insertion. diff --git a/core/blockchain_reader.go b/core/blockchain_reader.go index b8d4233c6..460a5888a 100644 --- a/core/blockchain_reader.go +++ b/core/blockchain_reader.go @@ -19,16 +19,16 @@ package core import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // CurrentHeader retrieves the current head header of the canonical chain. The diff --git a/core/blockchain_repair_test.go b/core/blockchain_repair_test.go index 24309405d..939aca494 100644 --- a/core/blockchain_repair_test.go +++ b/core/blockchain_repair_test.go @@ -25,12 +25,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" ) // Tests a recovery for a short canonical chain where a recent block was already @@ -1859,7 +1859,7 @@ func testRepair(t *testing.T, tt *rewindTest, snapshots bool) { } } -// TestIssue23496 tests scenario described in https://github.com/ethereum/go-ethereum/pull/23496#issuecomment-926393893 +// TestIssue23496 tests scenario described in https://github.com/electroneum/electroneum-sc/pull/23496#issuecomment-926393893 // Credits to @zzyalbert for finding the issue. // // Local chain owns these blocks: diff --git a/core/blockchain_sethead_test.go b/core/blockchain_sethead_test.go index 970e03063..11db6b909 100644 --- a/core/blockchain_sethead_test.go +++ b/core/blockchain_sethead_test.go @@ -26,12 +26,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" ) // rewindTest is a test case for chain rollback upon user request. diff --git a/core/blockchain_snapshot_test.go b/core/blockchain_snapshot_test.go index dfa8ed65e..f3e23062c 100644 --- a/core/blockchain_snapshot_test.go +++ b/core/blockchain_snapshot_test.go @@ -28,13 +28,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/consensus" - "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/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" ) // snapshotTestBasic wraps the common testing fields in the snapshot tests. diff --git a/core/blockchain_test.go b/core/blockchain_test.go index b42f572b1..59dc9273f 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -26,20 +26,20 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/beacon" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "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/eth/tracers/logger" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/beacon" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) // So we can deterministically seed different blockchains @@ -1588,7 +1588,7 @@ func TestEIP161AccountRemoval(t *testing.T) { // tests that under weird reorg conditions the blockchain and its internal header- // chain return the same latest block/header. // -// https://github.com/ethereum/go-ethereum/pull/15941 +// https://github.com/electroneum/electroneum-sc/pull/15941 func TestBlockchainHeaderchainReorgConsistency(t *testing.T) { // Generate a canonical chain to act as the main dataset engine := ethash.NewFaker() @@ -1864,8 +1864,8 @@ func TestInsertReceiptChainRollback(t *testing.T) { // overtake the 'canon' chain until after it's passed canon by about 200 blocks. // // Details at: -// - https://github.com/ethereum/go-ethereum/issues/18977 -// - https://github.com/ethereum/go-ethereum/pull/18988 +// - https://github.com/electroneum/electroneum-sc/issues/18977 +// - https://github.com/electroneum/electroneum-sc/pull/18988 func TestLowDiffLongChain(t *testing.T) { // Generate a canonical chain to act as the main dataset engine := ethash.NewFaker() diff --git a/core/blocks.go b/core/blocks.go index f20ba4aaf..a988f25fc 100644 --- a/core/blocks.go +++ b/core/blocks.go @@ -16,7 +16,7 @@ package core -import "github.com/ethereum/go-ethereum/common" +import "github.com/electroneum/electroneum-sc/common" // BadHashes represent a set of manually tracked bad hashes (usually hard forks) var BadHashes = map[common.Hash]bool{ diff --git a/core/bloom_indexer.go b/core/bloom_indexer.go index 856746a1c..fd9d8a41c 100644 --- a/core/bloom_indexer.go +++ b/core/bloom_indexer.go @@ -20,12 +20,12 @@ import ( "context" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" ) const ( diff --git a/core/bloombits/generator.go b/core/bloombits/generator.go index 646151db0..191ea2297 100644 --- a/core/bloombits/generator.go +++ b/core/bloombits/generator.go @@ -19,7 +19,7 @@ package bloombits import ( "errors" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) var ( diff --git a/core/bloombits/generator_test.go b/core/bloombits/generator_test.go index 883948d12..ea450c1e5 100644 --- a/core/bloombits/generator_test.go +++ b/core/bloombits/generator_test.go @@ -21,7 +21,7 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // Tests that batched bloom bits are correctly rotated from the input bloom diff --git a/core/bloombits/matcher.go b/core/bloombits/matcher.go index f2a8bda17..26b0f891e 100644 --- a/core/bloombits/matcher.go +++ b/core/bloombits/matcher.go @@ -26,8 +26,8 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/crypto" ) // bloomIndexes represents the bit indexes inside the bloom filter that belong diff --git a/core/bloombits/matcher_test.go b/core/bloombits/matcher_test.go index 923579221..0f2ecbbbe 100644 --- a/core/bloombits/matcher_test.go +++ b/core/bloombits/matcher_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) const testSectionSize = 4096 @@ -86,7 +86,7 @@ func TestMatcherRandom(t *testing.T) { // Tests that the matcher can properly find matches if the starting block is // shifter from a multiple of 8. This is needed to cover an optimisation with -// bitset matching https://github.com/ethereum/go-ethereum/issues/15309. +// bitset matching https://github.com/electroneum/electroneum-sc/issues/15309. func TestMatcherShifted(t *testing.T) { t.Parallel() // Block 0 always matches in the tests, skip ahead of first 8 blocks with the diff --git a/core/chain_indexer.go b/core/chain_indexer.go index 95901a0ea..37250ace1 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -24,12 +24,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" ) // ChainIndexerBackend defines the methods needed to process chain segments in diff --git a/core/chain_indexer_test.go b/core/chain_indexer_test.go index f09960901..05a912e9f 100644 --- a/core/chain_indexer_test.go +++ b/core/chain_indexer_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" ) // Runs multiple tests with randomized parameters. diff --git a/core/chain_makers.go b/core/chain_makers.go index c7bf60a4b..7cd116848 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -20,14 +20,14 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" ) // BlockGen creates blocks for testing. diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go index 85a029f7c..f769334cc 100644 --- a/core/chain_makers_test.go +++ b/core/chain_makers_test.go @@ -20,12 +20,12 @@ 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" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) func ExampleGenerateChain() { diff --git a/core/dao_test.go b/core/dao_test.go index c9c765a38..8ca8a5a60 100644 --- a/core/dao_test.go +++ b/core/dao_test.go @@ -20,10 +20,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" ) // Tests that DAO-fork enabled clients can properly filter out fork-commencing diff --git a/core/error.go b/core/error.go index 51ebefc13..facd8eecd 100644 --- a/core/error.go +++ b/core/error.go @@ -19,7 +19,7 @@ package core import ( "errors" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) var ( diff --git a/core/events.go b/core/events.go index ac935a137..8fd28756a 100644 --- a/core/events.go +++ b/core/events.go @@ -17,8 +17,8 @@ package core import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // NewTxsEvent is posted when a batch of transactions enter the transaction pool. diff --git a/core/evm.go b/core/evm.go index 536ac673e..799b65200 100644 --- a/core/evm.go +++ b/core/evm.go @@ -19,10 +19,10 @@ package core import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" ) // ChainContext supports retrieving headers and consensus parameters from the diff --git a/core/forkchoice.go b/core/forkchoice.go index b0dbb200e..a93034c1a 100644 --- a/core/forkchoice.go +++ b/core/forkchoice.go @@ -22,11 +22,11 @@ import ( "math/big" mrand "math/rand" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/core/forkid/forkid.go b/core/forkid/forkid.go index f56ce85fe..9d14c53be 100644 --- a/core/forkid/forkid.go +++ b/core/forkid/forkid.go @@ -26,10 +26,10 @@ import ( "reflect" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index 3ec3870ad..202bb3e8a 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -22,9 +22,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/core/gen_genesis.go b/core/gen_genesis.go index 4e0844e88..c61ed856e 100644 --- a/core/gen_genesis.go +++ b/core/gen_genesis.go @@ -7,10 +7,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/params" ) var _ = (*genesisSpecMarshaling)(nil) diff --git a/core/gen_genesis_account.go b/core/gen_genesis_account.go index a9d47e6ba..b1949cbab 100644 --- a/core/gen_genesis_account.go +++ b/core/gen_genesis_account.go @@ -7,9 +7,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" ) var _ = (*genesisAccountMarshaling)(nil) diff --git a/core/genesis.go b/core/genesis.go index 91e9398bb..937c6558d 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -24,17 +24,17 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) //go:generate go run github.com/fjl/gencodec -type Genesis -field-override genesisSpecMarshaling -out gen_genesis.go diff --git a/core/genesis_test.go b/core/genesis_test.go index eb3c29fdc..7a1e6ba03 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,12 +22,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" ) func TestInvalidCliqueConfig(t *testing.T) { diff --git a/core/headerchain.go b/core/headerchain.go index d8c415f33..d2f2d9cc0 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,14 +26,14 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/headerchain_test.go b/core/headerchain_test.go index ed0522671..3cdc8d151 100644 --- a/core/headerchain_test.go +++ b/core/headerchain_test.go @@ -23,12 +23,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/consensus" - "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/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) func verifyUnbrokenCanonchain(hc *HeaderChain) error { diff --git a/core/mkalloc.go b/core/mkalloc.go index df167d708..66a616e08 100644 --- a/core/mkalloc.go +++ b/core/mkalloc.go @@ -35,8 +35,8 @@ import ( "sort" "strconv" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/rlp" ) type allocItem struct{ Addr, Balance *big.Int } diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 84b621db8..09592a382 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -24,13 +24,13 @@ import ( "math/big" "sort" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // ReadCanonicalHash retrieves the hash assigned to a canonical block number. diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index dbb13caa4..b614b72a1 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -26,11 +26,11 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 25a44354b..ad92c44ba 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -20,12 +20,12 @@ import ( "bytes" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // ReadTxLookupEntry retrieves the positional metadata associated with a transaction diff --git a/core/rawdb/accessors_indexes_test.go b/core/rawdb/accessors_indexes_test.go index 43fd6f1c5..ad071dc1d 100644 --- a/core/rawdb/accessors_indexes_test.go +++ b/core/rawdb/accessors_indexes_test.go @@ -22,11 +22,11 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/rawdb/accessors_metadata.go b/core/rawdb/accessors_metadata.go index f5a161adb..15ba7281a 100644 --- a/core/rawdb/accessors_metadata.go +++ b/core/rawdb/accessors_metadata.go @@ -20,11 +20,11 @@ import ( "encoding/json" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // ReadDatabaseVersion retrieves the version number of the database. diff --git a/core/rawdb/accessors_snapshot.go b/core/rawdb/accessors_snapshot.go index 3c82b3f73..876d268fb 100644 --- a/core/rawdb/accessors_snapshot.go +++ b/core/rawdb/accessors_snapshot.go @@ -19,9 +19,9 @@ package rawdb import ( "encoding/binary" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) // ReadSnapshotDisabled retrieves if the snapshot maintenance is disabled. diff --git a/core/rawdb/accessors_state.go b/core/rawdb/accessors_state.go index 41e21b6ca..05cfb296e 100644 --- a/core/rawdb/accessors_state.go +++ b/core/rawdb/accessors_state.go @@ -17,9 +17,9 @@ package rawdb import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) // ReadPreimage retrieves a single preimage of the provided hash. diff --git a/core/rawdb/accessors_sync.go b/core/rawdb/accessors_sync.go index e87ad43c3..61ff49302 100644 --- a/core/rawdb/accessors_sync.go +++ b/core/rawdb/accessors_sync.go @@ -19,10 +19,10 @@ package rawdb import ( "bytes" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // ReadSkeletonSyncStatus retrieves the serialized sync status saved at shutdown. diff --git a/core/rawdb/chain_freezer.go b/core/rawdb/chain_freezer.go index 4c49db274..d5495ef8e 100644 --- a/core/rawdb/chain_freezer.go +++ b/core/rawdb/chain_freezer.go @@ -22,10 +22,10 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/core/rawdb/chain_iterator.go b/core/rawdb/chain_iterator.go index 21e42f42d..8ee54fe8c 100644 --- a/core/rawdb/chain_iterator.go +++ b/core/rawdb/chain_iterator.go @@ -21,12 +21,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // InitDatabaseFromFreezer reinitializes an empty database from a previous batch diff --git a/core/rawdb/chain_iterator_test.go b/core/rawdb/chain_iterator_test.go index e1f515975..988c6f519 100644 --- a/core/rawdb/chain_iterator_test.go +++ b/core/rawdb/chain_iterator_test.go @@ -23,8 +23,8 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) func TestChainIterator(t *testing.T) { diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 2b870d16d..10bb98370 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -24,11 +24,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/leveldb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/leveldb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/log" "github.com/olekukonko/tablewriter" ) diff --git a/core/rawdb/freezer.go b/core/rawdb/freezer.go index 63fd8cdcf..9e4bf2007 100644 --- a/core/rawdb/freezer.go +++ b/core/rawdb/freezer.go @@ -26,10 +26,10 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" "github.com/prometheus/tsdb/fileutil" ) diff --git a/core/rawdb/freezer_batch.go b/core/rawdb/freezer_batch.go index 54c98cee0..2b5758ac0 100644 --- a/core/rawdb/freezer_batch.go +++ b/core/rawdb/freezer_batch.go @@ -20,8 +20,8 @@ import ( "fmt" "sync/atomic" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/rlp" "github.com/golang/snappy" ) diff --git a/core/rawdb/freezer_meta.go b/core/rawdb/freezer_meta.go index 9eef9df35..fd444f741 100644 --- a/core/rawdb/freezer_meta.go +++ b/core/rawdb/freezer_meta.go @@ -20,8 +20,8 @@ import ( "io" "os" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) const freezerVersion = 1 // The initial version tag of freezer table metadata diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index dd4a80efc..63bc1d015 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -27,9 +27,9 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" "github.com/golang/snappy" ) diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index 0bddcf721..bf5944995 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -30,7 +30,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" "github.com/stretchr/testify/require" ) diff --git a/core/rawdb/freezer_test.go b/core/rawdb/freezer_test.go index c28d35ef3..603759cf2 100644 --- a/core/rawdb/freezer_test.go +++ b/core/rawdb/freezer_test.go @@ -27,8 +27,8 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rlp" "github.com/stretchr/testify/require" ) diff --git a/core/rawdb/key_length_iterator.go b/core/rawdb/key_length_iterator.go index d1c5af269..ff8fcad2b 100644 --- a/core/rawdb/key_length_iterator.go +++ b/core/rawdb/key_length_iterator.go @@ -16,7 +16,7 @@ package rawdb -import "github.com/ethereum/go-ethereum/ethdb" +import "github.com/electroneum/electroneum-sc/ethdb" // KeyLengthIterator is a wrapper for a database iterator that ensures only key-value pairs // with a specific key length will be returned. diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go index 041c9f044..a3913d228 100644 --- a/core/rawdb/schema.go +++ b/core/rawdb/schema.go @@ -21,8 +21,8 @@ import ( "bytes" "encoding/binary" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/metrics" ) // The fields below define the low level database schema prefixing. diff --git a/core/rawdb/table.go b/core/rawdb/table.go index 6d6fa0555..e810ac734 100644 --- a/core/rawdb/table.go +++ b/core/rawdb/table.go @@ -17,7 +17,7 @@ package rawdb import ( - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/ethdb" ) // table is a wrapper around a database that prefixes each key access with a pre- diff --git a/core/rawdb/table_test.go b/core/rawdb/table_test.go index aa6adf3e7..790821146 100644 --- a/core/rawdb/table_test.go +++ b/core/rawdb/table_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/ethdb" ) func TestTableDatabase(t *testing.T) { testTableDatabase(t, "prefix") } diff --git a/core/rlp_test.go b/core/rlp_test.go index bf5a934ce..ac74f9d42 100644 --- a/core/rlp_test.go +++ b/core/rlp_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "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/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/state/access_list.go b/core/state/access_list.go index 419469134..cf372c542 100644 --- a/core/state/access_list.go +++ b/core/state/access_list.go @@ -17,7 +17,7 @@ package state import ( - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) type accessList struct { diff --git a/core/state/database.go b/core/state/database.go index bbcd2358e..47fdbbb8e 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -21,11 +21,11 @@ import ( "fmt" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/trie" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/state/dump.go b/core/state/dump.go index bfcc03543..d137ab16a 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -21,12 +21,12 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // DumpConfig is a set of options to control what portions of the statewill be diff --git a/core/state/iterator.go b/core/state/iterator.go index 611df5243..ea6fc4525 100644 --- a/core/state/iterator.go +++ b/core/state/iterator.go @@ -20,10 +20,10 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // NodeIterator is an iterator to traverse the entire state trie post-order, diff --git a/core/state/iterator_test.go b/core/state/iterator_test.go index d1afe9ca3..af888a6c8 100644 --- a/core/state/iterator_test.go +++ b/core/state/iterator_test.go @@ -20,8 +20,8 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" ) // Tests that the node iterator indeed walks over the entire database contents. diff --git a/core/state/journal.go b/core/state/journal.go index 57a692dc7..45929f4b6 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -19,7 +19,7 @@ package state import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // journalEntry is a modification entry in the state change journal that can be diff --git a/core/state/metrics.go b/core/state/metrics.go index 7b40ff37a..909a47e8d 100644 --- a/core/state/metrics.go +++ b/core/state/metrics.go @@ -16,7 +16,7 @@ package state -import "github.com/ethereum/go-ethereum/metrics" +import "github.com/electroneum/electroneum-sc/metrics" var ( accountUpdatedMeter = metrics.NewRegisteredMeter("state/update/account", nil) diff --git a/core/state/pruner/bloom.go b/core/state/pruner/bloom.go index 29bc4e731..1524d6bc9 100644 --- a/core/state/pruner/bloom.go +++ b/core/state/pruner/bloom.go @@ -21,9 +21,9 @@ import ( "errors" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/log" bloomfilter "github.com/holiman/bloomfilter/v2" ) diff --git a/core/state/pruner/pruner.go b/core/state/pruner/pruner.go index a121839bd..ab6c765f7 100644 --- a/core/state/pruner/pruner.go +++ b/core/state/pruner/pruner.go @@ -27,15 +27,15 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) const ( diff --git a/core/state/snapshot/account.go b/core/state/snapshot/account.go index b92e94295..dfa64dba3 100644 --- a/core/state/snapshot/account.go +++ b/core/state/snapshot/account.go @@ -20,8 +20,8 @@ import ( "bytes" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" ) // Account is a modified version of a state.Account, where the root is replaced diff --git a/core/state/snapshot/context.go b/core/state/snapshot/context.go index 67d7e41a0..38ced7043 100644 --- a/core/state/snapshot/context.go +++ b/core/state/snapshot/context.go @@ -22,12 +22,12 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/log" ) const ( diff --git a/core/state/snapshot/conversion.go b/core/state/snapshot/conversion.go index f70cbf1e6..1f93150ed 100644 --- a/core/state/snapshot/conversion.go +++ b/core/state/snapshot/conversion.go @@ -26,12 +26,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // trieKV represents a trie key-value pair diff --git a/core/state/snapshot/dangling.go b/core/state/snapshot/dangling.go index ca73da793..11d857571 100644 --- a/core/state/snapshot/dangling.go +++ b/core/state/snapshot/dangling.go @@ -23,11 +23,11 @@ import ( "io" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // CheckDanglingStorage iterates the snap storage data, and verifies that all diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 822c91f15..1bbed7330 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -26,8 +26,8 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" bloomfilter "github.com/holiman/bloomfilter/v2" ) diff --git a/core/state/snapshot/difflayer_test.go b/core/state/snapshot/difflayer_test.go index e15c1d504..81a462cc9 100644 --- a/core/state/snapshot/difflayer_test.go +++ b/core/state/snapshot/difflayer_test.go @@ -22,9 +22,9 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) func copyDestructs(destructs map[common.Hash]struct{}) map[common.Hash]struct{} { diff --git a/core/state/snapshot/disklayer.go b/core/state/snapshot/disklayer.go index 7cbf6e293..ea2db50d2 100644 --- a/core/state/snapshot/disklayer.go +++ b/core/state/snapshot/disklayer.go @@ -21,11 +21,11 @@ import ( "sync" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // diskLayer is a low level persistent snapshot built on top of a key-value store. diff --git a/core/state/snapshot/disklayer_test.go b/core/state/snapshot/disklayer_test.go index b078951c7..2d327405e 100644 --- a/core/state/snapshot/disklayer_test.go +++ b/core/state/snapshot/disklayer_test.go @@ -21,11 +21,11 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb/leveldb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb/leveldb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/rlp" ) // reverse reverses the contents of a byte slice. It's used to update random accs diff --git a/core/state/snapshot/generate.go b/core/state/snapshot/generate.go index 769989aec..fa4da5a83 100644 --- a/core/state/snapshot/generate.go +++ b/core/state/snapshot/generate.go @@ -24,15 +24,15 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/core/state/snapshot/generate_test.go b/core/state/snapshot/generate_test.go index 94caed08a..3d3d79358 100644 --- a/core/state/snapshot/generate_test.go +++ b/core/state/snapshot/generate_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/core/state/snapshot/holdable_iterator.go b/core/state/snapshot/holdable_iterator.go index 1e86ff9d8..5a11ec662 100644 --- a/core/state/snapshot/holdable_iterator.go +++ b/core/state/snapshot/holdable_iterator.go @@ -17,8 +17,8 @@ package snapshot import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" ) // holdableIterator is a wrapper of underlying database iterator. It extends diff --git a/core/state/snapshot/holdable_iterator_test.go b/core/state/snapshot/holdable_iterator_test.go index ce4cf6bb8..43b52f52f 100644 --- a/core/state/snapshot/holdable_iterator_test.go +++ b/core/state/snapshot/holdable_iterator_test.go @@ -20,8 +20,8 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" ) func TestIteratorHold(t *testing.T) { diff --git a/core/state/snapshot/iterator.go b/core/state/snapshot/iterator.go index c1a196c7f..9678b8e8d 100644 --- a/core/state/snapshot/iterator.go +++ b/core/state/snapshot/iterator.go @@ -21,9 +21,9 @@ import ( "fmt" "sort" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" ) // Iterator is an iterator to step over all the accounts or the specific diff --git a/core/state/snapshot/iterator_binary.go b/core/state/snapshot/iterator_binary.go index 22184b254..15e1454f8 100644 --- a/core/state/snapshot/iterator_binary.go +++ b/core/state/snapshot/iterator_binary.go @@ -19,7 +19,7 @@ package snapshot import ( "bytes" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // binaryIterator is a simplistic iterator to step over the accounts or storage diff --git a/core/state/snapshot/iterator_fast.go b/core/state/snapshot/iterator_fast.go index 48069b8fc..758e680bf 100644 --- a/core/state/snapshot/iterator_fast.go +++ b/core/state/snapshot/iterator_fast.go @@ -21,7 +21,7 @@ import ( "fmt" "sort" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // weightedIterator is a iterator with an assigned weight. It is used to prioritise diff --git a/core/state/snapshot/iterator_test.go b/core/state/snapshot/iterator_test.go index 2c7e876e0..1a0bfe0c5 100644 --- a/core/state/snapshot/iterator_test.go +++ b/core/state/snapshot/iterator_test.go @@ -24,8 +24,8 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" ) // TestAccountIteratorBasics tests some simple single-layer(diff and disk) iteration diff --git a/core/state/snapshot/journal.go b/core/state/snapshot/journal.go index 6836a5740..757dc3d03 100644 --- a/core/state/snapshot/journal.go +++ b/core/state/snapshot/journal.go @@ -25,12 +25,12 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) const journalVersion uint64 = 0 diff --git a/core/state/snapshot/metrics.go b/core/state/snapshot/metrics.go index 43f417a0d..265177f89 100644 --- a/core/state/snapshot/metrics.go +++ b/core/state/snapshot/metrics.go @@ -16,7 +16,7 @@ package snapshot -import "github.com/ethereum/go-ethereum/metrics" +import "github.com/electroneum/electroneum-sc/metrics" // Metrics in generation var ( diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index 76200851e..1dfbd1879 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -24,13 +24,13 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/core/state/snapshot/snapshot_test.go b/core/state/snapshot/snapshot_test.go index bc4e5cbd0..0c29cebb4 100644 --- a/core/state/snapshot/snapshot_test.go +++ b/core/state/snapshot/snapshot_test.go @@ -25,9 +25,9 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/rlp" ) // randomHash generates a random blob of data and returns it as a hash. diff --git a/core/state/snapshot/sort.go b/core/state/snapshot/sort.go index 88841231d..675bcee0f 100644 --- a/core/state/snapshot/sort.go +++ b/core/state/snapshot/sort.go @@ -19,7 +19,7 @@ package snapshot import ( "bytes" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // hashes is a helper to implement sort.Interface. diff --git a/core/state/state_object.go b/core/state/state_object.go index bcb6dca4f..b29bc3d89 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -23,11 +23,11 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/rlp" ) var emptyCodeHash = crypto.Keccak256(nil) diff --git a/core/state/state_object_test.go b/core/state/state_object_test.go index 42fd77802..ea97c453f 100644 --- a/core/state/state_object_test.go +++ b/core/state/state_object_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func BenchmarkCutOriginal(b *testing.B) { diff --git a/core/state/state_test.go b/core/state/state_test.go index 0a55d7781..63250f4e3 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,10 +21,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" ) type stateTest struct { diff --git a/core/state/statedb.go b/core/state/statedb.go index 1d31cf470..9fe9ed035 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -24,15 +24,15 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) type revision struct { @@ -660,7 +660,7 @@ func (s *StateDB) Copy() *StateDB { } // Copy the dirty states, logs, and preimages for addr := range s.journal.dirties { - // As documented [here](https://github.com/ethereum/go-ethereum/pull/16485#issuecomment-380438527), + // As documented [here](https://github.com/electroneum/electroneum-sc/pull/16485#issuecomment-380438527), // and in the Finalise-method, there is a case where an object is in the journal but not // in the stateObjects: OOG after touch on ripeMD prior to Byzantium. Thus, we need to check for // nil diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index e9576d4dc..6ee49b7e5 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -29,9 +29,9 @@ import ( "testing" "testing/quick" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" ) // Tests that updating a state trie does not leak any database writes prior to @@ -146,7 +146,7 @@ func TestIntermediateLeaks(t *testing.T) { // TestCopy tests that copying a StateDB object indeed makes the original and // the copy independent of each other. This test is a regression test against -// https://github.com/ethereum/go-ethereum/pull/15549. +// https://github.com/electroneum/electroneum-sc/pull/15549. func TestCopy(t *testing.T) { // Create a random state test to copy and modify "independently" orig, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase()), nil) @@ -489,7 +489,7 @@ func TestTouchDelete(t *testing.T) { } // TestCopyOfCopy tests that modified objects are carried over to the copy, and the copy of the copy. -// See https://github.com/ethereum/go-ethereum/pull/15225#issuecomment-380191512 +// See https://github.com/electroneum/electroneum-sc/pull/15225#issuecomment-380191512 func TestCopyOfCopy(t *testing.T) { state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase()), nil) addr := common.HexToAddress("aaaa") @@ -506,7 +506,7 @@ func TestCopyOfCopy(t *testing.T) { // Tests a regression where committing a copy lost some internal meta information, // leading to corrupted subsequent copies. // -// See https://github.com/ethereum/go-ethereum/issues/20106. +// See https://github.com/electroneum/electroneum-sc/issues/20106. func TestCopyCommitCopy(t *testing.T) { state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase()), nil) @@ -578,7 +578,7 @@ func TestCopyCommitCopy(t *testing.T) { // Tests a regression where committing a copy lost some internal meta information, // leading to corrupted subsequent copies. // -// See https://github.com/ethereum/go-ethereum/issues/20106. +// See https://github.com/electroneum/electroneum-sc/issues/20106. func TestCopyCopyCommitCopy(t *testing.T) { state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase()), nil) diff --git a/core/state/sync.go b/core/state/sync.go index cc7d01a21..677b3f991 100644 --- a/core/state/sync.go +++ b/core/state/sync.go @@ -19,11 +19,11 @@ package state import ( "bytes" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // NewStateSync create a new state trie download scheduler. diff --git a/core/state/sync_test.go b/core/state/sync_test.go index 007590c76..70e48a338 100644 --- a/core/state/sync_test.go +++ b/core/state/sync_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "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/ethdb" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // testAccount is the data associated with an account used by the state tests. diff --git a/core/state/trie_prefetcher.go b/core/state/trie_prefetcher.go index 25c3730e3..ebff3f916 100644 --- a/core/state/trie_prefetcher.go +++ b/core/state/trie_prefetcher.go @@ -19,9 +19,9 @@ package state import ( "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" ) var ( diff --git a/core/state/trie_prefetcher_test.go b/core/state/trie_prefetcher_test.go index 35dc7a2c0..38c1d665c 100644 --- a/core/state/trie_prefetcher_test.go +++ b/core/state/trie_prefetcher_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" ) func filledStateDB() *StateDB { diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index 10a172294..dfaa6b9cc 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -19,11 +19,11 @@ package core import ( "sync/atomic" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" ) // statePrefetcher is a basic Prefetcher, which blindly executes a block on top diff --git a/core/state_processor.go b/core/state_processor.go index d4c77ae41..6c4e75897 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -20,14 +20,14 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "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" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // StateProcessor is a basic Processor, which takes care of transitioning diff --git a/core/state_processor_test.go b/core/state_processor_test.go index aa8e4bebf..9b87f1036 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -21,17 +21,17 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/consensus/misc" - "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" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/core/state_transition.go b/core/state_transition.go index 3b5f81b16..7f39d71c1 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -21,12 +21,12 @@ import ( "math" "math/big" - "github.com/ethereum/go-ethereum/common" - cmath "github.com/ethereum/go-ethereum/common/math" - "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" + "github.com/electroneum/electroneum-sc/common" + cmath "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) var emptyCodeHash = crypto.Keccak256Hash(nil) diff --git a/core/tx_cacher.go b/core/tx_cacher.go index b1e5d676a..778eff28c 100644 --- a/core/tx_cacher.go +++ b/core/tx_cacher.go @@ -19,7 +19,7 @@ package core import ( "runtime" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // senderCacher is a concurrent transaction sender recoverer and cacher. diff --git a/core/tx_journal.go b/core/tx_journal.go index 5453ee191..d245f9f26 100644 --- a/core/tx_journal.go +++ b/core/tx_journal.go @@ -21,10 +21,10 @@ import ( "io" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // errNoActiveJournal is returned if a transaction is attempted to be inserted diff --git a/core/tx_list.go b/core/tx_list.go index f141a03bb..550acc844 100644 --- a/core/tx_list.go +++ b/core/tx_list.go @@ -25,8 +25,8 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // nonceHeap is a heap.Interface implementation over 64bit unsigned integers for diff --git a/core/tx_list_test.go b/core/tx_list_test.go index ef49cae1d..31393581b 100644 --- a/core/tx_list_test.go +++ b/core/tx_list_test.go @@ -21,8 +21,8 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) // Tests that transactions can be added to strict lists and list contents and diff --git a/core/tx_noncer.go b/core/tx_noncer.go index d6d220077..1c9851ad1 100644 --- a/core/tx_noncer.go +++ b/core/tx_noncer.go @@ -19,8 +19,8 @@ package core import ( "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/state" ) // txNoncer is a tiny virtual state database to manage the executable nonces of diff --git a/core/tx_pool.go b/core/tx_pool.go index 81a726bae..c2c0bd269 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,15 +25,15 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index dd2407470..5a1ec20c3 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -27,14 +27,14 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/core/types.go b/core/types.go index 4c5b74a49..3f8016308 100644 --- a/core/types.go +++ b/core/types.go @@ -17,9 +17,9 @@ package core import ( - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" ) // Validator is an interface which defines the standard for block validation. It diff --git a/core/types/access_list_tx.go b/core/types/access_list_tx.go index 620848fe6..d768d38be 100644 --- a/core/types/access_list_tx.go +++ b/core/types/access_list_tx.go @@ -19,7 +19,7 @@ package types import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) //go:generate go run github.com/fjl/gencodec -type AccessTuple -out gen_access_tuple.go diff --git a/core/types/block.go b/core/types/block.go index c018a20ac..bae19eb78 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -26,9 +26,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/core/types/block_test.go b/core/types/block_test.go index aa1db2f4f..f4475356e 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -23,11 +23,11 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/types/bloom9.go b/core/types/bloom9.go index 1793c2adc..1192a521c 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -21,8 +21,8 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/crypto" ) type bytesBacked interface { diff --git a/core/types/bloom9_test.go b/core/types/bloom9_test.go index 893df486d..64d3d8d97 100644 --- a/core/types/bloom9_test.go +++ b/core/types/bloom9_test.go @@ -21,8 +21,8 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) func TestBloom(t *testing.T) { diff --git a/core/types/dynamic_fee_tx.go b/core/types/dynamic_fee_tx.go index 53f246ea1..d76843a49 100644 --- a/core/types/dynamic_fee_tx.go +++ b/core/types/dynamic_fee_tx.go @@ -19,7 +19,7 @@ package types import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) type DynamicFeeTx struct { diff --git a/core/types/gen_access_tuple.go b/core/types/gen_access_tuple.go index fc48a84cc..57bd22e7a 100644 --- a/core/types/gen_access_tuple.go +++ b/core/types/gen_access_tuple.go @@ -6,7 +6,7 @@ import ( "encoding/json" "errors" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // MarshalJSON marshals as JSON. diff --git a/core/types/gen_account_rlp.go b/core/types/gen_account_rlp.go index 5181d8841..056412eee 100644 --- a/core/types/gen_account_rlp.go +++ b/core/types/gen_account_rlp.go @@ -5,7 +5,7 @@ package types -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *StateAccount) EncodeRLP(_w io.Writer) error { diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go index 74746d033..68d4ca7b3 100644 --- a/core/types/gen_header_json.go +++ b/core/types/gen_header_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var _ = (*headerMarshaling)(nil) diff --git a/core/types/gen_header_rlp.go b/core/types/gen_header_rlp.go index e1a687331..1adc3f545 100644 --- a/core/types/gen_header_rlp.go +++ b/core/types/gen_header_rlp.go @@ -5,7 +5,7 @@ package types -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *Header) EncodeRLP(_w io.Writer) error { diff --git a/core/types/gen_log_json.go b/core/types/gen_log_json.go index 90e1c14d9..fee49fcce 100644 --- a/core/types/gen_log_json.go +++ b/core/types/gen_log_json.go @@ -6,8 +6,8 @@ import ( "encoding/json" "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var _ = (*logMarshaling)(nil) diff --git a/core/types/gen_log_rlp.go b/core/types/gen_log_rlp.go index 4a6c6b009..d35c00187 100644 --- a/core/types/gen_log_rlp.go +++ b/core/types/gen_log_rlp.go @@ -5,7 +5,7 @@ package types -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *rlpLog) EncodeRLP(_w io.Writer) error { diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go index bb892f85b..32aebe16b 100644 --- a/core/types/gen_receipt_json.go +++ b/core/types/gen_receipt_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var _ = (*receiptMarshaling)(nil) diff --git a/core/types/hashing.go b/core/types/hashing.go index a115a8842..3d8ca3cd7 100644 --- a/core/types/hashing.go +++ b/core/types/hashing.go @@ -20,9 +20,9 @@ import ( "bytes" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/types/hashing_test.go b/core/types/hashing_test.go index de71ee41a..1498e94ea 100644 --- a/core/types/hashing_test.go +++ b/core/types/hashing_test.go @@ -24,13 +24,13 @@ import ( mrand "math/rand" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "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/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) func TestDeriveSha(t *testing.T) { diff --git a/core/types/istanbul.go b/core/types/istanbul.go index 565100d95..90020ffb3 100644 --- a/core/types/istanbul.go +++ b/core/types/istanbul.go @@ -20,8 +20,8 @@ import ( "errors" "io" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/core/types/legacy.go b/core/types/legacy.go index 14ed30d88..2ff3161ee 100644 --- a/core/types/legacy.go +++ b/core/types/legacy.go @@ -19,7 +19,7 @@ package types import ( "errors" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) // IsLegacyStoredReceipts tries to parse the RLP-encoded blob diff --git a/core/types/legacy_tx.go b/core/types/legacy_tx.go index 14d307829..208ee124f 100644 --- a/core/types/legacy_tx.go +++ b/core/types/legacy_tx.go @@ -19,7 +19,7 @@ package types import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // LegacyTx is the transaction data of regular Ethereum transactions. diff --git a/core/types/log.go b/core/types/log.go index ee323ba86..b852e7279 100644 --- a/core/types/log.go +++ b/core/types/log.go @@ -19,9 +19,9 @@ package types import ( "io" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/rlp" ) //go:generate go run github.com/fjl/gencodec -type Log -field-override logMarshaling -out gen_log_json.go diff --git a/core/types/log_test.go b/core/types/log_test.go index 0e56acfe4..3d04c49e6 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,8 +23,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var unmarshalLogTests = map[string]struct { diff --git a/core/types/receipt.go b/core/types/receipt.go index a913cd0e8..ef37a7a2a 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -24,11 +24,11 @@ import ( "math/big" "unsafe" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) //go:generate go run github.com/fjl/gencodec -type Receipt -field-override receiptMarshaling -out gen_receipt_json.go diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index bba18d2a7..b19407233 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -23,10 +23,10 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/core/types/state_account.go b/core/types/state_account.go index 3b01be451..d04eee4eb 100644 --- a/core/types/state_account.go +++ b/core/types/state_account.go @@ -19,7 +19,7 @@ package types import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) //go:generate go run ../../rlp/rlpgen -type StateAccount -out gen_account_rlp.go diff --git a/core/types/transaction.go b/core/types/transaction.go index 29820a0d7..0fbe1eb5f 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -25,10 +25,10 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index aad31a5a9..ac06ec53d 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -21,8 +21,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // txJSON is the JSON representation of transactions. diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 1d0d2a4c7..feb2f9c81 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -22,9 +22,9 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) var ErrInvalidChainId = errors.New("invalid chain id for signer") diff --git a/core/types/transaction_signing_test.go b/core/types/transaction_signing_test.go index 689fc38a9..d152c9c06 100644 --- a/core/types/transaction_signing_test.go +++ b/core/types/transaction_signing_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" ) func TestEIP155Signing(t *testing.T) { diff --git a/core/types/transaction_test.go b/core/types/transaction_test.go index 2e418b230..b3c62a5f1 100644 --- a/core/types/transaction_test.go +++ b/core/types/transaction_test.go @@ -27,9 +27,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" ) // The values in those tests are from the Transaction Tests diff --git a/core/types/types_test.go b/core/types/types_test.go index 1fb386d5d..f39862e4f 100644 --- a/core/types/types_test.go +++ b/core/types/types_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" ) type devnull struct{ len int } diff --git a/core/vm/analysis_test.go b/core/vm/analysis_test.go index 398861f8a..b3dd8dba6 100644 --- a/core/vm/analysis_test.go +++ b/core/vm/analysis_test.go @@ -20,7 +20,7 @@ import ( "math/bits" "testing" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/crypto" ) func TestJumpDestAnalysis(t *testing.T) { diff --git a/core/vm/common.go b/core/vm/common.go index 90ba4a4ad..6371f7cdd 100644 --- a/core/vm/common.go +++ b/core/vm/common.go @@ -17,8 +17,8 @@ package vm import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" "github.com/holiman/uint256" ) diff --git a/core/vm/contract.go b/core/vm/contract.go index bb0902969..a054d15fa 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -19,7 +19,7 @@ package vm import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" "github.com/holiman/uint256" ) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 79f1a3611..d539ddad5 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -22,13 +22,13 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/blake2b" - "github.com/ethereum/go-ethereum/crypto/bls12381" - "github.com/ethereum/go-ethereum/crypto/bn256" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/crypto/blake2b" + "github.com/electroneum/electroneum-sc/crypto/bls12381" + "github.com/electroneum/electroneum-sc/crypto/bn256" + "github.com/electroneum/electroneum-sc/params" //lint:ignore SA1019 Needed for precompile "golang.org/x/crypto/ripemd160" diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index b22d999e6..29a5a4c7f 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // precompiledTest defines the input/output pairs for precompiled contract tests. diff --git a/core/vm/eips.go b/core/vm/eips.go index 93f5c399a..dcd4c375b 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -20,7 +20,7 @@ import ( "fmt" "sort" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" "github.com/holiman/uint256" ) diff --git a/core/vm/evm.go b/core/vm/evm.go index dd55618bf..182719a08 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -21,9 +21,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" "github.com/holiman/uint256" ) diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go index 4c2cb3e5c..67f16c728 100644 --- a/core/vm/gas_table.go +++ b/core/vm/gas_table.go @@ -19,9 +19,9 @@ package vm import ( "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/params" ) // memoryGasCost calculates the quadratic gas for memory expansion. It does so diff --git a/core/vm/gas_table_test.go b/core/vm/gas_table_test.go index 6cd126c9b..cb75b35fa 100644 --- a/core/vm/gas_table_test.go +++ b/core/vm/gas_table_test.go @@ -21,11 +21,11 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/params" ) func TestMemoryGasCost(t *testing.T) { diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 92be3bf25..7e9823dc0 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -19,9 +19,9 @@ package vm import ( "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" "github.com/holiman/uint256" "golang.org/x/crypto/sha3" ) diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index f0fa4811c..a48ad7f14 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -24,9 +24,9 @@ import ( "os" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" "github.com/holiman/uint256" ) diff --git a/core/vm/interface.go b/core/vm/interface.go index ad9b05d66..286720dff 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -19,8 +19,8 @@ package vm import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // StateDB is an EVM database for full state querying. diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 4f1ebc43a..3eab8c35b 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -19,9 +19,9 @@ package vm import ( "hash" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/log" ) // Config are the configuration options for the Interpreter diff --git a/core/vm/interpreter_test.go b/core/vm/interpreter_test.go index dfae0f2e2..e92633dec 100644 --- a/core/vm/interpreter_test.go +++ b/core/vm/interpreter_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/params" ) var loopInterruptTests = []string{ diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index eef3b53d8..509f52994 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -19,7 +19,7 @@ package vm import ( "fmt" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) type ( diff --git a/core/vm/logger.go b/core/vm/logger.go index 50fccafcf..618ec46bb 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -20,7 +20,7 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // EVMLogger is used to collect execution traces from an EVM transaction diff --git a/core/vm/operations_acl.go b/core/vm/operations_acl.go index 551e1f5f1..a645c2071 100644 --- a/core/vm/operations_acl.go +++ b/core/vm/operations_acl.go @@ -19,9 +19,9 @@ package vm import ( "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/params" ) func makeGasSStoreFunc(clearingRefund uint64) gasFunc { diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index dcb097428..b8b2a02d3 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -17,8 +17,8 @@ package runtime import ( - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/vm" ) func NewEnv(cfg *Config) *vm.EVM { diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 7861fb92d..e9bdf32cf 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -21,12 +21,12 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // Config is a basic type specifying certain configuration flags for running diff --git a/core/vm/runtime/runtime_example_test.go b/core/vm/runtime/runtime_example_test.go index b7d0ddc38..4050b492c 100644 --- a/core/vm/runtime/runtime_example_test.go +++ b/core/vm/runtime/runtime_example_test.go @@ -19,8 +19,8 @@ package runtime_test import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm/runtime" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/vm/runtime" ) func ExampleExecute() { diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index fcaa10f1c..86f9609e4 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -24,21 +24,21 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/asm" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers" - "github.com/ethereum/go-ethereum/eth/tracers/logger" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/asm" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/params" // force-load js tracers to trigger registration - _ "github.com/ethereum/go-ethereum/eth/tracers/js" + _ "github.com/electroneum/electroneum-sc/eth/tracers/js" ) func TestDefaults(t *testing.T) { @@ -626,7 +626,7 @@ func TestEip2929Cases(t *testing.T) { // TestColdAccountAccessCost test that the cold account access cost is reported // correctly -// see: https://github.com/ethereum/go-ethereum/issues/22649 +// see: https://github.com/electroneum/electroneum-sc/issues/22649 func TestColdAccountAccessCost(t *testing.T) { for i, tc := range []struct { code []byte diff --git a/core/vm/stack_table.go b/core/vm/stack_table.go index 10c12901a..3120b23e6 100644 --- a/core/vm/stack_table.go +++ b/core/vm/stack_table.go @@ -17,7 +17,7 @@ package vm import ( - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) func minSwapStack(n int) int { diff --git a/crypto/bls12381/g1_test.go b/crypto/bls12381/g1_test.go index eef9f4505..d5448fb1a 100644 --- a/crypto/bls12381/g1_test.go +++ b/crypto/bls12381/g1_test.go @@ -6,7 +6,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func (g *G1) one() *PointG1 { diff --git a/crypto/bls12381/g2_test.go b/crypto/bls12381/g2_test.go index f16f0e5ee..2c20c6607 100644 --- a/crypto/bls12381/g2_test.go +++ b/crypto/bls12381/g2_test.go @@ -6,7 +6,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func (g *G2) one() *PointG2 { diff --git a/crypto/bls12381/pairing_test.go b/crypto/bls12381/pairing_test.go index 77676fe9b..a620b63ed 100644 --- a/crypto/bls12381/pairing_test.go +++ b/crypto/bls12381/pairing_test.go @@ -4,7 +4,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func TestPairingExpected(t *testing.T) { diff --git a/crypto/bls12381/utils.go b/crypto/bls12381/utils.go index de8bf495f..82e03ef97 100644 --- a/crypto/bls12381/utils.go +++ b/crypto/bls12381/utils.go @@ -20,7 +20,7 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func bigFromHex(hex string) *big.Int { diff --git a/crypto/bn256/bn256_fast.go b/crypto/bn256/bn256_fast.go index e3c9b6051..2deae39d7 100644 --- a/crypto/bn256/bn256_fast.go +++ b/crypto/bn256/bn256_fast.go @@ -9,7 +9,7 @@ package bn256 import ( - bn256cf "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" + bn256cf "github.com/electroneum/electroneum-sc/crypto/bn256/cloudflare" ) // G1 is an abstract cyclic group. The zero value is suitable for use as the diff --git a/crypto/bn256/bn256_slow.go b/crypto/bn256/bn256_slow.go index 4c0c351e2..1896ba15f 100644 --- a/crypto/bn256/bn256_slow.go +++ b/crypto/bn256/bn256_slow.go @@ -8,7 +8,7 @@ // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 -import bn256 "github.com/ethereum/go-ethereum/crypto/bn256/google" +import bn256 "github.com/electroneum/electroneum-sc/crypto/bn256/google" // G1 is an abstract cyclic group. The zero value is suitable for use as the // output of an operation, but cannot be used as an input. diff --git a/crypto/crypto.go b/crypto/crypto.go index 45ea72747..8eb763b28 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -29,9 +29,9 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index da123cf98..0bb6d0398 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -25,8 +25,8 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) var testAddrHex = "970e8128ab834e8eac17ab8e3812f010678cf791" diff --git a/crypto/ecies/ecies_test.go b/crypto/ecies/ecies_test.go index 96e33da00..af07a1d4d 100644 --- a/crypto/ecies/ecies_test.go +++ b/crypto/ecies/ecies_test.go @@ -39,7 +39,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/crypto" ) func TestKDF(t *testing.T) { diff --git a/crypto/ecies/params.go b/crypto/ecies/params.go index 39e7c8947..f1fa7da39 100644 --- a/crypto/ecies/params.go +++ b/crypto/ecies/params.go @@ -42,7 +42,7 @@ import ( "fmt" "hash" - ethcrypto "github.com/ethereum/go-ethereum/crypto" + ethcrypto "github.com/electroneum/electroneum-sc/crypto" ) var ( diff --git a/crypto/secp256k1/dummy.go b/crypto/secp256k1/dummy.go index 65a75080f..342c8e7d1 100644 --- a/crypto/secp256k1/dummy.go +++ b/crypto/secp256k1/dummy.go @@ -15,7 +15,7 @@ package secp256k1 import ( - _ "github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/include" - _ "github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src" - _ "github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/recovery" + _ "github.com/electroneum/electroneum-sc/crypto/secp256k1/libsecp256k1/include" + _ "github.com/electroneum/electroneum-sc/crypto/secp256k1/libsecp256k1/src" + _ "github.com/electroneum/electroneum-sc/crypto/secp256k1/libsecp256k1/src/modules/recovery" ) diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index bd72d97d3..f56fac846 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -24,8 +24,8 @@ import ( "crypto/elliptic" "fmt" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto/secp256k1" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto/secp256k1" ) // Ecrecover returns the uncompressed public key that created the given signature. diff --git a/crypto/signature_test.go b/crypto/signature_test.go index aecff76bf..8e63141bc 100644 --- a/crypto/signature_test.go +++ b/crypto/signature_test.go @@ -22,9 +22,9 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" ) var ( diff --git a/eth/api.go b/eth/api.go index ef69acb76..d531720fb 100644 --- a/eth/api.go +++ b/eth/api.go @@ -28,17 +28,17 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" + "github.com/electroneum/electroneum-sc/trie" ) // PublicEthereumAPI provides an API to access Ethereum full node-related diff --git a/eth/api_backend.go b/eth/api_backend.go index f942710e2..f10053ffc 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -23,22 +23,22 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) // EthAPIBackend implements ethapi.Backend for full nodes @@ -288,7 +288,7 @@ func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.S return b.eth.TxPool().SubscribeNewTxsEvent(ch) } -func (b *EthAPIBackend) SyncProgress() ethereum.SyncProgress { +func (b *EthAPIBackend) SyncProgress() electroneum.SyncProgress { return b.eth.Downloader().Progress() } diff --git a/eth/api_test.go b/eth/api_test.go index 39a1d5846..47253b97e 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -25,10 +25,10 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/crypto" ) var dumper = spew.ConfigState{Indent: " "} diff --git a/eth/backend.go b/eth/backend.go index cc33055fe..217636c71 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -26,38 +26,38 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/beacon" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/pruner" - "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/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/internal/shutdowncheck" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/beacon" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/pruner" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/eth/filters" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/internal/shutdowncheck" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/dnsdisc" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" ) // Config contains the configuration options of the ETH protocol. diff --git a/eth/bloombits.go b/eth/bloombits.go index 0cb7050d2..d10c94490 100644 --- a/eth/bloombits.go +++ b/eth/bloombits.go @@ -19,8 +19,8 @@ package eth import ( "time" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/core/rawdb" ) const ( diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 108ec412d..4fbb2100c 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -25,15 +25,15 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/beacon" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/beacon" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/rpc" ) // Register adds catalyst APIs to the full node. diff --git a/eth/catalyst/api_test.go b/eth/catalyst/api_test.go index 415506d58..309b25048 100644 --- a/eth/catalyst/api_test.go +++ b/eth/catalyst/api_test.go @@ -23,21 +23,21 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/beacon" - "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" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/beacon" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/eth/catalyst/queue.go b/eth/catalyst/queue.go index ff8edc120..a29757e0b 100644 --- a/eth/catalyst/queue.go +++ b/eth/catalyst/queue.go @@ -20,9 +20,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/beacon" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/beacon" + "github.com/electroneum/electroneum-sc/core/types" ) // maxTrackedPayloads is the maximum number of prepared payloads the execution diff --git a/eth/discovery.go b/eth/discovery.go index f7c85b4c5..70fd2e0e0 100644 --- a/eth/discovery.go +++ b/eth/discovery.go @@ -17,10 +17,10 @@ package eth import ( - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) // ethEntry is the "eth" ENR entry which advertises eth protocol diff --git a/eth/downloader/api.go b/eth/downloader/api.go index 2024d23de..b74f3cc26 100644 --- a/eth/downloader/api.go +++ b/eth/downloader/api.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/rpc" ) // PublicDownloaderAPI provides an API which gives information about the current synchronisation status. @@ -121,8 +121,8 @@ func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, // SyncingResult provides information about the current synchronisation status for this node. type SyncingResult struct { - Syncing bool `json:"syncing"` - Status ethereum.SyncProgress `json:"status"` + Syncing bool `json:"syncing"` + Status electroneum.SyncProgress `json:"status"` } // uninstallSyncSubscriptionRequest uninstalles a syncing subscription in the API event loop. diff --git a/eth/downloader/beaconsync.go b/eth/downloader/beaconsync.go index 533404f6c..f8c20185d 100644 --- a/eth/downloader/beaconsync.go +++ b/eth/downloader/beaconsync.go @@ -22,9 +22,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" ) // beaconBackfiller is the chain and state backfilling that can be commenced once diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index c836fdd4b..8782022c2 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -25,16 +25,16 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) var ( @@ -236,7 +236,7 @@ func New(checkpoint uint64, stateDb ethdb.Database, mux *event.TypeMux, chain Bl // In addition, during the state download phase of snap synchronisation the number // of processed and the total number of known states are also returned. Otherwise // these are zero. -func (d *Downloader) Progress() ethereum.SyncProgress { +func (d *Downloader) Progress() electroneum.SyncProgress { // Lock the current stats and return the progress d.syncStatsLock.RLock() defer d.syncStatsLock.RUnlock() @@ -255,7 +255,7 @@ func (d *Downloader) Progress() ethereum.SyncProgress { } progress, pending := d.SnapSyncer.Progress() - return ethereum.SyncProgress{ + return electroneum.SyncProgress{ StartingBlock: d.syncStatsChainOrigin, CurrentBlock: current, HighestBlock: d.syncStatsChainHeight, diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index a5db037a4..8bd3d8b68 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -27,20 +27,20 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // downloadTester is a test simulator for mocking out local block chain. @@ -1002,7 +1002,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Synchronise half the blocks and check initial progress tester.newPeer("peer-half", protocol, chain.shorten(len(chain.blocks) / 2).blocks[1:]) @@ -1016,7 +1016,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(len(chain.blocks)/2 - 1), }) progress <- struct{}{} @@ -1032,7 +1032,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "completing", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "completing", electroneum.SyncProgress{ StartingBlock: uint64(len(chain.blocks)/2 - 1), CurrentBlock: uint64(len(chain.blocks)/2 - 1), HighestBlock: uint64(len(chain.blocks) - 1), @@ -1041,14 +1041,14 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ StartingBlock: uint64(len(chain.blocks)/2 - 1), CurrentBlock: uint64(len(chain.blocks) - 1), HighestBlock: uint64(len(chain.blocks) - 1), }) } -func checkProgress(t *testing.T, d *Downloader, stage string, want ethereum.SyncProgress) { +func checkProgress(t *testing.T, d *Downloader, stage string, want electroneum.SyncProgress) { // Mark this method as a helper to report errors at callsite, not in here t.Helper() @@ -1080,7 +1080,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Synchronise with one of the forks and check progress tester.newPeer("fork A", protocol, chainA.blocks[1:]) @@ -1094,7 +1094,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(len(chainA.blocks) - 1), }) progress <- struct{}{} @@ -1113,7 +1113,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "forking", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "forking", electroneum.SyncProgress{ StartingBlock: uint64(len(testChainBase.blocks)) - 1, CurrentBlock: uint64(len(chainA.blocks) - 1), HighestBlock: uint64(len(chainB.blocks) - 1), @@ -1122,7 +1122,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ StartingBlock: uint64(len(testChainBase.blocks)) - 1, CurrentBlock: uint64(len(chainB.blocks) - 1), HighestBlock: uint64(len(chainB.blocks) - 1), @@ -1150,7 +1150,7 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Attempt a full sync with a faulty peer missing := len(chain.blocks)/2 - 1 @@ -1167,7 +1167,7 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(len(chain.blocks) - 1), }) progress <- struct{}{} @@ -1190,7 +1190,7 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ CurrentBlock: uint64(len(chain.blocks) - 1), HighestBlock: uint64(len(chain.blocks) - 1), }) @@ -1215,7 +1215,7 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Create and sync with an attacker that promises a higher chain than available. attacker := tester.newPeer("attack", protocol, chain.blocks[1:]) @@ -1232,7 +1232,7 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(len(chain.blocks) - 1), }) progress <- struct{}{} @@ -1252,14 +1252,14 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "completing", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "completing", electroneum.SyncProgress{ CurrentBlock: afterFailedSync.CurrentBlock, HighestBlock: uint64(len(validChain.blocks) - 1), }) // Check final progress after successful sync. progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ CurrentBlock: uint64(len(validChain.blocks) - 1), HighestBlock: uint64(len(validChain.blocks) - 1), }) diff --git a/eth/downloader/events.go b/eth/downloader/events.go index 25255a3a7..86f7920c6 100644 --- a/eth/downloader/events.go +++ b/eth/downloader/events.go @@ -16,7 +16,7 @@ package downloader -import "github.com/ethereum/go-ethereum/core/types" +import "github.com/electroneum/electroneum-sc/core/types" type DoneEvent struct { Latest *types.Header diff --git a/eth/downloader/fetchers.go b/eth/downloader/fetchers.go index 021e8c4f9..38d3c58e9 100644 --- a/eth/downloader/fetchers.go +++ b/eth/downloader/fetchers.go @@ -19,9 +19,9 @@ package downloader import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" ) // fetchHeadersByHash is a blocking version of Peer.RequestHeadersByHash which diff --git a/eth/downloader/fetchers_concurrent.go b/eth/downloader/fetchers_concurrent.go index a0aa19717..9d8ea2f09 100644 --- a/eth/downloader/fetchers_concurrent.go +++ b/eth/downloader/fetchers_concurrent.go @@ -21,10 +21,10 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" ) // timeoutGracePeriod is the amount of time to allow for a peer to deliver a diff --git a/eth/downloader/fetchers_concurrent_bodies.go b/eth/downloader/fetchers_concurrent_bodies.go index a8de41032..be81298f1 100644 --- a/eth/downloader/fetchers_concurrent_bodies.go +++ b/eth/downloader/fetchers_concurrent_bodies.go @@ -19,9 +19,9 @@ package downloader import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" ) // bodyQueue implements typedQueue and is a type adapter between the generic diff --git a/eth/downloader/fetchers_concurrent_headers.go b/eth/downloader/fetchers_concurrent_headers.go index bd3bb3e00..692aab422 100644 --- a/eth/downloader/fetchers_concurrent_headers.go +++ b/eth/downloader/fetchers_concurrent_headers.go @@ -19,9 +19,9 @@ package downloader import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" ) // headerQueue implements typedQueue and is a type adapter between the generic diff --git a/eth/downloader/fetchers_concurrent_receipts.go b/eth/downloader/fetchers_concurrent_receipts.go index fee2c3410..772e4ea20 100644 --- a/eth/downloader/fetchers_concurrent_receipts.go +++ b/eth/downloader/fetchers_concurrent_receipts.go @@ -19,9 +19,9 @@ package downloader import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" ) // receiptQueue implements typedQueue and is a type adapter between the generic diff --git a/eth/downloader/metrics.go b/eth/downloader/metrics.go index 23c033a8a..ef92562b0 100644 --- a/eth/downloader/metrics.go +++ b/eth/downloader/metrics.go @@ -19,7 +19,7 @@ package downloader import ( - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) var ( diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index d74d23e74..f58045207 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/msgrate" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/msgrate" ) const ( diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index ff34d932f..3132a12d9 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -26,11 +26,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" ) const ( diff --git a/eth/downloader/queue_test.go b/eth/downloader/queue_test.go index 09b18afe5..fef821c5e 100644 --- a/eth/downloader/queue_test.go +++ b/eth/downloader/queue_test.go @@ -24,14 +24,14 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/eth/downloader/resultstore.go b/eth/downloader/resultstore.go index 3162cd6d5..13c9a0852 100644 --- a/eth/downloader/resultstore.go +++ b/eth/downloader/resultstore.go @@ -21,7 +21,7 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // resultStore implements a structure for maintaining fetchResults, tracking their diff --git a/eth/downloader/skeleton.go b/eth/downloader/skeleton.go index be4e8fbfc..7598f010e 100644 --- a/eth/downloader/skeleton.go +++ b/eth/downloader/skeleton.go @@ -24,12 +24,12 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) // scratchHeaders is the number of headers to store in a scratch space to allow diff --git a/eth/downloader/skeleton_test.go b/eth/downloader/skeleton_test.go index 836efabeb..ac38636d5 100644 --- a/eth/downloader/skeleton_test.go +++ b/eth/downloader/skeleton_test.go @@ -26,11 +26,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" ) // hookedBackfiller is a tester backfiller with all interface methods mocked and diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 501af63ed..57be6e9bb 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -19,8 +19,8 @@ package downloader import ( "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" ) // syncState starts downloading state with the given root hash. diff --git a/eth/downloader/testchain_test.go b/eth/downloader/testchain_test.go index 8b873343c..8e16455cf 100644 --- a/eth/downloader/testchain_test.go +++ b/eth/downloader/testchain_test.go @@ -22,14 +22,14 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // Test chain parameters. diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 847a50280..3dae4ac54 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -25,21 +25,21 @@ import ( "runtime" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/beacon" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/consensus/istanbul" - istanbulBackend "github.com/ethereum/go-ethereum/consensus/istanbul/backend" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/beacon" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + istanbulBackend "github.com/electroneum/electroneum-sc/consensus/istanbul/backend" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" ) // FullNodeGPO contains default gasprice oracle settings for full node. diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 13e062dc9..70c2ff48b 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -6,14 +6,14 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/consensus/istanbul" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/consensus/istanbul" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/params" ) // MarshalTOML marshals as TOML. diff --git a/eth/fetcher/block_fetcher.go b/eth/fetcher/block_fetcher.go index d75ba3f8e..3bc87333a 100644 --- a/eth/fetcher/block_fetcher.go +++ b/eth/fetcher/block_fetcher.go @@ -22,14 +22,14 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/trie" ) const ( diff --git a/eth/fetcher/block_fetcher_test.go b/eth/fetcher/block_fetcher_test.go index 06c61ae55..d97d871dd 100644 --- a/eth/fetcher/block_fetcher_test.go +++ b/eth/fetcher/block_fetcher_test.go @@ -24,15 +24,15 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/protocols/eth" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index a23cd24bf..3bf3bcf6b 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -25,12 +25,12 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" ) const ( diff --git a/eth/fetcher/tx_fetcher_test.go b/eth/fetcher/tx_fetcher_test.go index ce8d02af7..590446de7 100644 --- a/eth/fetcher/tx_fetcher_test.go +++ b/eth/fetcher/tx_fetcher_test.go @@ -23,10 +23,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" ) var ( diff --git a/eth/filters/api.go b/eth/filters/api.go index 7196e90f9..5dd0de67e 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rpc" ) // filter is a helper struct that holds meta information over the filter type @@ -246,7 +246,7 @@ func (api *PublicFilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc matchedLogs = make(chan []*types.Log) ) - logsSub, err := api.events.SubscribeLogs(ethereum.FilterQuery(crit), matchedLogs) + logsSub, err := api.events.SubscribeLogs(electroneum.FilterQuery(crit), matchedLogs) if err != nil { return nil, err } @@ -274,7 +274,7 @@ func (api *PublicFilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc // FilterCriteria represents a request to create a new filter. // Same as ethereum.FilterQuery but with UnmarshalJSON() method. -type FilterCriteria ethereum.FilterQuery +type FilterCriteria electroneum.FilterQuery // NewFilter creates a new filter and returns the filter id. It can be // used to retrieve logs when the state changes. This method cannot be @@ -291,7 +291,7 @@ type FilterCriteria ethereum.FilterQuery // https://eth.wiki/json-rpc/API#eth_newfilter func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) { logs := make(chan []*types.Log) - logsSub, err := api.events.SubscribeLogs(ethereum.FilterQuery(crit), logs) + logsSub, err := api.events.SubscribeLogs(electroneum.FilterQuery(crit), logs) if err != nil { return "", err } diff --git a/eth/filters/api_test.go b/eth/filters/api_test.go index 02229a754..e70edce20 100644 --- a/eth/filters/api_test.go +++ b/eth/filters/api_test.go @@ -21,8 +21,8 @@ import ( "fmt" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rpc" ) func TestUnmarshalJSONNewFilterArgs(t *testing.T) { diff --git a/eth/filters/bench_test.go b/eth/filters/bench_test.go index 9632f4195..77f7bcf04 100644 --- a/eth/filters/bench_test.go +++ b/eth/filters/bench_test.go @@ -22,13 +22,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/node" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/node" ) func BenchmarkBloomBits512(b *testing.B) { diff --git a/eth/filters/filter.go b/eth/filters/filter.go index f64e84abb..bacabea86 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -21,13 +21,13 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/rpc" ) type Backend interface { diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index c1a1b408b..6d91115c6 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -24,14 +24,14 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "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/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" ) // Type determines the kind of filter and is used to put the filter in to @@ -72,7 +72,7 @@ type subscription struct { id rpc.ID typ Type created time.Time - logsCrit ethereum.FilterQuery + logsCrit electroneum.FilterQuery logs chan []*types.Log hashes chan []common.Hash headers chan *types.Header @@ -187,7 +187,7 @@ func (es *EventSystem) subscribe(sub *subscription) *Subscription { // SubscribeLogs creates a subscription that will write all logs matching the // given criteria to the given logs channel. Default value for the from and to // block is "latest". If the fromBlock > toBlock an error is returned. -func (es *EventSystem) SubscribeLogs(crit ethereum.FilterQuery, logs chan []*types.Log) (*Subscription, error) { +func (es *EventSystem) SubscribeLogs(crit electroneum.FilterQuery, logs chan []*types.Log) (*Subscription, error) { var from, to rpc.BlockNumber if crit.FromBlock == nil { from = rpc.LatestBlockNumber @@ -225,7 +225,7 @@ func (es *EventSystem) SubscribeLogs(crit ethereum.FilterQuery, logs chan []*typ // subscribeMinedPendingLogs creates a subscription that returned mined and // pending logs that match the given criteria. -func (es *EventSystem) subscribeMinedPendingLogs(crit ethereum.FilterQuery, logs chan []*types.Log) *Subscription { +func (es *EventSystem) subscribeMinedPendingLogs(crit electroneum.FilterQuery, logs chan []*types.Log) *Subscription { sub := &subscription{ id: rpc.NewID(), typ: MinedAndPendingLogsSubscription, @@ -242,7 +242,7 @@ func (es *EventSystem) subscribeMinedPendingLogs(crit ethereum.FilterQuery, logs // subscribeLogs creates a subscription that will write all logs matching the // given criteria to the given logs channel. -func (es *EventSystem) subscribeLogs(crit ethereum.FilterQuery, logs chan []*types.Log) *Subscription { +func (es *EventSystem) subscribeLogs(crit electroneum.FilterQuery, logs chan []*types.Log) *Subscription { sub := &subscription{ id: rpc.NewID(), typ: LogsSubscription, @@ -259,7 +259,7 @@ func (es *EventSystem) subscribeLogs(crit ethereum.FilterQuery, logs chan []*typ // subscribePendingLogs creates a subscription that writes contract event logs for // transactions that enter the transaction pool. -func (es *EventSystem) subscribePendingLogs(crit ethereum.FilterQuery, logs chan []*types.Log) *Subscription { +func (es *EventSystem) subscribePendingLogs(crit electroneum.FilterQuery, logs chan []*types.Log) *Subscription { sub := &subscription{ id: rpc.NewID(), typ: PendingLogsSubscription, diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index 87971d5a9..f9a856458 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -26,17 +26,17 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) var ( @@ -512,7 +512,7 @@ func TestPendingLogsSubscription(t *testing.T) { pendingBlockNumber = big.NewInt(rpc.PendingBlockNumber.Int64()) testCases = []struct { - crit ethereum.FilterQuery + crit electroneum.FilterQuery expected []*types.Log c chan []*types.Log sub *Subscription @@ -520,67 +520,67 @@ func TestPendingLogsSubscription(t *testing.T) { }{ // match all { - ethereum.FilterQuery{FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, flattenLogs(allLogs), nil, nil, nil, }, // match none due to no matching addresses { - ethereum.FilterQuery{Addresses: []common.Address{{}, notUsedAddress}, Topics: [][]common.Hash{nil}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{Addresses: []common.Address{{}, notUsedAddress}, Topics: [][]common.Hash{nil}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, nil, nil, nil, nil, }, // match logs based on addresses, ignore topics { - ethereum.FilterQuery{Addresses: []common.Address{firstAddr}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{Addresses: []common.Address{firstAddr}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, append(flattenLogs(allLogs[:2]), allLogs[5][3]), nil, nil, nil, }, // match none due to no matching topics (match with address) { - ethereum.FilterQuery{Addresses: []common.Address{secondAddr}, Topics: [][]common.Hash{{notUsedTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{Addresses: []common.Address{secondAddr}, Topics: [][]common.Hash{{notUsedTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, nil, nil, nil, nil, }, // match logs based on addresses and topics { - ethereum.FilterQuery{Addresses: []common.Address{thirdAddress}, Topics: [][]common.Hash{{firstTopic, secondTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{Addresses: []common.Address{thirdAddress}, Topics: [][]common.Hash{{firstTopic, secondTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, append(flattenLogs(allLogs[3:5]), allLogs[5][0]), nil, nil, nil, }, // match logs based on multiple addresses and "or" topics { - ethereum.FilterQuery{Addresses: []common.Address{secondAddr, thirdAddress}, Topics: [][]common.Hash{{firstTopic, secondTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{Addresses: []common.Address{secondAddr, thirdAddress}, Topics: [][]common.Hash{{firstTopic, secondTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, append(flattenLogs(allLogs[2:5]), allLogs[5][0]), nil, nil, nil, }, // multiple pending logs, should match only 2 topics from the logs in block 5 { - ethereum.FilterQuery{Addresses: []common.Address{thirdAddress}, Topics: [][]common.Hash{{firstTopic, fourthTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, + electroneum.FilterQuery{Addresses: []common.Address{thirdAddress}, Topics: [][]common.Hash{{firstTopic, fourthTopic}}, FromBlock: pendingBlockNumber, ToBlock: pendingBlockNumber}, []*types.Log{allLogs[5][0], allLogs[5][2]}, nil, nil, nil, }, // match none due to only matching new mined logs { - ethereum.FilterQuery{}, + electroneum.FilterQuery{}, nil, nil, nil, nil, }, // match none due to only matching mined logs within a specific block range { - ethereum.FilterQuery{FromBlock: big.NewInt(1), ToBlock: big.NewInt(2)}, + electroneum.FilterQuery{FromBlock: big.NewInt(1), ToBlock: big.NewInt(2)}, nil, nil, nil, nil, }, // match all due to matching mined and pending logs { - ethereum.FilterQuery{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, + electroneum.FilterQuery{FromBlock: big.NewInt(rpc.LatestBlockNumber.Int64()), ToBlock: big.NewInt(rpc.PendingBlockNumber.Int64())}, flattenLogs(allLogs), nil, nil, nil, }, // match none due to matching logs from a specific block number to new mined blocks { - ethereum.FilterQuery{FromBlock: big.NewInt(1), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, + electroneum.FilterQuery{FromBlock: big.NewInt(1), ToBlock: big.NewInt(rpc.LatestBlockNumber.Int64())}, nil, nil, nil, nil, }, diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index f415046a8..daa549910 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "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/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) func makeReceipt(addr common.Address) *types.Receipt { diff --git a/eth/gasprice/feehistory.go b/eth/gasprice/feehistory.go index 4113089af..e8541cbdc 100644 --- a/eth/gasprice/feehistory.go +++ b/eth/gasprice/feehistory.go @@ -26,11 +26,11 @@ import ( "sort" "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" ) var ( diff --git a/eth/gasprice/feehistory_test.go b/eth/gasprice/feehistory_test.go index c259eb0ac..3dc7330ce 100644 --- a/eth/gasprice/feehistory_test.go +++ b/eth/gasprice/feehistory_test.go @@ -22,7 +22,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/rpc" ) func TestFeeHistory(t *testing.T) { diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 00128a5dc..654aee252 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -22,13 +22,13 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" lru "github.com/hashicorp/golang-lru" ) diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index c0d3c6b60..04da230e7 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -22,16 +22,16 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) const testHead = 32 diff --git a/eth/handler.go b/eth/handler.go index 66f2c9f06..cc7c7caa8 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -25,25 +25,25 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/beacon" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "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/eth/fetcher" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/beacon" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/fetcher" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/eth/handler_eth.go b/eth/handler_eth.go index 12e91ec7f..8b4a6353b 100644 --- a/eth/handler_eth.go +++ b/eth/handler_eth.go @@ -22,11 +22,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // ethHandler implements the eth.Backend interface to handle the various network diff --git a/eth/handler_eth_test.go b/eth/handler_eth_test.go index dffbfbe61..bb55868b6 100644 --- a/eth/handler_eth_test.go +++ b/eth/handler_eth_test.go @@ -24,21 +24,21 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "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/eth/downloader" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // testEthHandler is a mock event handler to listen for inbound network requests diff --git a/eth/handler_snap.go b/eth/handler_snap.go index 767416ffd..cd1d2a602 100644 --- a/eth/handler_snap.go +++ b/eth/handler_snap.go @@ -17,9 +17,9 @@ package eth import ( - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // snapHandler implements the snap.Backend interface to handle the various network diff --git a/eth/handler_test.go b/eth/handler_test.go index d967b6df9..e43866463 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -21,18 +21,18 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/eth/ibft_protocol.go b/eth/ibft_protocol.go index 3879f6582..0ab3343d9 100644 --- a/eth/ibft_protocol.go +++ b/eth/ibft_protocol.go @@ -3,7 +3,7 @@ package eth import ( "errors" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/p2p" ) // ibft_protocol enables the eth service to return two different protocols, one for the eth mainnet "eth" service, diff --git a/eth/peer.go b/eth/peer.go index 024a6e619..7632f2874 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -19,8 +19,8 @@ package eth import ( "math/big" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" ) // ethPeerInfo represents a short summary of the `eth` sub-protocol metadata known diff --git a/eth/peerset.go b/eth/peerset.go index 3e54a481e..a36e83831 100644 --- a/eth/peerset.go +++ b/eth/peerset.go @@ -21,10 +21,10 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/p2p" ) var ( diff --git a/eth/protocols/eth/broadcast.go b/eth/protocols/eth/broadcast.go index 09330cfdf..2e3ce768f 100644 --- a/eth/protocols/eth/broadcast.go +++ b/eth/protocols/eth/broadcast.go @@ -19,8 +19,8 @@ package eth import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) const ( diff --git a/eth/protocols/eth/discovery.go b/eth/protocols/eth/discovery.go index 03f2ea3cc..23a875b40 100644 --- a/eth/protocols/eth/discovery.go +++ b/eth/protocols/eth/discovery.go @@ -17,10 +17,10 @@ package eth import ( - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) // enrEntry is the ENR entry which advertises `eth` protocol on the discovery. diff --git a/eth/protocols/eth/dispatcher.go b/eth/protocols/eth/dispatcher.go index bf88d400d..aa48b39af 100644 --- a/eth/protocols/eth/dispatcher.go +++ b/eth/protocols/eth/dispatcher.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/p2p" ) var ( diff --git a/eth/protocols/eth/handler.go b/eth/protocols/eth/handler.go index 81d45d8b8..cc81cf611 100644 --- a/eth/protocols/eth/handler.go +++ b/eth/protocols/eth/handler.go @@ -21,14 +21,14 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/eth/protocols/eth/handler_test.go b/eth/protocols/eth/handler_test.go index bf836e8f5..cfbc214ce 100644 --- a/eth/protocols/eth/handler_test.go +++ b/eth/protocols/eth/handler_test.go @@ -22,18 +22,18 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/common" - "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/state" - "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/ethdb" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/eth/protocols/eth/handlers.go b/eth/protocols/eth/handlers.go index c8585dfdf..4e9240b3d 100644 --- a/eth/protocols/eth/handlers.go +++ b/eth/protocols/eth/handlers.go @@ -20,12 +20,12 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // handleGetBlockHeaders66 is the eth/66 version of handleGetBlockHeaders diff --git a/eth/protocols/eth/handshake.go b/eth/protocols/eth/handshake.go index 9a2769fa0..2219ac3cb 100644 --- a/eth/protocols/eth/handshake.go +++ b/eth/protocols/eth/handshake.go @@ -21,9 +21,9 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/p2p" ) const ( diff --git a/eth/protocols/eth/handshake_test.go b/eth/protocols/eth/handshake_test.go index 8cf5216cf..b9d9d1886 100644 --- a/eth/protocols/eth/handshake_test.go +++ b/eth/protocols/eth/handshake_test.go @@ -20,10 +20,10 @@ import ( "errors" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // Tests that handshake failures are detected and reported correctly. diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 6166f6dfb..4d8c14686 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -22,10 +22,10 @@ import ( "sync" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rlp" ) const ( diff --git a/eth/protocols/eth/peer_test.go b/eth/protocols/eth/peer_test.go index 0916ebee5..853d69e9e 100644 --- a/eth/protocols/eth/peer_test.go +++ b/eth/protocols/eth/peer_test.go @@ -23,9 +23,9 @@ import ( "crypto/rand" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // testPeer is a simulated peer to allow testing direct network calls. diff --git a/eth/protocols/eth/protocol.go b/eth/protocols/eth/protocol.go index 24b65f01d..02dcb9d85 100644 --- a/eth/protocols/eth/protocol.go +++ b/eth/protocols/eth/protocol.go @@ -22,10 +22,10 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) // Constants to match up protocol versions and messages diff --git a/eth/protocols/eth/protocol_test.go b/eth/protocols/eth/protocol_test.go index 5ca895774..7b830f35c 100644 --- a/eth/protocols/eth/protocol_test.go +++ b/eth/protocols/eth/protocol_test.go @@ -21,9 +21,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) // Tests that the custom union field encoder and decoder works correctly. diff --git a/eth/protocols/eth/tracker.go b/eth/protocols/eth/tracker.go index 324fd2283..e0a2d04ef 100644 --- a/eth/protocols/eth/tracker.go +++ b/eth/protocols/eth/tracker.go @@ -19,7 +19,7 @@ package eth import ( "time" - "github.com/ethereum/go-ethereum/p2p/tracker" + "github.com/electroneum/electroneum-sc/p2p/tracker" ) // requestTracker is a singleton tracker for eth/66 and newer request times. diff --git a/eth/protocols/snap/discovery.go b/eth/protocols/snap/discovery.go index 684ec7e63..b3513837a 100644 --- a/eth/protocols/snap/discovery.go +++ b/eth/protocols/snap/discovery.go @@ -17,7 +17,7 @@ package snap import ( - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) // enrEntry is the ENR entry which advertises `snap` protocol on the discovery. diff --git a/eth/protocols/snap/handler.go b/eth/protocols/snap/handler.go index 23638ef88..f941cd30a 100644 --- a/eth/protocols/snap/handler.go +++ b/eth/protocols/snap/handler.go @@ -21,17 +21,17 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) const ( diff --git a/eth/protocols/snap/peer.go b/eth/protocols/snap/peer.go index 87a62d2f8..261140b40 100644 --- a/eth/protocols/snap/peer.go +++ b/eth/protocols/snap/peer.go @@ -17,9 +17,9 @@ package snap import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" ) // Peer is a collection of relevant information we have about a `snap` peer. diff --git a/eth/protocols/snap/protocol.go b/eth/protocols/snap/protocol.go index 60a254f39..47c20eb49 100644 --- a/eth/protocols/snap/protocol.go +++ b/eth/protocols/snap/protocol.go @@ -20,9 +20,9 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/rlp" ) // Constants to match up protocol versions and messages diff --git a/eth/protocols/snap/range.go b/eth/protocols/snap/range.go index 2627cb954..cf61338be 100644 --- a/eth/protocols/snap/range.go +++ b/eth/protocols/snap/range.go @@ -19,7 +19,7 @@ package snap import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" "github.com/holiman/uint256" ) diff --git a/eth/protocols/snap/range_test.go b/eth/protocols/snap/range_test.go index c6dc8fb71..521e7e89e 100644 --- a/eth/protocols/snap/range_test.go +++ b/eth/protocols/snap/range_test.go @@ -19,7 +19,7 @@ package snap import ( "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // Tests that given a starting hash and a density, the hash ranger can correctly diff --git a/eth/protocols/snap/sort_test.go b/eth/protocols/snap/sort_test.go index c625be09e..8f8757aa6 100644 --- a/eth/protocols/snap/sort_test.go +++ b/eth/protocols/snap/sort_test.go @@ -21,8 +21,8 @@ import ( "fmt" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/trie" ) func hexToNibbles(s string) []byte { diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 415253c83..cf50b4441 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -27,20 +27,20 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/msgrate" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/msgrate" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/eth/protocols/snap/sync_test.go b/eth/protocols/snap/sync_test.go index e727544fa..ed0eb2407 100644 --- a/eth/protocols/snap/sync_test.go +++ b/eth/protocols/snap/sync_test.go @@ -27,15 +27,15 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/eth/protocols/snap/tracker.go b/eth/protocols/snap/tracker.go index 2cf59cc23..e4b9de0d6 100644 --- a/eth/protocols/snap/tracker.go +++ b/eth/protocols/snap/tracker.go @@ -19,7 +19,7 @@ package snap import ( "time" - "github.com/ethereum/go-ethereum/p2p/tracker" + "github.com/electroneum/electroneum-sc/p2p/tracker" ) // requestTracker is a singleton tracker for request times. diff --git a/eth/state_accessor.go b/eth/state_accessor.go index f01db93a6..ac5cbb9dc 100644 --- a/eth/state_accessor.go +++ b/eth/state_accessor.go @@ -21,13 +21,13 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/trie" ) // StateAtBlock retrieves the state database associated with a certain block. diff --git a/eth/sync.go b/eth/sync.go index d67d2311d..a454e0d18 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -22,12 +22,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/log" ) const ( diff --git a/eth/sync_test.go b/eth/sync_test.go index 929a2a9d1..3241b44e7 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // Tests that snap sync is disabled after a successful sync cycle. diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 074f193e6..0e7ffb280 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -27,21 +27,21 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers/logger" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" ) const ( diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index af41f05d2..c55817692 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -29,21 +29,21 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "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/state" - "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/eth/tracers/logger" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) var ( diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index 61a9b12bc..6170aa2c5 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -26,22 +26,22 @@ import ( "testing" "unicode" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/tracers" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/tests" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/tests" // Force-load native and js pacakges, to trigger registration - _ "github.com/ethereum/go-ethereum/eth/tracers/js" - _ "github.com/ethereum/go-ethereum/eth/tracers/native" + _ "github.com/electroneum/electroneum-sc/eth/tracers/js" + _ "github.com/electroneum/electroneum-sc/eth/tracers/native" ) // To generate a new callTracer test, copy paste the makeTest method below into diff --git a/eth/tracers/js/goja.go b/eth/tracers/js/goja.go index f0c78c084..45d3dac5b 100644 --- a/eth/tracers/js/goja.go +++ b/eth/tracers/js/goja.go @@ -25,12 +25,12 @@ import ( "github.com/dop251/goja" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/tracers" - jsassets "github.com/ethereum/go-ethereum/eth/tracers/js/internal/tracers" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers" + jsassets "github.com/electroneum/electroneum-sc/eth/tracers/js/internal/tracers" ) var assetTracers = make(map[string]string) diff --git a/eth/tracers/js/tracer_test.go b/eth/tracers/js/tracer_test.go index 2863bd445..6e3415b84 100644 --- a/eth/tracers/js/tracer_test.go +++ b/eth/tracers/js/tracer_test.go @@ -24,11 +24,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers" + "github.com/electroneum/electroneum-sc/params" ) type account struct{} diff --git a/eth/tracers/logger/access_list_tracer.go b/eth/tracers/logger/access_list_tracer.go index a8908094e..e3a9ca695 100644 --- a/eth/tracers/logger/access_list_tracer.go +++ b/eth/tracers/logger/access_list_tracer.go @@ -20,9 +20,9 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" ) // accessList is an accumulator for the set of accounts and storage slots an EVM diff --git a/eth/tracers/logger/gen_structlog.go b/eth/tracers/logger/gen_structlog.go index df06a9ee6..193489371 100644 --- a/eth/tracers/logger/gen_structlog.go +++ b/eth/tracers/logger/gen_structlog.go @@ -5,10 +5,10 @@ package logger import ( "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/vm" "github.com/holiman/uint256" ) diff --git a/eth/tracers/logger/logger.go b/eth/tracers/logger/logger.go index fe850d6b3..7261f3b7e 100644 --- a/eth/tracers/logger/logger.go +++ b/eth/tracers/logger/logger.go @@ -26,12 +26,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" "github.com/holiman/uint256" ) diff --git a/eth/tracers/logger/logger_json.go b/eth/tracers/logger/logger_json.go index 838d5017b..fbc66c351 100644 --- a/eth/tracers/logger/logger_json.go +++ b/eth/tracers/logger/logger_json.go @@ -22,9 +22,9 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/vm" ) type JSONLogger struct { diff --git a/eth/tracers/logger/logger_test.go b/eth/tracers/logger/logger_test.go index 1bc7456d3..233136d28 100644 --- a/eth/tracers/logger/logger_test.go +++ b/eth/tracers/logger/logger_test.go @@ -22,10 +22,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" ) type dummyContractRef struct { @@ -76,7 +76,7 @@ func TestStoreCapture(t *testing.T) { } // Tests that blank fields don't appear in logs when JSON marshalled, to reduce -// logs bloat and confusion. See https://github.com/ethereum/go-ethereum/issues/24487 +// logs bloat and confusion. See https://github.com/electroneum/electroneum-sc/issues/24487 func TestStructLogMarshalingOmitEmpty(t *testing.T) { tests := []struct { name string diff --git a/eth/tracers/native/4byte.go b/eth/tracers/native/4byte.go index 92cc70994..cf1a69c5c 100644 --- a/eth/tracers/native/4byte.go +++ b/eth/tracers/native/4byte.go @@ -23,9 +23,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers" ) func init() { diff --git a/eth/tracers/native/call.go b/eth/tracers/native/call.go index d334e328a..958ab3a22 100644 --- a/eth/tracers/native/call.go +++ b/eth/tracers/native/call.go @@ -25,9 +25,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers" ) func init() { diff --git a/eth/tracers/native/noop.go b/eth/tracers/native/noop.go index 0849fd74e..1fc08a961 100644 --- a/eth/tracers/native/noop.go +++ b/eth/tracers/native/noop.go @@ -21,9 +21,9 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers" ) func init() { diff --git a/eth/tracers/native/prestate.go b/eth/tracers/native/prestate.go index 4d289ca62..ac3df046b 100644 --- a/eth/tracers/native/prestate.go +++ b/eth/tracers/native/prestate.go @@ -22,11 +22,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers" ) func init() { diff --git a/eth/tracers/native/tracer.go b/eth/tracers/native/tracer.go index 3bab870ea..be1f776c5 100644 --- a/eth/tracers/native/tracer.go +++ b/eth/tracers/native/tracer.go @@ -37,7 +37,7 @@ package native import ( "errors" - "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/electroneum/electroneum-sc/eth/tracers" ) // init registers itself this packages as a lookup for tracers. diff --git a/eth/tracers/tracers.go b/eth/tracers/tracers.go index e7073e7d2..473d078df 100644 --- a/eth/tracers/tracers.go +++ b/eth/tracers/tracers.go @@ -21,8 +21,8 @@ import ( "encoding/json" "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/vm" ) // Context contains some contextual infos for a transaction execution that is not diff --git a/eth/tracers/tracers_test.go b/eth/tracers/tracers_test.go index ce9289dd7..a7e8e5263 100644 --- a/eth/tracers/tracers_test.go +++ b/eth/tracers/tracers_test.go @@ -20,16 +20,16 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/tracers/logger" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/tests" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/tests" ) // callTrace is the result of a callTracer run. diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 24edd8648..cce9b26fb 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -24,11 +24,11 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rpc" ) // Client defines typed wrappers for the Ethereum RPC API. @@ -113,7 +113,7 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface if err != nil { return nil, err } else if len(raw) == 0 { - return nil, ethereum.NotFound + return nil, electroneum.NotFound } // Decode header and transactions. var head *types.Header @@ -177,7 +177,7 @@ func (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) (*types.He var head *types.Header err := ec.c.CallContext(ctx, &head, "eth_getBlockByHash", hash, false) if err == nil && head == nil { - err = ethereum.NotFound + err = electroneum.NotFound } return head, err } @@ -188,7 +188,7 @@ func (ec *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.H var head *types.Header err := ec.c.CallContext(ctx, &head, "eth_getBlockByNumber", toBlockNumArg(number), false) if err == nil && head == nil { - err = ethereum.NotFound + err = electroneum.NotFound } return head, err } @@ -218,7 +218,7 @@ func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx * if err != nil { return nil, false, err } else if json == nil { - return nil, false, ethereum.NotFound + return nil, false, electroneum.NotFound } else if _, r, _ := json.tx.RawSignatureValues(); r == nil { return nil, false, fmt.Errorf("server returned transaction without signature") } @@ -270,7 +270,7 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, return nil, err } if json == nil { - return nil, ethereum.NotFound + return nil, electroneum.NotFound } else if _, r, _ := json.tx.RawSignatureValues(); r == nil { return nil, fmt.Errorf("server returned transaction without signature") } @@ -287,7 +287,7 @@ func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (* err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash) if err == nil { if r == nil { - return nil, ethereum.NotFound + return nil, electroneum.NotFound } } return r, err @@ -295,7 +295,7 @@ func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (* // SyncProgress retrieves the current progress of the sync algorithm. If there's // no sync currently running, it returns nil. -func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) { +func (ec *Client) SyncProgress(ctx context.Context) (*electroneum.SyncProgress, error) { var raw json.RawMessage if err := ec.c.CallContext(ctx, &raw, "eth_syncing"); err != nil { return nil, err @@ -314,7 +314,7 @@ func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, err // SubscribeNewHead subscribes to notifications about the current blockchain head // on the given channel. -func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) { +func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (electroneum.Subscription, error) { return ec.c.EthSubscribe(ctx, ch, "newHeads") } @@ -368,7 +368,7 @@ func (ec *Client) NonceAt(ctx context.Context, account common.Address, blockNumb // Filters // FilterLogs executes a filter query. -func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { +func (ec *Client) FilterLogs(ctx context.Context, q electroneum.FilterQuery) ([]types.Log, error) { var result []types.Log arg, err := toFilterArg(q) if err != nil { @@ -379,7 +379,7 @@ func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]typ } // SubscribeFilterLogs subscribes to the results of a streaming filter query. -func (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { +func (ec *Client) SubscribeFilterLogs(ctx context.Context, q electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error) { arg, err := toFilterArg(q) if err != nil { return nil, err @@ -387,7 +387,7 @@ func (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuer return ec.c.EthSubscribe(ctx, ch, "logs", arg) } -func toFilterArg(q ethereum.FilterQuery) (interface{}, error) { +func toFilterArg(q electroneum.FilterQuery) (interface{}, error) { arg := map[string]interface{}{ "address": q.Addresses, "topics": q.Topics, @@ -454,7 +454,7 @@ func (ec *Client) PendingTransactionCount(ctx context.Context) (uint, error) { // blockNumber selects the block height at which the call runs. It can be nil, in which // case the code is taken from the latest known block. Note that state from very old // blocks might not be available. -func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { +func (ec *Client) CallContract(ctx context.Context, msg electroneum.CallMsg, blockNumber *big.Int) ([]byte, error) { var hex hexutil.Bytes err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), toBlockNumArg(blockNumber)) if err != nil { @@ -465,7 +465,7 @@ func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockN // CallContractAtHash is almost the same as CallContract except that it selects // the block by block hash instead of block height. -func (ec *Client) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) { +func (ec *Client) CallContractAtHash(ctx context.Context, msg electroneum.CallMsg, blockHash common.Hash) ([]byte, error) { var hex hexutil.Bytes err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), rpc.BlockNumberOrHashWithHash(blockHash, false)) if err != nil { @@ -476,7 +476,7 @@ func (ec *Client) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, // PendingCallContract executes a message call transaction using the EVM. // The state seen by the contract call is the pending state. -func (ec *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) { +func (ec *Client) PendingCallContract(ctx context.Context, msg electroneum.CallMsg) ([]byte, error) { var hex hexutil.Bytes err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), "pending") if err != nil { @@ -509,7 +509,7 @@ func (ec *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { // the current pending state of the backend blockchain. There is no guarantee that this is // the true gas limit requirement as other transactions may be added or removed by miners, // but it should provide a basis for setting a reasonable default. -func (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) { +func (ec *Client) EstimateGas(ctx context.Context, msg electroneum.CallMsg) (uint64, error) { var hex hexutil.Uint64 err := ec.c.CallContext(ctx, &hex, "eth_estimateGas", toCallArg(msg)) if err != nil { @@ -541,7 +541,7 @@ func toBlockNumArg(number *big.Int) string { return hexutil.EncodeBig(number) } -func toCallArg(msg ethereum.CallMsg) interface{} { +func toCallArg(msg electroneum.CallMsg) interface{} { arg := map[string]interface{}{ "from": msg.From, "to": msg.To, @@ -584,11 +584,11 @@ type rpcProgress struct { HealingBytecode hexutil.Uint64 } -func (p *rpcProgress) toSyncProgress() *ethereum.SyncProgress { +func (p *rpcProgress) toSyncProgress() *electroneum.SyncProgress { if p == nil { return nil } - return ðereum.SyncProgress{ + return &electroneum.SyncProgress{ StartingBlock: uint64(p.StartingBlock), CurrentBlock: uint64(p.CurrentBlock), HighestBlock: uint64(p.HighestBlock), diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index 4a8727b37..d2b276cc4 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -26,33 +26,33 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "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" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) // Verify that Client implements the ethereum interfaces. var ( - _ = ethereum.ChainReader(&Client{}) - _ = ethereum.TransactionReader(&Client{}) - _ = ethereum.ChainStateReader(&Client{}) - _ = ethereum.ChainSyncReader(&Client{}) - _ = ethereum.ContractCaller(&Client{}) - _ = ethereum.GasEstimator(&Client{}) - _ = ethereum.GasPricer(&Client{}) - _ = ethereum.LogFilterer(&Client{}) - _ = ethereum.PendingStateReader(&Client{}) + _ = electroneum.ChainReader(&Client{}) + _ = electroneum.TransactionReader(&Client{}) + _ = electroneum.ChainStateReader(&Client{}) + _ = electroneum.ChainSyncReader(&Client{}) + _ = electroneum.ContractCaller(&Client{}) + _ = electroneum.GasEstimator(&Client{}) + _ = electroneum.GasPricer(&Client{}) + _ = electroneum.LogFilterer(&Client{}) + _ = electroneum.PendingStateReader(&Client{}) // _ = ethereum.PendingStateEventer(&Client{}) - _ = ethereum.PendingContractCaller(&Client{}) + _ = electroneum.PendingContractCaller(&Client{}) ) func TestToFilterArg(t *testing.T) { @@ -66,13 +66,13 @@ func TestToFilterArg(t *testing.T) { for _, testCase := range []struct { name string - input ethereum.FilterQuery + input electroneum.FilterQuery output interface{} err error }{ { "without BlockHash", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, FromBlock: big.NewInt(1), ToBlock: big.NewInt(2), @@ -88,7 +88,7 @@ func TestToFilterArg(t *testing.T) { }, { "with nil fromBlock and nil toBlock", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, Topics: [][]common.Hash{}, }, @@ -102,7 +102,7 @@ func TestToFilterArg(t *testing.T) { }, { "with negative fromBlock and negative toBlock", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, FromBlock: big.NewInt(-1), ToBlock: big.NewInt(-1), @@ -118,7 +118,7 @@ func TestToFilterArg(t *testing.T) { }, { "with blockhash", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, Topics: [][]common.Hash{}, @@ -132,7 +132,7 @@ func TestToFilterArg(t *testing.T) { }, { "with blockhash and from block", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, FromBlock: big.NewInt(1), @@ -143,7 +143,7 @@ func TestToFilterArg(t *testing.T) { }, { "with blockhash and to block", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, ToBlock: big.NewInt(1), @@ -154,7 +154,7 @@ func TestToFilterArg(t *testing.T) { }, { "with blockhash and both from / to block", - ethereum.FilterQuery{ + electroneum.FilterQuery{ Addresses: addresses, BlockHash: &blockHash, FromBlock: big.NewInt(1), @@ -319,7 +319,7 @@ func testHeader(t *testing.T, chain []*types.Block, client *rpc.Client) { "future_block": { block: big.NewInt(1000000000), want: nil, - wantErr: ethereum.NotFound, + wantErr: electroneum.NotFound, }, } for name, tt := range tests { @@ -404,12 +404,12 @@ func testTransactionInBlockInterrupted(t *testing.T, client *rpc.Client) { if tx != nil { t.Fatal("transaction should be nil") } - if err == nil || err == ethereum.NotFound { + if err == nil || err == electroneum.NotFound { t.Fatal("error should not be nil/notfound") } // Test tx in block not found. - if _, err := ec.TransactionInBlock(context.Background(), block.Hash(), 20); err != ethereum.NotFound { + if _, err := ec.TransactionInBlock(context.Background(), block.Hash(), 20); err != electroneum.NotFound { t.Fatal("error should be ethereum.NotFound") } } @@ -514,7 +514,7 @@ func testCallContractAtHash(t *testing.T, client *rpc.Client) { ec := NewClient(client) // EstimateGas - msg := ethereum.CallMsg{ + msg := electroneum.CallMsg{ From: testAddr, To: &common.Address{}, Gas: 21000, @@ -541,7 +541,7 @@ func testCallContract(t *testing.T, client *rpc.Client) { ec := NewClient(client) // EstimateGas - msg := ethereum.CallMsg{ + msg := electroneum.CallMsg{ From: testAddr, To: &common.Address{}, Gas: 21000, diff --git a/ethclient/gethclient/gethclient.go b/ethclient/gethclient/gethclient.go index 7af2bf45d..733b5be56 100644 --- a/ethclient/gethclient/gethclient.go +++ b/ethclient/gethclient/gethclient.go @@ -23,12 +23,12 @@ import ( "runtime" "runtime/debug" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rpc" ) // Client is a wrapper around rpc.Client that implements geth-specific functionality. @@ -45,7 +45,7 @@ func New(c *rpc.Client) *Client { // CreateAccessList tries to create an access list for a specific transaction based on the // current pending state of the blockchain. -func (ec *Client) CreateAccessList(ctx context.Context, msg ethereum.CallMsg) (*types.AccessList, uint64, string, error) { +func (ec *Client) CreateAccessList(ctx context.Context, msg electroneum.CallMsg) (*types.AccessList, uint64, string, error) { type accessListResult struct { Accesslist *types.AccessList `json:"accessList"` Error string `json:"error,omitempty"` @@ -138,7 +138,7 @@ type OverrideAccount struct { // overrides specifies a map of contract states that should be overwritten before executing // the message call. // Please use ethclient.CallContract instead if you don't need the override functionality. -func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int, overrides *map[common.Address]OverrideAccount) ([]byte, error) { +func (ec *Client) CallContract(ctx context.Context, msg electroneum.CallMsg, blockNumber *big.Int, overrides *map[common.Address]OverrideAccount) ([]byte, error) { var hex hexutil.Bytes err := ec.c.CallContext( ctx, &hex, "eth_call", toCallArg(msg), @@ -191,7 +191,7 @@ func toBlockNumArg(number *big.Int) string { return hexutil.EncodeBig(number) } -func toCallArg(msg ethereum.CallMsg) interface{} { +func toCallArg(msg electroneum.CallMsg) interface{} { arg := map[string]interface{}{ "from": msg.From, "to": msg.To, diff --git a/ethclient/gethclient/gethclient_test.go b/ethclient/gethclient/gethclient_test.go index 758acc085..597fe7d4c 100644 --- a/ethclient/gethclient/gethclient_test.go +++ b/ethclient/gethclient/gethclient_test.go @@ -22,19 +22,19 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "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" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) var ( @@ -139,7 +139,7 @@ func TestGethClient(t *testing.T) { func testAccessList(t *testing.T, client *rpc.Client) { ec := New(client) // Test transfer - msg := ethereum.CallMsg{ + msg := electroneum.CallMsg{ From: testAddr, To: &common.Address{}, Gas: 21000, @@ -160,7 +160,7 @@ func testAccessList(t *testing.T, client *rpc.Client) { t.Fatalf("unexpected length of accesslist: %v", len(*al)) } // Test reverting transaction - msg = ethereum.CallMsg{ + msg = electroneum.CallMsg{ From: testAddr, To: nil, Gas: 100000, @@ -300,7 +300,7 @@ func testSubscribePendingTransactions(t *testing.T, client *rpc.Client) { func testCallContract(t *testing.T, client *rpc.Client) { ec := New(client) - msg := ethereum.CallMsg{ + msg := electroneum.CallMsg{ From: testAddr, To: &common.Address{}, Gas: 21000, diff --git a/ethclient/signer.go b/ethclient/signer.go index f827d4eb5..aa7c71fbe 100644 --- a/ethclient/signer.go +++ b/ethclient/signer.go @@ -20,8 +20,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // senderFromServer is a types.Signer that remembers the sender address returned by the RPC diff --git a/ethdb/dbtest/testsuite.go b/ethdb/dbtest/testsuite.go index 6b206af48..1c6a161da 100644 --- a/ethdb/dbtest/testsuite.go +++ b/ethdb/dbtest/testsuite.go @@ -22,7 +22,7 @@ import ( "sort" "testing" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/ethdb" ) // TestDatabaseSuite runs a suite of tests against a KeyValueStore database diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index 15bd4e6eb..ab5200a2c 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -27,10 +27,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" diff --git a/ethdb/leveldb/leveldb_test.go b/ethdb/leveldb/leveldb_test.go index 421d9b469..9a802c449 100644 --- a/ethdb/leveldb/leveldb_test.go +++ b/ethdb/leveldb/leveldb_test.go @@ -19,8 +19,8 @@ package leveldb import ( "testing" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/dbtest" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/dbtest" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/storage" ) diff --git a/ethdb/memorydb/memorydb.go b/ethdb/memorydb/memorydb.go index e94570cb3..e03c9532e 100644 --- a/ethdb/memorydb/memorydb.go +++ b/ethdb/memorydb/memorydb.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" ) var ( diff --git a/ethdb/memorydb/memorydb_test.go b/ethdb/memorydb/memorydb_test.go index dba18ad30..138d58791 100644 --- a/ethdb/memorydb/memorydb_test.go +++ b/ethdb/memorydb/memorydb_test.go @@ -19,8 +19,8 @@ package memorydb import ( "testing" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/dbtest" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/dbtest" ) func TestMemoryDB(t *testing.T) { diff --git a/ethdb/remotedb/remotedb.go b/ethdb/remotedb/remotedb.go index 59a570bb5..89f087c18 100644 --- a/ethdb/remotedb/remotedb.go +++ b/ethdb/remotedb/remotedb.go @@ -25,9 +25,9 @@ import ( "errors" "strings" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rpc" ) // Database is a key-value lookup for a remote database via debug_dbGet. diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index c754a55e0..1908120d9 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,20 +30,20 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - ethproto "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + ethproto "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/les" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rpc" "github.com/gorilla/websocket" ) @@ -67,7 +67,7 @@ type backend interface { HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) GetTd(ctx context.Context, hash common.Hash) *big.Int Stats() (pending int, queued int) - SyncProgress() ethereum.SyncProgress + SyncProgress() electroneum.SyncProgress } // fullNodeBackend encompasses the functionality necessary for a full node diff --git a/event/example_feed_test.go b/event/example_feed_test.go index 9b5ad50df..995026a02 100644 --- a/event/example_feed_test.go +++ b/event/example_feed_test.go @@ -19,7 +19,7 @@ package event_test import ( "fmt" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/event" ) func ExampleFeed_acknowledgedEvents() { diff --git a/event/example_scope_test.go b/event/example_scope_test.go index 825a8deea..9c3aa42ff 100644 --- a/event/example_scope_test.go +++ b/event/example_scope_test.go @@ -20,7 +20,7 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/event" ) // This example demonstrates how SubscriptionScope can be used to control the lifetime of diff --git a/event/example_subscription_test.go b/event/example_subscription_test.go index 5c76b55d9..1b0262725 100644 --- a/event/example_subscription_test.go +++ b/event/example_subscription_test.go @@ -19,7 +19,7 @@ package event_test import ( "fmt" - "github.com/ethereum/go-ethereum/event" + "github.com/electroneum/electroneum-sc/event" ) func ExampleNewSubscription() { diff --git a/event/subscription.go b/event/subscription.go index 6c6287471..a7ba0976d 100644 --- a/event/subscription.go +++ b/event/subscription.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) // Subscription represents a stream of events. The carrier of the events is typically a diff --git a/go.mod b/go.mod index 8d104da04..437bdce6b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ethereum/go-ethereum +module github.com/electroneum/electroneum-sc go 1.16 diff --git a/graphql/graphql.go b/graphql/graphql.go index 0654fd1af..e0063804f 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -24,17 +24,17 @@ import ( "math/big" "strconv" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/filters" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" ) var ( @@ -1313,7 +1313,7 @@ func (r *Resolver) ChainID(ctx context.Context) (hexutil.Big, error) { // SyncState represents the synchronisation status returned from the `syncing` accessor. type SyncState struct { - progress ethereum.SyncProgress + progress electroneum.SyncProgress } func (s *SyncState) StartingBlock() hexutil.Uint64 { diff --git a/graphql/graphql_test.go b/graphql/graphql_test.go index 2768026b5..6c12314b7 100644 --- a/graphql/graphql_test.go +++ b/graphql/graphql_test.go @@ -25,16 +25,16 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "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/eth" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" "github.com/stretchr/testify/assert" ) diff --git a/graphql/service.go b/graphql/service.go index 29d98ad74..59ffbe12f 100644 --- a/graphql/service.go +++ b/graphql/service.go @@ -20,8 +20,8 @@ import ( "encoding/json" "net/http" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/node" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/node" "github.com/graph-gophers/graphql-go" ) diff --git a/interfaces.go b/interfaces.go index 76c1ef690..3909467ab 100644 --- a/interfaces.go +++ b/interfaces.go @@ -22,8 +22,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // NotFound is returned by API methods if the requested item does not exist. diff --git a/internal/debug/api.go b/internal/debug/api.go index 42d0fa15e..821b80b3f 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -35,7 +35,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "github.com/hashicorp/go-bexpr" ) diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 3aa990adf..2ccdd3df5 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,9 +24,9 @@ import ( "os" "runtime" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/metrics/exp" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/metrics/exp" "github.com/fjl/memsize/memsizeui" "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" diff --git a/internal/debug/trace.go b/internal/debug/trace.go index a273e4a9d..9f8b2edf7 100644 --- a/internal/debug/trace.go +++ b/internal/debug/trace.go @@ -24,7 +24,7 @@ import ( "os" "runtime/trace" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // StartGoTrace turns on tracing, writing to the given file. diff --git a/internal/ethapi/addrlock.go b/internal/ethapi/addrlock.go index 61ddff688..a56142f9c 100644 --- a/internal/ethapi/addrlock.go +++ b/internal/ethapi/addrlock.go @@ -19,7 +19,7 @@ package ethapi import ( "sync" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) type AddrLocker struct { diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1b7c17786..1241bccc3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -25,26 +25,26 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "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/eth/tracers/logger" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/accounts/scwallet" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" "github.com/tyler-smith/go-bip39" ) @@ -512,7 +512,7 @@ func (s *PrivateAccountAPI) SignTransaction(ctx context.Context, args Transactio // // The key used to calculate the signature is decrypted with the given password. // -// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign +// https://github.com/electroneum/electroneum-sc/wiki/Management-APIs#personal_sign func (s *PrivateAccountAPI) Sign(ctx context.Context, data hexutil.Bytes, addr common.Address, passwd string) (hexutil.Bytes, error) { // Look up the wallet containing the requested signer account := accounts.Account{Address: addr} @@ -540,7 +540,7 @@ func (s *PrivateAccountAPI) Sign(ctx context.Context, data hexutil.Bytes, addr c // Note, the signature must conform to the secp256k1 curve R, S and V values, where // the V value must be 27 or 28 for legacy reasons. // -// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_ecRecover +// https://github.com/electroneum/electroneum-sc/wiki/Management-APIs#personal_ecRecover func (s *PrivateAccountAPI) EcRecover(ctx context.Context, data, sig hexutil.Bytes) (common.Address, error) { if len(sig) != crypto.SignatureLength { return common.Address{}, fmt.Errorf("signature must be %d bytes long", crypto.SignatureLength) diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index bc60fb2a6..f7a7c3098 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -22,26 +22,26 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) // Backend interface provides the common API services (that are provided by // both full and light clients) with access to necessary functions. type Backend interface { // General Ethereum API - SyncProgress() ethereum.SyncProgress + SyncProgress() electroneum.SyncProgress SuggestGasTipCap(ctx context.Context) (*big.Int, error) FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*big.Int, [][]*big.Int, []*big.Int, []float64, error) diff --git a/internal/ethapi/dbapi.go b/internal/ethapi/dbapi.go index 33dca29d3..34c1d06d7 100644 --- a/internal/ethapi/dbapi.go +++ b/internal/ethapi/dbapi.go @@ -17,8 +17,8 @@ package ethapi import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // DbGet returns the raw value of a key stored in the database. diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 9c5950af5..5b2e8604f 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -23,12 +23,12 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" ) // TransactionArgs represents the arguments to construct a new transaction @@ -45,7 +45,7 @@ type TransactionArgs struct { // We accept "data" and "input" for backwards-compatibility reasons. // "input" is the newer name and should be preferred by clients. - // Issue detail: https://github.com/ethereum/go-ethereum/issues/15628 + // Issue detail: https://github.com/electroneum/electroneum-sc/issues/15628 Data *hexutil.Bytes `json:"data"` Input *hexutil.Bytes `json:"input"` diff --git a/internal/flags/helpers.go b/internal/flags/helpers.go index 1fc6409c6..0792c7523 100644 --- a/internal/flags/helpers.go +++ b/internal/flags/helpers.go @@ -20,7 +20,7 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" "gopkg.in/urfave/cli.v1" ) diff --git a/internal/guide/guide_test.go b/internal/guide/guide_test.go index cdf0ec4d2..7c0e42e8e 100644 --- a/internal/guide/guide_test.go +++ b/internal/guide/guide_test.go @@ -28,9 +28,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // Tests that the account management snippets work correctly. diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index 4de80a9e9..c25ed280f 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -28,7 +28,7 @@ import ( "time" "github.com/dop251/goja" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // JSRE is a JS runtime environment embedding the goja interpreter. diff --git a/internal/shutdowncheck/shutdown_tracker.go b/internal/shutdowncheck/shutdown_tracker.go index c95b4f02f..b40eec6b9 100644 --- a/internal/shutdowncheck/shutdown_tracker.go +++ b/internal/shutdowncheck/shutdown_tracker.go @@ -19,10 +19,10 @@ package shutdowncheck import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) // ShutdownTracker is a service that reports previous unclean shutdowns diff --git a/internal/testlog/testlog.go b/internal/testlog/testlog.go index 684339f16..0d881fa9a 100644 --- a/internal/testlog/testlog.go +++ b/internal/testlog/testlog.go @@ -21,7 +21,7 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // Handler returns a log handler which logs to the unit test log of t. diff --git a/les/api.go b/les/api.go index 782bb31ef..c5a7b28d3 100644 --- a/les/api.go +++ b/les/api.go @@ -21,10 +21,10 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/mclock" - vfs "github.com/ethereum/go-ethereum/les/vflux/server" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/mclock" + vfs "github.com/electroneum/electroneum-sc/les/vflux/server" + "github.com/electroneum/electroneum-sc/p2p/enode" ) var ( diff --git a/les/api_backend.go b/les/api_backend.go index 11a9ca128..e50ec1358 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -22,22 +22,22 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) type LesApiBackend struct { @@ -258,7 +258,7 @@ func (b *LesApiBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEven return b.eth.blockchain.SubscribeRemovedLogsEvent(ch) } -func (b *LesApiBackend) SyncProgress() ethereum.SyncProgress { +func (b *LesApiBackend) SyncProgress() electroneum.SyncProgress { return b.eth.Downloader().Progress() } diff --git a/les/api_test.go b/les/api_test.go index ea6870e35..4612f78e6 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -27,20 +27,20 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/eth" - ethdownloader "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/les/downloader" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/eth" + ethdownloader "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/les/downloader" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/rpc" "github.com/mattn/go-colorable" ) diff --git a/les/benchmark.go b/les/benchmark.go index 757822a6b..e030351df 100644 --- a/les/benchmark.go +++ b/les/benchmark.go @@ -24,17 +24,17 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "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/les/flowcontrol" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // requestBenchmark is an interface for different randomized request generators diff --git a/les/bloombits.go b/les/bloombits.go index a98524ce2..3d6babe5e 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -19,8 +19,8 @@ package les import ( "time" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/light" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/light" ) const ( diff --git a/les/catalyst/api.go b/les/catalyst/api.go index de09acdb0..1b88436cb 100644 --- a/les/catalyst/api.go +++ b/les/catalyst/api.go @@ -21,12 +21,12 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/beacon" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/beacon" + "github.com/electroneum/electroneum-sc/les" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/rpc" ) // Register adds catalyst APIs to the light client. diff --git a/les/catalyst/api_test.go b/les/catalyst/api_test.go index 70a6d2471..f3f2438cf 100644 --- a/les/catalyst/api_test.go +++ b/les/catalyst/api_test.go @@ -20,19 +20,19 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/beacon" - "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/eth/ethconfig" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/beacon" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/les" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/les/checkpointoracle/oracle.go b/les/checkpointoracle/oracle.go index 6ad1ea293..8849c3476 100644 --- a/les/checkpointoracle/oracle.go +++ b/les/checkpointoracle/oracle.go @@ -25,12 +25,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) // CheckpointOracle is responsible for offering the latest stable checkpoint diff --git a/les/client.go b/les/client.go index 722c8c35d..b93d35272 100644 --- a/les/client.go +++ b/les/client.go @@ -21,33 +21,33 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/internal/shutdowncheck" - "github.com/ethereum/go-ethereum/les/downloader" - "github.com/ethereum/go-ethereum/les/vflux" - vfc "github.com/ethereum/go-ethereum/les/vflux/client" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/bloombits" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/eth/filters" + "github.com/electroneum/electroneum-sc/eth/gasprice" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/internal/shutdowncheck" + "github.com/electroneum/electroneum-sc/les/downloader" + "github.com/electroneum/electroneum-sc/les/vflux" + vfc "github.com/electroneum/electroneum-sc/les/vflux/client" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/rpc" ) type LightEthereum struct { diff --git a/les/client_handler.go b/les/client_handler.go index e416f92e2..606af5467 100644 --- a/les/client_handler.go +++ b/les/client_handler.go @@ -24,16 +24,16 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/les/downloader" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/les/downloader" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/params" ) // clientHandler is responsible for receiving and processing all incoming server diff --git a/les/commons.go b/les/commons.go index d090fc21f..3b5031be2 100644 --- a/les/commons.go +++ b/les/commons.go @@ -21,20 +21,20 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum/common" - "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/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/checkpointoracle" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/checkpointoracle" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) func errResp(code errCode, format string, v ...interface{}) error { diff --git a/les/costtracker.go b/les/costtracker.go index 43e32a5b2..287071a38 100644 --- a/les/costtracker.go +++ b/les/costtracker.go @@ -23,12 +23,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" ) const makeCostStats = false // make request cost statistics during operation diff --git a/les/distributor.go b/les/distributor.go index 31150e4d7..d06d08026 100644 --- a/les/distributor.go +++ b/les/distributor.go @@ -21,8 +21,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/les/utils" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/les/utils" ) // requestDistributor implements a mechanism that distributes requests to diff --git a/les/distributor_test.go b/les/distributor_test.go index 9a93dba14..6485f1587 100644 --- a/les/distributor_test.go +++ b/les/distributor_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) type testDistReq struct { diff --git a/les/downloader/api.go b/les/downloader/api.go index 2024d23de..b74f3cc26 100644 --- a/les/downloader/api.go +++ b/les/downloader/api.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rpc" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/rpc" ) // PublicDownloaderAPI provides an API which gives information about the current synchronisation status. @@ -121,8 +121,8 @@ func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, // SyncingResult provides information about the current synchronisation status for this node. type SyncingResult struct { - Syncing bool `json:"syncing"` - Status ethereum.SyncProgress `json:"status"` + Syncing bool `json:"syncing"` + Status electroneum.SyncProgress `json:"status"` } // uninstallSyncSubscriptionRequest uninstalles a syncing subscription in the API event loop. diff --git a/les/downloader/downloader.go b/les/downloader/downloader.go index 448a94192..398712f7c 100644 --- a/les/downloader/downloader.go +++ b/les/downloader/downloader.go @@ -28,18 +28,18 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/params" ) var ( @@ -244,7 +244,7 @@ func New(checkpoint uint64, stateDb ethdb.Database, mux *event.TypeMux, chain Bl // In addition, during the state download phase of fast synchronisation the number // of processed and the total number of known states are also returned. Otherwise // these are zero. -func (d *Downloader) Progress() ethereum.SyncProgress { +func (d *Downloader) Progress() electroneum.SyncProgress { // Lock the current stats and return the progress d.syncStatsLock.RLock() defer d.syncStatsLock.RUnlock() @@ -261,7 +261,7 @@ func (d *Downloader) Progress() ethereum.SyncProgress { default: log.Error("Unknown downloader chain/mode combo", "light", d.lightchain != nil, "full", d.blockchain != nil, "mode", mode) } - return ethereum.SyncProgress{ + return electroneum.SyncProgress{ StartingBlock: d.syncStatsChainOrigin, CurrentBlock: current, HighestBlock: d.syncStatsChainHeight, diff --git a/les/downloader/downloader_test.go b/les/downloader/downloader_test.go index f6510eb41..a0873c095 100644 --- a/les/downloader/downloader_test.go +++ b/les/downloader/downloader_test.go @@ -26,15 +26,15 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/trie" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/trie" ) // Reduce some of the parameters to make the tester faster. @@ -1156,7 +1156,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Synchronise half the blocks and check initial progress tester.newPeer("peer-half", protocol, chain.shorten(chain.len()/2)) @@ -1170,7 +1170,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(chain.len()/2 - 1), }) progress <- struct{}{} @@ -1186,7 +1186,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "completing", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "completing", electroneum.SyncProgress{ StartingBlock: uint64(chain.len()/2 - 1), CurrentBlock: uint64(chain.len()/2 - 1), HighestBlock: uint64(chain.len() - 1), @@ -1195,14 +1195,14 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ StartingBlock: uint64(chain.len()/2 - 1), CurrentBlock: uint64(chain.len() - 1), HighestBlock: uint64(chain.len() - 1), }) } -func checkProgress(t *testing.T, d *Downloader, stage string, want ethereum.SyncProgress) { +func checkProgress(t *testing.T, d *Downloader, stage string, want electroneum.SyncProgress) { // Mark this method as a helper to report errors at callsite, not in here t.Helper() @@ -1237,7 +1237,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Synchronise with one of the forks and check progress tester.newPeer("fork A", protocol, chainA) @@ -1251,7 +1251,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(chainA.len() - 1), }) progress <- struct{}{} @@ -1270,7 +1270,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "forking", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "forking", electroneum.SyncProgress{ StartingBlock: uint64(testChainBase.len()) - 1, CurrentBlock: uint64(chainA.len() - 1), HighestBlock: uint64(chainB.len() - 1), @@ -1279,7 +1279,7 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ StartingBlock: uint64(testChainBase.len()) - 1, CurrentBlock: uint64(chainB.len() - 1), HighestBlock: uint64(chainB.len() - 1), @@ -1308,7 +1308,7 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Attempt a full sync with a faulty peer brokenChain := chain.shorten(chain.len()) @@ -1327,7 +1327,7 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(brokenChain.len() - 1), }) progress <- struct{}{} @@ -1350,7 +1350,7 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ CurrentBlock: uint64(chain.len() - 1), HighestBlock: uint64(chain.len() - 1), }) @@ -1376,7 +1376,7 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { starting <- struct{}{} <-progress } - checkProgress(t, tester.downloader, "pristine", ethereum.SyncProgress{}) + checkProgress(t, tester.downloader, "pristine", electroneum.SyncProgress{}) // Create and sync with an attacker that promises a higher chain than available. brokenChain := chain.shorten(chain.len()) @@ -1395,7 +1395,7 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "initial", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "initial", electroneum.SyncProgress{ HighestBlock: uint64(brokenChain.len() - 1), }) progress <- struct{}{} @@ -1415,7 +1415,7 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { } }() <-starting - checkProgress(t, tester.downloader, "completing", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "completing", electroneum.SyncProgress{ CurrentBlock: afterFailedSync.CurrentBlock, HighestBlock: uint64(validChain.len() - 1), }) @@ -1423,7 +1423,7 @@ func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { // Check final progress after successful sync. progress <- struct{}{} pending.Wait() - checkProgress(t, tester.downloader, "final", ethereum.SyncProgress{ + checkProgress(t, tester.downloader, "final", electroneum.SyncProgress{ CurrentBlock: uint64(validChain.len() - 1), HighestBlock: uint64(validChain.len() - 1), }) diff --git a/les/downloader/events.go b/les/downloader/events.go index 25255a3a7..86f7920c6 100644 --- a/les/downloader/events.go +++ b/les/downloader/events.go @@ -16,7 +16,7 @@ package downloader -import "github.com/ethereum/go-ethereum/core/types" +import "github.com/electroneum/electroneum-sc/core/types" type DoneEvent struct { Latest *types.Header diff --git a/les/downloader/metrics.go b/les/downloader/metrics.go index c38732043..0a018e3cc 100644 --- a/les/downloader/metrics.go +++ b/les/downloader/metrics.go @@ -19,7 +19,7 @@ package downloader import ( - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) var ( diff --git a/les/downloader/peer.go b/les/downloader/peer.go index 863294832..c96d5ad2e 100644 --- a/les/downloader/peer.go +++ b/les/downloader/peer.go @@ -27,11 +27,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/msgrate" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/eth/protocols/eth" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/msgrate" ) const ( diff --git a/les/downloader/queue.go b/les/downloader/queue.go index 04ec12cfa..e6a4c9d44 100644 --- a/les/downloader/queue.go +++ b/les/downloader/queue.go @@ -26,12 +26,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/trie" ) const ( diff --git a/les/downloader/queue_test.go b/les/downloader/queue_test.go index 2a884d30a..a67412c22 100644 --- a/les/downloader/queue_test.go +++ b/les/downloader/queue_test.go @@ -24,13 +24,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/les/downloader/resultstore.go b/les/downloader/resultstore.go index 3162cd6d5..13c9a0852 100644 --- a/les/downloader/resultstore.go +++ b/les/downloader/resultstore.go @@ -21,7 +21,7 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // resultStore implements a structure for maintaining fetchResults, tracking their diff --git a/les/downloader/statesync.go b/les/downloader/statesync.go index 2b3278822..e6722bc3f 100644 --- a/les/downloader/statesync.go +++ b/les/downloader/statesync.go @@ -21,12 +21,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/les/downloader/testchain_test.go b/les/downloader/testchain_test.go index b9865f7e0..6202d4199 100644 --- a/les/downloader/testchain_test.go +++ b/les/downloader/testchain_test.go @@ -21,13 +21,13 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum/common" - "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/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" ) // Test chain parameters. diff --git a/les/downloader/types.go b/les/downloader/types.go index ff70bfa0e..3cd82f06f 100644 --- a/les/downloader/types.go +++ b/les/downloader/types.go @@ -19,7 +19,7 @@ package downloader import ( "fmt" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // peerDropFn is a callback type for dropping a peer detected as malicious. diff --git a/les/enr_entry.go b/les/enr_entry.go index 307313fb1..7a1aad3d2 100644 --- a/les/enr_entry.go +++ b/les/enr_entry.go @@ -17,10 +17,10 @@ package les import ( - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/p2p/dnsdisc" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) // lesEntry is the "les" ENR entry. This is set for LES servers only. diff --git a/les/fetcher.go b/les/fetcher.go index cf62c8f70..b21c2806d 100644 --- a/les/fetcher.go +++ b/les/fetcher.go @@ -22,16 +22,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "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/ethdb" - "github.com/ethereum/go-ethereum/les/fetcher" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/fetcher" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" ) const ( diff --git a/les/fetcher/block_fetcher.go b/les/fetcher/block_fetcher.go index 283008db0..111743214 100644 --- a/les/fetcher/block_fetcher.go +++ b/les/fetcher/block_fetcher.go @@ -25,13 +25,13 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/trie" ) const ( diff --git a/les/fetcher/block_fetcher_test.go b/les/fetcher/block_fetcher_test.go index de066ac26..78bcc04f0 100644 --- a/les/fetcher/block_fetcher_test.go +++ b/les/fetcher/block_fetcher_test.go @@ -24,14 +24,14 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/les/fetcher_test.go b/les/fetcher_test.go index 28db3b891..44a274ce0 100644 --- a/les/fetcher_test.go +++ b/les/fetcher_test.go @@ -21,13 +21,13 @@ import ( "testing" "time" - "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/light" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) // verifyImportEvent verifies that one single event arrive on an import channel. diff --git a/les/flowcontrol/control.go b/les/flowcontrol/control.go index 4f0de8231..c4e976343 100644 --- a/les/flowcontrol/control.go +++ b/les/flowcontrol/control.go @@ -23,8 +23,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/log" ) const ( diff --git a/les/flowcontrol/logger.go b/les/flowcontrol/logger.go index 428d7fbf2..bd449eede 100644 --- a/les/flowcontrol/logger.go +++ b/les/flowcontrol/logger.go @@ -20,7 +20,7 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) // logger collects events in string format and discards events older than the diff --git a/les/flowcontrol/manager.go b/les/flowcontrol/manager.go index c9e681c14..96c970534 100644 --- a/les/flowcontrol/manager.go +++ b/les/flowcontrol/manager.go @@ -22,8 +22,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/common/prque" ) // cmNodeFields are ClientNode fields used by the client manager diff --git a/les/flowcontrol/manager_test.go b/les/flowcontrol/manager_test.go index 9d2f88763..e0a5520e8 100644 --- a/les/flowcontrol/manager_test.go +++ b/les/flowcontrol/manager_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) type testNode struct { diff --git a/les/handler_test.go b/les/handler_test.go index aba45764b..64239ee34 100644 --- a/les/handler_test.go +++ b/les/handler_test.go @@ -23,19 +23,19 @@ import ( "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/les/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" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/les/downloader" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) func expectResponse(r p2p.MsgReader, msgcode, reqID, bv uint64, data interface{}) error { diff --git a/les/metrics.go b/les/metrics.go index 07d3133c9..e80fb7d18 100644 --- a/les/metrics.go +++ b/les/metrics.go @@ -17,8 +17,8 @@ package les import ( - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p" ) var ( diff --git a/les/odr.go b/les/odr.go index 10ff0854d..c73d18765 100644 --- a/les/odr.go +++ b/les/odr.go @@ -22,10 +22,10 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/light" ) // LesOdr implements light.OdrBackend diff --git a/les/odr_requests.go b/les/odr_requests.go index d548fb1ee..6216e86e4 100644 --- a/les/odr_requests.go +++ b/les/odr_requests.go @@ -21,15 +21,15 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "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/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/les/odr_test.go b/les/odr_test.go index ad77abf5b..ce0e86547 100644 --- a/les/odr_test.go +++ b/les/odr_test.go @@ -26,17 +26,17 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) type odrTestFn func(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte diff --git a/les/peer.go b/les/peer.go index 499429739..22d9141ec 100644 --- a/les/peer.go +++ b/les/peer.go @@ -27,20 +27,20 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/les/utils" - vfc "github.com/ethereum/go-ethereum/les/vflux/client" - vfs "github.com/ethereum/go-ethereum/les/vflux/server" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + "github.com/electroneum/electroneum-sc/les/utils" + vfc "github.com/electroneum/electroneum-sc/les/vflux/client" + vfs "github.com/electroneum/electroneum-sc/les/vflux/server" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/les/peer_test.go b/les/peer_test.go index d6551ce6b..3a3737b8a 100644 --- a/les/peer_test.go +++ b/les/peer_test.go @@ -25,14 +25,14 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) type testServerPeerSub struct { diff --git a/les/protocol.go b/les/protocol.go index 09706c356..d92202b72 100644 --- a/les/protocol.go +++ b/les/protocol.go @@ -23,12 +23,12 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - vfc "github.com/ethereum/go-ethereum/les/vflux/client" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + vfc "github.com/electroneum/electroneum-sc/les/vflux/client" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) // Constants to match up protocol versions and messages diff --git a/les/pruner.go b/les/pruner.go index d115a61a7..d839ec7db 100644 --- a/les/pruner.go +++ b/les/pruner.go @@ -20,10 +20,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) // pruner is responsible for pruning historical light chain data. diff --git a/les/pruner_test.go b/les/pruner_test.go index 167241493..3005040af 100644 --- a/les/pruner_test.go +++ b/les/pruner_test.go @@ -23,8 +23,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/light" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/light" ) func TestLightPruner(t *testing.T) { diff --git a/les/request_test.go b/les/request_test.go index c65405e37..b5ce07aee 100644 --- a/les/request_test.go +++ b/les/request_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/light" ) var testBankSecureTrieKey = secAddr(bankAddr) diff --git a/les/retrieve.go b/les/retrieve.go index 307af0421..3e24f20a2 100644 --- a/les/retrieve.go +++ b/les/retrieve.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/light" + "github.com/electroneum/electroneum-sc/light" ) var ( diff --git a/les/server.go b/les/server.go index c135e65f2..6509c43e2 100644 --- a/les/server.go +++ b/les/server.go @@ -20,20 +20,20 @@ import ( "crypto/ecdsa" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/flowcontrol" - vfs "github.com/ethereum/go-ethereum/les/vflux/server" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + vfs "github.com/electroneum/electroneum-sc/les/vflux/server" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rpc" ) var ( diff --git a/les/server_handler.go b/les/server_handler.go index ef1af844c..0ddbb01bc 100644 --- a/les/server_handler.go +++ b/les/server_handler.go @@ -22,20 +22,20 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) const ( diff --git a/les/server_requests.go b/les/server_requests.go index bab5f733d..01dfafa37 100644 --- a/les/server_requests.go +++ b/les/server_requests.go @@ -20,15 +20,15 @@ import ( "encoding/binary" "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // serverBackend defines the backend functions needed for serving LES requests diff --git a/les/servingqueue.go b/les/servingqueue.go index 10c7e6f48..80fd90ac5 100644 --- a/les/servingqueue.go +++ b/les/servingqueue.go @@ -21,8 +21,8 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/common/prque" ) // servingQueue allows running tasks in a limited number of threads and puts the diff --git a/les/state_accessor.go b/les/state_accessor.go index 112e6fd44..dcaf95532 100644 --- a/les/state_accessor.go +++ b/les/state_accessor.go @@ -21,11 +21,11 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/light" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/light" ) // stateAtBlock retrieves the state database associated with a certain block. diff --git a/les/sync.go b/les/sync.go index 31cd06ca7..48c1e801a 100644 --- a/les/sync.go +++ b/les/sync.go @@ -21,12 +21,12 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/les/downloader" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/les/downloader" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) var errInvalidCheckpoint = errors.New("invalid advertised checkpoint") diff --git a/les/sync_test.go b/les/sync_test.go index 3fc2a9c15..e5862f122 100644 --- a/les/sync_test.go +++ b/les/sync_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/params" ) // Test light syncing which will download all headers from genesis. @@ -196,7 +196,7 @@ func testMissOracleBackend(t *testing.T, hasCheckpoint bool, protocol int) { // that user wants to unlock something which blocks the oracle backend // initialisation. But at the same time syncing starts. // - // See https://github.com/ethereum/go-ethereum/issues/20097 for more detail. + // See https://github.com/electroneum/electroneum-sc/issues/20097 for more detail. // // In this case, client should run light sync or legacy checkpoint sync // if hardcoded checkpoint is configured. diff --git a/les/test_helper.go b/les/test_helper.go index 8335e2c39..85b27ff87 100644 --- a/les/test_helper.go +++ b/les/test_helper.go @@ -29,28 +29,28 @@ import ( "testing" "time" - "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/common/mclock" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "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/ethconfig" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/les/checkpointoracle" - "github.com/ethereum/go-ethereum/les/flowcontrol" - vfs "github.com/ethereum/go-ethereum/les/vflux/server" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/abi/bind/backends" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/contracts/checkpointoracle/contract" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/forkid" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/les/checkpointoracle" + "github.com/electroneum/electroneum-sc/les/flowcontrol" + vfs "github.com/electroneum/electroneum-sc/les/vflux/server" + "github.com/electroneum/electroneum-sc/light" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/les/txrelay.go b/les/txrelay.go index 40a51fb76..8cd8a2e45 100644 --- a/les/txrelay.go +++ b/les/txrelay.go @@ -21,9 +21,9 @@ import ( "math/rand" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) type lesTxRelay struct { diff --git a/les/ulc.go b/les/ulc.go index b97217e79..d97e6023e 100644 --- a/les/ulc.go +++ b/les/ulc.go @@ -19,8 +19,8 @@ package les import ( "errors" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" ) type ulc struct { diff --git a/les/ulc_test.go b/les/ulc_test.go index a4df0795b..d589d58e1 100644 --- a/les/ulc_test.go +++ b/les/ulc_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" ) func TestULCAnnounceThresholdLes2(t *testing.T) { testULCAnnounceThreshold(t, 2) } diff --git a/les/utils/expiredvalue.go b/les/utils/expiredvalue.go index 3fd52616f..b44955edf 100644 --- a/les/utils/expiredvalue.go +++ b/les/utils/expiredvalue.go @@ -20,7 +20,7 @@ import ( "math" "sync" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) // ExpiredValue is a scalar value that is continuously expired (decreased diff --git a/les/utils/expiredvalue_test.go b/les/utils/expiredvalue_test.go index 1c751d8cc..d02bbf8fe 100644 --- a/les/utils/expiredvalue_test.go +++ b/les/utils/expiredvalue_test.go @@ -19,7 +19,7 @@ package utils import ( "testing" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) func TestValueExpiration(t *testing.T) { diff --git a/les/utils/limiter.go b/les/utils/limiter.go index 84d186efd..800b751df 100644 --- a/les/utils/limiter.go +++ b/les/utils/limiter.go @@ -20,7 +20,7 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) const maxSelectionWeight = 1000000000 // maximum selection weight of each individual node/address group diff --git a/les/utils/limiter_test.go b/les/utils/limiter_test.go index 3fbdc60d7..7834d684b 100644 --- a/les/utils/limiter_test.go +++ b/les/utils/limiter_test.go @@ -20,7 +20,7 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) const ( diff --git a/les/utils/timeutils.go b/les/utils/timeutils.go index 62a4285d1..f3adbb834 100644 --- a/les/utils/timeutils.go +++ b/les/utils/timeutils.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) type UpdateTimer struct { diff --git a/les/utils/timeutils_test.go b/les/utils/timeutils_test.go index 9f9e1c2dc..ce0abea78 100644 --- a/les/utils/timeutils_test.go +++ b/les/utils/timeutils_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) func TestUpdateTimer(t *testing.T) { diff --git a/les/utils/weighted_select.go b/les/utils/weighted_select.go index 486b00820..a9fe8d68c 100644 --- a/les/utils/weighted_select.go +++ b/les/utils/weighted_select.go @@ -20,7 +20,7 @@ import ( "math" "math/rand" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) type ( diff --git a/les/vflux/client/api.go b/les/vflux/client/api.go index 135273ef9..c01a65bfd 100644 --- a/les/vflux/client/api.go +++ b/les/vflux/client/api.go @@ -19,9 +19,9 @@ package client import ( "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // PrivateClientAPI implements the vflux client side API diff --git a/les/vflux/client/fillset.go b/les/vflux/client/fillset.go index 0da850bca..ba21e9f22 100644 --- a/les/vflux/client/fillset.go +++ b/les/vflux/client/fillset.go @@ -19,8 +19,8 @@ package client import ( "sync" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) // FillSet tries to read nodes from an input iterator and add them to a node set by diff --git a/les/vflux/client/fillset_test.go b/les/vflux/client/fillset_test.go index ca5af8f07..0ccd82379 100644 --- a/les/vflux/client/fillset_test.go +++ b/les/vflux/client/fillset_test.go @@ -21,10 +21,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) type testIter struct { diff --git a/les/vflux/client/queueiterator.go b/les/vflux/client/queueiterator.go index ad3f8df5b..864f7de23 100644 --- a/les/vflux/client/queueiterator.go +++ b/les/vflux/client/queueiterator.go @@ -19,8 +19,8 @@ package client import ( "sync" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) // QueueIterator returns nodes from the specified selectable set in the same order as diff --git a/les/vflux/client/queueiterator_test.go b/les/vflux/client/queueiterator_test.go index 400d978e1..d2a7a0d47 100644 --- a/les/vflux/client/queueiterator_test.go +++ b/les/vflux/client/queueiterator_test.go @@ -20,10 +20,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) func testNode(i int) *enode.Node { diff --git a/les/vflux/client/requestbasket.go b/les/vflux/client/requestbasket.go index 55d4b165d..f520eff2e 100644 --- a/les/vflux/client/requestbasket.go +++ b/les/vflux/client/requestbasket.go @@ -19,8 +19,8 @@ package client import ( "io" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/rlp" ) const basketFactor = 1000000 // reference basket amount and value scale factor diff --git a/les/vflux/client/requestbasket_test.go b/les/vflux/client/requestbasket_test.go index 7c5f87c61..237132866 100644 --- a/les/vflux/client/requestbasket_test.go +++ b/les/vflux/client/requestbasket_test.go @@ -20,7 +20,7 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/les/utils" + "github.com/electroneum/electroneum-sc/les/utils" ) func checkU64(t *testing.T, name string, value, exp uint64) { diff --git a/les/vflux/client/serverpool.go b/les/vflux/client/serverpool.go index e481075f7..8d5708afb 100644 --- a/les/vflux/client/serverpool.go +++ b/les/vflux/client/serverpool.go @@ -24,15 +24,15 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" + "github.com/electroneum/electroneum-sc/rlp" ) const ( diff --git a/les/vflux/client/serverpool_test.go b/les/vflux/client/serverpool_test.go index c7d0245ef..df7a61194 100644 --- a/les/vflux/client/serverpool_test.go +++ b/les/vflux/client/serverpool_test.go @@ -24,11 +24,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) const ( diff --git a/les/vflux/client/timestats.go b/les/vflux/client/timestats.go index 7f1ffdbe2..99547c14f 100644 --- a/les/vflux/client/timestats.go +++ b/les/vflux/client/timestats.go @@ -21,8 +21,8 @@ import ( "math" "time" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/rlp" ) const ( diff --git a/les/vflux/client/timestats_test.go b/les/vflux/client/timestats_test.go index a28460171..3f7916dcd 100644 --- a/les/vflux/client/timestats_test.go +++ b/les/vflux/client/timestats_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/les/utils" + "github.com/electroneum/electroneum-sc/les/utils" ) func TestTransition(t *testing.T) { diff --git a/les/vflux/client/valuetracker.go b/les/vflux/client/valuetracker.go index dcd2fcdfd..a11a7cf40 100644 --- a/les/vflux/client/valuetracker.go +++ b/les/vflux/client/valuetracker.go @@ -23,12 +23,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) const ( diff --git a/les/vflux/client/valuetracker_test.go b/les/vflux/client/valuetracker_test.go index 87a337be8..9f73634a6 100644 --- a/les/vflux/client/valuetracker_test.go +++ b/les/vflux/client/valuetracker_test.go @@ -23,11 +23,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/p2p/enode" - "github.com/ethereum/go-ethereum/les/utils" + "github.com/electroneum/electroneum-sc/les/utils" ) const ( diff --git a/les/vflux/client/wrsiterator.go b/les/vflux/client/wrsiterator.go index 8a2e39ad4..3f9f693ed 100644 --- a/les/vflux/client/wrsiterator.go +++ b/les/vflux/client/wrsiterator.go @@ -19,9 +19,9 @@ package client import ( "sync" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) // WrsIterator returns nodes from the specified selectable set with a weighted random diff --git a/les/vflux/client/wrsiterator_test.go b/les/vflux/client/wrsiterator_test.go index 77bb5ee0c..f0c27db68 100644 --- a/les/vflux/client/wrsiterator_test.go +++ b/les/vflux/client/wrsiterator_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) var ( diff --git a/les/vflux/requests.go b/les/vflux/requests.go index 7d4bafc18..910e61d7b 100644 --- a/les/vflux/requests.go +++ b/les/vflux/requests.go @@ -21,7 +21,7 @@ import ( "math" "math/big" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) var ErrNoReply = errors.New("no reply for given request") diff --git a/les/vflux/server/balance.go b/les/vflux/server/balance.go index 727ce09a4..2b9ad21ce 100644 --- a/les/vflux/server/balance.go +++ b/les/vflux/server/balance.go @@ -22,10 +22,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) var errBalanceOverflow = errors.New("balance overflow") diff --git a/les/vflux/server/balance_test.go b/les/vflux/server/balance_test.go index 9f253cabf..d76a8b684 100644 --- a/les/vflux/server/balance_test.go +++ b/les/vflux/server/balance_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) type zeroExpirer struct{} diff --git a/les/vflux/server/balance_tracker.go b/les/vflux/server/balance_tracker.go index 9695e7963..73ad0c961 100644 --- a/les/vflux/server/balance_tracker.go +++ b/les/vflux/server/balance_tracker.go @@ -20,12 +20,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) const ( diff --git a/les/vflux/server/clientdb.go b/les/vflux/server/clientdb.go index 30cd9a652..cb4e75f1f 100644 --- a/les/vflux/server/clientdb.go +++ b/les/vflux/server/clientdb.go @@ -21,13 +21,13 @@ import ( "encoding/binary" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" lru "github.com/hashicorp/golang-lru" ) diff --git a/les/vflux/server/clientdb_test.go b/les/vflux/server/clientdb_test.go index 353d84aea..17dd9061d 100644 --- a/les/vflux/server/clientdb_test.go +++ b/les/vflux/server/clientdb_test.go @@ -21,10 +21,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/p2p/enode" ) func expval(v uint64) utils.ExpiredValue { diff --git a/les/vflux/server/clientpool.go b/les/vflux/server/clientpool.go index e90469bb1..f78fcf404 100644 --- a/les/vflux/server/clientpool.go +++ b/les/vflux/server/clientpool.go @@ -21,14 +21,14 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/les/vflux" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nodestate" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/les/vflux" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nodestate" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/les/vflux/server/clientpool_test.go b/les/vflux/server/clientpool_test.go index 49e66297a..45aacb916 100644 --- a/les/vflux/server/clientpool_test.go +++ b/les/vflux/server/clientpool_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) const defaultConnectedBias = time.Minute * 3 diff --git a/les/vflux/server/metrics.go b/les/vflux/server/metrics.go index 680aebe2e..495261a5c 100644 --- a/les/vflux/server/metrics.go +++ b/les/vflux/server/metrics.go @@ -17,7 +17,7 @@ package server import ( - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) var ( diff --git a/les/vflux/server/prioritypool.go b/les/vflux/server/prioritypool.go index 059dac0d4..167e91829 100644 --- a/les/vflux/server/prioritypool.go +++ b/les/vflux/server/prioritypool.go @@ -21,11 +21,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) const ( diff --git a/les/vflux/server/prioritypool_test.go b/les/vflux/server/prioritypool_test.go index 515231211..f7d183750 100644 --- a/les/vflux/server/prioritypool_test.go +++ b/les/vflux/server/prioritypool_test.go @@ -22,10 +22,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) const ( diff --git a/les/vflux/server/service.go b/les/vflux/server/service.go index 40515f072..ce37f7dbb 100644 --- a/les/vflux/server/service.go +++ b/les/vflux/server/service.go @@ -22,11 +22,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/les/utils" - "github.com/ethereum/go-ethereum/les/vflux" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/les/utils" + "github.com/electroneum/electroneum-sc/les/vflux" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) type ( diff --git a/les/vflux/server/status.go b/les/vflux/server/status.go index 469190777..fab207a65 100644 --- a/les/vflux/server/status.go +++ b/les/vflux/server/status.go @@ -19,7 +19,7 @@ package server import ( "reflect" - "github.com/ethereum/go-ethereum/p2p/nodestate" + "github.com/electroneum/electroneum-sc/p2p/nodestate" ) type peerWrapper struct{ clientPeer } // the NodeStateMachine type system needs this wrapper diff --git a/light/lightchain.go b/light/lightchain.go index fa0dc71c9..da46e6262 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" lru "github.com/hashicorp/golang-lru" ) diff --git a/light/lightchain_test.go b/light/lightchain_test.go index 8600e5634..da1595e73 100644 --- a/light/lightchain_test.go +++ b/light/lightchain_test.go @@ -22,13 +22,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "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/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" ) // So we can deterministically seed different blockchains diff --git a/light/nodeset.go b/light/nodeset.go index 366259678..dd7b524eb 100644 --- a/light/nodeset.go +++ b/light/nodeset.go @@ -20,10 +20,10 @@ import ( "errors" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rlp" ) // NodeSet stores a set of trie nodes. It implements trie.Database and can also diff --git a/light/odr.go b/light/odr.go index 9521dd53e..4a6eb8c25 100644 --- a/light/odr.go +++ b/light/odr.go @@ -21,11 +21,11 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "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/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" ) // NoOdr is the default context passed to an ODR capable function when the ODR diff --git a/light/odr_test.go b/light/odr_test.go index fdf657a82..f5189404a 100644 --- a/light/odr_test.go +++ b/light/odr_test.go @@ -24,19 +24,19 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "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/state" - "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/ethdb" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/light/odr_util.go b/light/odr_util.go index bbbcdbce2..f73e44263 100644 --- a/light/odr_util.go +++ b/light/odr_util.go @@ -22,11 +22,11 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "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/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) // errNonCanonicalHash is returned if the requested chain data doesn't belong diff --git a/light/postprocess.go b/light/postprocess.go index ce38d091e..44a73d7d8 100644 --- a/light/postprocess.go +++ b/light/postprocess.go @@ -26,16 +26,16 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "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/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) // IndexerConfig includes a set of configs for chain indexers. diff --git a/light/trie.go b/light/trie.go index 4ab6f4ace..72faab39c 100644 --- a/light/trie.go +++ b/light/trie.go @@ -21,14 +21,14 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/light/trie_test.go b/light/trie_test.go index e8294cc2a..f745446da 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -24,13 +24,13 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "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/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) func TestNodeIterator(t *testing.T) { diff --git a/light/txpool.go b/light/txpool.go index a7df4aeec..88d5c8cc5 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -23,15 +23,15 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/light/txpool_test.go b/light/txpool_test.go index cc2651d29..cc437cace 100644 --- a/light/txpool_test.go +++ b/light/txpool_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" ) type testTxRelay struct { diff --git a/log/format.go b/log/format.go index baf8fddac..800159e95 100644 --- a/log/format.go +++ b/log/format.go @@ -24,7 +24,7 @@ const ( // locationTrims are trimmed for display to avoid unwieldy log lines. var locationTrims = []string{ - "github.com/ethereum/go-ethereum/", + "github.com/electroneum/electroneum-sc/", } // PrintOrigins sets or unsets log location (file:line) printing for terminal diff --git a/metrics/cpu_enabled.go b/metrics/cpu_enabled.go index 533d40b85..1a6972faf 100644 --- a/metrics/cpu_enabled.go +++ b/metrics/cpu_enabled.go @@ -20,7 +20,7 @@ package metrics import ( - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "github.com/shirou/gopsutil/cpu" ) diff --git a/metrics/cputime_unix.go b/metrics/cputime_unix.go index 3c56a75d0..721389e53 100644 --- a/metrics/cputime_unix.go +++ b/metrics/cputime_unix.go @@ -22,7 +22,7 @@ package metrics import ( syscall "golang.org/x/sys/unix" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // getProcessCPUTime retrieves the process' CPU time since program startup. diff --git a/metrics/exp/exp.go b/metrics/exp/exp.go index 3ebe8cc68..d4c227ad8 100644 --- a/metrics/exp/exp.go +++ b/metrics/exp/exp.go @@ -8,9 +8,9 @@ import ( "net/http" "sync" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/metrics/prometheus" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/metrics/prometheus" ) type exp struct { diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index dac9e8247..e5151455c 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -5,8 +5,8 @@ import ( uurl "net/url" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" "github.com/influxdata/influxdb/client" ) diff --git a/metrics/influxdb/influxdbv2.go b/metrics/influxdb/influxdbv2.go index 00901f52c..11b09cebd 100644 --- a/metrics/influxdb/influxdbv2.go +++ b/metrics/influxdb/influxdbv2.go @@ -13,8 +13,8 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" influxdb2 "github.com/influxdata/influxdb-client-go/v2" "github.com/influxdata/influxdb-client-go/v2/api" ) diff --git a/metrics/librato/librato.go b/metrics/librato/librato.go index b16493413..6b95f0188 100644 --- a/metrics/librato/librato.go +++ b/metrics/librato/librato.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) // a regexp for extracting the unit from time.Duration.String diff --git a/metrics/metrics.go b/metrics/metrics.go index 747d6471a..0d081761b 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // Enabled is checked by the constructor functions for all of the diff --git a/metrics/prometheus/collector.go b/metrics/prometheus/collector.go index e8d5e4f5d..97c1caa08 100644 --- a/metrics/prometheus/collector.go +++ b/metrics/prometheus/collector.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) var ( diff --git a/metrics/prometheus/collector_test.go b/metrics/prometheus/collector_test.go index 43f2f804d..7488397e3 100644 --- a/metrics/prometheus/collector_test.go +++ b/metrics/prometheus/collector_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) func TestMain(m *testing.M) { diff --git a/metrics/prometheus/prometheus.go b/metrics/prometheus/prometheus.go index 9ad5ec7e9..93787d3d9 100644 --- a/metrics/prometheus/prometheus.go +++ b/metrics/prometheus/prometheus.go @@ -22,8 +22,8 @@ import ( "net/http" "sort" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" ) // Handler returns an HTTP handler which dump metrics in Prometheus format. diff --git a/miner/miner.go b/miner/miner.go index 16c3bf19d..cea8efd05 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -23,16 +23,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" ) // Backend wraps all methods required for mining. Only full node is capable diff --git a/miner/miner_test.go b/miner/miner_test.go index cf619845d..822a26b7f 100644 --- a/miner/miner_test.go +++ b/miner/miner_test.go @@ -22,17 +22,17 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/trie" ) type mockBackend struct { diff --git a/miner/stress/1559/main.go b/miner/stress/1559/main.go index e7438cbbe..94767bdc8 100644 --- a/miner/stress/1559/main.go +++ b/miner/stress/1559/main.go @@ -25,21 +25,21 @@ import ( "os/signal" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/fdlimit" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/miner/stress/beacon/main.go b/miner/stress/beacon/main.go index 646ea129f..1342395ec 100644 --- a/miner/stress/beacon/main.go +++ b/miner/stress/beacon/main.go @@ -26,26 +26,26 @@ import ( "path/filepath" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/beacon" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - ethcatalyst "github.com/ethereum/go-ethereum/eth/catalyst" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/les" - lescatalyst "github.com/ethereum/go-ethereum/les/catalyst" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/fdlimit" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/beacon" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + ethcatalyst "github.com/electroneum/electroneum-sc/eth/catalyst" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/les" + lescatalyst "github.com/electroneum/electroneum-sc/les/catalyst" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) type nodetype int diff --git a/miner/stress/clique/main.go b/miner/stress/clique/main.go index b10fad30a..0ad0ec9af 100644 --- a/miner/stress/clique/main.go +++ b/miner/stress/clique/main.go @@ -26,21 +26,21 @@ import ( "os/signal" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/fdlimit" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) func main() { diff --git a/miner/stress/ethash/main.go b/miner/stress/ethash/main.go index f89a7794d..3573bdde1 100644 --- a/miner/stress/ethash/main.go +++ b/miner/stress/ethash/main.go @@ -25,21 +25,21 @@ import ( "os/signal" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/fdlimit" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/eth" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/miner" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) func main() { diff --git a/miner/unconfirmed.go b/miner/unconfirmed.go index 0489f1ea4..e9304e903 100644 --- a/miner/unconfirmed.go +++ b/miner/unconfirmed.go @@ -20,9 +20,9 @@ import ( "container/ring" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" ) // chainRetriever is used by the unconfirmed block set to verify whether a previously diff --git a/miner/unconfirmed_test.go b/miner/unconfirmed_test.go index dc83cb926..679414fbb 100644 --- a/miner/unconfirmed_test.go +++ b/miner/unconfirmed_test.go @@ -19,7 +19,7 @@ package miner import ( "testing" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // noopChainRetriever is an implementation of headerRetriever that always diff --git a/miner/worker.go b/miner/worker.go index a108628e8..36a0f53f0 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -25,17 +25,17 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/misc" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/trie" ) const ( @@ -1168,7 +1168,7 @@ func (w *worker) commit(env *environment, interval func(), update bool, start ti interval() } // Create a local environment copy, avoid the data race with snapshot state. - // https://github.com/ethereum/go-ethereum/issues/24299 + // https://github.com/electroneum/electroneum-sc/issues/24299 env := env.copy() block, err := w.engine.FinalizeAndAssemble(w.chain, env.header, env.state, env.txs, env.unclelist(), env.receipts) if err != nil { diff --git a/miner/worker_test.go b/miner/worker_test.go index 55361349b..daeb52cf1 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -24,20 +24,20 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/clique" - "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/state" - "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/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/params" ) const ( diff --git a/mobile/accounts.go b/mobile/accounts.go index 4d979bfff..c73807cd1 100644 --- a/mobile/accounts.go +++ b/mobile/accounts.go @@ -23,10 +23,10 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" ) const ( diff --git a/mobile/android_test.go b/mobile/android_test.go index 2ddf5d9d9..7b0a0351b 100644 --- a/mobile/android_test.go +++ b/mobile/android_test.go @@ -202,7 +202,7 @@ func TestAndroid(t *testing.T) { } } // Generate the mobile bindings for Geth and add the tester class - gobind := exec.Command("gomobile", "bind", "-javapkg", "org.ethereum", "github.com/ethereum/go-ethereum/mobile") + gobind := exec.Command("gomobile", "bind", "-javapkg", "org.ethereum", "github.com/electroneum/electroneum-sc/mobile") if output, err := gobind.CombinedOutput(); err != nil { t.Logf("%s", output) t.Fatalf("failed to run gomobile bind: %v", err) diff --git a/mobile/big.go b/mobile/big.go index c08bcf93f..2d9074e64 100644 --- a/mobile/big.go +++ b/mobile/big.go @@ -22,7 +22,7 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // A BigInt represents a signed multi-precision integer. diff --git a/mobile/bind.go b/mobile/bind.go index e32d864aa..710cb53e5 100644 --- a/mobile/bind.go +++ b/mobile/bind.go @@ -22,11 +22,11 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi/bind" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" ) // Signer is an interface defining the callback when a contract requires a diff --git a/mobile/common.go b/mobile/common.go index 124712b4b..588c10312 100644 --- a/mobile/common.go +++ b/mobile/common.go @@ -24,8 +24,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // Hash represents the 32 byte Keccak256 hash of arbitrary data. diff --git a/mobile/discover.go b/mobile/discover.go index 2c699f08b..c5ca153aa 100644 --- a/mobile/discover.go +++ b/mobile/discover.go @@ -22,7 +22,7 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // Enode represents a host on the network. diff --git a/mobile/ethclient.go b/mobile/ethclient.go index 662125c4a..d46fd7d5c 100644 --- a/mobile/ethclient.go +++ b/mobile/ethclient.go @@ -21,8 +21,8 @@ package geth import ( "math/big" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/ethclient" ) // EthereumClient provides access to the Ethereum APIs. diff --git a/mobile/ethereum.go b/mobile/ethereum.go index d5058e4e2..f227e0004 100644 --- a/mobile/ethereum.go +++ b/mobile/ethereum.go @@ -21,14 +21,14 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" + electroneum "github.com/electroneum/electroneum-sc" + "github.com/electroneum/electroneum-sc/common" ) // Subscription represents an event subscription where events are // delivered on a data channel. type Subscription struct { - sub ethereum.Subscription + sub electroneum.Subscription } // Unsubscribe cancels the sending of events to the data channel @@ -39,7 +39,7 @@ func (s *Subscription) Unsubscribe() { // CallMsg contains parameters for contract calls. type CallMsg struct { - msg ethereum.CallMsg + msg electroneum.CallMsg } // NewCallMsg creates an empty contract call parameter list. @@ -75,7 +75,7 @@ func (msg *CallMsg) SetTo(address *Address) { // SyncProgress gives progress indications when the node is synchronising with // the Ethereum network. type SyncProgress struct { - progress ethereum.SyncProgress + progress electroneum.SyncProgress } func (p *SyncProgress) GetStartingBlock() int64 { return int64(p.progress.StartingBlock) } @@ -138,7 +138,7 @@ func (t *Topics) Append(topics *Hashes) { // FilterQuery contains options for contract log filtering. type FilterQuery struct { - query ethereum.FilterQuery + query electroneum.FilterQuery } // NewFilterQuery creates an empty filter query for contract log filtering. diff --git a/mobile/geth.go b/mobile/geth.go index cbbe29c60..8c3216456 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -24,17 +24,17 @@ import ( "fmt" "path/filepath" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/ethstats" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/eth/downloader" + "github.com/electroneum/electroneum-sc/eth/ethconfig" + "github.com/electroneum/electroneum-sc/ethclient" + "github.com/electroneum/electroneum-sc/ethstats" + "github.com/electroneum/electroneum-sc/internal/debug" + "github.com/electroneum/electroneum-sc/les" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/nat" + "github.com/electroneum/electroneum-sc/params" ) // NodeConfig represents the collection of configuration values to fine tune the Geth diff --git a/mobile/init.go b/mobile/init.go index 2025d85ed..75aa0aef6 100644 --- a/mobile/init.go +++ b/mobile/init.go @@ -22,7 +22,7 @@ import ( "os" "runtime" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) func init() { diff --git a/mobile/interface.go b/mobile/interface.go index d5200d5b1..b30f92c16 100644 --- a/mobile/interface.go +++ b/mobile/interface.go @@ -22,7 +22,7 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // Interface represents a wrapped version of Go's interface{}, with the capacity diff --git a/mobile/interface_test.go b/mobile/interface_test.go index 4bd1af47a..76529bae7 100644 --- a/mobile/interface_test.go +++ b/mobile/interface_test.go @@ -22,7 +22,7 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) func TestInterfaceGetSet(t *testing.T) { diff --git a/mobile/logger.go b/mobile/logger.go index 7078c4fd2..285699b65 100644 --- a/mobile/logger.go +++ b/mobile/logger.go @@ -19,7 +19,7 @@ package geth import ( "os" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // SetVerbosity sets the global verbosity level (between 0 and 6 - see logger/verbosity.go). diff --git a/mobile/p2p.go b/mobile/p2p.go index a80d9fff2..045436229 100644 --- a/mobile/p2p.go +++ b/mobile/p2p.go @@ -21,7 +21,7 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/p2p" ) // NodeInfo represents pi short summary of the information known about the host. diff --git a/mobile/params.go b/mobile/params.go index 8834fee95..245ad24aa 100644 --- a/mobile/params.go +++ b/mobile/params.go @@ -21,9 +21,9 @@ package geth import ( "encoding/json" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" ) // MainnetGenesis returns the JSON spec to use for the main Ethereum network. It diff --git a/mobile/primitives.go b/mobile/primitives.go index 7e1ab26ef..a327bd345 100644 --- a/mobile/primitives.go +++ b/mobile/primitives.go @@ -22,7 +22,7 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // Strings represents s slice of strs. diff --git a/mobile/types.go b/mobile/types.go index a224f12ab..f3fb00fb9 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -23,9 +23,9 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) type jsonEncoder interface { diff --git a/mobile/vm.go b/mobile/vm.go index 72093e3d5..45de1a42d 100644 --- a/mobile/vm.go +++ b/mobile/vm.go @@ -21,7 +21,7 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/core/types" ) // Log represents a contract log event. These events are generated by the LOG diff --git a/node/api.go b/node/api.go index 1b32399f6..42f37cd74 100644 --- a/node/api.go +++ b/node/api.go @@ -21,13 +21,13 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/debug" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rpc" ) // apis returns the collection of built-in RPC APIs. diff --git a/node/api_test.go b/node/api_test.go index 9549adf9c..2148f8ba6 100644 --- a/node/api_test.go +++ b/node/api_test.go @@ -25,7 +25,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/rpc" "github.com/stretchr/testify/assert" ) diff --git a/node/config.go b/node/config.go index 2047299fb..723fafde9 100644 --- a/node/config.go +++ b/node/config.go @@ -25,12 +25,12 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rpc" ) const ( diff --git a/node/config_test.go b/node/config_test.go index d9f812ec4..eaa98732a 100644 --- a/node/config_test.go +++ b/node/config_test.go @@ -23,8 +23,8 @@ import ( "runtime" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p" ) // Tests that datadirs can be successfully created, be them manually configured diff --git a/node/defaults.go b/node/defaults.go index 305f58c0a..8d486c9d9 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -22,9 +22,9 @@ import ( "path/filepath" "runtime" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/nat" + "github.com/electroneum/electroneum-sc/rpc" ) const ( diff --git a/node/endpoints.go b/node/endpoints.go index efc311e7e..b22cd79c3 100644 --- a/node/endpoints.go +++ b/node/endpoints.go @@ -21,8 +21,8 @@ import ( "net/http" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" ) // StartHTTPEndpoint starts the HTTP RPC endpoint. diff --git a/node/node.go b/node/node.go index 189519c88..4159dd4ab 100644 --- a/node/node.go +++ b/node/node.go @@ -28,15 +28,15 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rpc" "github.com/prometheus/tsdb/fileutil" ) diff --git a/node/node_example_test.go b/node/node_example_test.go index d54fe0306..93c9c5f55 100644 --- a/node/node_example_test.go +++ b/node/node_example_test.go @@ -20,7 +20,7 @@ import ( "fmt" "log" - "github.com/ethereum/go-ethereum/node" + "github.com/electroneum/electroneum-sc/node" ) // SampleLifecycle is a trivial network service that can be attached to a node for diff --git a/node/node_test.go b/node/node_test.go index 9f9febcac..9c7149bcb 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -26,10 +26,10 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rpc" "github.com/stretchr/testify/assert" ) diff --git a/node/rpcstack.go b/node/rpcstack.go index 0d2be9008..6572c2ca8 100644 --- a/node/rpcstack.go +++ b/node/rpcstack.go @@ -28,8 +28,8 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" "github.com/rs/cors" ) diff --git a/node/rpcstack_test.go b/node/rpcstack_test.go index c7dba8a1e..bf04d978c 100644 --- a/node/rpcstack_test.go +++ b/node/rpcstack_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" "github.com/golang-jwt/jwt/v4" "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" diff --git a/node/utils_test.go b/node/utils_test.go index b7474bb70..7b612f30d 100644 --- a/node/utils_test.go +++ b/node/utils_test.go @@ -20,8 +20,8 @@ package node import ( - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/rpc" ) // NoopLifecycle is a trivial implementation of the Service interface. diff --git a/oss-fuzz.sh b/oss-fuzz.sh index 745a5ba7c..9e360e135 100644 --- a/oss-fuzz.sh +++ b/oss-fuzz.sh @@ -27,7 +27,7 @@ # $LIB_FUZZING_ENGINE C++ compiler argument to link fuzz target against the prebuilt engine library (e.g. libFuzzer). # This sets the -coverpgk for the coverage report when the corpus is executed through go test -coverpkg="github.com/ethereum/go-ethereum/..." +coverpkg="github.com/electroneum/electroneum-sc/..." function coverbuild { path=$1 @@ -65,7 +65,7 @@ function compile_fuzzer { # $2: The name of the fuzzing function # $3: The name to give to the final fuzzing-binary - path=$GOPATH/src/github.com/ethereum/go-ethereum/$1 + path=$GOPATH/src/github.com/electroneum/electroneum-sc/$1 func=$2 fuzzer=$3 diff --git a/p2p/dial.go b/p2p/dial.go index 0d70e6f4a..830b88566 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -27,10 +27,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) const ( diff --git a/p2p/dial_test.go b/p2p/dial_test.go index cd8dedff1..dc8d0dd8d 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -27,11 +27,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) // This test checks that dynamic dials are launched from discovery results. diff --git a/p2p/discover/common.go b/p2p/discover/common.go index e389821fd..2b3c24afd 100644 --- a/p2p/discover/common.go +++ b/p2p/discover/common.go @@ -20,11 +20,11 @@ import ( "crypto/ecdsa" "net" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) // UDPConn is a network connection on which discovery can operate. diff --git a/p2p/discover/lookup.go b/p2p/discover/lookup.go index 9ab4a71ce..2e09305f1 100644 --- a/p2p/discover/lookup.go +++ b/p2p/discover/lookup.go @@ -20,7 +20,7 @@ import ( "context" "time" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // lookup performs a network search for nodes close to the given target. It approaches the diff --git a/p2p/discover/node.go b/p2p/discover/node.go index 9ffe101cc..518cfb566 100644 --- a/p2p/discover/node.go +++ b/p2p/discover/node.go @@ -24,9 +24,9 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // node represents a host on the network. diff --git a/p2p/discover/ntp.go b/p2p/discover/ntp.go index 1bb52399f..ea84398ae 100644 --- a/p2p/discover/ntp.go +++ b/p2p/discover/ntp.go @@ -25,7 +25,7 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) const ( diff --git a/p2p/discover/table.go b/p2p/discover/table.go index d08f8a6c6..052785105 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -32,10 +32,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) const ( diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go index 5f40c967f..f823fa46b 100644 --- a/p2p/discover/table_test.go +++ b/p2p/discover/table_test.go @@ -27,10 +27,10 @@ import ( "testing/quick" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) func TestTable_pingReplace(t *testing.T) { diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go index 47a2e7ac3..b2fe046c2 100644 --- a/p2p/discover/table_util_test.go +++ b/p2p/discover/table_util_test.go @@ -27,10 +27,10 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) var nullNode *enode.Node diff --git a/p2p/discover/v4_lookup_test.go b/p2p/discover/v4_lookup_test.go index a00de9ca1..90f90181b 100644 --- a/p2p/discover/v4_lookup_test.go +++ b/p2p/discover/v4_lookup_test.go @@ -23,10 +23,10 @@ import ( "sort" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/discover/v4wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/discover/v4wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) func TestUDPv4_Lookup(t *testing.T) { diff --git a/p2p/discover/v4_udp.go b/p2p/discover/v4_udp.go index 334716aeb..797aa8e64 100644 --- a/p2p/discover/v4_udp.go +++ b/p2p/discover/v4_udp.go @@ -29,11 +29,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover/v4wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/discover/v4wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) // Errors diff --git a/p2p/discover/v4_udp_test.go b/p2p/discover/v4_udp_test.go index e36912f01..b7dcb3ace 100644 --- a/p2p/discover/v4_udp_test.go +++ b/p2p/discover/v4_udp_test.go @@ -31,11 +31,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover/v4wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/discover/v4wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) // shared test variables diff --git a/p2p/discover/v4wire/v4wire.go b/p2p/discover/v4wire/v4wire.go index d6bf3dc46..517eb523f 100644 --- a/p2p/discover/v4wire/v4wire.go +++ b/p2p/discover/v4wire/v4wire.go @@ -27,11 +27,11 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) // RPC packet types diff --git a/p2p/discover/v4wire/v4wire_test.go b/p2p/discover/v4wire/v4wire_test.go index 38820f3b4..a2639725e 100644 --- a/p2p/discover/v4wire/v4wire_test.go +++ b/p2p/discover/v4wire/v4wire_test.go @@ -23,8 +23,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" ) // EIP-8 test vectors. diff --git a/p2p/discover/v5_udp.go b/p2p/discover/v5_udp.go index dc63382fc..9f6bff463 100644 --- a/p2p/discover/v5_udp.go +++ b/p2p/discover/v5_udp.go @@ -29,12 +29,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover/v5wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/discover/v5wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) const ( diff --git a/p2p/discover/v5_udp_test.go b/p2p/discover/v5_udp_test.go index 30d610a4d..08e4134de 100644 --- a/p2p/discover/v5_udp_test.go +++ b/p2p/discover/v5_udp_test.go @@ -28,12 +28,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover/v5wire" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/discover/v5wire" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) // Real sockets, real crypto: this test checks end-to-end connectivity for UDPv5. diff --git a/p2p/discover/v5wire/crypto.go b/p2p/discover/v5wire/crypto.go index fc0a0edef..9a00728df 100644 --- a/p2p/discover/v5wire/crypto.go +++ b/p2p/discover/v5wire/crypto.go @@ -25,9 +25,9 @@ import ( "fmt" "hash" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" "golang.org/x/crypto/hkdf" ) diff --git a/p2p/discover/v5wire/crypto_test.go b/p2p/discover/v5wire/crypto_test.go index 72169b431..8bd618829 100644 --- a/p2p/discover/v5wire/crypto_test.go +++ b/p2p/discover/v5wire/crypto_test.go @@ -25,9 +25,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" ) func TestVector_ECDH(t *testing.T) { diff --git a/p2p/discover/v5wire/encoding.go b/p2p/discover/v5wire/encoding.go index 7d17281ef..a1d62ddb0 100644 --- a/p2p/discover/v5wire/encoding.go +++ b/p2p/discover/v5wire/encoding.go @@ -28,10 +28,10 @@ import ( "fmt" "hash" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) // TODO concurrent WHOAREYOU tie-breaker diff --git a/p2p/discover/v5wire/encoding_test.go b/p2p/discover/v5wire/encoding_test.go index 18aa1db1a..89b88dba3 100644 --- a/p2p/discover/v5wire/encoding_test.go +++ b/p2p/discover/v5wire/encoding_test.go @@ -30,10 +30,10 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // To regenerate discv5 test vectors, run diff --git a/p2p/discover/v5wire/msg.go b/p2p/discover/v5wire/msg.go index 2f387b402..41876f229 100644 --- a/p2p/discover/v5wire/msg.go +++ b/p2p/discover/v5wire/msg.go @@ -20,10 +20,10 @@ import ( "fmt" "net" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) // Packet is implemented by all message types. diff --git a/p2p/discover/v5wire/session.go b/p2p/discover/v5wire/session.go index d52b5c118..07640b761 100644 --- a/p2p/discover/v5wire/session.go +++ b/p2p/discover/v5wire/session.go @@ -22,9 +22,9 @@ import ( "encoding/binary" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" "github.com/hashicorp/golang-lru/simplelru" ) diff --git a/p2p/dnsdisc/client.go b/p2p/dnsdisc/client.go index 93868b39a..5d6e1826c 100644 --- a/p2p/dnsdisc/client.go +++ b/p2p/dnsdisc/client.go @@ -26,11 +26,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" lru "github.com/hashicorp/golang-lru" "golang.org/x/sync/singleflight" "golang.org/x/time/rate" diff --git a/p2p/dnsdisc/client_test.go b/p2p/dnsdisc/client_test.go index 0a9a96e62..ce15d7bd7 100644 --- a/p2p/dnsdisc/client_test.go +++ b/p2p/dnsdisc/client_test.go @@ -26,12 +26,12 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) const ( diff --git a/p2p/dnsdisc/sync.go b/p2p/dnsdisc/sync.go index 073547c90..c2b9a012e 100644 --- a/p2p/dnsdisc/sync.go +++ b/p2p/dnsdisc/sync.go @@ -21,8 +21,8 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // This is the number of consecutive leaf requests that may fail before diff --git a/p2p/dnsdisc/tree.go b/p2p/dnsdisc/tree.go index 7d11e07ef..0672faa38 100644 --- a/p2p/dnsdisc/tree.go +++ b/p2p/dnsdisc/tree.go @@ -26,10 +26,10 @@ import ( "sort" "strings" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/dnsdisc/tree_test.go b/p2p/dnsdisc/tree_test.go index 461b9ec4f..c60dad3c6 100644 --- a/p2p/dnsdisc/tree_test.go +++ b/p2p/dnsdisc/tree_test.go @@ -21,8 +21,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/p2p/enode" ) func TestParseRoot(t *testing.T) { diff --git a/p2p/enode/idscheme.go b/p2p/enode/idscheme.go index c1834f069..8ea6ed763 100644 --- a/p2p/enode/idscheme.go +++ b/p2p/enode/idscheme.go @@ -21,10 +21,10 @@ import ( "fmt" "io" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/enode/idscheme_test.go b/p2p/enode/idscheme_test.go index 0910e6e83..f63c8472c 100644 --- a/p2p/enode/idscheme_test.go +++ b/p2p/enode/idscheme_test.go @@ -23,9 +23,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/enode/iter_test.go b/p2p/enode/iter_test.go index 5014346af..cbbd44405 100644 --- a/p2p/enode/iter_test.go +++ b/p2p/enode/iter_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/enr" ) func TestReadNodes(t *testing.T) { diff --git a/p2p/enode/localnode.go b/p2p/enode/localnode.go index a18204e75..996a9efc7 100644 --- a/p2p/enode/localnode.go +++ b/p2p/enode/localnode.go @@ -26,9 +26,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) const ( diff --git a/p2p/enode/localnode_test.go b/p2p/enode/localnode_test.go index 312df813b..e9e8b055b 100644 --- a/p2p/enode/localnode_test.go +++ b/p2p/enode/localnode_test.go @@ -21,8 +21,8 @@ import ( "net" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enr" "github.com/stretchr/testify/assert" ) diff --git a/p2p/enode/node.go b/p2p/enode/node.go index d747ca331..f9b8b2973 100644 --- a/p2p/enode/node.go +++ b/p2p/enode/node.go @@ -26,8 +26,8 @@ import ( "net" "strings" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) var errMissingPrefix = errors.New("missing 'enr:' prefix for base64-encoded record") diff --git a/p2p/enode/node_test.go b/p2p/enode/node_test.go index d15859c47..cca0018f2 100644 --- a/p2p/enode/node_test.go +++ b/p2p/enode/node_test.go @@ -24,8 +24,8 @@ import ( "testing" "testing/quick" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" "github.com/stretchr/testify/assert" ) diff --git a/p2p/enode/nodedb.go b/p2p/enode/nodedb.go index d1712f759..f07d2f80b 100644 --- a/p2p/enode/nodedb.go +++ b/p2p/enode/nodedb.go @@ -26,7 +26,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" diff --git a/p2p/enode/urlv4.go b/p2p/enode/urlv4.go index c44504910..a23ea9c45 100644 --- a/p2p/enode/urlv4.go +++ b/p2p/enode/urlv4.go @@ -26,9 +26,9 @@ import ( "regexp" "strconv" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enr" ) var ( diff --git a/p2p/enode/urlv4_test.go b/p2p/enode/urlv4_test.go index 33de96cc5..4ef82f59b 100644 --- a/p2p/enode/urlv4_test.go +++ b/p2p/enode/urlv4_test.go @@ -24,8 +24,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/enr" ) func init() { diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 15891813b..f48ddaa51 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -40,7 +40,7 @@ import ( "io" "sort" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) const SizeLimit = 300 // maximum encoded size of a node record in bytes diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index bf3f10474..b336d8c1b 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/enr/entries.go b/p2p/enr/entries.go index f2118401a..3740f3584 100644 --- a/p2p/enr/entries.go +++ b/p2p/enr/entries.go @@ -21,7 +21,7 @@ import ( "io" "net" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) // Entry is implemented by known node record entry types. diff --git a/p2p/message.go b/p2p/message.go index 649856ead..b7884bf92 100644 --- a/p2p/message.go +++ b/p2p/message.go @@ -24,9 +24,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rlp" ) // Msg defines the structure of a p2p message. diff --git a/p2p/metrics.go b/p2p/metrics.go index 1bb505cdf..7b9b30a56 100644 --- a/p2p/metrics.go +++ b/p2p/metrics.go @@ -21,7 +21,7 @@ package p2p import ( "net" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) const ( diff --git a/p2p/msgrate/msgrate.go b/p2p/msgrate/msgrate.go index 5bfa27b43..b5185b02b 100644 --- a/p2p/msgrate/msgrate.go +++ b/p2p/msgrate/msgrate.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // measurementImpact is the impact a single measurement has on a peer's final diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index 9d5519b9c..fbc6d1b17 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" natpmp "github.com/jackpal/go-nat-pmp" ) diff --git a/p2p/nat/natupnp_test.go b/p2p/nat/natupnp_test.go index 9072451d5..ca4e0cf25 100644 --- a/p2p/nat/natupnp_test.go +++ b/p2p/nat/natupnp_test.go @@ -166,7 +166,7 @@ func TestUPNP_DDWRT(t *testing.T) { if os.Getenv("CI") != "" { t.Fatalf("not discovered") } else { - t.Skipf("UPnP not discovered (known issue, see https://github.com/ethereum/go-ethereum/issues/21476)") + t.Skipf("UPnP not discovered (known issue, see https://github.com/electroneum/electroneum-sc/issues/21476)") } } upnp, _ := discovered.(*upnp) diff --git a/p2p/netutil/iptrack.go b/p2p/netutil/iptrack.go index b9cbd5e1c..0c24a2c11 100644 --- a/p2p/netutil/iptrack.go +++ b/p2p/netutil/iptrack.go @@ -19,7 +19,7 @@ package netutil import ( "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) // IPTracker predicts the external endpoint, i.e. IP address and port, of the local host diff --git a/p2p/netutil/iptrack_test.go b/p2p/netutil/iptrack_test.go index a9a2998a6..6d445a05b 100644 --- a/p2p/netutil/iptrack_test.go +++ b/p2p/netutil/iptrack_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) const ( diff --git a/p2p/nodestate/nodestate.go b/p2p/nodestate/nodestate.go index 2af0d0a6b..667a9ca60 100644 --- a/p2p/nodestate/nodestate.go +++ b/p2p/nodestate/nodestate.go @@ -23,13 +23,13 @@ import ( "time" "unsafe" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/p2p/nodestate/nodestate_test.go b/p2p/nodestate/nodestate_test.go index d06ad755e..a7a8cd4e5 100644 --- a/p2p/nodestate/nodestate_test.go +++ b/p2p/nodestate/nodestate_test.go @@ -23,11 +23,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) func testSetup(flagPersist []bool, fieldType []reflect.Type) (*Setup, []Flags, []Field) { diff --git a/p2p/peer.go b/p2p/peer.go index ae35c7f56..3b77d71c3 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -25,13 +25,13 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/p2p/peer_test.go b/p2p/peer_test.go index 4308bbd2e..66562714a 100644 --- a/p2p/peer_test.go +++ b/p2p/peer_test.go @@ -28,9 +28,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) var discard = Protocol{ diff --git a/p2p/protocol.go b/p2p/protocol.go index fa23a087c..7ac9c1fb2 100644 --- a/p2p/protocol.go +++ b/p2p/protocol.go @@ -19,8 +19,8 @@ package p2p import ( "fmt" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" ) // Protocol represents a P2P subprotocol implementation. diff --git a/p2p/rlpx/buffer_test.go b/p2p/rlpx/buffer_test.go index 9fee4172b..6d15ff1b6 100644 --- a/p2p/rlpx/buffer_test.go +++ b/p2p/rlpx/buffer_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" "github.com/stretchr/testify/assert" ) diff --git a/p2p/rlpx/rlpx.go b/p2p/rlpx/rlpx.go index 8bd6f64b9..3537f5c41 100644 --- a/p2p/rlpx/rlpx.go +++ b/p2p/rlpx/rlpx.go @@ -34,9 +34,9 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/crypto/ecies" + "github.com/electroneum/electroneum-sc/rlp" "github.com/golang/snappy" "golang.org/x/crypto/sha3" ) diff --git a/p2p/rlpx/rlpx_test.go b/p2p/rlpx/rlpx_test.go index 28759f2b4..aba8d9baf 100644 --- a/p2p/rlpx/rlpx_test.go +++ b/p2p/rlpx/rlpx_test.go @@ -29,10 +29,10 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/crypto/ecies" + "github.com/electroneum/electroneum-sc/p2p/simulations/pipes" + "github.com/electroneum/electroneum-sc/rlp" "github.com/stretchr/testify/assert" ) diff --git a/p2p/server.go b/p2p/server.go index 138975e54..62b603689 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -29,16 +29,16 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/discover" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/nat" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) const ( diff --git a/p2p/server_test.go b/p2p/server_test.go index f6f5700c5..f764683fb 100644 --- a/p2p/server_test.go +++ b/p2p/server_test.go @@ -27,12 +27,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/rlpx" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/internal/testlog" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/p2p/rlpx" ) type testTransport struct { diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 35ccdfb06..8eaa0c647 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -35,11 +35,11 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/rpc" "github.com/gorilla/websocket" ) diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index 1cb26a8ea..3d04a8b1d 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -24,13 +24,13 @@ import ( "net" "sync" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/pipes" + "github.com/electroneum/electroneum-sc/rpc" "github.com/gorilla/websocket" ) diff --git a/p2p/simulations/adapters/inproc_test.go b/p2p/simulations/adapters/inproc_test.go index 2a61508fe..b715fbde9 100644 --- a/p2p/simulations/adapters/inproc_test.go +++ b/p2p/simulations/adapters/inproc_test.go @@ -23,7 +23,7 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" + "github.com/electroneum/electroneum-sc/p2p/simulations/pipes" ) func TestTCPPipe(t *testing.T) { diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index aeb8ef777..be6409770 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -26,13 +26,13 @@ import ( "strconv" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rpc" "github.com/gorilla/websocket" ) diff --git a/p2p/simulations/connect.go b/p2p/simulations/connect.go index ede96b34c..9c483a6ba 100644 --- a/p2p/simulations/connect.go +++ b/p2p/simulations/connect.go @@ -20,7 +20,7 @@ import ( "errors" "strings" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) var ( diff --git a/p2p/simulations/connect_test.go b/p2p/simulations/connect_test.go index 0154a18b0..e6fdb04c2 100644 --- a/p2p/simulations/connect_test.go +++ b/p2p/simulations/connect_test.go @@ -19,9 +19,9 @@ package simulations import ( "testing" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" ) func newTestNetwork(t *testing.T, nodeCount int) (*Network, []enode.ID) { diff --git a/p2p/simulations/examples/ping-pong.go b/p2p/simulations/examples/ping-pong.go index 2f4c56054..a4d375c0c 100644 --- a/p2p/simulations/examples/ping-pong.go +++ b/p2p/simulations/examples/ping-pong.go @@ -25,12 +25,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" ) var adapterType = flag.String("adapter", "sim", `node adapter to use (one of "sim", "exec" or "docker")`) diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 341ff8718..7ac8e5eaf 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,11 +29,11 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/rpc" "github.com/gorilla/websocket" "github.com/julienschmidt/httprouter" ) diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index f5172f3f2..bd3a420a3 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -29,13 +29,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/rpc" "github.com/mattn/go-colorable" ) diff --git a/p2p/simulations/mocker.go b/p2p/simulations/mocker.go index fd25e2c91..752f2cd45 100644 --- a/p2p/simulations/mocker.go +++ b/p2p/simulations/mocker.go @@ -24,9 +24,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" ) //a map of mocker names to its function diff --git a/p2p/simulations/mocker_test.go b/p2p/simulations/mocker_test.go index 56d81942b..ecd8e88be 100644 --- a/p2p/simulations/mocker_test.go +++ b/p2p/simulations/mocker_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) func TestMocker(t *testing.T) { diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index 962910dd2..cffb1f5dc 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -26,11 +26,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/event" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" ) var DialBanTimeout = 200 * time.Millisecond diff --git a/p2p/simulations/network_test.go b/p2p/simulations/network_test.go index fa6936d27..f05bf7baa 100644 --- a/p2p/simulations/network_test.go +++ b/p2p/simulations/network_test.go @@ -27,10 +27,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/node" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/simulations/adapters" ) // Tests that a created snapshot with a minimal service only contains the expected connections diff --git a/p2p/simulations/simulation.go b/p2p/simulations/simulation.go index ae62c42b9..c789c44ac 100644 --- a/p2p/simulations/simulation.go +++ b/p2p/simulations/simulation.go @@ -20,7 +20,7 @@ import ( "context" "time" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enode" ) // Simulation provides a framework for running actions in a simulated network diff --git a/p2p/simulations/test.go b/p2p/simulations/test.go index 0edb07b12..69ea70f78 100644 --- a/p2p/simulations/test.go +++ b/p2p/simulations/test.go @@ -19,10 +19,10 @@ package simulations import ( "testing" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rpc" ) // NoopService is the service that does not do anything diff --git a/p2p/tracker/tracker.go b/p2p/tracker/tracker.go index 69a49087e..c915c7214 100644 --- a/p2p/tracker/tracker.go +++ b/p2p/tracker/tracker.go @@ -22,8 +22,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" ) const ( diff --git a/p2p/transport.go b/p2p/transport.go index 4f6bb569b..350c83c72 100644 --- a/p2p/transport.go +++ b/p2p/transport.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p/rlpx" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/bitutil" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/p2p/rlpx" + "github.com/electroneum/electroneum-sc/rlp" ) const ( diff --git a/p2p/transport_test.go b/p2p/transport_test.go index 24e06c5a0..3f2f3d25d 100644 --- a/p2p/transport_test.go +++ b/p2p/transport_test.go @@ -23,8 +23,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/p2p/simulations/pipes" ) func TestProtocolHandshake(t *testing.T) { diff --git a/p2p/util.go b/p2p/util.go index 3c5f6b850..4f763e6bb 100644 --- a/p2p/util.go +++ b/p2p/util.go @@ -19,7 +19,7 @@ package p2p import ( "container/heap" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) // expHeap tracks strings and their expiry time. diff --git a/p2p/util_test.go b/p2p/util_test.go index cc0d2b215..a67c24f27 100644 --- a/p2p/util_test.go +++ b/p2p/util_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/electroneum/electroneum-sc/common/mclock" ) func TestExpHeap(t *testing.T) { diff --git a/params/bootnodes.go b/params/bootnodes.go index a8ed9f738..a261f444d 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -16,7 +16,7 @@ package params -import "github.com/ethereum/go-ethereum/common" +import "github.com/electroneum/electroneum-sc/common" // MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on // the main Electroneum network. diff --git a/params/config.go b/params/config.go index 44f6cf48b..90ecd7886 100644 --- a/params/config.go +++ b/params/config.go @@ -21,7 +21,7 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" "golang.org/x/crypto/sha3" ) diff --git a/params/dao.go b/params/dao.go index da3c8dfc9..a328c5ab0 100644 --- a/params/dao.go +++ b/params/dao.go @@ -19,7 +19,7 @@ package params import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // DAOForkBlockExtra is the block header extra-data field to set for the DAO fork diff --git a/rlp/decode.go b/rlp/decode.go index 9214dbfb3..f563c7ba2 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -28,7 +28,7 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/rlp/internal/rlpstruct" + "github.com/electroneum/electroneum-sc/rlp/internal/rlpstruct" ) //lint:ignore ST1012 EOL is not an error. diff --git a/rlp/decode_test.go b/rlp/decode_test.go index 46aa68cea..b3fecbafe 100644 --- a/rlp/decode_test.go +++ b/rlp/decode_test.go @@ -27,7 +27,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common/math" ) func TestStreamKind(t *testing.T) { diff --git a/rlp/encbuffer_example_test.go b/rlp/encbuffer_example_test.go index ee15d82a7..a1251e970 100644 --- a/rlp/encbuffer_example_test.go +++ b/rlp/encbuffer_example_test.go @@ -20,7 +20,7 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) func ExampleEncoderBuffer() { diff --git a/rlp/encode.go b/rlp/encode.go index b96505f56..a8e0126a4 100644 --- a/rlp/encode.go +++ b/rlp/encode.go @@ -23,7 +23,7 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/rlp/internal/rlpstruct" + "github.com/electroneum/electroneum-sc/rlp/internal/rlpstruct" ) var ( diff --git a/rlp/encode_test.go b/rlp/encode_test.go index 78392906b..1c00e0f72 100644 --- a/rlp/encode_test.go +++ b/rlp/encode_test.go @@ -26,7 +26,7 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common/math" ) type testEncoder struct { diff --git a/rlp/encoder_example_test.go b/rlp/encoder_example_test.go index 4cd3cb867..ab8e509a4 100644 --- a/rlp/encoder_example_test.go +++ b/rlp/encoder_example_test.go @@ -20,7 +20,7 @@ import ( "fmt" "io" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) type MyCoolType struct { diff --git a/rlp/iterator_test.go b/rlp/iterator_test.go index a22aaec86..9bee15f6d 100644 --- a/rlp/iterator_test.go +++ b/rlp/iterator_test.go @@ -19,7 +19,7 @@ package rlp import ( "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // TestIterator tests some basic things about the ListIterator. A more diff --git a/rlp/rlpgen/gen.go b/rlp/rlpgen/gen.go index 1deb5a93c..b756e4460 100644 --- a/rlp/rlpgen/gen.go +++ b/rlp/rlpgen/gen.go @@ -23,7 +23,7 @@ import ( "go/types" "sort" - "github.com/ethereum/go-ethereum/rlp/internal/rlpstruct" + "github.com/electroneum/electroneum-sc/rlp/internal/rlpstruct" ) // buildContext keeps the data needed for make*Op. diff --git a/rlp/rlpgen/main.go b/rlp/rlpgen/main.go index 6258fdb47..eb1ff8fe0 100644 --- a/rlp/rlpgen/main.go +++ b/rlp/rlpgen/main.go @@ -27,7 +27,7 @@ import ( "golang.org/x/tools/go/packages" ) -const pathOfPackageRLP = "github.com/ethereum/go-ethereum/rlp" +const pathOfPackageRLP = "github.com/electroneum/electroneum-sc/rlp" func main() { var ( diff --git a/rlp/rlpgen/testdata/bigint.out.txt b/rlp/rlpgen/testdata/bigint.out.txt index f54d1faa1..46a3d38a1 100644 --- a/rlp/rlpgen/testdata/bigint.out.txt +++ b/rlp/rlpgen/testdata/bigint.out.txt @@ -1,6 +1,6 @@ package test -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *Test) EncodeRLP(_w io.Writer) error { diff --git a/rlp/rlpgen/testdata/nil.out.txt b/rlp/rlpgen/testdata/nil.out.txt index e0d5dceba..92f3fde0d 100644 --- a/rlp/rlpgen/testdata/nil.out.txt +++ b/rlp/rlpgen/testdata/nil.out.txt @@ -1,6 +1,6 @@ package test -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *Test) EncodeRLP(_w io.Writer) error { diff --git a/rlp/rlpgen/testdata/optional.out.txt b/rlp/rlpgen/testdata/optional.out.txt index 02df8e457..60bcd9a95 100644 --- a/rlp/rlpgen/testdata/optional.out.txt +++ b/rlp/rlpgen/testdata/optional.out.txt @@ -1,6 +1,6 @@ package test -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *Test) EncodeRLP(_w io.Writer) error { diff --git a/rlp/rlpgen/testdata/rawvalue.in.txt b/rlp/rlpgen/testdata/rawvalue.in.txt index 3a657bc90..c42d47194 100644 --- a/rlp/rlpgen/testdata/rawvalue.in.txt +++ b/rlp/rlpgen/testdata/rawvalue.in.txt @@ -2,7 +2,7 @@ package test -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" type Test struct { RawValue rlp.RawValue diff --git a/rlp/rlpgen/testdata/rawvalue.out.txt b/rlp/rlpgen/testdata/rawvalue.out.txt index 3607c9863..ae7ee057f 100644 --- a/rlp/rlpgen/testdata/rawvalue.out.txt +++ b/rlp/rlpgen/testdata/rawvalue.out.txt @@ -1,6 +1,6 @@ package test -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *Test) EncodeRLP(_w io.Writer) error { diff --git a/rlp/rlpgen/testdata/uints.out.txt b/rlp/rlpgen/testdata/uints.out.txt index 1a354956a..42440207a 100644 --- a/rlp/rlpgen/testdata/uints.out.txt +++ b/rlp/rlpgen/testdata/uints.out.txt @@ -1,6 +1,6 @@ package test -import "github.com/ethereum/go-ethereum/rlp" +import "github.com/electroneum/electroneum-sc/rlp" import "io" func (obj *Test) EncodeRLP(_w io.Writer) error { diff --git a/rlp/typecache.go b/rlp/typecache.go index 3e37c9d2f..76eb54c06 100644 --- a/rlp/typecache.go +++ b/rlp/typecache.go @@ -22,7 +22,7 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/rlp/internal/rlpstruct" + "github.com/electroneum/electroneum-sc/rlp/internal/rlpstruct" ) // typeinfo is an entry in the type cache. diff --git a/rpc/client.go b/rpc/client.go index d3ce02977..8e34a858c 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -27,7 +27,7 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) var ( diff --git a/rpc/client_example_test.go b/rpc/client_example_test.go index 044b57a9c..ad6ae5659 100644 --- a/rpc/client_example_test.go +++ b/rpc/client_example_test.go @@ -21,8 +21,8 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/rpc" ) // In this example, our client wishes to track the latest 'block number' diff --git a/rpc/client_test.go b/rpc/client_test.go index fa6010bb1..0bf4891b2 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -33,7 +33,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) func TestClientRequest(t *testing.T) { @@ -354,7 +354,7 @@ func TestClientSubscribeClose(t *testing.T) { } } -// This test reproduces https://github.com/ethereum/go-ethereum/issues/17837 where the +// This test reproduces https://github.com/electroneum/electroneum-sc/issues/17837 where the // client hangs during shutdown when Unsubscribe races with Client.Close. func TestClientCloseUnsubscribeRace(t *testing.T) { server := newTestServer() @@ -438,7 +438,7 @@ func TestClientSubscriptionUnsubscribeServer(t *testing.T) { } // This checks that the subscribed channel can be closed after Unsubscribe. -// It is the reproducer for https://github.com/ethereum/go-ethereum/issues/22322 +// It is the reproducer for https://github.com/electroneum/electroneum-sc/issues/22322 func TestClientSubscriptionChannelClose(t *testing.T) { t.Parallel() diff --git a/rpc/doc.go b/rpc/doc.go index e0a632467..037b8bec7 100644 --- a/rpc/doc.go +++ b/rpc/doc.go @@ -99,7 +99,7 @@ Subscriptions are deleted when the user sends an unsubscribe request or when the connection which was used to create the subscription is closed. This can be initiated by the client and server. The server will close the connection for any write error. -For more information about subscriptions, see https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB. +For more information about subscriptions, see https://github.com/electroneum/electroneum-sc/wiki/RPC-PUB-SUB. Reverse Calls diff --git a/rpc/endpoints.go b/rpc/endpoints.go index d78ebe285..1394fd477 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -20,7 +20,7 @@ import ( "net" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // StartIPCEndpoint starts an IPC endpoint. diff --git a/rpc/handler.go b/rpc/handler.go index e8d1887c7..af25da0dd 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // handler handles JSON-RPC messages. There is one handler per connection. Note that diff --git a/rpc/ipc.go b/rpc/ipc.go index 07a211c62..a2ee0cbf6 100644 --- a/rpc/ipc.go +++ b/rpc/ipc.go @@ -20,8 +20,8 @@ import ( "context" "net" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/netutil" ) // ServeListener accepts connections on l, serving JSON-RPC on them. diff --git a/rpc/ipc_unix.go b/rpc/ipc_unix.go index 249a9cf04..7c2f8eebf 100644 --- a/rpc/ipc_unix.go +++ b/rpc/ipc_unix.go @@ -26,7 +26,7 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) // ipcListen will create a Unix socket on the given endpoint. diff --git a/rpc/metrics.go b/rpc/metrics.go index 4f166ad1c..6a0b5ed52 100644 --- a/rpc/metrics.go +++ b/rpc/metrics.go @@ -19,7 +19,7 @@ package rpc import ( "fmt" - "github.com/ethereum/go-ethereum/metrics" + "github.com/electroneum/electroneum-sc/metrics" ) var ( diff --git a/rpc/server.go b/rpc/server.go index babc5688e..4ae927683 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -22,7 +22,7 @@ import ( "sync/atomic" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) const MetadataApi = "rpc" diff --git a/rpc/service.go b/rpc/service.go index bef891ea1..4e7eac319 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -26,7 +26,7 @@ import ( "sync" "unicode" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) var ( diff --git a/rpc/types.go b/rpc/types.go index f4d05be48..3744d413f 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -24,8 +24,8 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" ) // API describes the set of methods offered over the RPC interface diff --git a/rpc/types_test.go b/rpc/types_test.go index f110dee7c..7907518e6 100644 --- a/rpc/types_test.go +++ b/rpc/types_test.go @@ -21,8 +21,8 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" ) func TestBlockNumberJSONUnmarshal(t *testing.T) { diff --git a/rpc/websocket.go b/rpc/websocket.go index 28380d8aa..8c4151214 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -28,7 +28,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" "github.com/gorilla/websocket" ) diff --git a/rpc/websocket_test.go b/rpc/websocket_test.go index f74b7fd08..132d0d4ec 100644 --- a/rpc/websocket_test.go +++ b/rpc/websocket_test.go @@ -179,7 +179,7 @@ func TestClientWebsocketPing(t *testing.T) { // server can't handle the request. // Wait for the context's deadline to be reached before proceeding. - // This is important for reproducing https://github.com/ethereum/go-ethereum/issues/19798 + // This is important for reproducing https://github.com/electroneum/electroneum-sc/issues/19798 <-ctx.Done() close(sendPing) diff --git a/signer/core/api.go b/signer/core/api.go index f06fbeb76..2a8cce1cc 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -25,17 +25,17 @@ import ( "os" "reflect" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/accounts/usbwallet" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/accounts/scwallet" + "github.com/electroneum/electroneum-sc/accounts/usbwallet" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/signer/storage" ) const ( diff --git a/signer/core/api_test.go b/signer/core/api_test.go index ddc2b82ea..7d61cc334 100644 --- a/signer/core/api_test.go +++ b/signer/core/api_test.go @@ -26,17 +26,17 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/ethereum/go-ethereum/signer/fourbyte" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/signer/core" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/signer/fourbyte" + "github.com/electroneum/electroneum-sc/signer/storage" ) //Used for testing diff --git a/signer/core/apitypes/signed_data_internal_test.go b/signer/core/apitypes/signed_data_internal_test.go index 121cc00de..68c0ffc37 100644 --- a/signer/core/apitypes/signed_data_internal_test.go +++ b/signer/core/apitypes/signed_data_internal_test.go @@ -21,7 +21,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/electroneum/electroneum-sc/common/hexutil" ) func TestBytesPadding(t *testing.T) { diff --git a/signer/core/apitypes/types.go b/signer/core/apitypes/types.go index f5c2fe2f3..474a9027f 100644 --- a/signer/core/apitypes/types.go +++ b/signer/core/apitypes/types.go @@ -30,12 +30,12 @@ import ( "unicode" "unicode/utf8" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" ) var typedDataReferenceTypeRegexp = regexp.MustCompile(`^[A-Z](\w*)(\[\])?$`) @@ -93,7 +93,7 @@ type SendTxArgs struct { // We accept "data" and "input" for backwards-compatibility reasons. // "input" is the newer name and should be preferred by clients. - // Issue detail: https://github.com/ethereum/go-ethereum/issues/15628 + // Issue detail: https://github.com/electroneum/electroneum-sc/issues/15628 Data *hexutil.Bytes `json:"data"` Input *hexutil.Bytes `json:"input,omitempty"` diff --git a/signer/core/auditlog.go b/signer/core/auditlog.go index 663d6d131..4000b0ab9 100644 --- a/signer/core/auditlog.go +++ b/signer/core/auditlog.go @@ -20,11 +20,11 @@ import ( "context" "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) type AuditLogger struct { diff --git a/signer/core/cliui.go b/signer/core/cliui.go index 05c60906c..71e54810a 100644 --- a/signer/core/cliui.go +++ b/signer/core/cliui.go @@ -24,10 +24,10 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/console/prompt" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/console/prompt" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" ) type CommandlineUI struct { diff --git a/signer/core/gnosis_safe.go b/signer/core/gnosis_safe.go index 01724e538..eb9adee81 100644 --- a/signer/core/gnosis_safe.go +++ b/signer/core/gnosis_safe.go @@ -20,10 +20,10 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) // GnosisSafeTx is a type to parse the safe-tx returned by the relayer, diff --git a/signer/core/signed_data.go b/signer/core/signed_data.go index 9bf47be79..d5b0137bc 100644 --- a/signer/core/signed_data.go +++ b/signer/core/signed_data.go @@ -22,14 +22,14 @@ import ( "fmt" "mime" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/consensus/clique" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) // sign receives a request and produces a signature @@ -277,7 +277,7 @@ func (api *SignerAPI) EcRecover(ctx context.Context, data hexutil.Bytes, sig hex // Note, the signature must conform to the secp256k1 curve R, S and V values, where // the V value must be be 27 or 28 for legacy reasons. // - // https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_ecRecover + // https://github.com/electroneum/electroneum-sc/wiki/Management-APIs#personal_ecRecover if len(sig) != 65 { return common.Address{}, fmt.Errorf("signature must be 65 bytes long") } diff --git a/signer/core/signed_data_test.go b/signer/core/signed_data_test.go index 7d5661e7e..8fe182c3b 100644 --- a/signer/core/signed_data_test.go +++ b/signer/core/signed_data_test.go @@ -26,13 +26,13 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/signer/core" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) var typesStandard = apitypes.Types{ diff --git a/signer/core/stdioui.go b/signer/core/stdioui.go index 6963a8912..9e5998b8b 100644 --- a/signer/core/stdioui.go +++ b/signer/core/stdioui.go @@ -19,9 +19,9 @@ package core import ( "context" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rpc" ) type StdIOUI struct { diff --git a/signer/core/uiapi.go b/signer/core/uiapi.go index 59466d8fa..6e8c67647 100644 --- a/signer/core/uiapi.go +++ b/signer/core/uiapi.go @@ -24,11 +24,11 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/accounts/keystore" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/crypto" ) // SignerUIAPI implements methods Clef provides for a UI to query, in the bidirectional communication diff --git a/signer/fourbyte/abi.go b/signer/fourbyte/abi.go index 352abc59e..581d49772 100644 --- a/signer/fourbyte/abi.go +++ b/signer/fourbyte/abi.go @@ -22,8 +22,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/common" ) // decodedCallData is an internal type to represent a method call parsed according diff --git a/signer/fourbyte/abi_test.go b/signer/fourbyte/abi_test.go index 68c027ece..b49cc0486 100644 --- a/signer/fourbyte/abi_test.go +++ b/signer/fourbyte/abi_test.go @@ -22,8 +22,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/common" ) func verify(t *testing.T, jsondata, calldata string, exp []interface{}) { diff --git a/signer/fourbyte/fourbyte_test.go b/signer/fourbyte/fourbyte_test.go index 017001f97..28c91bb4e 100644 --- a/signer/fourbyte/fourbyte_test.go +++ b/signer/fourbyte/fourbyte_test.go @@ -21,8 +21,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/accounts/abi" + "github.com/electroneum/electroneum-sc/common" ) // Tests that all the selectors contained in the 4byte database are valid. diff --git a/signer/fourbyte/validation.go b/signer/fourbyte/validation.go index 58111e8e0..9974b93ba 100644 --- a/signer/fourbyte/validation.go +++ b/signer/fourbyte/validation.go @@ -22,8 +22,8 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) // ValidateTransaction does a number of checks on the supplied transaction, and @@ -49,7 +49,7 @@ func (db *Database) ValidateTransaction(selector *string, tx *apitypes.SendTxArg if tx.To == nil { // Contract creation should contain sufficient data to deploy a contract. A // typical error is omitting sender due to some quirk in the javascript call - // e.g. https://github.com/ethereum/go-ethereum/issues/16106. + // e.g. https://github.com/electroneum/electroneum-sc/issues/16106. if len(data) == 0 { // Prevent sending ether into black hole (show stopper) if tx.Value.ToInt().Cmp(big.NewInt(0)) > 0 { diff --git a/signer/fourbyte/validation_test.go b/signer/fourbyte/validation_test.go index c3085696f..b4aaaee05 100644 --- a/signer/fourbyte/validation_test.go +++ b/signer/fourbyte/validation_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" ) func mixAddr(a string) (*common.MixedcaseAddress, error) { diff --git a/signer/rules/rules.go b/signer/rules/rules.go index 6852d86f3..063936feb 100644 --- a/signer/rules/rules.go +++ b/signer/rules/rules.go @@ -23,11 +23,11 @@ import ( "strings" "github.com/dop251/goja" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/internal/jsre/deps" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/internal/jsre/deps" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/signer/core" + "github.com/electroneum/electroneum-sc/signer/storage" ) // consoleOutput is an override for the console.log and console.error methods to diff --git a/signer/rules/rules_test.go b/signer/rules/rules_test.go index 0ab246eea..ef4f8efbd 100644 --- a/signer/rules/rules_test.go +++ b/signer/rules/rules_test.go @@ -22,14 +22,14 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/electroneum/electroneum-sc/accounts" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/internal/ethapi" + "github.com/electroneum/electroneum-sc/signer/core" + "github.com/electroneum/electroneum-sc/signer/core/apitypes" + "github.com/electroneum/electroneum-sc/signer/storage" ) const JS = ` diff --git a/signer/storage/aes_gcm_storage.go b/signer/storage/aes_gcm_storage.go index f09bfa7d4..0ec70148f 100644 --- a/signer/storage/aes_gcm_storage.go +++ b/signer/storage/aes_gcm_storage.go @@ -24,7 +24,7 @@ import ( "io" "os" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/log" ) type storedCredential struct { diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index a2a95d9de..fb54ab992 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -23,8 +23,8 @@ import ( "os" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/log" "github.com/mattn/go-colorable" ) diff --git a/tests/block_test_util.go b/tests/block_test_util.go index 76f0b880b..546c0d7f3 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -25,18 +25,18 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "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/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // A BlockTest checks handling of entire blocks. diff --git a/tests/difficulty_test.go b/tests/difficulty_test.go index 9144fa5e0..46ad72cfc 100644 --- a/tests/difficulty_test.go +++ b/tests/difficulty_test.go @@ -20,8 +20,8 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/tests/difficulty_test_util.go b/tests/difficulty_test_util.go index bda5a9611..88071aaeb 100644 --- a/tests/difficulty_test_util.go +++ b/tests/difficulty_test_util.go @@ -20,11 +20,11 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" ) //go:generate go run github.com/fjl/gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go diff --git a/tests/fuzzers/abi/abifuzzer.go b/tests/fuzzers/abi/abifuzzer.go index 60233d158..4c39188c5 100644 --- a/tests/fuzzers/abi/abifuzzer.go +++ b/tests/fuzzers/abi/abifuzzer.go @@ -21,7 +21,7 @@ import ( "reflect" "strings" - "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/electroneum/electroneum-sc/accounts/abi" fuzz "github.com/google/gofuzz" ) diff --git a/tests/fuzzers/bitutil/compress_fuzz.go b/tests/fuzzers/bitutil/compress_fuzz.go index 5903cf2f9..137b0c7eb 100644 --- a/tests/fuzzers/bitutil/compress_fuzz.go +++ b/tests/fuzzers/bitutil/compress_fuzz.go @@ -19,7 +19,7 @@ package bitutil import ( "bytes" - "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/electroneum/electroneum-sc/common/bitutil" ) // Fuzz implements a go-fuzz fuzzer method to test various encoding method diff --git a/tests/fuzzers/bls12381/bls12381_fuzz.go b/tests/fuzzers/bls12381/bls12381_fuzz.go index b283ed11f..ff2499258 100644 --- a/tests/fuzzers/bls12381/bls12381_fuzz.go +++ b/tests/fuzzers/bls12381/bls12381_fuzz.go @@ -29,7 +29,7 @@ import ( gnark "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" - "github.com/ethereum/go-ethereum/crypto/bls12381" + "github.com/electroneum/electroneum-sc/crypto/bls12381" ) func FuzzCrossPairing(data []byte) int { diff --git a/tests/fuzzers/bls12381/precompile_fuzzer.go b/tests/fuzzers/bls12381/precompile_fuzzer.go index bc3c45652..0a5d2816d 100644 --- a/tests/fuzzers/bls12381/precompile_fuzzer.go +++ b/tests/fuzzers/bls12381/precompile_fuzzer.go @@ -20,8 +20,8 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/vm" ) const ( diff --git a/tests/fuzzers/bn256/bn256_fuzz.go b/tests/fuzzers/bn256/bn256_fuzz.go index 1ce20571f..f586c3874 100644 --- a/tests/fuzzers/bn256/bn256_fuzz.go +++ b/tests/fuzzers/bn256/bn256_fuzz.go @@ -26,8 +26,8 @@ import ( "math/big" "github.com/consensys/gnark-crypto/ecc/bn254" - cloudflare "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" - google "github.com/ethereum/go-ethereum/crypto/bn256/google" + cloudflare "github.com/electroneum/electroneum-sc/crypto/bn256/cloudflare" + google "github.com/electroneum/electroneum-sc/crypto/bn256/google" ) func getG1Points(input io.Reader) (*cloudflare.G1, *google.G1, *bn254.G1Affine) { diff --git a/tests/fuzzers/difficulty/debug/main.go b/tests/fuzzers/difficulty/debug/main.go index 70cf09256..1cb8eaba8 100644 --- a/tests/fuzzers/difficulty/debug/main.go +++ b/tests/fuzzers/difficulty/debug/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/tests/fuzzers/difficulty" + "github.com/electroneum/electroneum-sc/tests/fuzzers/difficulty" ) func main() { diff --git a/tests/fuzzers/difficulty/difficulty-fuzz.go b/tests/fuzzers/difficulty/difficulty-fuzz.go index 58936fcd8..f8bbe516d 100644 --- a/tests/fuzzers/difficulty/difficulty-fuzz.go +++ b/tests/fuzzers/difficulty/difficulty-fuzz.go @@ -23,8 +23,8 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core/types" ) type fuzzer struct { diff --git a/tests/fuzzers/keystore/keystore-fuzzer.go b/tests/fuzzers/keystore/keystore-fuzzer.go index e3bcae92e..a2fd6ff1f 100644 --- a/tests/fuzzers/keystore/keystore-fuzzer.go +++ b/tests/fuzzers/keystore/keystore-fuzzer.go @@ -19,7 +19,7 @@ package keystore import ( "os" - "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/electroneum/electroneum-sc/accounts/keystore" ) func Fuzz(input []byte) int { diff --git a/tests/fuzzers/les/debug/main.go b/tests/fuzzers/les/debug/main.go index 77a612703..5fcdab6c7 100644 --- a/tests/fuzzers/les/debug/main.go +++ b/tests/fuzzers/les/debug/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/tests/fuzzers/les" + "github.com/electroneum/electroneum-sc/tests/fuzzers/les" ) func main() { diff --git a/tests/fuzzers/les/les-fuzzer.go b/tests/fuzzers/les/les-fuzzer.go index 3e1017187..d54a6291e 100644 --- a/tests/fuzzers/les/les-fuzzer.go +++ b/tests/fuzzers/les/les-fuzzer.go @@ -22,17 +22,17 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "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/core/vm" - "github.com/ethereum/go-ethereum/crypto" - l "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + l "github.com/electroneum/electroneum-sc/les" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" + "github.com/electroneum/electroneum-sc/trie" ) var ( diff --git a/tests/fuzzers/rangeproof/debug/main.go b/tests/fuzzers/rangeproof/debug/main.go index d4cab8ec4..66477b72a 100644 --- a/tests/fuzzers/rangeproof/debug/main.go +++ b/tests/fuzzers/rangeproof/debug/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/tests/fuzzers/rangeproof" + "github.com/electroneum/electroneum-sc/tests/fuzzers/rangeproof" ) func main() { diff --git a/tests/fuzzers/rangeproof/rangeproof-fuzzer.go b/tests/fuzzers/rangeproof/rangeproof-fuzzer.go index 18717e70d..b36c6bdca 100644 --- a/tests/fuzzers/rangeproof/rangeproof-fuzzer.go +++ b/tests/fuzzers/rangeproof/rangeproof-fuzzer.go @@ -23,10 +23,10 @@ import ( "io" "sort" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/trie" ) type kv struct { diff --git a/tests/fuzzers/rlp/rlp_fuzzer.go b/tests/fuzzers/rlp/rlp_fuzzer.go index 18b36287b..20fabe74b 100644 --- a/tests/fuzzers/rlp/rlp_fuzzer.go +++ b/tests/fuzzers/rlp/rlp_fuzzer.go @@ -20,8 +20,8 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/rlp" ) func decodeEncode(input []byte, val interface{}, i int) { diff --git a/tests/fuzzers/runtime/runtime_fuzz.go b/tests/fuzzers/runtime/runtime_fuzz.go index 9b9604575..79ebd3444 100644 --- a/tests/fuzzers/runtime/runtime_fuzz.go +++ b/tests/fuzzers/runtime/runtime_fuzz.go @@ -17,7 +17,7 @@ package runtime import ( - "github.com/ethereum/go-ethereum/core/vm/runtime" + "github.com/electroneum/electroneum-sc/core/vm/runtime" ) // Fuzz is the basic entry point for the go-fuzz tool diff --git a/tests/fuzzers/secp256k1/secp_fuzzer.go b/tests/fuzzers/secp256k1/secp_fuzzer.go index 47083d5fe..f09ab923f 100644 --- a/tests/fuzzers/secp256k1/secp_fuzzer.go +++ b/tests/fuzzers/secp256k1/secp_fuzzer.go @@ -22,7 +22,7 @@ import ( "fmt" "github.com/btcsuite/btcd/btcec/v2" - "github.com/ethereum/go-ethereum/crypto/secp256k1" + "github.com/electroneum/electroneum-sc/crypto/secp256k1" fuzz "github.com/google/gofuzz" ) diff --git a/tests/fuzzers/snap/debug/main.go b/tests/fuzzers/snap/debug/main.go index df46bb1e2..16a1dae9c 100644 --- a/tests/fuzzers/snap/debug/main.go +++ b/tests/fuzzers/snap/debug/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/tests/fuzzers/snap" + "github.com/electroneum/electroneum-sc/tests/fuzzers/snap" ) func main() { diff --git a/tests/fuzzers/snap/fuzz_handler.go b/tests/fuzzers/snap/fuzz_handler.go index 1ae61df29..2da6703e6 100644 --- a/tests/fuzzers/snap/fuzz_handler.go +++ b/tests/fuzzers/snap/fuzz_handler.go @@ -23,16 +23,16 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "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/vm" - "github.com/ethereum/go-ethereum/eth/protocols/snap" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/consensus/ethash" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/protocols/snap" + "github.com/electroneum/electroneum-sc/p2p" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" fuzz "github.com/google/gofuzz" ) diff --git a/tests/fuzzers/stacktrie/debug/main.go b/tests/fuzzers/stacktrie/debug/main.go index 6b634f05c..bd9b3e290 100644 --- a/tests/fuzzers/stacktrie/debug/main.go +++ b/tests/fuzzers/stacktrie/debug/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/tests/fuzzers/stacktrie" + "github.com/electroneum/electroneum-sc/tests/fuzzers/stacktrie" ) func main() { diff --git a/tests/fuzzers/stacktrie/trie_fuzzer.go b/tests/fuzzers/stacktrie/trie_fuzzer.go index 9ed8bcbc5..b30700d7b 100644 --- a/tests/fuzzers/stacktrie/trie_fuzzer.go +++ b/tests/fuzzers/stacktrie/trie_fuzzer.go @@ -25,9 +25,9 @@ import ( "io" "sort" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/trie" "golang.org/x/crypto/sha3" ) diff --git a/tests/fuzzers/trie/trie-fuzzer.go b/tests/fuzzers/trie/trie-fuzzer.go index e993af47c..73021c2b7 100644 --- a/tests/fuzzers/trie/trie-fuzzer.go +++ b/tests/fuzzers/trie/trie-fuzzer.go @@ -21,9 +21,9 @@ import ( "encoding/binary" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/trie" ) // randTest performs random trie operations. diff --git a/tests/fuzzers/txfetcher/txfetcher_fuzzer.go b/tests/fuzzers/txfetcher/txfetcher_fuzzer.go index d1d6fdc66..48665140f 100644 --- a/tests/fuzzers/txfetcher/txfetcher_fuzzer.go +++ b/tests/fuzzers/txfetcher/txfetcher_fuzzer.go @@ -23,10 +23,10 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/fetcher" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/eth/fetcher" ) var ( diff --git a/tests/fuzzers/vflux/clientpool-fuzzer.go b/tests/fuzzers/vflux/clientpool-fuzzer.go index b3b523cc8..8d84a6b77 100644 --- a/tests/fuzzers/vflux/clientpool-fuzzer.go +++ b/tests/fuzzers/vflux/clientpool-fuzzer.go @@ -24,14 +24,14 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/les/vflux" - vfs "github.com/ethereum/go-ethereum/les/vflux/server" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common/mclock" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/les/vflux" + vfs "github.com/electroneum/electroneum-sc/les/vflux/server" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/p2p/enode" + "github.com/electroneum/electroneum-sc/p2p/enr" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/tests/fuzzers/vflux/debug/main.go b/tests/fuzzers/vflux/debug/main.go index e6cec0460..2ff9a0b7b 100644 --- a/tests/fuzzers/vflux/debug/main.go +++ b/tests/fuzzers/vflux/debug/main.go @@ -20,8 +20,8 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/tests/fuzzers/vflux" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/tests/fuzzers/vflux" ) func main() { diff --git a/tests/gen_btheader.go b/tests/gen_btheader.go index 4387f8db4..4ea915668 100644 --- a/tests/gen_btheader.go +++ b/tests/gen_btheader.go @@ -6,10 +6,10 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" ) var _ = (*btHeaderMarshaling)(nil) diff --git a/tests/gen_difficultytest.go b/tests/gen_difficultytest.go index cd15ae31b..807dc59ca 100644 --- a/tests/gen_difficultytest.go +++ b/tests/gen_difficultytest.go @@ -6,8 +6,8 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" ) var _ = (*difficultyTestMarshaling)(nil) diff --git a/tests/gen_stenv.go b/tests/gen_stenv.go index 71f006317..134ceb432 100644 --- a/tests/gen_stenv.go +++ b/tests/gen_stenv.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/math" ) var _ = (*stEnvMarshaling)(nil) diff --git a/tests/gen_sttransaction.go b/tests/gen_sttransaction.go index 7693a207a..29e609c1a 100644 --- a/tests/gen_sttransaction.go +++ b/tests/gen_sttransaction.go @@ -6,9 +6,9 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core/types" ) var _ = (*stTransactionMarshaling)(nil) diff --git a/tests/init.go b/tests/init.go index 52277e841..111c2800a 100644 --- a/tests/init.go +++ b/tests/init.go @@ -21,7 +21,7 @@ import ( "math/big" "sort" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) // Forks table defines supported forks and their chain config. diff --git a/tests/init_test.go b/tests/init_test.go index 218634966..0c5b5f556 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -29,7 +29,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) var ( diff --git a/tests/rlp_test_util.go b/tests/rlp_test_util.go index 9069ec55a..f17c57e3c 100644 --- a/tests/rlp_test_util.go +++ b/tests/rlp_test_util.go @@ -24,7 +24,7 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) // RLPTest is the JSON structure of a single RLP test. diff --git a/tests/state_test.go b/tests/state_test.go index d2c92b211..aa5a1653c 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -27,11 +27,11 @@ import ( "strings" "testing" - "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/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers/logger" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/eth/tracers/logger" ) func TestState(t *testing.T) { diff --git a/tests/state_test_util.go b/tests/state_test_util.go index f6d8e1500..c1a2d2c94 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -24,19 +24,19 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/state/snapshot" - "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/ethdb" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/common/math" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/state" + "github.com/electroneum/electroneum-sc/core/state/snapshot" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/core/vm" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/tests/transaction_test.go b/tests/transaction_test.go index cb0f26231..e55e6c6a7 100644 --- a/tests/transaction_test.go +++ b/tests/transaction_test.go @@ -19,7 +19,7 @@ package tests import ( "testing" - "github.com/ethereum/go-ethereum/params" + "github.com/electroneum/electroneum-sc/params" ) func TestTransaction(t *testing.T) { diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go index 82ee01de1..85ff69976 100644 --- a/tests/transaction_test_util.go +++ b/tests/transaction_test_util.go @@ -19,12 +19,12 @@ package tests import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/hexutil" + "github.com/electroneum/electroneum-sc/core" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/params" + "github.com/electroneum/electroneum-sc/rlp" ) // TransactionTest checks RLP decoding and sender derivation of transactions. diff --git a/trie/committer.go b/trie/committer.go index 9a7bf48d9..3fd895bd1 100644 --- a/trie/committer.go +++ b/trie/committer.go @@ -21,7 +21,7 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // leafChanSize is the size of the leafCh. It's a pretty arbitrary number, to allow diff --git a/trie/database.go b/trie/database.go index d71abeee4..18bc52118 100644 --- a/trie/database.go +++ b/trie/database.go @@ -26,12 +26,12 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/metrics" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/trie/database_test.go b/trie/database_test.go index 81c469500..57b1a6878 100644 --- a/trie/database_test.go +++ b/trie/database_test.go @@ -19,8 +19,8 @@ package trie import ( "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) // Tests that the trie database returns a missing trie node error if attempting diff --git a/trie/errors.go b/trie/errors.go index 567b80078..e4aab4043 100644 --- a/trie/errors.go +++ b/trie/errors.go @@ -19,7 +19,7 @@ package trie import ( "fmt" - "github.com/ethereum/go-ethereum/common" + "github.com/electroneum/electroneum-sc/common" ) // MissingNodeError is returned by the trie functions (TryGet, TryUpdate, TryDelete) diff --git a/trie/hasher.go b/trie/hasher.go index 2949a3dde..bf937241b 100644 --- a/trie/hasher.go +++ b/trie/hasher.go @@ -19,8 +19,8 @@ package trie import ( "sync" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/trie/iterator.go b/trie/iterator.go index e0006ee05..85a5289d8 100644 --- a/trie/iterator.go +++ b/trie/iterator.go @@ -21,8 +21,8 @@ import ( "container/heap" "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" ) // Iterator is a key-value trie iterator that traverses a Trie. diff --git a/trie/iterator_test.go b/trie/iterator_test.go index ea8a46bb4..4cb0f991b 100644 --- a/trie/iterator_test.go +++ b/trie/iterator_test.go @@ -23,11 +23,11 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) func TestEmptyIterator(t *testing.T) { diff --git a/trie/node.go b/trie/node.go index bf3f024bb..29d3882cd 100644 --- a/trie/node.go +++ b/trie/node.go @@ -21,8 +21,8 @@ import ( "io" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/rlp" ) var indices = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "[17]"} diff --git a/trie/node_enc.go b/trie/node_enc.go index cade35b70..08bcbe362 100644 --- a/trie/node_enc.go +++ b/trie/node_enc.go @@ -17,7 +17,7 @@ package trie import ( - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) func nodeToBytes(n node) []byte { diff --git a/trie/node_test.go b/trie/node_test.go index ac1d8fbef..90a5a4804 100644 --- a/trie/node_test.go +++ b/trie/node_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/rlp" ) func newTestFullNode(v []byte) []interface{} { diff --git a/trie/proof.go b/trie/proof.go index f42dcc761..56a4c9ab9 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -21,9 +21,9 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) // Prove constructs a merkle proof for key. The result contains all encoded nodes diff --git a/trie/proof_test.go b/trie/proof_test.go index cdf5cf605..52315dace 100644 --- a/trie/proof_test.go +++ b/trie/proof_test.go @@ -25,10 +25,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) func init() { diff --git a/trie/secure_trie.go b/trie/secure_trie.go index 248b93544..ff68d3c5c 100644 --- a/trie/secure_trie.go +++ b/trie/secure_trie.go @@ -19,10 +19,10 @@ package trie import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) // SecureTrie wraps a trie with key hashing. In a secure trie, all diff --git a/trie/secure_trie_test.go b/trie/secure_trie_test.go index a3ece84b5..90cac3074 100644 --- a/trie/secure_trie_test.go +++ b/trie/secure_trie_test.go @@ -22,9 +22,9 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) func newEmptySecure() *SecureTrie { diff --git a/trie/stacktrie.go b/trie/stacktrie.go index b38bb01b0..b17baba23 100644 --- a/trie/stacktrie.go +++ b/trie/stacktrie.go @@ -25,9 +25,9 @@ import ( "io" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/log" ) var ErrCommitDisabled = errors.New("no database for committing") diff --git a/trie/stacktrie_test.go b/trie/stacktrie_test.go index e57df6036..c78e49a08 100644 --- a/trie/stacktrie_test.go +++ b/trie/stacktrie_test.go @@ -21,9 +21,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) func TestStackTrieInsertAndHash(t *testing.T) { diff --git a/trie/sync.go b/trie/sync.go index db51dd4b0..fc4cf9052 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,10 +20,10 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/common/prque" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/ethdb" ) // ErrNotRequested is returned by the trie sync when it's requested to process a diff --git a/trie/sync_test.go b/trie/sync_test.go index 970730b67..451d48348 100644 --- a/trie/sync_test.go +++ b/trie/sync_test.go @@ -20,9 +20,9 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" ) // makeTestTrie create a sample test trie to test node-wise reconstruction. diff --git a/trie/trie.go b/trie/trie.go index fe7d6dc17..64121700a 100644 --- a/trie/trie.go +++ b/trie/trie.go @@ -23,12 +23,12 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/common" - "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/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/log" + "github.com/electroneum/electroneum-sc/rlp" ) var ( diff --git a/trie/trie_test.go b/trie/trie_test.go index f994e31af..c36cd3118 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -30,14 +30,14 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "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/ethdb" - "github.com/ethereum/go-ethereum/ethdb/leveldb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" + "github.com/electroneum/electroneum-sc/core/types" + "github.com/electroneum/electroneum-sc/crypto" + "github.com/electroneum/electroneum-sc/ethdb" + "github.com/electroneum/electroneum-sc/ethdb/leveldb" + "github.com/electroneum/electroneum-sc/ethdb/memorydb" + "github.com/electroneum/electroneum-sc/rlp" "golang.org/x/crypto/sha3" ) diff --git a/trie/util_test.go b/trie/util_test.go index fadb0553b..06735fee7 100644 --- a/trie/util_test.go +++ b/trie/util_test.go @@ -19,8 +19,8 @@ package trie import ( "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/electroneum/electroneum-sc/common" + "github.com/electroneum/electroneum-sc/core/rawdb" ) // Tests if the trie diffs are tracked correctly. From c571965496a9934426a0c89a8bed7ab3453073ee Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 28 Jun 2022 02:11:06 -0300 Subject: [PATCH 26/30] Update README.md --- README.md | 292 +++++++++++++++--------------------------------------- 1 file changed, 82 insertions(+), 210 deletions(-) diff --git a/README.md b/README.md index 0987200d3..3c1ebe985 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,41 @@ -## Go Ethereum +# Electroneum Smart Chain -Official Golang implementation of the Ethereum protocol. +Electroneum Smart Chain implementation based on go-ethereum. -[![API Reference]( -https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 -)](https://pkg.go.dev/github.com/ethereum/go-ethereum?tab=doc) -[![Go Report Card](https://goreportcard.com/badge/github.com/ethereum/go-ethereum)](https://goreportcard.com/report/github.com/ethereum/go-ethereum) -[![Travis](https://travis-ci.com/ethereum/go-ethereum.svg?branch=master)](https://travis-ci.com/ethereum/go-ethereum) -[![Discord](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://discord.gg/nthXNEv) +Electroneum Smart Chain is EVM-compatible, supports all the existing Ethereum tooling, provides nearly instant transaction verification and 1-block finality with a modified version of the Istanbul Byzantine Fault Torerance (IBFT) consensus protocol. -Automated builds are available for stable releases and the unstable master branch. Binary -archives are published at https://geth.ethereum.org/downloads/. +# Key Features -## Building the source +## IBFT Consensus Protocol -For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/install-and-build/installing-geth). +Electroneum Smart Chain implements a modified version of the standard IBFT proof of authority consensus protocol, making it the perfect consensus algorithm for public blockchains with a consortium of publicly-known validators participating in the block creation. Existing validators propose and vote to add or remove validators through our on-chain voting system. -Building `geth` requires both a Go (version 1.16 or later) and a C compiler. You can install +This state-of-the-art consensus protocol features: + +- **Immediate Finality:** blocks are final, meaning there are no forks or concurrent alt-chains, and valid blocks must be in the main chain +- **Nearly Instant Confirmations:** blocks are created every 5 seconds +- **Dynamic Validator Set:** validators can be added or removed from the network by an on-chain voting mechanism +- **Optimal Byzantine Resilience:** the protocol can withstand up to `(n-1)/3` Byzantine validators, where +`n` is the number of validators + +## EVM-Compatible + +Electroneum Smart Chain supports all the existing Ethereum tooling, smart contracts, decentralized applications and regular applications based on the Ethereum JSON RPC, such as MetaMask. + +## Cross-chain Bridge + +Electroneum Smart Chain supports cross-chain transfers between our legacy Electroneum Blockchain and the Smart Chain. All users, exchanges and other services providers can seemlessly transfer their funds over to the Electroneum Smart Chain, free of charge. + + +# Building the source + +For prerequisites and detailed build instructions please read the [Installation Instructions](https://github.com/electroneum/electroneum-sc/wiki/Install-and-Build). + +Building `etn-sc` requires both a Go (version 1.16 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run ```shell -make geth +make etn-sc ``` or, to build the full suite of utilities: @@ -29,30 +44,30 @@ or, to build the full suite of utilities: make all ``` -## Executables +# Executables -The go-ethereum project comes with several wrappers/executables found in the `cmd` +The electroneum-sc project comes with several wrappers/executables found in the `cmd` directory. | Command | Description | | :-----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `geth --help` and the [CLI page](https://geth.ethereum.org/docs/interface/command-line-options) for command line options. | -| `clef` | Stand-alone signing tool, which can be used as a backend signer for `geth`. | +| **`etn-sc`** | Our main Electroneum Smart Chain CLI client. It is the entry point into the Electroneum-SC network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Electroneum-SC network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. `etn-sc --help` and the [CLI page](https://geth.ethereum.org/docs/interface/command-line-options) for command line options. | +| `clef` | Stand-alone signing tool, which can be used as a backend signer for `etn-sc`. | | `devp2p` | Utilities to interact with nodes on the networking layer, without running a full blockchain. | -| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://docs.soliditylang.org/en/develop/abi-spec.html) with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://geth.ethereum.org/docs/dapp/native-bindings) page for details. | -| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. | +| `abigen` | Source code generator to convert Electroneum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://docs.soliditylang.org/en/develop/abi-spec.html) with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://geth.ethereum.org/docs/dapp/native-bindings) page for details. | +| `bootnode` | Stripped down version of our Electroneum-SC client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. | | `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug run`). | | `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://eth.wiki/en/fundamentals/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). | -| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. | +| `puppeth` | a CLI wizard that aids in creating a new Electroneum-SC network. | -## Running `geth` +# Running `etn-sc` Going through all the possible command line flags is out of scope here (please consult our [CLI Wiki page](https://geth.ethereum.org/docs/interface/command-line-options)), but we've enumerated a few common parameter combos to get you up to speed quickly -on how you can run your own `geth` instance. +on how you can run your own `etn-sc` instance. -### Hardware Requirements +## Hardware Requirements Minimum: @@ -68,132 +83,106 @@ Recommended: * High Performance SSD with at least 1TB free space * 25+ MBit/sec download Internet service -### Full node on the main Ethereum network +## Full node on the main Electroneum Smart Chain network -By far the most common scenario is people wanting to simply interact with the Ethereum +By far the most common scenario is people wanting to simply interact with the Electroneum Smart Chain network: create accounts; transfer funds; deploy and interact with contracts. For this particular use-case the user doesn't care about years-old historical data, so we can sync quickly to the current state of the network. To do so: ```shell -$ geth console +$ etn-sc console ``` This command will: - * Start `geth` in snap sync mode (default, can be changed with the `--syncmode` flag), + * Start `etn-sc` in snap sync mode (default, can be changed with the `--syncmode` flag), causing it to download more data in exchange for avoiding processing the entire history - of the Ethereum network, which is very CPU intensive. - * Start up `geth`'s built-in interactive [JavaScript console](https://geth.ethereum.org/docs/interface/javascript-console), + of the Electroneum Smart Chain network, which is very CPU intensive. + * Start up `etn-sc`'s built-in interactive [JavaScript console](https://geth.ethereum.org/docs/interface/javascript-console), (via the trailing `console` subcommand) through which you can interact using [`web3` methods](https://github.com/ChainSafe/web3.js/blob/0.20.7/DOCUMENTATION.md) - (note: the `web3` version bundled within `geth` is very old, and not up to date with official docs), - as well as `geth`'s own [management APIs](https://geth.ethereum.org/docs/rpc/server). + (note: the `web3` version bundled within `etn-sc` is very old, and not up to date with official docs), + as well as `etn-sc`'s own [management APIs](https://geth.ethereum.org/docs/rpc/server). This tool is optional and if you leave it out you can always attach to an already running - `geth` instance with `geth attach`. + `etn-sc` instance with `etn-sc attach`. -### A Full node on the Görli test network +## Full node on the test network -Transitioning towards developers, if you'd like to play around with creating Ethereum +Transitioning towards developers, if you'd like to play around with creating Electroneum contracts, you almost certainly would like to do that without any real money involved until you get the hang of the entire system. In other words, instead of attaching to the main network, you want to join the **test** network with your node, which is fully equivalent to -the main network, but with play-Ether only. +the main network, but with play-ETN only. ```shell -$ geth --goerli console +$ etn-sc --testnet console ``` The `console` subcommand has the exact same meaning as above and they are equally useful on the testnet too. Please, see above for their explanations if you've skipped here. -Specifying the `--goerli` flag, however, will reconfigure your `geth` instance a bit: +Specifying the `--testnet` flag, however, will reconfigure your `etn-sc` instance a bit: - * Instead of connecting the main Ethereum network, the client will connect to the Görli - test network, which uses different P2P bootnodes, different network IDs and genesis + * Instead of connecting the main Electroneum Smart Chain network, the client will connect to the test network, which uses different P2P bootnodes, different network IDs and genesis states. - * Instead of using the default data directory (`~/.ethereum` on Linux for example), `geth` - will nest itself one level deeper into a `goerli` subfolder (`~/.ethereum/goerli` on + * Instead of using the default data directory (`~/.electroneum` on Linux for example), `etn-sc` + will nest itself one level deeper into a `testnet` subfolder (`~/.ethereum/testbet` on Linux). Note, on OSX and Linux this also means that attaching to a running testnet node - requires the use of a custom endpoint since `geth attach` will try to attach to a + requires the use of a custom endpoint since `etn-sc attach` will try to attach to a production node endpoint by default, e.g., - `geth attach /goerli/geth.ipc`. Windows users are not affected by + `etn-sc attach /testnet/etn-sc.ipc`. Windows users are not affected by this. *Note: Although there are some internal protective measures to prevent transactions from crossing over between the main network and test network, you should make sure to always use separate accounts for play-money and real-money. Unless you manually move -accounts, `geth` will by default correctly separate the two networks and will not make any +accounts, `etn-sc` will by default correctly separate the two networks and will not make any accounts available between them.* -### Full node on the Rinkeby test network - -Go Ethereum also supports connecting to the older proof-of-authority based test network -called [*Rinkeby*](https://www.rinkeby.io) which is operated by members of the community. - -```shell -$ geth --rinkeby console -``` +## Configuration -### Full node on the Ropsten test network - -In addition to Görli and Rinkeby, Geth also supports the ancient Ropsten testnet. The -Ropsten test network is based on the Ethash proof-of-work consensus algorithm. As such, -it has certain extra overhead and is more susceptible to reorganization attacks due to the -network's low difficulty/security. - -```shell -$ geth --ropsten console -``` - -*Note: Older Geth configurations store the Ropsten database in the `testnet` subdirectory.* - -### Configuration - -As an alternative to passing the numerous flags to the `geth` binary, you can also pass a +As an alternative to passing the numerous flags to the `etn-sc` binary, you can also pass a configuration file via: ```shell -$ geth --config /path/to/your_config.toml +$ etn-sc --config /path/to/your_config.toml ``` To get an idea how the file should look like you can use the `dumpconfig` subcommand to export your existing configuration: ```shell -$ geth --your-favourite-flags dumpconfig +$ etn-sc --your-favourite-flags dumpconfig ``` +### Docker quick start -*Note: This works only with `geth` v1.6.0 and above.* - -#### Docker quick start - -One of the quickest ways to get Ethereum up and running on your machine is by using +One of the quickest ways to get Electroneum Smart Chain up and running on your machine is by using Docker: ```shell -docker run -d --name ethereum-node -v /Users/alice/ethereum:/root \ +docker run -d --name etn-sc-node -v /Users/alice/electroneum:/root \ -p 8545:8545 -p 30303:30303 \ - ethereum/client-go + electroneum/client-go ``` -This will start `geth` in snap-sync mode with a DB memory allowance of 1GB just as the +This will start `etn-sc` in snap-sync mode with a DB memory allowance of 1GB just as the above command does. It will also create a persistent volume in your home directory for saving your blockchain as well as map the default ports. There is also an `alpine` tag available for a slim version of the image. Do not forget `--http.addr 0.0.0.0`, if you want to access RPC from other containers -and/or hosts. By default, `geth` binds to the local interface and RPC endpoints are not +and/or hosts. By default, `etn-sc` binds to the local interface and RPC endpoints are not accessible from the outside. -### Programmatically interfacing `geth` nodes +## Programmatically interfacing `etn-sc` nodes -As a developer, sooner rather than later you'll want to start interacting with `geth` and the -Ethereum network via your own programs and not manually through the console. To aid -this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://eth.wiki/json-rpc/API) -and [`geth` specific APIs](https://geth.ethereum.org/docs/rpc/server)). +As a developer, sooner rather than later you'll want to start interacting with `etn-sc` and the +Electroneum Smart Chain network via your own programs and not manually through the console. To aid +this, `etn-sc` has built-in support for a JSON-RPC based APIs ([standard APIs](https://eth.wiki/json-rpc/API) +and [`etn-sc` specific APIs](https://geth.ethereum.org/docs/rpc/server)). These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based platforms, and named pipes on Windows). -The IPC interface is enabled by default and exposes all the APIs supported by `geth`, +The IPC interface is enabled by default and exposes all the APIs supported by `etn-sc`, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect. @@ -215,139 +204,22 @@ HTTP based JSON-RPC API options: * `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it) You'll need to use your own programming environments' capabilities (libraries, tools, etc) to -connect via HTTP, WS or IPC to a `geth` node configured with the above flags and you'll +connect via HTTP, WS or IPC to a `etn-sc` node configured with the above flags and you'll need to speak [JSON-RPC](https://www.jsonrpc.org/specification) on all transports. You can reuse the same connection for multiple requests! **Note: Please understand the security implications of opening up an HTTP/WS based transport before doing so! Hackers on the internet are actively trying to subvert -Ethereum nodes with exposed APIs! Further, all browser tabs can access locally +Electroneum nodes with exposed APIs! Further, all browser tabs can access locally running web servers, so malicious web pages could try to subvert locally available APIs!** -### Operating a private network - -Maintaining your own private network is more involved as a lot of configurations taken for -granted in the official networks need to be manually set up. - -#### Defining the private genesis state - -First, you'll need to create the genesis state of your networks, which all nodes need to be -aware of and agree upon. This consists of a small JSON file (e.g. call it `genesis.json`): - -```json -{ - "config": { - "chainId": , - "homesteadBlock": 0, - "eip150Block": 0, - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "berlinBlock": 0, - "londonBlock": 0 - }, - "alloc": {}, - "coinbase": "0x0000000000000000000000000000000000000000", - "difficulty": "0x20000", - "extraData": "", - "gasLimit": "0x2fefd8", - "nonce": "0x0000000000000042", - "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": "0x00" -} -``` - -The above fields should be fine for most purposes, although we'd recommend changing -the `nonce` to some random value so you prevent unknown remote nodes from being able -to connect to you. If you'd like to pre-fund some accounts for easier testing, create -the accounts and populate the `alloc` field with their addresses. - -```json -"alloc": { - "0x0000000000000000000000000000000000000001": { - "balance": "111111111" - }, - "0x0000000000000000000000000000000000000002": { - "balance": "222222222" - } -} -``` - -With the genesis state defined in the above JSON file, you'll need to initialize **every** -`geth` node with it prior to starting it up to ensure all blockchain parameters are correctly -set: - -```shell -$ geth init path/to/genesis.json -``` - -#### Creating the rendezvous point - -With all nodes that you want to run initialized to the desired genesis state, you'll need to -start a bootstrap node that others can use to find each other in your network and/or over -the internet. The clean way is to configure and run a dedicated bootnode: - -```shell -$ bootnode --genkey=boot.key -$ bootnode --nodekey=boot.key -``` - -With the bootnode online, it will display an [`enode` URL](https://eth.wiki/en/fundamentals/enode-url-format) -that other nodes can use to connect to it and exchange peer information. Make sure to -replace the displayed IP address information (most probably `[::]`) with your externally -accessible IP to get the actual `enode` URL. - -*Note: You could also use a full-fledged `geth` node as a bootnode, but it's the less -recommended way.* - -#### Starting up your member nodes - -With the bootnode operational and externally reachable (you can try -`telnet ` to ensure it's indeed reachable), start every subsequent `geth` -node pointed to the bootnode for peer discovery via the `--bootnodes` flag. It will -probably also be desirable to keep the data directory of your private network separated, so -do also specify a custom `--datadir` flag. - -```shell -$ geth --datadir=path/to/custom/data/folder --bootnodes= -``` - -*Note: Since your network will be completely cut off from the main and test networks, you'll -also need to configure a miner to process transactions and create new blocks for you.* - -#### Running a private miner - -Mining on the public Ethereum network is a complex task as it's only feasible using GPUs, -requiring an OpenCL or CUDA enabled `ethminer` instance. For information on such a -setup, please consult the [EtherMining subreddit](https://www.reddit.com/r/EtherMining/) -and the [ethminer](https://github.com/ethereum-mining/ethminer) repository. - -In a private network setting, however a single CPU miner instance is more than enough for -practical purposes as it can produce a stable stream of blocks at the correct intervals -without needing heavy resources (consider running on a single thread, no need for multiple -ones either). To start a `geth` instance for mining, run it with all your usual flags, extended -by: - -```shell -$ geth --mine --miner.threads=1 --miner.etherbase=0x0000000000000000000000000000000000000000 -``` - -Which will start mining blocks and transactions on a single CPU thread, crediting all -proceedings to the account specified by `--miner.etherbase`. You can further tune the mining -by changing the default gas limit blocks converge to (`--miner.targetgaslimit`) and the price -transactions are accepted at (`--miner.gasprice`). - -## Contribution +# Contribution Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! -If you'd like to contribute to go-ethereum, please fork, fix, commit and send a pull request +If you'd like to contribute to electroneum-sc, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on [our Discord Server](https://discord.gg/invite/nthXNEv) to ensure those changes are in line with the general philosophy of the project and/or get @@ -368,12 +240,12 @@ Please see the [Developers' Guide](https://geth.ethereum.org/docs/developers/dev for more details on configuring your environment, managing project dependencies, and testing procedures. -## License +# License -The go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the +The electroneum-sc and go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html), also included in our repository in the `COPYING.LESSER` file. -The go-ethereum binaries (i.e. all code inside of the `cmd` directory) is licensed under the +The electroneum-sc and go-ethereum binaries (i.e. all code inside of the `cmd` directory) is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html), also included in our repository in the `COPYING` file. From 356ecf1d1bfa85fa1c99b5ba905f27d778b2b065 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 28 Jun 2022 02:55:08 -0300 Subject: [PATCH 27/30] Update README.md --- README.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3c1ebe985..ef4c74b4e 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Electroneum Smart Chain implementation based on go-ethereum. Electroneum Smart Chain is EVM-compatible, supports all the existing Ethereum tooling, provides nearly instant transaction verification and 1-block finality with a modified version of the Istanbul Byzantine Fault Torerance (IBFT) consensus protocol. -# Key Features +## Key Features -## IBFT Consensus Protocol +### IBFT Consensus Protocol Electroneum Smart Chain implements a modified version of the standard IBFT proof of authority consensus protocol, making it the perfect consensus algorithm for public blockchains with a consortium of publicly-known validators participating in the block creation. Existing validators propose and vote to add or remove validators through our on-chain voting system. @@ -18,16 +18,16 @@ This state-of-the-art consensus protocol features: - **Optimal Byzantine Resilience:** the protocol can withstand up to `(n-1)/3` Byzantine validators, where `n` is the number of validators -## EVM-Compatible +### EVM-Compatible Electroneum Smart Chain supports all the existing Ethereum tooling, smart contracts, decentralized applications and regular applications based on the Ethereum JSON RPC, such as MetaMask. -## Cross-chain Bridge +### Cross-chain Bridge Electroneum Smart Chain supports cross-chain transfers between our legacy Electroneum Blockchain and the Smart Chain. All users, exchanges and other services providers can seemlessly transfer their funds over to the Electroneum Smart Chain, free of charge. -# Building the source +## Building the source For prerequisites and detailed build instructions please read the [Installation Instructions](https://github.com/electroneum/electroneum-sc/wiki/Install-and-Build). @@ -44,7 +44,7 @@ or, to build the full suite of utilities: make all ``` -# Executables +## Executables The electroneum-sc project comes with several wrappers/executables found in the `cmd` directory. @@ -60,30 +60,29 @@ directory. | `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://eth.wiki/en/fundamentals/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). | | `puppeth` | a CLI wizard that aids in creating a new Electroneum-SC network. | -# Running `etn-sc` +## Running `etn-sc` Going through all the possible command line flags is out of scope here (please consult our [CLI Wiki page](https://geth.ethereum.org/docs/interface/command-line-options)), but we've enumerated a few common parameter combos to get you up to speed quickly on how you can run your own `etn-sc` instance. -## Hardware Requirements +### Hardware Requirements Minimum: * CPU with 2+ cores * 4GB RAM -* 1TB free storage space to sync the Mainnet * 8 MBit/sec download Internet service Recommended: * Fast CPU with 4+ cores * 16GB+ RAM -* High Performance SSD with at least 1TB free space +* High Performance SSD * 25+ MBit/sec download Internet service -## Full node on the main Electroneum Smart Chain network +### Full node on the main Electroneum Smart Chain network By far the most common scenario is people wanting to simply interact with the Electroneum Smart Chain network: create accounts; transfer funds; deploy and interact with contracts. For this @@ -105,7 +104,7 @@ This command will: This tool is optional and if you leave it out you can always attach to an already running `etn-sc` instance with `etn-sc attach`. -## Full node on the test network +### Full node on the test network Transitioning towards developers, if you'd like to play around with creating Electroneum contracts, you almost certainly would like to do that without any real money involved until @@ -138,7 +137,7 @@ use separate accounts for play-money and real-money. Unless you manually move accounts, `etn-sc` will by default correctly separate the two networks and will not make any accounts available between them.* -## Configuration +### Configuration As an alternative to passing the numerous flags to the `etn-sc` binary, you can also pass a configuration file via: @@ -173,7 +172,7 @@ Do not forget `--http.addr 0.0.0.0`, if you want to access RPC from other contai and/or hosts. By default, `etn-sc` binds to the local interface and RPC endpoints are not accessible from the outside. -## Programmatically interfacing `etn-sc` nodes +### Programmatically interfacing `etn-sc` nodes As a developer, sooner rather than later you'll want to start interacting with `etn-sc` and the Electroneum Smart Chain network via your own programs and not manually through the console. To aid @@ -214,7 +213,7 @@ Electroneum nodes with exposed APIs! Further, all browser tabs can access locall running web servers, so malicious web pages could try to subvert locally available APIs!** -# Contribution +## Contribution Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! @@ -240,7 +239,7 @@ Please see the [Developers' Guide](https://geth.ethereum.org/docs/developers/dev for more details on configuring your environment, managing project dependencies, and testing procedures. -# License +## License The electroneum-sc and go-ethereum library (i.e. all code outside of the `cmd` directory) is licensed under the [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html), From d17407c342c7360c1b53a5af075019ed8f0b1746 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 28 Jun 2022 02:56:02 -0300 Subject: [PATCH 28/30] core: params: properly set pre-allocated funds to dev addresses (testnet and stagenet) --- core/genesis.go | 8 ++++---- params/config.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index 937c6558d..ef81fbc5a 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -448,8 +448,8 @@ func DefaultStagenetGenesisBlock() *Genesis { Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), Coinbase: common.Address{}, Alloc: GenesisAlloc{ - common.HexToAddress("0x72f1a0bAA7f1C79129A391C2F32bCD8247A18a63"): {Balance: big.NewInt(math.MaxInt64)}, - common.HexToAddress("0xf29A0844926Fe8d63e5B211978B26E3f6d9e9fd5"): {Balance: big.NewInt(math.MaxInt64)}, + common.HexToAddress("0x72f1a0bAA7f1C79129A391C2F32bCD8247A18a63"): {Balance: math.MustParseBig256("1000000000000000000000000000")}, + common.HexToAddress("0xf29A0844926Fe8d63e5B211978B26E3f6d9e9fd5"): {Balance: math.MustParseBig256("1000000000000000000000000000")}, }, } } @@ -466,8 +466,8 @@ func DefaultTestnetGenesisBlock() *Genesis { Mixhash: common.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365"), Coinbase: common.Address{}, Alloc: GenesisAlloc{ - common.HexToAddress("0x72f1a0bAA7f1C79129A391C2F32bCD8247A18a63"): {Balance: big.NewInt(math.MaxInt64)}, - common.HexToAddress("0xf29A0844926Fe8d63e5B211978B26E3f6d9e9fd5"): {Balance: big.NewInt(math.MaxInt64)}, + common.HexToAddress("0x72f1a0bAA7f1C79129A391C2F32bCD8247A18a63"): {Balance: math.MustParseBig256("1000000000000000000000000000")}, + common.HexToAddress("0xf29A0844926Fe8d63e5B211978B26E3f6d9e9fd5"): {Balance: math.MustParseBig256("1000000000000000000000000000")}, }, } } diff --git a/params/config.go b/params/config.go index 90ecd7886..3ec21fd9e 100644 --- a/params/config.go +++ b/params/config.go @@ -28,8 +28,8 @@ import ( // Genesis hashes to enforce below configs on. var ( MainnetGenesisHash = common.HexToHash("0x4fda998638776057c8c27989bc021aed4b813fcebd483bf7a6b139f6efb324a6") - StagenetGenesisHash = common.HexToHash("0xb40d104645676c4e738e440d2cc57e0a900cfba3feb3eb8eeb92ec6d7515730d") - TestnetGenesisHash = common.HexToHash("0x1f088de945b278c0131967e5d32f569bdeaa1052a8a0e38f887f58fbcbba0fe8") + StagenetGenesisHash = common.HexToHash("0x619e6f8fa6e99eb9829e1f0c7fa62a999d47bf8a7da51a72c2af3cd83cb6e4a3") + TestnetGenesisHash = common.HexToHash("0xcf1b6615aa11a133442a21cc1bf9fbe935fd146f74123ba4f3f0e107362c3eb4") ) // TrustedCheckpoints associates each known checkpoint with the genesis hash of From ff3e40b73c8882460a031e8f7b2d6ff6ab91ecd4 Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 28 Jun 2022 14:26:43 -0300 Subject: [PATCH 29/30] node/defaults: change default data dir to "electroneum-sc" --- node/defaults.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/defaults.go b/node/defaults.go index 8d486c9d9..58a561931 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -74,19 +74,19 @@ func DefaultDataDir() string { if home != "" { switch runtime.GOOS { case "darwin": - return filepath.Join(home, "Library", "Electroneum") + return filepath.Join(home, "Library", "Electroneum-sc") case "windows": // We used to put everything in %HOME%\AppData\Roaming, but this caused // problems with non-typical setups. If this fallback location exists and // is non-empty, use it, otherwise DTRT and check %LOCALAPPDATA%. - fallback := filepath.Join(home, "AppData", "Roaming", "Electroneum") + fallback := filepath.Join(home, "AppData", "Roaming", "Electroneum-sc") appdata := windowsAppData() if appdata == "" || isNonEmptyDir(fallback) { return fallback } - return filepath.Join(appdata, "Electroneum") + return filepath.Join(appdata, "Electroneum-sc") default: - return filepath.Join(home, ".electroneum") + return filepath.Join(home, ".electroneum-sc") } } // As we cannot guess a stable location, return empty and handle later From 42003f0f640bcffafd838d303f75ffcb05c9b55c Mon Sep 17 00:00:00 2001 From: andrepatta Date: Tue, 28 Jun 2022 15:00:24 -0300 Subject: [PATCH 30/30] core/genesis: update mainnet/stagenet/testnet comments --- core/genesis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index ef81fbc5a..9068208be 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -421,7 +421,7 @@ func GenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big return g.MustCommit(db) } -// DefaultGenesisBlock returns the Ethereum main net genesis block. +// DefaultGenesisBlock returns the Electroneum-sc mainnet genesis block. func DefaultGenesisBlock() *Genesis { return &Genesis{ Config: params.MainnetChainConfig, @@ -436,7 +436,7 @@ func DefaultGenesisBlock() *Genesis { } } -// DefaultGoerliGenesisBlock returns the Görli network genesis block. +// DefaultStagenetGenesisBlock returns the test network genesis block. func DefaultStagenetGenesisBlock() *Genesis { return &Genesis{ Config: params.StagenetChainConfig, @@ -454,7 +454,7 @@ func DefaultStagenetGenesisBlock() *Genesis { } } -// DefaultGoerliGenesisBlock returns the Görli network genesis block. +// DefaultTestnetGenesisBlock returns the stage network genesis block. func DefaultTestnetGenesisBlock() *Genesis { return &Genesis{ Config: params.TestnetChainConfig,