diff --git a/book/src/terminology.md b/book/src/terminology.md index cea37ba36f..6d3ad70ab7 100644 --- a/book/src/terminology.md +++ b/book/src/terminology.md @@ -20,7 +20,7 @@ A contiguous set of [entries](terminology.md#entry) on the ledger covered by a [ ## block height -The number of [blocks](terminology.md#block) beneath the current block. The first block after the [genesis block](terminology.md#genesis-block) has height zero. +The number of [blocks](terminology.md#block) beneath the current block. The first block after the [genesis block](terminology.md#genesis-block) has height one. ## block id @@ -96,7 +96,11 @@ A [ledger](terminology.md#ledger) derived from common entries but then diverged. ## genesis block -The configuration file that prepares the [ledger](terminology.md#ledger) for the first [block](terminology.md#block). +The first [block](terminology.md#block) in the chain. + +## genesis config + +The configuration file that prepares the [ledger](terminology.md#ledger) for the [genesis block](terminology.md#genesis-block). ## hash @@ -114,10 +118,6 @@ A [public key](terminology.md#public-key) and corresponding [private key](termin A fractional [native token](terminology.md#native-token) with the value of 0.000000001 [sol](terminology.md#sol). -## loader - -A [program](terminology.md#program) with the ability to interpret the binary encoding of other on-chain programs. - ## leader The role of a [validator](terminology.md#validator) when it is appending [entries](terminology.md#entry) to the [ledger](terminology.md#ledger). @@ -142,6 +142,10 @@ A [hash](terminology.md#hash) of the [validator's state](terminology.md#bank-sta A type of [client](terminology.md#client) that can verify it's pointing to a valid [cluster](terminology.md#cluster). It performs more ledger verification than a [thin client](terminology.md#thin-client) and less than a [validator](terminology.md#validator). +## loader + +A [program](terminology.md#program) with the ability to interpret the binary encoding of other on-chain programs. + ## lockout The duration of time for which a [validator](terminology.md#validator) is unable to [vote](terminology.md#ledger-vote) on another [fork](terminology.md#fork). diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index a2f9a61ef0..f7988a4da4 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -1682,6 +1682,15 @@ mod tests { assert_eq!(rent.lamports_per_byte_year, 5); } + #[test] + fn test_bank_block_height() { + let (genesis_block, _mint_keypair) = create_genesis_block(1); + let bank0 = Arc::new(Bank::new(&genesis_block)); + assert_eq!(bank0.block_height(), 0); + let bank1 = Arc::new(new_from_parent(&bank0)); + assert_eq!(bank1.block_height(), 1); + } + #[test] fn test_bank_capitalization() { let bank = Arc::new(Bank::new(&GenesisBlock {