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 }}
Repository navigation
feat: interpolate Bitcoin block times of past schedule points no Stacks block anchored to - #2720
Schedule points on past Bitcoin blocks that no canonical Stacks block anchored to (e.g. missed sortitions) now return an estimated time / time_iso in bond and PoX cycle schedules, interpolated between the nearest anchored blocks before and after them, instead of null; projected_time stays reserved for future blocks.
Sample responses from a seeded fixture (Stacks blocks anchored only to Bitcoin heights 150 and 160, test block times at 9-minute spacing, so 155 and 159 are interpolated):
GET /extended/v3/staking/bonds/0 (schedule excerpt)
Clarify OpenAPI description for header times versus estimates
src/api/schemas/v3/entities/common.ts:118
The opening sentence says every time value was recorded in a Bitcoin header, but this field now also contains synthesized timestamps, as the following sentence acknowledges. This makes the public OpenAPI description contradictory; distinguish exact anchored header times from interpolated estimates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Schedule points on past Bitcoin blocks that no canonical Stacks block anchored to (e.g. missed sortitions) now return an estimated
time/time_isoin bond and PoX cycle schedules, interpolated between the nearest anchored blocks before and after them, instead ofnull;projected_timestays reserved for future blocks.Sample responses from a seeded fixture (Stacks blocks anchored only to Bitcoin heights 150 and 160, test block times at 9-minute spacing, so 155 and 159 are interpolated):
GET /extended/v3/staking/bonds/0(schedule excerpt){ "index": 0, "schedule": { "enrollment_cutoff": { "bitcoin_height": 155, "pox_cycle": 7, "time": 1700083700, "time_iso": "2023-11-15T21:28:20.000Z", "projected_time": null, "projected_time_iso": null }, "activation": { "bitcoin_height": 160, "pox_cycle": 8, "time": 1700086400, "time_iso": "2023-11-15T22:13:20.000Z", "projected_time": null, "projected_time_iso": null }, "unlock": { "bitcoin_height": 410, "pox_cycle": 20, "time": null, "time_iso": null, "projected_time": 1700221400, "projected_time_iso": "2023-11-17T11:43:20.000Z" } } }GET /extended/v3/staking/cycles/7(schedule excerpt; 140 predates every Stacks block, so it staysnull){ "number": 7, "status": "finished", "schedule": { "start": { "bitcoin_height": 140, "time": null, "time_iso": null, "projected_time": null, "projected_time_iso": null }, "prepare_phase_start": { "bitcoin_height": 155, "time": 1700083700, "time_iso": "2023-11-15T21:28:20.000Z", "projected_time": null, "projected_time_iso": null }, "end": { "bitcoin_height": 159, "time": 1700085860, "time_iso": "2023-11-15T22:04:20.000Z", "projected_time": null, "projected_time_iso": null } } }