Skip to content

Commit

Permalink
extract genesis-config crate
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Dec 5, 2024
1 parent 926c175 commit eb73002
Show file tree
Hide file tree
Showing 11 changed files with 537 additions and 337 deletions.
33 changes: 33 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ solana-frozen-abi-macro = { path = "sdk/frozen-abi/macro", version = "=2.2.0" }
solana-tps-client = { path = "tps-client", version = "=2.2.0" }
solana-file-download = { path = "sdk/file-download", version = "=2.2.0" }
solana-genesis = { path = "genesis", version = "=2.2.0" }
solana-genesis-config = { path = "sdk/genesis-config", version = "=2.2.0" }
solana-genesis-utils = { path = "genesis-utils", version = "=2.2.0" }
agave-geyser-plugin-interface = { path = "geyser-plugin-interface", version = "=2.2.0" }
solana-geyser-plugin-manager = { path = "geyser-plugin-manager", version = "=2.2.0" }
Expand Down
29 changes: 29 additions & 0 deletions programs/sbf/Cargo.lock

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

3 changes: 3 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ full = [
"dep:solana-ed25519-program",
"dep:solana-compute-budget-interface",
"dep:solana-keypair",
"dep:solana-genesis-config",
"dep:solana-precompile-error",
"dep:solana-precompiles",
"dep:solana-presigner",
Expand Down Expand Up @@ -73,6 +74,7 @@ frozen-abi = [
"solana-fee-structure/frozen-abi",
"solana-account/frozen-abi",
"solana-cluster-type/frozen-abi",
"solana-genesis-config/frozen-abi",
"solana-inflation/frozen-abi",
"solana-poh-config/frozen-abi",
"solana-program/frozen-abi",
Expand Down Expand Up @@ -140,6 +142,7 @@ solana-frozen-abi = { workspace = true, optional = true, features = [
solana-frozen-abi-macro = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-genesis-config = { workspace = true, optional = true, features = ["bincode"] }
solana-inflation = { workspace = true, features = ["serde"] }
solana-instruction = { workspace = true }
solana-keypair = { workspace = true, optional = true, features = [
Expand Down
88 changes: 88 additions & 0 deletions sdk/genesis-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[package]
name = "solana-genesis-config"
description = "Solana genesis config."
documentation = "https://docs.rs/solana-genesis-config"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
all-features = true
rustdoc-args = ["--cfg=docsrs"]

[dependencies]
bincode = { workspace = true, optional = true }
byteorder = { workspace = true }
chrono = { workspace = true, features = ["alloc"], optional = true }
memmap2 = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
solana-account = { workspace = true }
solana-clock = { workspace = true }
solana-cluster-type = { workspace = true }
solana-epoch-schedule = { workspace = true }
solana-fee-calculator = { workspace = true }
solana-frozen-abi = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-frozen-abi-macro = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-hash = { workspace = true }
solana-inflation = { workspace = true }
solana-keypair = { workspace = true }
solana-logger = { workspace = true, optional = true }
solana-native-token = { workspace = true, optional = true }
solana-poh-config = { workspace = true }
solana-pubkey = { workspace = true }
solana-rent = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-sha256-hasher = { workspace = true }
solana-signer = { workspace = true }
solana-time-utils = { workspace = true }

[dev-dependencies]
solana-genesis-config = { path = ".", features = ["dev-context-only-utils"] }
solana-pubkey = { workspace = true, features = ["rand"] }

[features]
bincode = [
"dep:bincode",
"dep:chrono",
"dep:memmap2",
"dep:solana-native-token",
"serde",
]
dev-context-only-utils = ["bincode"]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"dep:solana-logger",
"solana-account/frozen-abi",
"solana-cluster-type/frozen-abi",
"solana-epoch-schedule/frozen-abi",
"solana-fee-calculator/frozen-abi",
"solana-inflation/frozen-abi",
"solana-poh-config/frozen-abi",
"solana-pubkey/frozen-abi",
"solana-rent/frozen-abi",
]
serde = [
"dep:serde",
"dep:serde_derive",
"solana-account/serde",
"solana-cluster-type/serde",
"solana-epoch-schedule/serde",
"solana-fee-calculator/serde",
"solana-inflation/serde",
"solana-poh-config/serde",
"solana-pubkey/serde",
"solana-rent/serde",
]

[lints]
workspace = true
12 changes: 7 additions & 5 deletions sdk/src/hard_forks.rs → sdk/genesis-config/src/hard_forks.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
//! The list of slot boundaries at which a hard fork should
//! occur.
#![cfg(feature = "full")]

use {
byteorder::{ByteOrder, LittleEndian},
solana_sdk::clock::Slot,
solana_clock::Slot,
};

#[cfg_attr(feature = "frozen-abi", derive(AbiExample))]
#[derive(Default, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Deserialize, serde_derive::Serialize)
)]
#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct HardForks {
hard_forks: Vec<(Slot, usize)>,
}
Expand Down
Loading

0 comments on commit eb73002

Please sign in to comment.