Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions book/src/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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).
Expand All @@ -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).
Expand Down
9 changes: 9 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down