optimism icon indicating copy to clipboard operation
optimism copied to clipboard

`waitForMessageStatus` queries from genesis to latest (server error)

Open ratankaliani opened this issue 2 years ago • 3 comments

I'm currently working with the Optimism SDK to prove withdrawals that I've initiated from a smart contract on Optimism.

When I'm calling waitForMessageStatus on the CrossChainMessenger with my own RPC URL, I get the following error: '{"jsonrpc":"2.0","error":{"code":-32600,"message":"block range is too wide"},"id":null}' as the SDK is querying for blocks from genesis to latest.

It would be great if the queryFilter below could be limited to querying over events from the past day (or a similar timeframe), so that user-defined RPCs don't error.

Ex. messenger.filters.RelayedMessage(messageHash, 100, 'latest')

https://github.com/ethereum-optimism/optimism/blob/3589cb98522481d4a9cda0b58ca042d495a6e173/packages/sdk/src/cross-chain-messenger.ts#L734-L736

ratankaliani avatar Jun 21 '23 04:06 ratankaliani

Note: This is a problem for Ankr RPC's specifically, works as intended on Alchemy RPC's.

ratankaliani avatar Jun 21 '23 17:06 ratankaliani

It would be nice to have a generic chunker and then allow the user to specify the start and the end with sane defaults

tynes avatar Jun 24 '23 02:06 tynes

Yeah this needs to be improved in the SDK generally, unfortunately.

smartcontracts avatar Feb 05 '24 01:02 smartcontracts

The sdk has been deprecated

tynes avatar Jun 17 '24 21:06 tynes