Add bank timestamp bounding (bp #13120) (#13331)

* Add bounding feature

(cherry picked from commit 96b8aa8bd1)

* Repurpose unused as Clock::epoch_start_timestamp; add gated update

(cherry picked from commit 0049ab69fb)

* Add bounded timestamp-estimation method

(cherry picked from commit 80db6c0980)

* Use bounded timestamp-correction when feature enabled

(cherry picked from commit 90778615f6)

* Prevent block times from ever going backward

(cherry picked from commit eb2560e782)

* Sample votes from ancestors back to root

(cherry picked from commit 4260b3b416)

* Add Clock sysvar details, update struct docs

(cherry picked from commit 3a1e125ce3)

* Add design proposal and update validator-timestamp-oracle

(cherry picked from commit a3912bc084)

* Adapt to feature::create_account

Co-authored-by: Tyera Eulberg <tyera@solana.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2020-11-01 06:02:34 +00:00
committed by GitHub
parent b6dc48da75
commit b28d10d46f
9 changed files with 795 additions and 52 deletions

View File

@@ -79,14 +79,15 @@ pub type UnixTimestamp = i64;
pub struct Clock {
/// the current network/bank Slot
pub slot: Slot,
/// unused
pub unused: u64,
/// the timestamp of the first Slot in this Epoch
pub epoch_start_timestamp: UnixTimestamp,
/// the bank Epoch
pub epoch: Epoch,
/// the future Epoch for which the leader schedule has
/// most recently been calculated
pub leader_schedule_epoch: Epoch,
/// computed from genesis creation time and network time
/// in slots, drifts!
/// originally computed from genesis creation time and network time
/// in slots (drifty); corrected using validator timestamp oracle as of
/// timestamp_correction and timestamp_bounding features
pub unix_timestamp: UnixTimestamp,
}