diff --git a/configs/config.go b/configs/config.go index cef29de..35f4731 100644 --- a/configs/config.go +++ b/configs/config.go @@ -72,6 +72,7 @@ type Config struct { RPCNumParallelCalls uint64 `env:"RPC_NUM_PARALLEL_CALLS" envDefault:"20"` RPCBatchSize uint64 `env:"RPC_BATCH_SIZE" envDefault:"10"` RPCBatchMaxMemoryUsageMB uint64 `env:"RPC_BATCH_MAX_MEMORY_USAGE_MB" envDefault:"32"` + RPCDisableBlockReceipts bool `env:"RPC_DISABLE_BLOCK_RECEIPTS" envDefault:"false"` ParquetMaxFileSizeMB int64 `env:"PARQUET_MAX_FILE_SIZE_MB" envDefault:"512"` InsightServiceUrl string `env:"INSIGHT_SERVICE_URL" envDefault:"https://insight.thirdweb.com"` InsightServiceApiKey string `env:"INSIGHT_SERVICE_API_KEY"` diff --git a/internal/rpc/rpc.go b/internal/rpc/rpc.go index e8c8acf..4d807e4 100644 --- a/internal/rpc/rpc.go +++ b/internal/rpc/rpc.go @@ -181,6 +181,11 @@ func (rpc *Client) checkGetBlockByNumberSupport() error { } func (rpc *Client) checkGetBlockReceiptsSupport() error { + if config.Cfg.RPCDisableBlockReceipts { + rpc.supportsBlockReceipts = false + log.Warn().Msg("eth_getBlockReceipts method disabled by config") + return nil + } // Always probe to see if the method is supported var getBlockReceiptsResult interface{} receiptsErr := rpc.RPCClient.Call(&getBlockReceiptsResult, "eth_getBlockReceipts", "latest")