Skip to content
Closed
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
138 changes: 137 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ base64 = "0.22.1"
bencher = "0.1.5"
bincode = "1.3.3"
bitflags = { version = "2.9.3" }
bitvec = { version = "1.0.1", features = ["serde"] }
blake3 = "1.8.2"
borsh = { version = "1.5.7", features = ["derive", "unstable__schema"] }
bs58 = { version = "0.5.1", default-features = false }
Expand Down Expand Up @@ -385,6 +386,7 @@ solana-big-mod-exp = "3.0.0"
solana-bincode = "3.0.0"
solana-blake3-hasher = "3.0.0"
solana-bloom = { path = "bloom", version = "=3.1.0" }
solana-bls-signatures = { version = "0.2.0", features = ["serde"] }
solana-bn254 = "3.0.0"
solana-borsh = "3.0.0"
solana-bpf-loader-program = { path = "programs/bpf_loader", version = "=3.1.0" }
Expand Down Expand Up @@ -511,6 +513,7 @@ solana-short-vec = "3.0.0"
solana-shred-version = "3.0.0"
solana-signature = { version = "3.1.0", default-features = false }
solana-signer = "3.0.0"
solana-signer-store = "0.1.0"
solana-slot-hashes = "3.0.0"
solana-slot-history = "3.0.0"
solana-stable-layout = "3.0.0"
Expand Down Expand Up @@ -554,6 +557,7 @@ solana-version = { path = "version", version = "=3.1.0" }
solana-vote = { path = "vote", version = "=3.1.0" }
solana-vote-interface = "3.0.0"
solana-vote-program = { path = "programs/vote", version = "=3.1.0", default-features = false }
solana-votor-messages = { path = "votor-messages", version = "=3.1.0" }
solana-wen-restart = { path = "wen-restart", version = "=3.1.0" }
solana-zk-elgamal-proof-program = { path = "programs/zk-elgamal-proof", version = "=3.1.0" }
solana-zk-sdk = "4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion ci/test-miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source ci/rust-version.sh nightly
_ cargo "+${rust_nightly}" miri test -p solana-unified-scheduler-logic

# test big endian branch
_ cargo "+${rust_nightly}" miri test --target s390x-unknown-linux-gnu -p solana-vote -- "vote_state_view" --skip "arbitrary"
_ cargo "+${rust_nightly}" miri test --target s390x-unknown-linux-gnu --no-default-features --features miri -p solana-vote -- "vote_state_view" --skip "arbitrary"
# test little endian branch for UB
_ cargo "+${rust_nightly}" miri test -p solana-vote -- "vote_state_view" --skip "arbitrary"

Expand Down
1 change: 1 addition & 0 deletions ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ solana-transaction-error = { workspace = true }
solana-transaction-status = { workspace = true }
solana-vote = { workspace = true }
solana-vote-program = { workspace = true }
solana-votor-messages = { workspace = true }
static_assertions = { workspace = true }
strum = { workspace = true, features = ["derive"] }
strum_macros = { workspace = true }
Expand Down
21 changes: 21 additions & 0 deletions ledger/src/leader_schedule_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ pub fn first_of_consecutive_leader_slots(slot: Slot) -> Slot {
(slot / NUM_CONSECUTIVE_LEADER_SLOTS) * NUM_CONSECUTIVE_LEADER_SLOTS
}

/// Returns the last slot in the leader window that contains `slot`
#[inline]
pub fn last_of_consecutive_leader_slots(slot: Slot) -> Slot {
first_of_consecutive_leader_slots(slot) + NUM_CONSECUTIVE_LEADER_SLOTS - 1
}

/// Returns the index within the leader slot range that contains `slot`
#[inline]
pub fn leader_slot_index(slot: Slot) -> usize {
(slot % NUM_CONSECUTIVE_LEADER_SLOTS) as usize
}

/// Returns the number of slots left after `slot` in the leader window
/// that contains `slot`
#[inline]
pub fn remaining_slots_in_window(slot: Slot) -> u64 {
NUM_CONSECUTIVE_LEADER_SLOTS
.checked_sub(leader_slot_index(slot) as u64)
.unwrap()
}

#[cfg(test)]
mod tests {
use {
Expand Down
2 changes: 2 additions & 0 deletions local-cluster/src/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ impl LocalCluster {
node_keypair: node_keypair.insecure_clone(),
vote_keypair: vote_keypair.insecure_clone(),
stake_keypair: Keypair::new(),
bls_keypair: None,
},
stake,
))
Expand Down Expand Up @@ -314,6 +315,7 @@ impl LocalCluster {
&keys_in_genesis,
stakes_in_genesis,
config.cluster_type,
false,
);
genesis_config.accounts.extend(
config
Expand Down
1 change: 1 addition & 0 deletions program-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ impl ProgramTest {
rent.clone(),
ClusterType::Development,
std::mem::take(&mut self.genesis_accounts),
None,
);

// Remove features tagged to deactivate
Expand Down
Loading
Loading