diff --git a/docs/src/developing/runtime-facilities/sysvars.md b/docs/src/developing/runtime-facilities/sysvars.md index a72929a68..3b5ed443a 100644 --- a/docs/src/developing/runtime-facilities/sysvars.md +++ b/docs/src/developing/runtime-facilities/sysvars.md @@ -97,7 +97,9 @@ other instructions in the same transaction. Read more information on ## RecentBlockhashes The RecentBlockhashes sysvar contains the active recent blockhashes as well as -their associated fee calculators. It is updated every slot. +their associated fee calculators. It is updated every slot. Entries are ordered +by descending block height, so the first entry holds the most recent block hash, +and the last entry holds an old block hash. - Address: `SysvarRecentB1ockHashes11111111111111111111` - Layout: diff --git a/sdk/program/src/sysvar/recent_blockhashes.rs b/sdk/program/src/sysvar/recent_blockhashes.rs index 93fee5e4d..00f822c74 100644 --- a/sdk/program/src/sysvar/recent_blockhashes.rs +++ b/sdk/program/src/sysvar/recent_blockhashes.rs @@ -53,6 +53,10 @@ impl<'a> PartialOrd for IterItem<'a> { } } +/// Contains recent block hashes and fee calculators. +/// +/// The entries are ordered by descending block height, so the first entry holds +/// the most recent block hash, and the last entry holds an old block hash. #[repr(C)] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] pub struct RecentBlockhashes(Vec);