diff --git a/crates/consensus/debug-client/src/providers/etherscan.rs b/crates/consensus/debug-client/src/providers/etherscan.rs index d3167b6cfab1..06dfdabbc425 100644 --- a/crates/consensus/debug-client/src/providers/etherscan.rs +++ b/crates/consensus/debug-client/src/providers/etherscan.rs @@ -32,13 +32,17 @@ impl EtherscanBlockProvider { /// `BlockNumberOrTag::Earliest`, `BlockNumberOrTag::Pending`, `BlockNumberOrTag::Number(u64)` /// are supported. pub async fn load_block(&self, block_number_or_tag: BlockNumberOrTag) -> eyre::Result { + let tag = match block_number_or_tag { + BlockNumberOrTag::Number(num) => format!("{num:#02x}"), + tag => tag.to_string(), + }; let block: EtherscanBlockResponse = self .http_client .get(&self.base_url) .query(&[ ("module", "proxy"), ("action", "eth_getBlockByNumber"), - ("tag", &block_number_or_tag.to_string()), + ("tag", &tag), ("boolean", "true"), ("apikey", &self.api_key), ])