Add design proposal and update validator-timestamp-oracle
This commit is contained in:
committed by
Michael Vines
parent
3a1e125ce3
commit
a3912bc084
@@ -48,19 +48,11 @@ Vote vector (`Vote::slots.iter().max()`). It is signed by the validator's
|
||||
identity keypair as a usual Vote. In order to enable this reporting, the Vote
|
||||
struct needs to be extended to include a timestamp field, `timestamp: Option<UnixTimestamp>`, which will be set to `None` in most Votes.
|
||||
|
||||
This proposal suggests that Vote instructions with `Some(timestamp)` be issued
|
||||
every 30min, which should be short enough to prevent block times drifting very
|
||||
much, without adding too much transaction overhead to the cluster. Validators
|
||||
can convert this time to a slot interval using the `slots_per_year` value that
|
||||
is stored in each bank.
|
||||
|
||||
```text
|
||||
let seconds_in_30min = 1800;
|
||||
let timestamp_interval = (slots_per_year / SECONDS_PER_YEAR) * seconds_in_30min;
|
||||
```
|
||||
|
||||
Votes with `Some(timestamp)` should be triggered in `replay_stage::handle_votable_bank()`
|
||||
when `bank.slot() % timestamp_interval == 0`.
|
||||
As of https://github.com/solana-labs/solana/pull/10630, validators submit a
|
||||
timestamp every vote. This enables implementation of a block time caching
|
||||
service that allows nodes to calculate the estimated timestamp immediately after
|
||||
the block is rooted, and cache that value in Blockstore. This provides
|
||||
persistent data and quick queries, while still meeting requirement 1) above.
|
||||
|
||||
### Vote Accounts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user