remove mentions of go-ethereum

This commit is contained in:
Igor Mandrigin 2021-03-15 17:19:45 +01:00
parent a486baa0a0
commit 8014fd1a8e
13 changed files with 45 additions and 135 deletions

View File

@ -26,11 +26,11 @@ import (
"time"
"github.com/ledgerwatch/turbo-geth/eth"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethconfig"
"github.com/ledgerwatch/turbo-geth/consensus/ethash"
"github.com/ledgerwatch/turbo-geth/core"
"github.com/ledgerwatch/turbo-geth/ethconfig"
"github.com/ledgerwatch/turbo-geth/node"
"github.com/ethereum/go-ethereum/params"
"github.com/ledgerwatch/turbo-geth/params"
"github.com/stretchr/testify/assert"
)

View File

@ -1,88 +0,0 @@
// Copyright 2021 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 <http://www.gnu.org/licenses/>.
package les
import (
"context"
"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"
)
// stateAtBlock retrieves the state database associated with a certain block.
func (leth *LightEthereum) stateAtBlock(ctx context.Context, block *types.Block, reexec uint64) (*state.StateDB, func(), error) {
return light.NewState(ctx, block.Header(), leth.odr), func() {}, nil
}
// statesInRange retrieves a batch of state databases associated with the specific
// block ranges.
func (leth *LightEthereum) statesInRange(ctx context.Context, fromBlock *types.Block, toBlock *types.Block, reexec uint64) ([]*state.StateDB, func(), error) {
var states []*state.StateDB
for number := fromBlock.NumberU64(); number <= toBlock.NumberU64(); number++ {
header, err := leth.blockchain.GetHeaderByNumberOdr(ctx, number)
if err != nil {
return nil, nil, err
}
states = append(states, light.NewState(ctx, header, leth.odr))
}
return states, nil, nil
}
// stateAtTransaction returns the execution environment of a certain transaction.
func (leth *LightEthereum) stateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, func(), error) {
// Short circuit if it's genesis block.
if block.NumberU64() == 0 {
return nil, vm.BlockContext{}, nil, nil, errors.New("no transaction in genesis")
}
// Create the parent state database
parent, err := leth.blockchain.GetBlock(ctx, block.ParentHash(), block.NumberU64()-1)
if err != nil {
return nil, vm.BlockContext{}, nil, nil, err
}
statedb, _, err := leth.stateAtBlock(ctx, parent, reexec)
if err != nil {
return nil, vm.BlockContext{}, nil, nil, err
}
if txIndex == 0 && len(block.Transactions()) == 0 {
return nil, vm.BlockContext{}, statedb, func() {}, nil
}
// Recompute transactions up to the target index.
signer := types.MakeSigner(leth.blockchain.Config(), block.Number())
for idx, tx := range block.Transactions() {
// Assemble the transaction call message and return if the requested offset
msg, _ := tx.AsMessage(signer)
txContext := core.NewEVMTxContext(msg)
context := core.NewEVMBlockContext(block.Header(), leth.blockchain, nil)
if idx == txIndex {
return msg, context, statedb, func() {}, nil
}
// Not yet the searched for transaction, execute on top of the current state
vmenv := vm.NewEVM(context, txContext, statedb, leth.blockchain.Config(), vm.Config{})
if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())); err != nil {
return nil, vm.BlockContext{}, nil, nil, fmt.Errorf("transaction %#x failed: %v", tx.Hash(), err)
}
// Ensure any modifications are committed to the state
// Only delete empty objects if EIP158/161 (a.k.a Spurious Dragon) is in effect
statedb.Finalise(vmenv.ChainConfig().IsEIP158(block.Number()))
}
return nil, vm.BlockContext{}, nil, nil, fmt.Errorf("transaction index %d out of range for block %#x", txIndex, block.Hash())
}

View File

@ -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/ledgerwatch/turbo-geth/..."
function coverbuild {
path=$1

View File

@ -19,7 +19,7 @@ package bitutil
import (
"bytes"
"github.com/ethereum/go-ethereum/common/bitutil"
"github.com/ledgerwatch/turbo-geth/common/bitutil"
)
// Fuzz implements a go-fuzz fuzzer method to test various encoding method

View File

@ -20,8 +20,8 @@ import (
"bytes"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ledgerwatch/turbo-geth/common"
"github.com/ledgerwatch/turbo-geth/core/vm"
)
const (

View File

@ -5,7 +5,7 @@ import (
"io/ioutil"
"os"
"github.com/ethereum/go-ethereum/tests/fuzzers/difficulty"
"github.com/ledgerwatch/turbo-geth/tests/fuzzers/difficulty"
)
func main() {

View File

@ -23,8 +23,8 @@ import (
"io"
"math/big"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ledgerwatch/turbo-geth/consensus/ethash"
"github.com/ledgerwatch/turbo-geth/core/types"
)
type fuzzer struct {

View File

@ -21,7 +21,7 @@ import (
"io/ioutil"
"os"
"github.com/ethereum/go-ethereum/tests/fuzzers/les"
"github.com/ledgerwatch/turbo-geth/tests/fuzzers/les"
)
func main() {

View File

@ -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/ledgerwatch/turbo-geth/common"
"github.com/ledgerwatch/turbo-geth/consensus/ethash"
"github.com/ledgerwatch/turbo-geth/core"
"github.com/ledgerwatch/turbo-geth/core/rawdb"
"github.com/ledgerwatch/turbo-geth/core/types"
"github.com/ledgerwatch/turbo-geth/core/vm"
"github.com/ledgerwatch/turbo-geth/crypto"
l "github.com/ledgerwatch/turbo-geth/les"
"github.com/ledgerwatch/turbo-geth/params"
"github.com/ledgerwatch/turbo-geth/rlp"
"github.com/ledgerwatch/turbo-geth/trie"
)
var (

View File

@ -21,7 +21,7 @@ import (
"io/ioutil"
"os"
"github.com/ethereum/go-ethereum/tests/fuzzers/rangeproof"
"github.com/ledgerwatch/turbo-geth/tests/fuzzers/rangeproof"
)
func main() {

View File

@ -23,9 +23,9 @@ import (
"io"
"sort"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb/memorydb"
"github.com/ethereum/go-ethereum/trie"
"github.com/ledgerwatch/turbo-geth/common"
"github.com/ledgerwatch/turbo-geth/ethdb/memorydb"
"github.com/ledgerwatch/turbo-geth/trie"
)
type kv struct {

View File

@ -17,7 +17,7 @@
package runtime
import (
"github.com/ethereum/go-ethereum/core/vm/runtime"
"github.com/ledgerwatch/turbo-geth/core/vm/runtime"
)
// Fuzz is the basic entry point for the go-fuzz tool

View File

@ -26,18 +26,16 @@ import (
"strings"
"github.com/holiman/uint256"
"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/ledgerwatch/turbo-geth/common/hexutil"
"github.com/ledgerwatch/turbo-geth/common/math"
"github.com/ledgerwatch/turbo-geth/core"
"github.com/ledgerwatch/turbo-geth/core/state"
"github.com/ledgerwatch/turbo-geth/core/types"
"github.com/ledgerwatch/turbo-geth/core/vm"
"github.com/ledgerwatch/turbo-geth/crypto"
"github.com/ledgerwatch/turbo-geth/ethdb"
"github.com/ledgerwatch/turbo-geth/params"
"github.com/ledgerwatch/turbo-geth/rlp"
"golang.org/x/crypto/sha3"
"github.com/ledgerwatch/turbo-geth/common"
@ -108,14 +106,14 @@ type stEnvMarshaling struct {
//go:generate gencodec -type stTransaction -field-override stTransactionMarshaling -out gen_sttransaction.go
type stTransaction struct {
GasPrice *uint256.Int `json:"gasPrice"`
Nonce uint64 `json:"nonce"`
To string `json:"to"`
Data []string `json:"data"`
GasPrice *uint256.Int `json:"gasPrice"`
Nonce uint64 `json:"nonce"`
To string `json:"to"`
Data []string `json:"data"`
AccessLists []*types.AccessList `json:"accessLists,omitempty"`
GasLimit []uint64 `json:"gasLimit"`
Value []string `json:"value"`
PrivateKey []byte `json:"secretKey"`
GasLimit []uint64 `json:"gasLimit"`
Value []string `json:"value"`
PrivateKey []byte `json:"secretKey"`
}
type stTransactionMarshaling struct {