From c88be5b3b1edfdda8ba2536270d919de38114f50 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 28 Apr 2023 12:34:32 -0700 Subject: [PATCH] Disable IO tracing --- eth/tracers/api.go | 4 +++- eth/tracers/api_test.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 36a2785b6f..198d8623e2 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -74,6 +74,8 @@ const ( var defaultBorTraceEnabled = newBoolPtr(false) +var allowIOTracing = false // Change this to true to enable IO tracing for debugging + // Backend interface provides the common API services (that are provided by // both full and light clients) with access to necessary functions. type Backend interface { @@ -719,7 +721,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac } ioflag := defaultIOFlag - if config != nil && config.IOFlag != nil { + if allowIOTracing && config != nil && config.IOFlag != nil { ioflag = *config.IOFlag } diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index 653b50d349..b7207b5b81 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -449,6 +449,8 @@ func TestIOdump(t *testing.T) { } })) + allowIOTracing = true + ioflag := new(bool) *ioflag = true