mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
move all packages from "internal" folder - to simplify users live (#5857)
This commit is contained in:
parent
b1680de12d
commit
26fdf9169d
@ -30,8 +30,8 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/common/compiler"
|
"github.com/ledgerwatch/erigon/common/compiler"
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/internal/flags"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
|
cli2 "github.com/ledgerwatch/erigon/turbo/cli"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
@ -98,7 +98,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
app = flags.NewApp(params.GitCommit, "", "ethereum checkpoint helper tool")
|
app = cli2.NewApp(params.GitCommit, "", "ethereum checkpoint helper tool")
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
abiFlag,
|
abiFlag,
|
||||||
binFlag,
|
binFlag,
|
||||||
|
@ -25,10 +25,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon-lib/common"
|
"github.com/ledgerwatch/erigon-lib/common"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/p2p/discover"
|
"github.com/ledgerwatch/erigon/p2p/discover"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enode"
|
"github.com/ledgerwatch/erigon/p2p/enode"
|
||||||
"github.com/ledgerwatch/erigon/p2p/nat"
|
"github.com/ledgerwatch/erigon/p2p/nat"
|
||||||
|
@ -18,10 +18,10 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/cmd/downloader/downloader/downloadercfg"
|
"github.com/ledgerwatch/erigon/cmd/downloader/downloader/downloadercfg"
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/common/paths"
|
"github.com/ledgerwatch/erigon/common/paths"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
"github.com/ledgerwatch/erigon/p2p/nat"
|
"github.com/ledgerwatch/erigon/p2p/nat"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
logging2 "github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/pelletier/go-toml/v2"
|
"github.com/pelletier/go-toml/v2"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -49,7 +49,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
utils.CobraFlags(rootCmd, debug.Flags, utils.MetricFlags, logging.Flags)
|
utils.CobraFlags(rootCmd, debug.Flags, utils.MetricFlags, logging2.Flags)
|
||||||
|
|
||||||
withDataDir(rootCmd)
|
withDataDir(rootCmd)
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ var rootCmd = &cobra.Command{
|
|||||||
debug.Exit()
|
debug.Exit()
|
||||||
},
|
},
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
_ = logging.GetLoggerCmd("downloader", cmd)
|
_ = logging2.GetLoggerCmd("downloader", cmd)
|
||||||
if err := Downloader(cmd.Context()); err != nil {
|
if err := Downloader(cmd.Context()); err != nil {
|
||||||
log.Error("Downloader", "err", err)
|
log.Error("Downloader", "err", err)
|
||||||
return nil
|
return nil
|
||||||
|
@ -8,13 +8,13 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/pelletier/go-toml"
|
"github.com/pelletier/go-toml"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon-lib/common/dbg"
|
"github.com/ledgerwatch/erigon-lib/common/dbg"
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
erigonapp "github.com/ledgerwatch/erigon/turbo/app"
|
erigonapp "github.com/ledgerwatch/erigon/turbo/app"
|
||||||
erigoncli "github.com/ledgerwatch/erigon/turbo/cli"
|
erigoncli "github.com/ledgerwatch/erigon/turbo/cli"
|
||||||
|
@ -22,17 +22,17 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
cli2 "github.com/ledgerwatch/erigon/turbo/cli"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/cmd/evm/internal/t8ntool"
|
"github.com/ledgerwatch/erigon/cmd/evm/internal/t8ntool"
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/internal/flags"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
app = flags.NewApp(params.GitCommit, "", "the evm command line interface")
|
app = cli2.NewApp(params.GitCommit, "", "the evm command line interface")
|
||||||
|
|
||||||
DebugFlag = cli.BoolFlag{
|
DebugFlag = cli.BoolFlag{
|
||||||
Name: "debug",
|
Name: "debug",
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/docker/pkg/reexec"
|
"github.com/docker/docker/pkg/reexec"
|
||||||
"github.com/ledgerwatch/erigon/internal/cmdtest"
|
"github.com/ledgerwatch/erigon/turbo/cmdtest"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
|
@ -25,6 +25,8 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
||||||
"github.com/ledgerwatch/erigon-lib/recsplit"
|
"github.com/ledgerwatch/erigon-lib/recsplit"
|
||||||
"github.com/ledgerwatch/erigon-lib/recsplit/eliasfano32"
|
"github.com/ledgerwatch/erigon-lib/recsplit/eliasfano32"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
hackdb "github.com/ledgerwatch/erigon/cmd/hack/db"
|
hackdb "github.com/ledgerwatch/erigon/cmd/hack/db"
|
||||||
@ -43,8 +45,6 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/eth/stagedsync/stages"
|
"github.com/ledgerwatch/erigon/eth/stagedsync/stages"
|
||||||
"github.com/ledgerwatch/erigon/ethdb"
|
"github.com/ledgerwatch/erigon/ethdb"
|
||||||
"github.com/ledgerwatch/erigon/ethdb/cbor"
|
"github.com/ledgerwatch/erigon/ethdb/cbor"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/ledgerwatch/erigon/rlp"
|
"github.com/ledgerwatch/erigon/rlp"
|
||||||
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon-lib/kv"
|
"github.com/ledgerwatch/erigon-lib/kv"
|
||||||
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/migrations"
|
"github.com/ledgerwatch/erigon/migrations"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/torquem-ch/mdbx-go/mdbx"
|
"github.com/torquem-ch/mdbx-go/mdbx"
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
@ -17,6 +17,8 @@ import (
|
|||||||
libstate "github.com/ledgerwatch/erigon-lib/state"
|
libstate "github.com/ledgerwatch/erigon-lib/state"
|
||||||
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
||||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon-lib/direct"
|
"github.com/ledgerwatch/erigon-lib/direct"
|
||||||
"github.com/ledgerwatch/erigon-lib/gointerfaces"
|
"github.com/ledgerwatch/erigon-lib/gointerfaces"
|
||||||
@ -36,8 +38,6 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/common/hexutil"
|
"github.com/ledgerwatch/erigon/common/hexutil"
|
||||||
"github.com/ledgerwatch/erigon/common/paths"
|
"github.com/ledgerwatch/erigon/common/paths"
|
||||||
"github.com/ledgerwatch/erigon/core/rawdb"
|
"github.com/ledgerwatch/erigon/core/rawdb"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/node"
|
"github.com/ledgerwatch/erigon/node"
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg"
|
"github.com/ledgerwatch/erigon/node/nodecfg"
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
|
@ -15,8 +15,8 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/eth/stagedsync/stages"
|
"github.com/ledgerwatch/erigon/eth/stagedsync/stages"
|
||||||
"github.com/ledgerwatch/erigon/eth/tracers"
|
"github.com/ledgerwatch/erigon/eth/tracers"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/transactions"
|
"github.com/ledgerwatch/erigon/turbo/transactions"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
)
|
)
|
||||||
|
@ -11,9 +11,9 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
|
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
|
||||||
"github.com/ledgerwatch/erigon/common"
|
"github.com/ledgerwatch/erigon/common"
|
||||||
"github.com/ledgerwatch/erigon/eth/tracers"
|
"github.com/ledgerwatch/erigon/eth/tracers"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/rawdb"
|
"github.com/ledgerwatch/erigon/core/rawdb"
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/core/types/accounts"
|
"github.com/ledgerwatch/erigon/core/types/accounts"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ func buildBlockResponse(db kv.Tx, blockNum uint64, fullTx bool) (map[string]inte
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
response, err := ethapi.RPCMarshalBlock(block, true, fullTx)
|
response, err := ethapi.RPCMarshalBlockDeprecated(block, true, fullTx)
|
||||||
|
|
||||||
if err == nil && rpc.BlockNumber(block.NumberU64()) == rpc.PendingBlockNumber {
|
if err == nil && rpc.BlockNumber(block.NumberU64()) == rpc.PendingBlockNumber {
|
||||||
// Pending blocks need to nil out a few fields
|
// Pending blocks need to nil out a few fields
|
||||||
|
@ -20,9 +20,9 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/rawdb"
|
"github.com/ledgerwatch/erigon/core/rawdb"
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
ethFilters "github.com/ledgerwatch/erigon/eth/filters"
|
ethFilters "github.com/ledgerwatch/erigon/eth/filters"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
|
ethapi2 "github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
||||||
"github.com/ledgerwatch/erigon/turbo/services"
|
"github.com/ledgerwatch/erigon/turbo/services"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
@ -77,14 +77,14 @@ type EthAPI interface {
|
|||||||
GasPrice(_ context.Context) (*hexutil.Big, error)
|
GasPrice(_ context.Context) (*hexutil.Big, error)
|
||||||
|
|
||||||
// Sending related (see ./eth_call.go)
|
// Sending related (see ./eth_call.go)
|
||||||
Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *ethapi.StateOverrides) (hexutil.Bytes, error)
|
Call(ctx context.Context, args ethapi2.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *ethapi2.StateOverrides) (hexutil.Bytes, error)
|
||||||
EstimateGas(ctx context.Context, argsOrNil *ethapi.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)
|
EstimateGas(ctx context.Context, argsOrNil *ethapi2.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)
|
||||||
SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
|
SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
|
||||||
SendTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
|
SendTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
|
||||||
Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error)
|
Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error)
|
||||||
SignTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
|
SignTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
|
||||||
GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNr rpc.BlockNumber) (*interface{}, error)
|
GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNr rpc.BlockNumber) (*interface{}, error)
|
||||||
CreateAccessList(ctx context.Context, args ethapi.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash, optimizeGas *bool) (*accessListResult, error)
|
CreateAccessList(ctx context.Context, args ethapi2.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash, optimizeGas *bool) (*accessListResult, error)
|
||||||
|
|
||||||
// Mining related (see ./eth_mining.go)
|
// Mining related (see ./eth_mining.go)
|
||||||
Coinbase(ctx context.Context) (common.Address, error)
|
Coinbase(ctx context.Context) (common.Address, error)
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
"github.com/ledgerwatch/erigon/common/hexutil"
|
"github.com/ledgerwatch/erigon/common/hexutil"
|
||||||
"github.com/ledgerwatch/erigon/core"
|
"github.com/ledgerwatch/erigon/core"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon-lib/gointerfaces"
|
"github.com/ledgerwatch/erigon-lib/gointerfaces"
|
||||||
txpool_proto "github.com/ledgerwatch/erigon-lib/gointerfaces/txpool"
|
txpool_proto "github.com/ledgerwatch/erigon-lib/gointerfaces/txpool"
|
||||||
"github.com/ledgerwatch/erigon-lib/kv"
|
"github.com/ledgerwatch/erigon-lib/kv"
|
||||||
|
ethapi2 "github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
@ -21,7 +22,6 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/eth/tracers/logger"
|
"github.com/ledgerwatch/erigon/eth/tracers/logger"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
||||||
@ -29,7 +29,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Call implements eth_call. Executes a new message call immediately without creating a transaction on the block chain.
|
// Call implements eth_call. Executes a new message call immediately without creating a transaction on the block chain.
|
||||||
func (api *APIImpl) Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *ethapi.StateOverrides) (hexutil.Bytes, error) {
|
func (api *APIImpl) Call(ctx context.Context, args ethapi2.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *ethapi2.StateOverrides) (hexutil.Bytes, error) {
|
||||||
tx, err := api.db.BeginRo(ctx)
|
tx, err := api.db.BeginRo(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -68,7 +68,7 @@ func (api *APIImpl) Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHas
|
|||||||
|
|
||||||
// If the result contains a revert reason, try to unpack and return it.
|
// If the result contains a revert reason, try to unpack and return it.
|
||||||
if len(result.Revert()) > 0 {
|
if len(result.Revert()) > 0 {
|
||||||
return nil, ethapi.NewRevertError(result)
|
return nil, ethapi2.NewRevertError(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.Return(), result.Err
|
return result.Return(), result.Err
|
||||||
@ -89,8 +89,8 @@ func headerByNumberOrHash(ctx context.Context, tx kv.Tx, blockNrOrHash rpc.Block
|
|||||||
}
|
}
|
||||||
|
|
||||||
// EstimateGas implements eth_estimateGas. Returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.
|
// EstimateGas implements eth_estimateGas. Returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.
|
||||||
func (api *APIImpl) EstimateGas(ctx context.Context, argsOrNil *ethapi.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error) {
|
func (api *APIImpl) EstimateGas(ctx context.Context, argsOrNil *ethapi2.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error) {
|
||||||
var args ethapi.CallArgs
|
var args ethapi2.CallArgs
|
||||||
// if we actually get CallArgs here, we use them
|
// if we actually get CallArgs here, we use them
|
||||||
if argsOrNil != nil {
|
if argsOrNil != nil {
|
||||||
args = *argsOrNil
|
args = *argsOrNil
|
||||||
@ -263,7 +263,7 @@ func (api *APIImpl) EstimateGas(ctx context.Context, argsOrNil *ethapi.CallArgs,
|
|||||||
if failed {
|
if failed {
|
||||||
if result != nil && !errors.Is(result.Err, vm.ErrOutOfGas) {
|
if result != nil && !errors.Is(result.Err, vm.ErrOutOfGas) {
|
||||||
if len(result.Revert()) > 0 {
|
if len(result.Revert()) > 0 {
|
||||||
return 0, ethapi.NewRevertError(result)
|
return 0, ethapi2.NewRevertError(result)
|
||||||
}
|
}
|
||||||
return 0, result.Err
|
return 0, result.Err
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ type accessListResult struct {
|
|||||||
// CreateAccessList implements eth_createAccessList. It creates an access list for the given transaction.
|
// CreateAccessList implements eth_createAccessList. It creates an access list for the given transaction.
|
||||||
// If the accesslist creation fails an error is returned.
|
// If the accesslist creation fails an error is returned.
|
||||||
// If the transaction itself fails, an vmErr is returned.
|
// If the transaction itself fails, an vmErr is returned.
|
||||||
func (api *APIImpl) CreateAccessList(ctx context.Context, args ethapi.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash, optimizeGas *bool) (*accessListResult, error) {
|
func (api *APIImpl) CreateAccessList(ctx context.Context, args ethapi2.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash, optimizeGas *bool) (*accessListResult, error) {
|
||||||
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
|
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
|
||||||
if blockNrOrHash != nil {
|
if blockNrOrHash != nil {
|
||||||
bNrOrHash = *blockNrOrHash
|
bNrOrHash = *blockNrOrHash
|
||||||
|
@ -16,7 +16,6 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/state"
|
"github.com/ledgerwatch/erigon/core/state"
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
rpcapi "github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
||||||
@ -34,7 +33,7 @@ type BlockOverrides struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Bundle struct {
|
type Bundle struct {
|
||||||
Transactions []rpcapi.CallArgs
|
Transactions []ethapi.CallArgs
|
||||||
BlockOverride BlockOverrides
|
BlockOverride BlockOverrides
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +68,7 @@ func blockHeaderOverride(blockCtx *vm.BlockContext, blockOverride BlockOverrides
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *APIImpl) CallMany(ctx context.Context, bundles []Bundle, simulateContext StateContext, stateOverride *rpcapi.StateOverrides, timeoutMilliSecondsPtr *int64) ([][]map[string]interface{}, error) {
|
func (api *APIImpl) CallMany(ctx context.Context, bundles []Bundle, simulateContext StateContext, stateOverride *ethapi.StateOverrides, timeoutMilliSecondsPtr *int64) ([][]map[string]interface{}, error) {
|
||||||
var (
|
var (
|
||||||
hash common.Hash
|
hash common.Hash
|
||||||
replayTransactions types.Transactions
|
replayTransactions types.Transactions
|
||||||
|
@ -15,10 +15,10 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/common/hexutil"
|
"github.com/ledgerwatch/erigon/common/hexutil"
|
||||||
"github.com/ledgerwatch/erigon/core"
|
"github.com/ledgerwatch/erigon/core"
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// block 1 contains 3 Transactions
|
// block 1 contains 3 Transactions
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
|
|
||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -24,7 +25,6 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/state"
|
"github.com/ledgerwatch/erigon/core/state"
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
||||||
@ -110,7 +110,7 @@ func TestGetBlockByTimestampLatestTime(t *testing.T) {
|
|||||||
api := NewErigonAPI(NewBaseApi(nil, stateCache, br, agg, false, rpccfg.DefaultEvmCallTimeout), m.DB, nil)
|
api := NewErigonAPI(NewBaseApi(nil, stateCache, br, agg, false, rpccfg.DefaultEvmCallTimeout), m.DB, nil)
|
||||||
|
|
||||||
latestBlock := rawdb.ReadCurrentBlock(tx)
|
latestBlock := rawdb.ReadCurrentBlock(tx)
|
||||||
response, err := ethapi.RPCMarshalBlock(latestBlock, true, false)
|
response, err := ethapi.RPCMarshalBlockDeprecated(latestBlock, true, false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("couldn't get the rpc marshal block")
|
t.Error("couldn't get the rpc marshal block")
|
||||||
@ -152,7 +152,7 @@ func TestGetBlockByTimestampOldestTime(t *testing.T) {
|
|||||||
t.Error("couldn't retrieve oldest block")
|
t.Error("couldn't retrieve oldest block")
|
||||||
}
|
}
|
||||||
|
|
||||||
response, err := ethapi.RPCMarshalBlock(oldestBlock, true, false)
|
response, err := ethapi.RPCMarshalBlockDeprecated(oldestBlock, true, false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("couldn't get the rpc marshal block")
|
t.Error("couldn't get the rpc marshal block")
|
||||||
@ -191,7 +191,7 @@ func TestGetBlockByTimeHigherThanLatestBlock(t *testing.T) {
|
|||||||
|
|
||||||
latestBlock := rawdb.ReadCurrentBlock(tx)
|
latestBlock := rawdb.ReadCurrentBlock(tx)
|
||||||
|
|
||||||
response, err := ethapi.RPCMarshalBlock(latestBlock, true, false)
|
response, err := ethapi.RPCMarshalBlockDeprecated(latestBlock, true, false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("couldn't get the rpc marshal block")
|
t.Error("couldn't get the rpc marshal block")
|
||||||
@ -243,7 +243,7 @@ func TestGetBlockByTimeMiddle(t *testing.T) {
|
|||||||
t.Error("couldn't retrieve middle block")
|
t.Error("couldn't retrieve middle block")
|
||||||
}
|
}
|
||||||
|
|
||||||
response, err := ethapi.RPCMarshalBlock(middleBlock, true, false)
|
response, err := ethapi.RPCMarshalBlockDeprecated(middleBlock, true, false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("couldn't get the rpc marshal block")
|
t.Error("couldn't get the rpc marshal block")
|
||||||
@ -289,7 +289,7 @@ func TestGetBlockByTimestamp(t *testing.T) {
|
|||||||
if pickedBlock == nil {
|
if pickedBlock == nil {
|
||||||
t.Error("couldn't retrieve picked block")
|
t.Error("couldn't retrieve picked block")
|
||||||
}
|
}
|
||||||
response, err := ethapi.RPCMarshalBlock(pickedBlock, true, false)
|
response, err := ethapi.RPCMarshalBlockDeprecated(pickedBlock, true, false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("couldn't get the rpc marshal block")
|
t.Error("couldn't get the rpc marshal block")
|
||||||
|
@ -18,8 +18,8 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
"github.com/ledgerwatch/erigon/eth/tracers"
|
"github.com/ledgerwatch/erigon/eth/tracers"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
"github.com/ledgerwatch/erigon/turbo/rpchelper"
|
||||||
"github.com/ledgerwatch/erigon/turbo/transactions"
|
"github.com/ledgerwatch/erigon/turbo/transactions"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon-lib/common"
|
"github.com/ledgerwatch/erigon-lib/common"
|
||||||
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli"
|
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli"
|
||||||
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands"
|
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/cmd/sentry/sentry"
|
"github.com/ledgerwatch/erigon/cmd/sentry/sentry"
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/common/paths"
|
"github.com/ledgerwatch/erigon/common/paths"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
logging2 "github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
node2 "github.com/ledgerwatch/erigon/turbo/node"
|
node2 "github.com/ledgerwatch/erigon/turbo/node"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -35,7 +35,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
utils.CobraFlags(rootCmd, debug.Flags, utils.MetricFlags, logging.Flags)
|
utils.CobraFlags(rootCmd, debug.Flags, utils.MetricFlags, logging2.Flags)
|
||||||
|
|
||||||
rootCmd.Flags().StringVar(&sentryAddr, "sentry.api.addr", "localhost:9091", "grpc addresses")
|
rootCmd.Flags().StringVar(&sentryAddr, "sentry.api.addr", "localhost:9091", "grpc addresses")
|
||||||
rootCmd.Flags().StringVar(&datadirCli, utils.DataDirFlag.Name, paths.DefaultDataDir(), utils.DataDirFlag.Usage)
|
rootCmd.Flags().StringVar(&datadirCli, utils.DataDirFlag.Name, paths.DefaultDataDir(), utils.DataDirFlag.Usage)
|
||||||
@ -87,7 +87,7 @@ var rootCmd = &cobra.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = logging.GetLoggerCmd("sentry", cmd)
|
_ = logging2.GetLoggerCmd("sentry", cmd)
|
||||||
return sentry.Sentry(cmd.Context(), dirs, sentryAddr, discoveryDNS, p2pConfig, uint(protocol), healthCheck)
|
return sentry.Sentry(cmd.Context(), dirs, sentryAddr, discoveryDNS, p2pConfig, uint(protocol), healthCheck)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
||||||
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
||||||
"github.com/ledgerwatch/erigon/eth/ethconsensusconfig"
|
"github.com/ledgerwatch/erigon/eth/ethconsensusconfig"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/erigon/turbo/services"
|
"github.com/ledgerwatch/erigon/turbo/services"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -29,9 +29,9 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/types/accounts"
|
"github.com/ledgerwatch/erigon/core/types/accounts"
|
||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
datadir2 "github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
datadir2 "github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/erigon/turbo/services"
|
"github.com/ledgerwatch/erigon/turbo/services"
|
||||||
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
@ -7,12 +7,12 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon-lib/common"
|
"github.com/ledgerwatch/erigon-lib/common"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/core"
|
"github.com/ledgerwatch/erigon/core"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ import (
|
|||||||
common2 "github.com/ledgerwatch/erigon/common"
|
common2 "github.com/ledgerwatch/erigon/common"
|
||||||
"github.com/ledgerwatch/erigon/common/paths"
|
"github.com/ledgerwatch/erigon/common/paths"
|
||||||
"github.com/ledgerwatch/erigon/ethdb/privateapi"
|
"github.com/ledgerwatch/erigon/ethdb/privateapi"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
logging2 "github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@ -51,7 +51,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
utils.CobraFlags(rootCmd, debug.Flags, utils.MetricFlags, logging.Flags)
|
utils.CobraFlags(rootCmd, debug.Flags, utils.MetricFlags, logging2.Flags)
|
||||||
rootCmd.Flags().StringSliceVar(&sentryAddr, "sentry.api.addr", []string{"localhost:9091"}, "comma separated sentry addresses '<host>:<port>,<host>:<port>'")
|
rootCmd.Flags().StringSliceVar(&sentryAddr, "sentry.api.addr", []string{"localhost:9091"}, "comma separated sentry addresses '<host>:<port>,<host>:<port>'")
|
||||||
rootCmd.Flags().StringVar(&privateApiAddr, "private.api.addr", "localhost:9090", "execution service <host>:<port>")
|
rootCmd.Flags().StringVar(&privateApiAddr, "private.api.addr", "localhost:9090", "execution service <host>:<port>")
|
||||||
rootCmd.Flags().StringVar(&txpoolApiAddr, "txpool.api.addr", "localhost:9094", "txpool service <host>:<port>")
|
rootCmd.Flags().StringVar(&txpoolApiAddr, "txpool.api.addr", "localhost:9094", "txpool service <host>:<port>")
|
||||||
@ -82,7 +82,7 @@ var rootCmd = &cobra.Command{
|
|||||||
debug.Exit()
|
debug.Exit()
|
||||||
},
|
},
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
_ = logging.GetLoggerCmd("txpool", cmd)
|
_ = logging2.GetLoggerCmd("txpool", cmd)
|
||||||
ctx := cmd.Context()
|
ctx := cmd.Context()
|
||||||
creds, err := grpcutil.TLS(TLSCACert, TLSCertfile, TLSKeyFile)
|
creds, err := grpcutil.TLS(TLSCACert, TLSCertfile, TLSKeyFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -23,8 +23,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/node"
|
"github.com/ledgerwatch/erigon/node"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fatalf formats a message to standard error and exits the program.
|
// Fatalf formats a message to standard error and exits the program.
|
||||||
|
@ -26,10 +26,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goccy/go-json"
|
"github.com/goccy/go-json"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/common"
|
"github.com/ledgerwatch/erigon/common"
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ func TestInterpreterReadonly(t *testing.T) {
|
|||||||
rapid.Check(t, func(t *rapid.T) {
|
rapid.Check(t, func(t *rapid.T) {
|
||||||
env := NewEVM(BlockContext{}, TxContext{}, &dummyStatedb{}, params.TestChainConfig, Config{})
|
env := NewEVM(BlockContext{}, TxContext{}, &dummyStatedb{}, params.TestChainConfig, Config{})
|
||||||
|
|
||||||
isEVMSliceTest := rapid.SliceOfN(rapid.Bool(), 1, -1).Draw(t, "tevm").([]bool)
|
isEVMSliceTest := rapid.SliceOfN(rapid.Bool(), 1, -1).Draw(t, "tevm")
|
||||||
readOnlySliceTest := rapid.SliceOfN(rapid.Bool(), len(isEVMSliceTest), len(isEVMSliceTest)).Draw(t, "readonly").([]bool)
|
readOnlySliceTest := rapid.SliceOfN(rapid.Bool(), len(isEVMSliceTest), len(isEVMSliceTest)).Draw(t, "readonly")
|
||||||
|
|
||||||
isEVMCalled := make([]bool, len(isEVMSliceTest))
|
isEVMCalled := make([]bool, len(isEVMSliceTest))
|
||||||
readOnlies := make([]*readOnlyState, len(readOnlySliceTest))
|
readOnlies := make([]*readOnlyState, len(readOnlySliceTest))
|
||||||
|
@ -2,7 +2,7 @@ package tracers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
"github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TraceConfig holds extra parameters to trace functions.
|
// TraceConfig holds extra parameters to trace functions.
|
||||||
|
10
go.mod
10
go.mod
@ -35,7 +35,7 @@ require (
|
|||||||
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c
|
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c
|
||||||
github.com/goccy/go-json v0.9.7
|
github.com/goccy/go-json v0.9.7
|
||||||
github.com/gofrs/flock v0.8.1
|
github.com/gofrs/flock v0.8.1
|
||||||
github.com/golang-jwt/jwt/v4 v4.4.1
|
github.com/golang-jwt/jwt/v4 v4.4.2
|
||||||
github.com/golang/snappy v0.0.4
|
github.com/golang/snappy v0.0.4
|
||||||
github.com/google/btree v1.1.2
|
github.com/google/btree v1.1.2
|
||||||
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa
|
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa
|
||||||
@ -74,7 +74,7 @@ require (
|
|||||||
github.com/xsleonard/go-merkle v1.1.0
|
github.com/xsleonard/go-merkle v1.1.0
|
||||||
go.uber.org/atomic v1.10.0
|
go.uber.org/atomic v1.10.0
|
||||||
go.uber.org/zap v1.23.0
|
go.uber.org/zap v1.23.0
|
||||||
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a
|
golang.org/x/crypto v0.1.0
|
||||||
golang.org/x/exp v0.0.0-20221018221608-02f3b879a704
|
golang.org/x/exp v0.0.0-20221018221608-02f3b879a704
|
||||||
golang.org/x/sync v0.1.0
|
golang.org/x/sync v0.1.0
|
||||||
golang.org/x/sys v0.1.0
|
golang.org/x/sys v0.1.0
|
||||||
@ -85,7 +85,7 @@ require (
|
|||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
modernc.org/sqlite v1.19.2
|
modernc.org/sqlite v1.19.2
|
||||||
pgregory.net/rapid v0.4.7
|
pgregory.net/rapid v0.5.3
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -235,8 +235,8 @@ require (
|
|||||||
github.com/valyala/histogram v1.2.0 // indirect
|
github.com/valyala/histogram v1.2.0 // indirect
|
||||||
go.etcd.io/bbolt v1.3.6 // indirect
|
go.etcd.io/bbolt v1.3.6 // indirect
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||||
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 // indirect
|
golang.org/x/net v0.1.0 // indirect
|
||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.4.0 // indirect
|
||||||
golang.org/x/tools v0.1.12 // indirect
|
golang.org/x/tools v0.1.12 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect
|
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||||
|
19
go.sum
19
go.sum
@ -346,8 +346,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV
|
|||||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ=
|
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
|
||||||
github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
@ -1034,8 +1034,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm
|
|||||||
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg=
|
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
|
||||||
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
@ -1129,8 +1129,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su
|
|||||||
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 h1:KafLifaRFIuSJ5C+7CyFJOF9haxKNC1CEIDk8GX6X0k=
|
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
|
||||||
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
@ -1239,8 +1239,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
|
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
|
||||||
|
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
@ -1482,8 +1483,8 @@ modernc.org/tcl v1.15.0 h1:oY+JeD11qVVSgVvodMJsu7Edf8tr5E/7tuhF5cNYz34=
|
|||||||
modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=
|
modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=
|
||||||
modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||||
modernc.org/z v1.7.0 h1:xkDw/KepgEjeizO2sNco+hqYkU12taxQFqPEmgm1GWE=
|
modernc.org/z v1.7.0 h1:xkDw/KepgEjeizO2sNco+hqYkU12taxQFqPEmgm1GWE=
|
||||||
pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g=
|
pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M=
|
||||||
pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
|
pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
|
||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||||
|
@ -27,9 +27,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
"github.com/ledgerwatch/erigon/rpc/rpccfg"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
@ -28,9 +28,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/common/mclock"
|
"github.com/ledgerwatch/erigon/common/mclock"
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/erigon/p2p/enode"
|
"github.com/ledgerwatch/erigon/p2p/enode"
|
||||||
"github.com/ledgerwatch/erigon/p2p/netutil"
|
"github.com/ledgerwatch/erigon/p2p/netutil"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -32,9 +32,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/erigon/p2p/discover/v4wire"
|
"github.com/ledgerwatch/erigon/p2p/discover/v4wire"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enode"
|
"github.com/ledgerwatch/erigon/p2p/enode"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enr"
|
"github.com/ledgerwatch/erigon/p2p/enr"
|
||||||
|
@ -29,9 +29,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/erigon/p2p/discover/v5wire"
|
"github.com/ledgerwatch/erigon/p2p/discover/v5wire"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enode"
|
"github.com/ledgerwatch/erigon/p2p/enode"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enr"
|
"github.com/ledgerwatch/erigon/p2p/enr"
|
||||||
|
@ -28,9 +28,9 @@ import (
|
|||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/ledgerwatch/erigon/common/mclock"
|
"github.com/ledgerwatch/erigon/common/mclock"
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/erigon/p2p/enode"
|
"github.com/ledgerwatch/erigon/p2p/enode"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enr"
|
"github.com/ledgerwatch/erigon/p2p/enr"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,10 +29,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/crypto"
|
"github.com/ledgerwatch/erigon/crypto"
|
||||||
"github.com/ledgerwatch/erigon/internal/testlog"
|
|
||||||
"github.com/ledgerwatch/erigon/p2p/enode"
|
"github.com/ledgerwatch/erigon/p2p/enode"
|
||||||
"github.com/ledgerwatch/erigon/p2p/enr"
|
"github.com/ledgerwatch/erigon/p2p/enr"
|
||||||
"github.com/ledgerwatch/erigon/p2p/rlpx"
|
"github.com/ledgerwatch/erigon/p2p/rlpx"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/testlog"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -282,11 +282,11 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} {
|
|||||||
// RPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are
|
// RPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are
|
||||||
// returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain
|
// returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain
|
||||||
// transaction hashes.
|
// transaction hashes.
|
||||||
func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error) {
|
func RPCMarshalBlockDeprecated(block *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error) {
|
||||||
return RPCMarshalBlockEx(block, inclTx, fullTx, nil, common.Hash{})
|
return RPCMarshalBlockExDeprecated(block, inclTx, fullTx, nil, common.Hash{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func RPCMarshalBlockEx(block *types.Block, inclTx bool, fullTx bool, borTx types.Transaction, borTxHash common.Hash) (map[string]interface{}, error) {
|
func RPCMarshalBlockExDeprecated(block *types.Block, inclTx bool, fullTx bool, borTx types.Transaction, borTxHash common.Hash) (map[string]interface{}, error) {
|
||||||
fields := RPCMarshalHeader(block.Header())
|
fields := RPCMarshalHeader(block.Header())
|
||||||
fields["size"] = hexutil.Uint64(block.Size())
|
fields["size"] = hexutil.Uint64(block.Size())
|
||||||
if _, ok := fields["transactions"]; !ok {
|
if _, ok := fields["transactions"]; !ok {
|
@ -3,37 +3,12 @@ package ethapi
|
|||||||
// This file stores proxy-objects for `internal` package
|
// This file stores proxy-objects for `internal` package
|
||||||
import (
|
import (
|
||||||
"github.com/ledgerwatch/erigon/common"
|
"github.com/ledgerwatch/erigon/common"
|
||||||
"github.com/ledgerwatch/erigon/core"
|
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// This package provides copy-paste and proxy objects to "internal/ethapi" package
|
|
||||||
|
|
||||||
func NewRevertError(result *core.ExecutionResult) *RevertError {
|
|
||||||
return &RevertError{ethapi.NewRevertError(result)}
|
|
||||||
}
|
|
||||||
|
|
||||||
type RevertError struct {
|
|
||||||
*ethapi.RevertError
|
|
||||||
}
|
|
||||||
|
|
||||||
type CallArgs struct {
|
|
||||||
*ethapi.CallArgs
|
|
||||||
}
|
|
||||||
|
|
||||||
type ExecutionResult struct {
|
|
||||||
*ethapi.ExecutionResult
|
|
||||||
}
|
|
||||||
|
|
||||||
// nolint
|
|
||||||
func RPCMarshalHeader(head *types.Header) map[string]interface{} {
|
|
||||||
return ethapi.RPCMarshalHeader(head)
|
|
||||||
}
|
|
||||||
|
|
||||||
// nolint
|
// nolint
|
||||||
func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool, additional map[string]interface{}) (map[string]interface{}, error) {
|
func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool, additional map[string]interface{}) (map[string]interface{}, error) {
|
||||||
fields, err := ethapi.RPCMarshalBlock(b, inclTx, fullTx)
|
fields, err := RPCMarshalBlockDeprecated(b, inclTx, fullTx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -47,7 +22,7 @@ func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool, additional map[st
|
|||||||
|
|
||||||
// nolint
|
// nolint
|
||||||
func RPCMarshalBlockEx(b *types.Block, inclTx bool, fullTx bool, borTx types.Transaction, borTxHash common.Hash, additional map[string]interface{}) (map[string]interface{}, error) {
|
func RPCMarshalBlockEx(b *types.Block, inclTx bool, fullTx bool, borTx types.Transaction, borTxHash common.Hash, additional map[string]interface{}) (map[string]interface{}, error) {
|
||||||
fields, err := ethapi.RPCMarshalBlockEx(b, inclTx, fullTx, borTx, borTxHash)
|
fields, err := RPCMarshalBlockExDeprecated(b, inclTx, fullTx, borTx, borTxHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -58,8 +33,3 @@ func RPCMarshalBlockEx(b *types.Block, inclTx bool, fullTx bool, borTx types.Tra
|
|||||||
|
|
||||||
return fields, err
|
return fields, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint
|
|
||||||
type RPCTransaction struct {
|
|
||||||
*ethapi.RPCTransaction
|
|
||||||
}
|
|
||||||
|
@ -3,13 +3,12 @@ package app
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/flags"
|
|
||||||
"github.com/ledgerwatch/erigon/node"
|
"github.com/ledgerwatch/erigon/node"
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg"
|
"github.com/ledgerwatch/erigon/node/nodecfg"
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
|
cli2 "github.com/ledgerwatch/erigon/turbo/cli"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ import (
|
|||||||
// * action: the main function for the application. receives `*cli.Context` with parsed command-line flags. Returns no error, if some error could not be recovered from write to the log or panic.
|
// * action: the main function for the application. receives `*cli.Context` with parsed command-line flags. Returns no error, if some error could not be recovered from write to the log or panic.
|
||||||
// * cliFlags: the list of flags `cli.Flag` that the app should set and parse. By default, use `DefaultFlags()`. If you want to specify your own flag, use `append(DefaultFlags(), myFlag)` for this parameter.
|
// * cliFlags: the list of flags `cli.Flag` that the app should set and parse. By default, use `DefaultFlags()`. If you want to specify your own flag, use `append(DefaultFlags(), myFlag)` for this parameter.
|
||||||
func MakeApp(action func(*cli.Context), cliFlags []cli.Flag) *cli.App {
|
func MakeApp(action func(*cli.Context), cliFlags []cli.Flag) *cli.App {
|
||||||
app := flags.NewApp(params.GitCommit, "", "erigon experimental cli")
|
app := cli2.NewApp(params.GitCommit, "", "erigon experimental cli")
|
||||||
app.Action = action
|
app.Action = action
|
||||||
app.Flags = append(cliFlags, debug.Flags...) // debug flags are required
|
app.Flags = append(cliFlags, debug.Flags...) // debug flags are required
|
||||||
app.Before = func(ctx *cli.Context) error {
|
app.Before = func(ctx *cli.Context) error {
|
||||||
|
@ -26,10 +26,10 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/rawdb"
|
"github.com/ledgerwatch/erigon/core/rawdb"
|
||||||
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
||||||
"github.com/ledgerwatch/erigon/eth/ethconfig/estimate"
|
"github.com/ledgerwatch/erigon/eth/ethconfig/estimate"
|
||||||
"github.com/ledgerwatch/erigon/internal/debug"
|
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
"github.com/ledgerwatch/erigon/node/nodecfg/datadir"
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/debug"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
"github.com/ledgerwatch/erigon/turbo/snapshotsync"
|
||||||
"github.com/ledgerwatch/erigon/turbo/snapshotsync/snap"
|
"github.com/ledgerwatch/erigon/turbo/snapshotsync/snap"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
@ -2,7 +2,7 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package flags
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
@ -23,9 +23,9 @@ import (
|
|||||||
|
|
||||||
metrics2 "github.com/VictoriaMetrics/metrics"
|
metrics2 "github.com/VictoriaMetrics/metrics"
|
||||||
"github.com/ledgerwatch/erigon/common/fdlimit"
|
"github.com/ledgerwatch/erigon/common/fdlimit"
|
||||||
"github.com/ledgerwatch/erigon/internal/logging"
|
|
||||||
"github.com/ledgerwatch/erigon/metrics"
|
"github.com/ledgerwatch/erigon/metrics"
|
||||||
"github.com/ledgerwatch/erigon/metrics/exp"
|
"github.com/ledgerwatch/erigon/metrics/exp"
|
||||||
|
"github.com/ledgerwatch/erigon/turbo/logging"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
@ -13,18 +13,18 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/core/state"
|
"github.com/ledgerwatch/erigon/core/state"
|
||||||
"github.com/ledgerwatch/erigon/core/types"
|
"github.com/ledgerwatch/erigon/core/types"
|
||||||
"github.com/ledgerwatch/erigon/core/vm"
|
"github.com/ledgerwatch/erigon/core/vm"
|
||||||
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
||||||
"github.com/ledgerwatch/erigon/params"
|
"github.com/ledgerwatch/erigon/params"
|
||||||
"github.com/ledgerwatch/erigon/rpc"
|
"github.com/ledgerwatch/erigon/rpc"
|
||||||
|
ethapi2 "github.com/ledgerwatch/erigon/turbo/adapter/ethapi"
|
||||||
"github.com/ledgerwatch/erigon/turbo/services"
|
"github.com/ledgerwatch/erigon/turbo/services"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func DoCall(
|
func DoCall(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
args ethapi.CallArgs,
|
args ethapi2.CallArgs,
|
||||||
tx kv.Tx, blockNrOrHash rpc.BlockNumberOrHash,
|
tx kv.Tx, blockNrOrHash rpc.BlockNumberOrHash,
|
||||||
block *types.Block, overrides *ethapi.StateOverrides,
|
block *types.Block, overrides *ethapi2.StateOverrides,
|
||||||
gasCap uint64,
|
gasCap uint64,
|
||||||
chainConfig *params.ChainConfig,
|
chainConfig *params.ChainConfig,
|
||||||
stateReader state.StateReader,
|
stateReader state.StateReader,
|
||||||
|
Loading…
Reference in New Issue
Block a user