Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ramtinms committed Aug 13, 2024
1 parent 609eee7 commit ba08d38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/execution_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,12 @@ func (exeNode *ExecutionNode) LoadProviderEngine(

if exeNode.exeConf.evmTracingEnabled {
var err error
var evmTraceUploader debug.Uploader
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)
}
} else {
evmTraceUploader = &debug.NoopUploader{}
}
evmTracer, err := debug.NewEVMCallTracer(evmTraceUploader, node.Logger)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions fvm/evm/debug/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func (g *GCPUploader) Upload(id string, data json.RawMessage) error {
return nil
}

// NewNoopUploader constructs a new noop uploader
func NewNoopUploader() Uploader {
return &NoopUploader{}
}

type NoopUploader struct{}

func (np *NoopUploader) Upload(id string, data json.RawMessage) error {
Expand Down

0 comments on commit ba08d38

Please sign in to comment.