flow-go-sdk icon indicating copy to clipboard operation
flow-go-sdk copied to clipboard

Add support for querying blocks near a timestamp

Open jordancoblin opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. Would like to query chain state via ExecuteScript at the last block before a given timestamp. Currently, this involves finding the block corresponding to the desired timestamp on the application side.

Describe the solution you'd like GetBlockBeforeTimestamp and GetBlockAfterTimestamp endpoints. Possibly even ExecuteScriptBeforeTimestamp/ExecuteScriptAfterTimestamp.

Describe alternatives you've considered Current alternative I'm using is performing a binary search from latest block to 0 in order to find the block just before a timestamp. However, this pushes extra processing/complexity to the application.

Additional context

jordancoblin avatar Aug 04 '20 18:08 jordancoblin

This issue should be moved to the flow-go AN repository since the SDK can not implement such a feature if the AN doesn't support it.

devbugging avatar Feb 23 '22 13:02 devbugging

Unlikely to be implemented in Go SDK. Usage of archive node would be appropriate.

devbugging avatar Mar 30 '23 12:03 devbugging