You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.
External RPC scripts interested in blocks in some date range have to either play a binary search game trying to figure out the block ID that corresponds to a given date/time, or fetch a conservatively large number of blocks, many of which will end up being ignored.
So we need an RPC that takes a date/time and converts it to the block ID and height of the first block after that date/time.
The text was updated successfully, but these errors were encountered:
@pmconrad This is low priority but you might want to consider optimizing this for the case when we have chain_interface::get_statistics_enabled() is true, because then you should be able to do a lower bound on chain_database_impl::_slot_index_to_record or chain_database_impl::_slot_timestamp_to_delegate with the timestamp and (iterate backwards until you) find the first valid block ID.
But AFAICS statistics are disabled by default, and the method is (as of today) rarely called, and with 98% delegate participation it should converge in 3-4 steps as it is now - so I think that would be a case of premature optimization, and therefore I'd advise against it.
External RPC scripts interested in blocks in some date range have to either play a binary search game trying to figure out the block ID that corresponds to a given date/time, or fetch a conservatively large number of blocks, many of which will end up being ignored.
So we need an RPC that takes a date/time and converts it to the block ID and height of the first block after that date/time.
The text was updated successfully, but these errors were encountered: