Skip to content

Commit

Permalink
Merge pull request #6841 from onflow/mpeter/decommission-evm-trace-ge…
Browse files Browse the repository at this point in the history
…neration

Remove trace generation and GCP uploading functionality
  • Loading branch information
janezpodhostnik authored Jan 13, 2025
2 parents d50ad45 + 8c03eb5 commit 76aa569
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 1,309 deletions.
18 changes: 0 additions & 18 deletions cmd/execution_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import (
"github.com/onflow/flow-go/engine/execution/state/bootstrap"
"github.com/onflow/flow-go/engine/execution/storehouse"
"github.com/onflow/flow-go/fvm"
"github.com/onflow/flow-go/fvm/evm/debug"
"github.com/onflow/flow-go/fvm/storage/snapshot"
"github.com/onflow/flow-go/fvm/systemcontracts"
ledgerpkg "github.com/onflow/flow-go/ledger"
Expand Down Expand Up @@ -527,23 +526,6 @@ func (exeNode *ExecutionNode) LoadProviderEngine(
node.FvmOptions...,
)

if exeNode.exeConf.evmTracingEnabled {
var err error
evmTraceUploader := debug.NewNoopUploader()
if len(exeNode.exeConf.evmTracesGCPBucket) > 0 {
evmTraceUploader, err = debug.NewGCPUploader(exeNode.exeConf.evmTracesGCPBucket)
if err != nil {
return nil, fmt.Errorf("could not create evm trace uploader: %w", err)
}
}
evmTracer, err := debug.NewEVMCallTracer(evmTraceUploader, node.Logger)
if err != nil {
return nil, fmt.Errorf("could not create evm tracer: %w", err)
}

opts = append(opts, fvm.WithEVMTracer(evmTracer))
}

vmCtx := fvm.NewContext(opts...)

var collector module.ExecutionMetrics
Expand Down
6 changes: 0 additions & 6 deletions cmd/execution_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ type ExecutionConfig struct {
transactionExecutionMetricsEnabled bool
transactionExecutionMetricsBufferSize uint

// evm tracing configuration
evmTracingEnabled bool
evmTracesGCPBucket string

computationConfig computation.ComputationConfig
receiptRequestWorkers uint // common provider engine workers
receiptRequestsCacheSize uint32 // common provider engine cache size
Expand Down Expand Up @@ -125,8 +121,6 @@ func (exeConf *ExecutionConfig) SetupFlags(flags *pflag.FlagSet) {
flags.IntVar(&exeConf.importCheckpointWorkerCount, "import-checkpoint-worker-count", 10, "number of workers to import checkpoint file during bootstrap")
flags.BoolVar(&exeConf.transactionExecutionMetricsEnabled, "tx-execution-metrics", true, "enable collection of transaction execution metrics")
flags.UintVar(&exeConf.transactionExecutionMetricsBufferSize, "tx-execution-metrics-buffer-size", 200, "buffer size for transaction execution metrics. The buffer size is the number of blocks that are kept in memory by the metrics provider engine")
flags.BoolVar(&exeConf.evmTracingEnabled, "evm-tracing-enabled", false, "enable EVM tracing, when set it will generate traces and upload them to the GCP bucket provided by the --evm-traces-gcp-bucket. Warning: this might affect speed of execution")
flags.StringVar(&exeConf.evmTracesGCPBucket, "evm-traces-gcp-bucket", "", "define GCP bucket name used for uploading EVM traces, must be used in combination with --evm-tracing-enabled. if left empty the upload step is skipped")

flags.BoolVar(&exeConf.onflowOnlyLNs, "temp-onflow-only-lns", false, "do not use unless required. forces node to only request collections from onflow collection nodes")
flags.BoolVar(&exeConf.enableStorehouse, "enable-storehouse", false, "enable storehouse to store registers on disk, default is false")
Expand Down
12 changes: 0 additions & 12 deletions fvm/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
otelTrace "go.opentelemetry.io/otel/trace"

"github.com/onflow/flow-go/fvm/environment"
"github.com/onflow/flow-go/fvm/evm/debug"
reusableRuntime "github.com/onflow/flow-go/fvm/runtime"
"github.com/onflow/flow-go/fvm/storage/derived"
"github.com/onflow/flow-go/fvm/storage/state"
Expand Down Expand Up @@ -47,8 +46,6 @@ type Context struct {
// AllowProgramCacheWritesInScripts determines if the program cache can be written to in scripts
// By default, the program cache is only updated by transactions.
AllowProgramCacheWritesInScripts bool

debug.EVMTracer
}

// NewContext initializes a new execution context with the provided options.
Expand Down Expand Up @@ -79,7 +76,6 @@ func defaultContext() Context {
MaxStateInteractionSize: DefaultMaxInteractionSize,
TransactionExecutorParams: DefaultTransactionExecutorParams(),
EnvironmentParams: environment.DefaultEnvironmentParams(),
EVMTracer: debug.NopTracer,
}
return ctx
}
Expand Down Expand Up @@ -385,14 +381,6 @@ func WithAllowProgramCacheWritesInScriptsEnabled(enabled bool) Option {
}
}

// WithEVMTracer will set the evm execution tracer
func WithEVMTracer(tracer debug.EVMTracer) Option {
return func(ctx Context) Context {
ctx.EVMTracer = tracer
return ctx
}
}

// WithReadVersionFromNodeVersionBeacon sets whether the version from the node version beacon should be read
// this should only be disabled for testing
func WithReadVersionFromNodeVersionBeacon(enabled bool) Option {
Expand Down
Loading

0 comments on commit 76aa569

Please sign in to comment.