mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-11 05:20:05 +00:00
0953fd42cb
* trace_call initial * Fix tests * More tracing * Add more fields to the action * Completed first example query * Add initial bench11 to compare trace_call with OpenEthereum * Exclude precompile calls from call traces * Add self-destruct, call types, more comparison in rpctest * Support for execution errors * Stack underflow error and delegatecall value * Fix lint * Fix suicide traceAddress, Bad instruction error * Fix lint Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
46 lines
1.7 KiB
Go
46 lines
1.7 KiB
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/cli"
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
"github.com/ledgerwatch/turbo-geth/common/hexutil"
|
|
"github.com/ledgerwatch/turbo-geth/ethdb"
|
|
"github.com/ledgerwatch/turbo-geth/rpc"
|
|
)
|
|
|
|
// TraceAPI RPC interface into tracing API
|
|
type TraceAPI interface {
|
|
// Ad-hoc (see ./trace_adhoc.go)
|
|
ReplayBlockTransactions(ctx context.Context, blockNr rpc.BlockNumber, traceTypes []string) ([]interface{}, error)
|
|
ReplayTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
|
|
Call(ctx context.Context, call TraceCallParam, types []string, blockNr *rpc.BlockNumberOrHash) (*TraceCallResult, error)
|
|
CallMany(ctx context.Context, calls []interface{}, blockNr *rpc.BlockNumberOrHash) ([]interface{}, error)
|
|
RawTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
|
|
|
|
// Filtering (see ./trace_filtering.go)
|
|
Transaction(ctx context.Context, txHash common.Hash) (ParityTraces, error)
|
|
Get(ctx context.Context, txHash common.Hash, txIndicies []hexutil.Uint64) (*ParityTrace, error)
|
|
Block(ctx context.Context, blockNr rpc.BlockNumber) (ParityTraces, error)
|
|
Filter(ctx context.Context, req TraceFilterRequest) (ParityTraces, error)
|
|
}
|
|
|
|
// TraceAPIImpl is implementation of the TraceAPI interface based on remote Db access
|
|
type TraceAPIImpl struct {
|
|
dbReader ethdb.Database
|
|
maxTraces uint64
|
|
traceType string
|
|
gasCap uint64
|
|
}
|
|
|
|
// NewTraceAPI returns NewTraceAPI instance
|
|
func NewTraceAPI(dbReader ethdb.Database, cfg *cli.Flags) *TraceAPIImpl {
|
|
return &TraceAPIImpl{
|
|
dbReader: dbReader,
|
|
maxTraces: cfg.MaxTraces,
|
|
traceType: cfg.TraceType,
|
|
gasCap: cfg.Gascap,
|
|
}
|
|
}
|