Skip to content

Commit 19296e1

Browse files
authored
disable block receipts flag (#309)
1 parent 655c22b commit 19296e1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

configs/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ type Config struct {
7272
RPCNumParallelCalls uint64 `env:"RPC_NUM_PARALLEL_CALLS" envDefault:"20"`
7373
RPCBatchSize uint64 `env:"RPC_BATCH_SIZE" envDefault:"10"`
7474
RPCBatchMaxMemoryUsageMB uint64 `env:"RPC_BATCH_MAX_MEMORY_USAGE_MB" envDefault:"32"`
75+
RPCDisableBlockReceipts bool `env:"RPC_DISABLE_BLOCK_RECEIPTS" envDefault:"false"`
7576
ParquetMaxFileSizeMB int64 `env:"PARQUET_MAX_FILE_SIZE_MB" envDefault:"512"`
7677
InsightServiceUrl string `env:"INSIGHT_SERVICE_URL" envDefault:"https://insight.thirdweb.com"`
7778
InsightServiceApiKey string `env:"INSIGHT_SERVICE_API_KEY"`

internal/rpc/rpc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ func (rpc *Client) checkGetBlockByNumberSupport() error {
181181
}
182182

183183
func (rpc *Client) checkGetBlockReceiptsSupport() error {
184+
if config.Cfg.RPCDisableBlockReceipts {
185+
rpc.supportsBlockReceipts = false
186+
log.Warn().Msg("eth_getBlockReceipts method disabled by config")
187+
return nil
188+
}
184189
// Always probe to see if the method is supported
185190
var getBlockReceiptsResult interface{}
186191
receiptsErr := rpc.RPCClient.Call(&getBlockReceiptsResult, "eth_getBlockReceipts", "latest")

0 commit comments

Comments
 (0)