Open
Description
The most recent blocks are not automatically the most representative of the future performance of the chain. In the case of the agoric mainnet chain for example, we're seeing somewhat cyclic performance degradation with a primary interval of 7.2 days (and a secondary interval of 1.6 days).
The primary use case is to estimate the expected time of a future block.
The existing -height
command line option would accept an -offset
argument that would be parsed as a date/time offset (e.g. 7d
). In that case the tool should estimate the time of the requested block (breq
) based on the timings of the blocks starting at the given offest
:
- query the chain's current block (
bcur
) height and time. - search for the first block (
bz
) with atime >= bcur.time - offset
.- Unfortunately it seems that
block.time
is not indexed because theblock_search
RPC endpoint does not return any value forquery="block.time >= TIME 2024-12-31T01:40:00Z"
, which should the right syntax so we may need to do a binary search (likely weighted by the calculated average block time between intermediate results of the search)
- Unfortunately it seems that
- Let
range = breq.height - bcur.height
- If
bcur.height - bz.height < range
, updatebz
info with block query forheight = bcur.height - range
- If
- Query
bt
block info fromheight = bz.height + range
- Let
time_delta = bt.time - bz.time
The estimated breq.time = bcur.time + time_delta
Metadata
Metadata
Assignees
Labels
No labels