matter-labs / block-explorer

zkSync Era Block Explorer
Apache License 2.0
123 stars 104 forks source link

API Compatibility: getLogs requires an address, while Etherscan API doesn't #194

Open kunalmodi opened 6 months ago

kunalmodi commented 6 months ago

🐛 Bug Report

📝 Description

The Get Logs endpoint (https://block-explorer-api.mainnet.zksync.io/docs#/Logs%20API/ApiController_getLogs) requires an address. On the Etherscan family of APIs, address is optional (example query)

Querying without an address is useful when I'm looking for logs from proxy contracts, where the cardinality of contracts is extremely high (or maybe even unknown)

🔄 Reproduction Steps

Query I would have expected to work: https://block-explorer-api.mainnet.zksync.io/api?&module=logs&action=getLogs&offset=1000&fromBlock=12689376&toBlock=12788055&topic0=0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8

Currently throws: {"status":"0","message":"NOTOK","result":"Error! Invalid address format"}

🤔 Expected Behavior

😯 Current Behavior

🖥️ Environment

📋 Additional Context