Advertise node software version in gossip (#9981)
* Advertise node version in gossip * Remove solana_clap_utils::version! macro
This commit is contained in:
29
Cargo.lock
generated
29
Cargo.lock
generated
@ -3700,6 +3700,7 @@ dependencies = [
|
|||||||
"solana-metrics",
|
"solana-metrics",
|
||||||
"solana-net-utils",
|
"solana-net-utils",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3790,6 +3791,7 @@ dependencies = [
|
|||||||
"solana-net-utils",
|
"solana-net-utils",
|
||||||
"solana-runtime",
|
"solana-runtime",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3801,6 +3803,7 @@ dependencies = [
|
|||||||
"solana-logger",
|
"solana-logger",
|
||||||
"solana-net-utils",
|
"solana-net-utils",
|
||||||
"solana-streamer",
|
"solana-streamer",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3829,6 +3832,7 @@ dependencies = [
|
|||||||
"solana-net-utils",
|
"solana-net-utils",
|
||||||
"solana-runtime",
|
"solana-runtime",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3966,6 +3970,7 @@ dependencies = [
|
|||||||
"solana-stake-program",
|
"solana-stake-program",
|
||||||
"solana-storage-program",
|
"solana-storage-program",
|
||||||
"solana-transaction-status",
|
"solana-transaction-status",
|
||||||
|
"solana-version",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"solana-vote-signer",
|
"solana-vote-signer",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
@ -4081,6 +4086,7 @@ dependencies = [
|
|||||||
"solana-streamer",
|
"solana-streamer",
|
||||||
"solana-sys-tuner",
|
"solana-sys-tuner",
|
||||||
"solana-transaction-status",
|
"solana-transaction-status",
|
||||||
|
"solana-version",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"solana-vote-signer",
|
"solana-vote-signer",
|
||||||
"systemstat",
|
"systemstat",
|
||||||
@ -4131,6 +4137,7 @@ dependencies = [
|
|||||||
"solana-net-utils",
|
"solana-net-utils",
|
||||||
"solana-runtime",
|
"solana-runtime",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4187,6 +4194,7 @@ dependencies = [
|
|||||||
"solana-logger",
|
"solana-logger",
|
||||||
"solana-metrics",
|
"solana-metrics",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
"tokio 0.1.22",
|
"tokio 0.1.22",
|
||||||
"tokio-codec",
|
"tokio-codec",
|
||||||
]
|
]
|
||||||
@ -4208,6 +4216,7 @@ dependencies = [
|
|||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"solana-stake-program",
|
"solana-stake-program",
|
||||||
"solana-storage-program",
|
"solana-storage-program",
|
||||||
|
"solana-version",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
@ -4237,6 +4246,7 @@ dependencies = [
|
|||||||
"solana-logger",
|
"solana-logger",
|
||||||
"solana-net-utils",
|
"solana-net-utils",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4264,6 +4274,7 @@ dependencies = [
|
|||||||
"solana-config-program",
|
"solana-config-program",
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
"tar",
|
"tar",
|
||||||
"tempdir",
|
"tempdir",
|
||||||
"url 2.1.1",
|
"url 2.1.1",
|
||||||
@ -4283,6 +4294,7 @@ dependencies = [
|
|||||||
"solana-cli-config",
|
"solana-cli-config",
|
||||||
"solana-remote-wallet",
|
"solana-remote-wallet",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
"tiny-bip39",
|
"tiny-bip39",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -4353,6 +4365,7 @@ dependencies = [
|
|||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"solana-stake-program",
|
"solana-stake-program",
|
||||||
"solana-transaction-status",
|
"solana-transaction-status",
|
||||||
|
"solana-version",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
@ -4410,6 +4423,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4512,6 +4526,7 @@ dependencies = [
|
|||||||
"socket2",
|
"socket2",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
|
"solana-version",
|
||||||
"tokio 0.1.22",
|
"tokio 0.1.22",
|
||||||
"tokio-codec",
|
"tokio-codec",
|
||||||
]
|
]
|
||||||
@ -4742,6 +4757,7 @@ dependencies = [
|
|||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"solana-stake-program",
|
"solana-stake-program",
|
||||||
"solana-transaction-status",
|
"solana-transaction-status",
|
||||||
|
"solana-version",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -4804,6 +4820,7 @@ dependencies = [
|
|||||||
"nix",
|
"nix",
|
||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
|
"solana-version",
|
||||||
"sysctl",
|
"sysctl",
|
||||||
"unix_socket2",
|
"unix_socket2",
|
||||||
"users",
|
"users",
|
||||||
@ -4852,10 +4869,20 @@ dependencies = [
|
|||||||
"solana-perf",
|
"solana-perf",
|
||||||
"solana-runtime",
|
"solana-runtime",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
"solana-vote-signer",
|
"solana-vote-signer",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "solana-version"
|
||||||
|
version = "1.2.0"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"solana-sdk",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-vest-program"
|
name = "solana-vest-program"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@ -4900,6 +4927,7 @@ dependencies = [
|
|||||||
"solana-clap-utils",
|
"solana-clap-utils",
|
||||||
"solana-metrics",
|
"solana-metrics",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
|
"solana-version",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4919,6 +4947,7 @@ dependencies = [
|
|||||||
"solana-metrics",
|
"solana-metrics",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"solana-transaction-status",
|
"solana-transaction-status",
|
||||||
|
"solana-version",
|
||||||
"solana-vote-program",
|
"solana-vote-program",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ members = [
|
|||||||
"transaction-status",
|
"transaction-status",
|
||||||
"upload-perf",
|
"upload-perf",
|
||||||
"net-utils",
|
"net-utils",
|
||||||
|
"version",
|
||||||
"vote-signer",
|
"vote-signer",
|
||||||
"cli",
|
"cli",
|
||||||
"rayon-threadlimit",
|
"rayon-threadlimit",
|
||||||
|
@ -17,7 +17,7 @@ solana-metrics = { path = "../metrics", version = "1.2.0" }
|
|||||||
solana-archiver-lib = { path = "../archiver-lib", version = "1.2.0" }
|
solana-archiver-lib = { path = "../archiver-lib", version = "1.2.0" }
|
||||||
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
@ -24,7 +24,7 @@ fn main() {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("identity_keypair")
|
Arg::with_name("identity_keypair")
|
||||||
.short("i")
|
.short("i")
|
||||||
@ -105,7 +105,7 @@ fn main() {
|
|||||||
println!(
|
println!(
|
||||||
"{} version {} (branch={}, commit={})",
|
"{} version {} (branch={}, commit={})",
|
||||||
style(crate_name!()).bold(),
|
style(crate_name!()).bold(),
|
||||||
solana_clap_utils::version!(),
|
solana_version::version!(),
|
||||||
option_env!("CI_BRANCH").unwrap_or("unknown"),
|
option_env!("CI_BRANCH").unwrap_or("unknown"),
|
||||||
option_env!("CI_COMMIT").unwrap_or("unknown")
|
option_env!("CI_COMMIT").unwrap_or("unknown")
|
||||||
);
|
);
|
||||||
|
@ -29,6 +29,7 @@ solana-metrics = { path = "../metrics", version = "1.2.0" }
|
|||||||
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
||||||
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
solana-local-cluster = { path = "../local-cluster", version = "1.2.0" }
|
solana-local-cluster = { path = "../local-cluster", version = "1.2.0" }
|
||||||
|
@ -11,7 +11,7 @@ fn main() {
|
|||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
solana_metrics::set_panic_hook("bench-exchange");
|
solana_metrics::set_panic_hook("bench-exchange");
|
||||||
|
|
||||||
let matches = cli::build_args(solana_clap_utils::version!()).get_matches();
|
let matches = cli::build_args(solana_version::version!()).get_matches();
|
||||||
let cli_config = cli::extract_args(&matches);
|
let cli_config = cli::extract_args(&matches);
|
||||||
|
|
||||||
let cli::Config {
|
let cli::Config {
|
||||||
|
@ -13,6 +13,7 @@ solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
|||||||
solana-streamer = { path = "../streamer", version = "1.2.0" }
|
solana-streamer = { path = "../streamer", version = "1.2.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
@ -52,7 +52,7 @@ fn main() -> Result<()> {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("num-recv-sockets")
|
Arg::with_name("num-recv-sockets")
|
||||||
.long("num-recv-sockets")
|
.long("num-recv-sockets")
|
||||||
|
@ -27,6 +27,7 @@ solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
|||||||
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
solana-move-loader-program = { path = "../programs/move_loader", version = "1.2.0", optional = true }
|
solana-move-loader-program = { path = "../programs/move_loader", version = "1.2.0", optional = true }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serial_test = "0.4.0"
|
serial_test = "0.4.0"
|
||||||
|
@ -15,7 +15,7 @@ fn main() {
|
|||||||
solana_logger::setup_with_default("solana=info");
|
solana_logger::setup_with_default("solana=info");
|
||||||
solana_metrics::set_panic_hook("bench-tps");
|
solana_metrics::set_panic_hook("bench-tps");
|
||||||
|
|
||||||
let matches = cli::build_args(solana_clap_utils::version!()).get_matches();
|
let matches = cli::build_args(solana_version::version!()).get_matches();
|
||||||
let cli_config = cli::extract_args(&matches);
|
let cli_config = cli::extract_args(&matches);
|
||||||
|
|
||||||
let cli::Config {
|
let cli::Config {
|
||||||
|
@ -1,24 +1,5 @@
|
|||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! version {
|
|
||||||
() => {
|
|
||||||
&*format!(
|
|
||||||
"{}{}",
|
|
||||||
env!("CARGO_PKG_VERSION"),
|
|
||||||
if option_env!("CI_TAG").unwrap_or("").is_empty() {
|
|
||||||
format!(
|
|
||||||
" [channel={} commit={}]",
|
|
||||||
option_env!("CHANNEL").unwrap_or("unknown"),
|
|
||||||
option_env!("CI_COMMIT").unwrap_or("unknown"),
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
"".to_string()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct ArgConstant<'a> {
|
pub struct ArgConstant<'a> {
|
||||||
pub long: &'a str,
|
pub long: &'a str,
|
||||||
pub name: &'a str,
|
pub name: &'a str,
|
||||||
|
@ -41,6 +41,7 @@ solana-sdk = { path = "../sdk", version = "1.2.0" }
|
|||||||
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
||||||
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
|
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
|
||||||
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
||||||
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
|
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
|
||||||
thiserror = "1.0.15"
|
thiserror = "1.0.15"
|
||||||
|
@ -156,7 +156,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
let matches = app(
|
let matches = app(
|
||||||
crate_name!(),
|
crate_name!(),
|
||||||
crate_description!(),
|
crate_description!(),
|
||||||
solana_clap_utils::version!(),
|
solana_version::version!(),
|
||||||
)
|
)
|
||||||
.arg({
|
.arg({
|
||||||
let arg = Arg::with_name("config_file")
|
let arg = Arg::with_name("config_file")
|
||||||
|
@ -61,6 +61,7 @@ solana-sdk = { path = "../sdk", version = "1.2.0" }
|
|||||||
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
||||||
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
|
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
|
||||||
solana-streamer = { path = "../streamer", version = "1.2.0" }
|
solana-streamer = { path = "../streamer", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
||||||
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
|
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
|
||||||
solana-sys-tuner = { path = "../sys-tuner", version = "1.2.0" }
|
solana-sys-tuner = { path = "../sys-tuner", version = "1.2.0" }
|
||||||
|
@ -18,8 +18,8 @@ use crate::{
|
|||||||
crds_gossip_error::CrdsGossipError,
|
crds_gossip_error::CrdsGossipError,
|
||||||
crds_gossip_pull::{CrdsFilter, CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS},
|
crds_gossip_pull::{CrdsFilter, CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS},
|
||||||
crds_value::{
|
crds_value::{
|
||||||
self, CrdsData, CrdsValue, CrdsValueLabel, EpochSlotsIndex, LowestSlot, SnapshotHash, Vote,
|
self, CrdsData, CrdsValue, CrdsValueLabel, EpochSlotsIndex, LowestSlot, SnapshotHash,
|
||||||
MAX_WALLCLOCK,
|
Version, Vote, MAX_WALLCLOCK,
|
||||||
},
|
},
|
||||||
epoch_slots::EpochSlots,
|
epoch_slots::EpochSlots,
|
||||||
result::{Error, Result},
|
result::{Error, Result},
|
||||||
@ -378,6 +378,7 @@ impl ClusterInfo {
|
|||||||
archivers += 1;
|
archivers += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let node_version = self.get_node_version(&node.id);
|
||||||
if my_shred_version != 0 && (node.shred_version != 0 && node.shred_version != my_shred_version) {
|
if my_shred_version != 0 && (node.shred_version != 0 && node.shred_version != my_shred_version) {
|
||||||
different_shred_nodes += 1;
|
different_shred_nodes += 1;
|
||||||
None
|
None
|
||||||
@ -393,10 +394,9 @@ impl ClusterInfo {
|
|||||||
"none".to_string()
|
"none".to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let ip_addr = node.gossip.ip();
|
let ip_addr = node.gossip.ip();
|
||||||
Some(format!(
|
Some(format!(
|
||||||
"{:15} {:2}| {:5} | {:44} | {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {}\n",
|
"{:15} {:2}| {:5} | {:44} |{:^15}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {:5}| {}\n",
|
||||||
if ContactInfo::is_valid_address(&node.gossip) {
|
if ContactInfo::is_valid_address(&node.gossip) {
|
||||||
ip_addr.to_string()
|
ip_addr.to_string()
|
||||||
} else {
|
} else {
|
||||||
@ -405,6 +405,11 @@ impl ClusterInfo {
|
|||||||
if node.id == my_pubkey { "me" } else { "" }.to_string(),
|
if node.id == my_pubkey { "me" } else { "" }.to_string(),
|
||||||
now.saturating_sub(last_updated),
|
now.saturating_sub(last_updated),
|
||||||
node.id.to_string(),
|
node.id.to_string(),
|
||||||
|
if let Some(node_version) = node_version {
|
||||||
|
node_version.to_string()
|
||||||
|
} else {
|
||||||
|
"-".to_string()
|
||||||
|
},
|
||||||
addr_to_string(&ip_addr, &node.gossip),
|
addr_to_string(&ip_addr, &node.gossip),
|
||||||
addr_to_string(&ip_addr, &node.tpu),
|
addr_to_string(&ip_addr, &node.tpu),
|
||||||
addr_to_string(&ip_addr, &node.tpu_forwards),
|
addr_to_string(&ip_addr, &node.tpu_forwards),
|
||||||
@ -412,7 +417,6 @@ impl ClusterInfo {
|
|||||||
addr_to_string(&ip_addr, &node.tvu_forwards),
|
addr_to_string(&ip_addr, &node.tvu_forwards),
|
||||||
addr_to_string(&ip_addr, &node.repair),
|
addr_to_string(&ip_addr, &node.repair),
|
||||||
addr_to_string(&ip_addr, &node.serve_repair),
|
addr_to_string(&ip_addr, &node.serve_repair),
|
||||||
addr_to_string(&ip_addr, &node.storage_addr),
|
|
||||||
addr_to_string(&ip_addr, &node.rpc),
|
addr_to_string(&ip_addr, &node.rpc),
|
||||||
addr_to_string(&ip_addr, &node.rpc_pubsub),
|
addr_to_string(&ip_addr, &node.rpc_pubsub),
|
||||||
node.shred_version,
|
node.shred_version,
|
||||||
@ -423,9 +427,9 @@ impl ClusterInfo {
|
|||||||
|
|
||||||
format!(
|
format!(
|
||||||
"IP Address |Age(ms)| Node identifier \
|
"IP Address |Age(ms)| Node identifier \
|
||||||
|Gossip| TPU |TPUfwd| TVU |TVUfwd|Repair|ServeR|Storag| RPC |PubSub|ShredVer\n\
|
| Version |Gossip| TPU |TPUfwd| TVU |TVUfwd|Repair|ServeR| RPC |PubSub|ShredVer\n\
|
||||||
------------------+-------+----------------------------------------------+\
|
------------------+-------+----------------------------------------------+---------------+\
|
||||||
------+------+------+------+------+------+------+------+------+------+--------\n\
|
------+------+------+------+------+------+------+------+------+--------\n\
|
||||||
{}\
|
{}\
|
||||||
Nodes: {}{}{}{}",
|
Nodes: {}{}{}{}",
|
||||||
nodes.join(""),
|
nodes.join(""),
|
||||||
@ -440,7 +444,7 @@ impl ClusterInfo {
|
|||||||
} else {
|
} else {
|
||||||
"".to_string()
|
"".to_string()
|
||||||
},
|
},
|
||||||
if spy_nodes > 0 {
|
if different_shred_nodes > 0 {
|
||||||
format!(
|
format!(
|
||||||
"\nNodes with different shred version: {}",
|
"\nNodes with different shred version: {}",
|
||||||
different_shred_nodes
|
different_shred_nodes
|
||||||
@ -703,6 +707,18 @@ impl ClusterInfo {
|
|||||||
(vec, max)
|
(vec, max)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_node_version(&self, pubkey: &Pubkey) -> Option<solana_version::Version> {
|
||||||
|
self.gossip
|
||||||
|
.read()
|
||||||
|
.unwrap()
|
||||||
|
.crds
|
||||||
|
.table
|
||||||
|
.get(&CrdsValueLabel::Version(*pubkey))
|
||||||
|
.map(|x| x.value.version())
|
||||||
|
.flatten()
|
||||||
|
.map(|version| version.version.clone())
|
||||||
|
}
|
||||||
|
|
||||||
/// all validators that have a valid rpc port regardless of `shred_version`.
|
/// all validators that have a valid rpc port regardless of `shred_version`.
|
||||||
pub fn all_rpc_peers(&self) -> Vec<ContactInfo> {
|
pub fn all_rpc_peers(&self) -> Vec<ContactInfo> {
|
||||||
self.gossip
|
self.gossip
|
||||||
@ -1313,6 +1329,9 @@ impl ClusterInfo {
|
|||||||
let mut last_contact_info_trace = timestamp();
|
let mut last_contact_info_trace = timestamp();
|
||||||
let mut adopt_shred_version = obj.my_shred_version() == 0;
|
let mut adopt_shred_version = obj.my_shred_version() == 0;
|
||||||
let recycler = PacketsRecycler::default();
|
let recycler = PacketsRecycler::default();
|
||||||
|
|
||||||
|
let message = CrdsData::Version(Version::new(obj.id()));
|
||||||
|
obj.push_message(CrdsValue::new_signed(message, &obj.keypair));
|
||||||
loop {
|
loop {
|
||||||
let start = timestamp();
|
let start = timestamp();
|
||||||
thread_mem_usage::datapoint("solana-gossip");
|
thread_mem_usage::datapoint("solana-gossip");
|
||||||
|
@ -75,6 +75,7 @@ pub enum CrdsData {
|
|||||||
SnapshotHashes(SnapshotHash),
|
SnapshotHashes(SnapshotHash),
|
||||||
AccountsHashes(SnapshotHash),
|
AccountsHashes(SnapshotHash),
|
||||||
EpochSlots(EpochSlotsIndex, EpochSlots),
|
EpochSlots(EpochSlotsIndex, EpochSlots),
|
||||||
|
Version(Version),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Sanitize for CrdsData {
|
impl Sanitize for CrdsData {
|
||||||
@ -101,6 +102,7 @@ impl Sanitize for CrdsData {
|
|||||||
}
|
}
|
||||||
val.sanitize()
|
val.sanitize()
|
||||||
}
|
}
|
||||||
|
CrdsData::Version(version) => version.sanitize(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,6 +208,33 @@ impl Vote {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
||||||
|
pub struct Version {
|
||||||
|
pub from: Pubkey,
|
||||||
|
pub wallclock: u64,
|
||||||
|
pub version: solana_version::Version,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Sanitize for Version {
|
||||||
|
fn sanitize(&self) -> Result<(), SanitizeError> {
|
||||||
|
if self.wallclock >= MAX_WALLCLOCK {
|
||||||
|
return Err(SanitizeError::ValueOutOfBounds);
|
||||||
|
}
|
||||||
|
self.from.sanitize()?;
|
||||||
|
self.version.sanitize()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Version {
|
||||||
|
pub fn new(from: Pubkey) -> Self {
|
||||||
|
Self {
|
||||||
|
from,
|
||||||
|
wallclock: timestamp(),
|
||||||
|
version: solana_version::Version::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Type of the replicated value
|
/// Type of the replicated value
|
||||||
/// These are labels for values in a record that is associated with `Pubkey`
|
/// These are labels for values in a record that is associated with `Pubkey`
|
||||||
#[derive(PartialEq, Hash, Eq, Clone, Debug)]
|
#[derive(PartialEq, Hash, Eq, Clone, Debug)]
|
||||||
@ -216,6 +245,7 @@ pub enum CrdsValueLabel {
|
|||||||
SnapshotHashes(Pubkey),
|
SnapshotHashes(Pubkey),
|
||||||
EpochSlots(EpochSlotsIndex, Pubkey),
|
EpochSlots(EpochSlotsIndex, Pubkey),
|
||||||
AccountsHashes(Pubkey),
|
AccountsHashes(Pubkey),
|
||||||
|
Version(Pubkey),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for CrdsValueLabel {
|
impl fmt::Display for CrdsValueLabel {
|
||||||
@ -227,6 +257,7 @@ impl fmt::Display for CrdsValueLabel {
|
|||||||
CrdsValueLabel::SnapshotHashes(_) => write!(f, "SnapshotHash({})", self.pubkey()),
|
CrdsValueLabel::SnapshotHashes(_) => write!(f, "SnapshotHash({})", self.pubkey()),
|
||||||
CrdsValueLabel::EpochSlots(ix, _) => write!(f, "EpochSlots({}, {})", ix, self.pubkey()),
|
CrdsValueLabel::EpochSlots(ix, _) => write!(f, "EpochSlots({}, {})", ix, self.pubkey()),
|
||||||
CrdsValueLabel::AccountsHashes(_) => write!(f, "AccountsHashes({})", self.pubkey()),
|
CrdsValueLabel::AccountsHashes(_) => write!(f, "AccountsHashes({})", self.pubkey()),
|
||||||
|
CrdsValueLabel::Version(_) => write!(f, "Version({})", self.pubkey()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -240,6 +271,7 @@ impl CrdsValueLabel {
|
|||||||
CrdsValueLabel::SnapshotHashes(p) => *p,
|
CrdsValueLabel::SnapshotHashes(p) => *p,
|
||||||
CrdsValueLabel::EpochSlots(_, p) => *p,
|
CrdsValueLabel::EpochSlots(_, p) => *p,
|
||||||
CrdsValueLabel::AccountsHashes(p) => *p,
|
CrdsValueLabel::AccountsHashes(p) => *p,
|
||||||
|
CrdsValueLabel::Version(p) => *p,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -257,7 +289,7 @@ impl CrdsValue {
|
|||||||
value.sign(keypair);
|
value.sign(keypair);
|
||||||
value
|
value
|
||||||
}
|
}
|
||||||
/// Totally unsecure unverfiable wallclock of the node that generated this message
|
/// Totally unsecure unverifiable wallclock of the node that generated this message
|
||||||
/// Latest wallclock is always picked.
|
/// Latest wallclock is always picked.
|
||||||
/// This is used to time out push messages.
|
/// This is used to time out push messages.
|
||||||
pub fn wallclock(&self) -> u64 {
|
pub fn wallclock(&self) -> u64 {
|
||||||
@ -268,6 +300,7 @@ impl CrdsValue {
|
|||||||
CrdsData::SnapshotHashes(hash) => hash.wallclock,
|
CrdsData::SnapshotHashes(hash) => hash.wallclock,
|
||||||
CrdsData::AccountsHashes(hash) => hash.wallclock,
|
CrdsData::AccountsHashes(hash) => hash.wallclock,
|
||||||
CrdsData::EpochSlots(_, p) => p.wallclock,
|
CrdsData::EpochSlots(_, p) => p.wallclock,
|
||||||
|
CrdsData::Version(version) => version.wallclock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn pubkey(&self) -> Pubkey {
|
pub fn pubkey(&self) -> Pubkey {
|
||||||
@ -278,6 +311,7 @@ impl CrdsValue {
|
|||||||
CrdsData::SnapshotHashes(hash) => hash.from,
|
CrdsData::SnapshotHashes(hash) => hash.from,
|
||||||
CrdsData::AccountsHashes(hash) => hash.from,
|
CrdsData::AccountsHashes(hash) => hash.from,
|
||||||
CrdsData::EpochSlots(_, p) => p.from,
|
CrdsData::EpochSlots(_, p) => p.from,
|
||||||
|
CrdsData::Version(version) => version.from,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn label(&self) -> CrdsValueLabel {
|
pub fn label(&self) -> CrdsValueLabel {
|
||||||
@ -288,6 +322,7 @@ impl CrdsValue {
|
|||||||
CrdsData::SnapshotHashes(_) => CrdsValueLabel::SnapshotHashes(self.pubkey()),
|
CrdsData::SnapshotHashes(_) => CrdsValueLabel::SnapshotHashes(self.pubkey()),
|
||||||
CrdsData::AccountsHashes(_) => CrdsValueLabel::AccountsHashes(self.pubkey()),
|
CrdsData::AccountsHashes(_) => CrdsValueLabel::AccountsHashes(self.pubkey()),
|
||||||
CrdsData::EpochSlots(ix, _) => CrdsValueLabel::EpochSlots(*ix, self.pubkey()),
|
CrdsData::EpochSlots(ix, _) => CrdsValueLabel::EpochSlots(*ix, self.pubkey()),
|
||||||
|
CrdsData::Version(_) => CrdsValueLabel::Version(self.pubkey()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn contact_info(&self) -> Option<&ContactInfo> {
|
pub fn contact_info(&self) -> Option<&ContactInfo> {
|
||||||
@ -338,6 +373,13 @@ impl CrdsValue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn version(&self) -> Option<&Version> {
|
||||||
|
match &self.data {
|
||||||
|
CrdsData::Version(version) => Some(version),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Return all the possible labels for a record identified by Pubkey.
|
/// Return all the possible labels for a record identified by Pubkey.
|
||||||
pub fn record_labels(key: &Pubkey) -> Vec<CrdsValueLabel> {
|
pub fn record_labels(key: &Pubkey) -> Vec<CrdsValueLabel> {
|
||||||
let mut labels = vec![
|
let mut labels = vec![
|
||||||
@ -345,6 +387,7 @@ impl CrdsValue {
|
|||||||
CrdsValueLabel::LowestSlot(*key),
|
CrdsValueLabel::LowestSlot(*key),
|
||||||
CrdsValueLabel::SnapshotHashes(*key),
|
CrdsValueLabel::SnapshotHashes(*key),
|
||||||
CrdsValueLabel::AccountsHashes(*key),
|
CrdsValueLabel::AccountsHashes(*key),
|
||||||
|
CrdsValueLabel::Version(*key),
|
||||||
];
|
];
|
||||||
labels.extend((0..MAX_VOTES).map(|ix| CrdsValueLabel::Vote(ix, *key)));
|
labels.extend((0..MAX_VOTES).map(|ix| CrdsValueLabel::Vote(ix, *key)));
|
||||||
labels.extend((0..MAX_EPOCH_SLOTS).map(|ix| CrdsValueLabel::EpochSlots(ix, *key)));
|
labels.extend((0..MAX_EPOCH_SLOTS).map(|ix| CrdsValueLabel::EpochSlots(ix, *key)));
|
||||||
@ -395,7 +438,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_labels() {
|
fn test_labels() {
|
||||||
let mut hits = [false; 4 + MAX_VOTES as usize + MAX_EPOCH_SLOTS as usize];
|
let mut hits = [false; 5 + MAX_VOTES as usize + MAX_EPOCH_SLOTS as usize];
|
||||||
// this method should cover all the possible labels
|
// this method should cover all the possible labels
|
||||||
for v in &CrdsValue::record_labels(&Pubkey::default()) {
|
for v in &CrdsValue::record_labels(&Pubkey::default()) {
|
||||||
match v {
|
match v {
|
||||||
@ -403,9 +446,10 @@ mod test {
|
|||||||
CrdsValueLabel::LowestSlot(_) => hits[1] = true,
|
CrdsValueLabel::LowestSlot(_) => hits[1] = true,
|
||||||
CrdsValueLabel::SnapshotHashes(_) => hits[2] = true,
|
CrdsValueLabel::SnapshotHashes(_) => hits[2] = true,
|
||||||
CrdsValueLabel::AccountsHashes(_) => hits[3] = true,
|
CrdsValueLabel::AccountsHashes(_) => hits[3] = true,
|
||||||
CrdsValueLabel::Vote(ix, _) => hits[*ix as usize + 4] = true,
|
CrdsValueLabel::Version(_) => hits[4] = true,
|
||||||
|
CrdsValueLabel::Vote(ix, _) => hits[*ix as usize + 5] = true,
|
||||||
CrdsValueLabel::EpochSlots(ix, _) => {
|
CrdsValueLabel::EpochSlots(ix, _) => {
|
||||||
hits[*ix as usize + MAX_VOTES as usize + 4] = true
|
hits[*ix as usize + MAX_VOTES as usize + 5] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1465,7 +1465,7 @@ impl RpcSol for RpcSolImpl {
|
|||||||
|
|
||||||
fn get_version(&self, _: Self::Metadata) -> Result<RpcVersionInfo> {
|
fn get_version(&self, _: Self::Metadata) -> Result<RpcVersionInfo> {
|
||||||
Ok(RpcVersionInfo {
|
Ok(RpcVersionInfo {
|
||||||
solana_core: solana_clap_utils::version!().to_string(),
|
solana_core: solana_version::Version::default().to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2628,7 +2628,7 @@ pub mod tests {
|
|||||||
let expected = json!({
|
let expected = json!({
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"result": {
|
"result": {
|
||||||
"solana-core": solana_clap_utils::version!().to_string()
|
"solana-core": solana_version::version!().to_string()
|
||||||
},
|
},
|
||||||
"id": 1
|
"id": 1
|
||||||
});
|
});
|
||||||
|
@ -46,7 +46,7 @@ fn test_rpc_client() {
|
|||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
client.get_version().unwrap().solana_core,
|
client.get_version().unwrap().solana_core,
|
||||||
solana_clap_utils::version!()
|
solana_version::version!()
|
||||||
);
|
);
|
||||||
|
|
||||||
assert!(client.get_account(&bob_pubkey).is_err());
|
assert!(client.get_account(&bob_pubkey).is_err());
|
||||||
|
@ -19,6 +19,7 @@ solana-logger = { path = "../logger", version = "1.2.0" }
|
|||||||
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
||||||
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
@ -94,7 +94,7 @@ fn main() {
|
|||||||
solana_logger::setup_with_default("solana=info");
|
solana_logger::setup_with_default("solana=info");
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("entrypoint")
|
Arg::with_name("entrypoint")
|
||||||
.long("entrypoint")
|
.long("entrypoint")
|
||||||
|
@ -8,9 +8,6 @@ license = "Apache-2.0"
|
|||||||
homepage = "https://solana.com/"
|
homepage = "https://solana.com/"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.2.1"
|
bincode = "1.2.1"
|
||||||
byteorder = "1.3.4"
|
byteorder = "1.3.4"
|
||||||
@ -23,6 +20,7 @@ solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
|||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
solana-metrics = { path = "../metrics", version = "1.2.0" }
|
solana-metrics = { path = "../metrics", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
tokio = "0.1"
|
tokio = "0.1"
|
||||||
tokio-codec = "0.1"
|
tokio-codec = "0.1"
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
solana_metrics::set_panic_hook("faucet");
|
solana_metrics::set_panic_hook("faucet");
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("keypair")
|
Arg::with_name("keypair")
|
||||||
.short("k")
|
.short("k")
|
||||||
|
@ -23,13 +23,13 @@ solana-sdk = { path = "../sdk", version = "1.2.0" }
|
|||||||
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
||||||
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
|
solana-storage-program = { path = "../programs/storage", version = "1.2.0" }
|
||||||
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.1.0"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "solana-genesis"
|
name = "solana-genesis"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "solana_genesis"
|
name = "solana_genesis"
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("creation_time")
|
Arg::with_name("creation_time")
|
||||||
.long("creation-time")
|
.long("creation-time")
|
||||||
|
@ -16,9 +16,7 @@ solana-client = { path = "../client", version = "1.2.0" }
|
|||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
@ -17,7 +17,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.setting(AppSettings::SubcommandRequiredElseHelp)
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("rpc-url")
|
SubCommand::with_name("rpc-url")
|
||||||
|
@ -29,6 +29,7 @@ solana-client = { path = "../client", version = "1.2.0" }
|
|||||||
solana-config-program = { path = "../programs/config", version = "1.2.0" }
|
solana-config-program = { path = "../programs/config", version = "1.2.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
semver = "0.9.0"
|
semver = "0.9.0"
|
||||||
tar = "0.4.26"
|
tar = "0.4.26"
|
||||||
tempdir = "0.3.7"
|
tempdir = "0.3.7"
|
||||||
|
@ -84,7 +84,7 @@ pub fn main() -> Result<(), String> {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.setting(AppSettings::SubcommandRequiredElseHelp)
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.arg({
|
.arg({
|
||||||
let arg = Arg::with_name("config_file")
|
let arg = Arg::with_name("config_file")
|
||||||
@ -268,7 +268,7 @@ pub fn main_init() -> Result<(), String> {
|
|||||||
|
|
||||||
let matches = App::new("solana-install-init")
|
let matches = App::new("solana-install-init")
|
||||||
.about("initializes a new installation")
|
.about("initializes a new installation")
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg({
|
.arg({
|
||||||
let arg = Arg::with_name("config_file")
|
let arg = Arg::with_name("config_file")
|
||||||
.short("c")
|
.short("c")
|
||||||
|
@ -17,6 +17,7 @@ solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
|||||||
solana-cli-config = { path = "../cli-config", version = "1.2.0" }
|
solana-cli-config = { path = "../cli-config", version = "1.2.0" }
|
||||||
solana-remote-wallet = { path = "../remote-wallet", version = "1.2.0" }
|
solana-remote-wallet = { path = "../remote-wallet", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
tiny-bip39 = "0.7.0"
|
tiny-bip39 = "0.7.0"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
@ -208,7 +208,7 @@ fn grind_parse_args(
|
|||||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.setting(AppSettings::SubcommandRequiredElseHelp)
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.arg({
|
.arg({
|
||||||
let arg = Arg::with_name("config_file")
|
let arg = Arg::with_name("config_file")
|
||||||
|
@ -22,6 +22,7 @@ solana-runtime = { path = "../runtime", version = "1.2.0" }
|
|||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
||||||
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.1.0"
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ fn main() {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("ledger_path")
|
Arg::with_name("ledger_path")
|
||||||
.short("l")
|
.short("l")
|
||||||
|
@ -16,6 +16,7 @@ serde = "1.0.110"
|
|||||||
serde_json = "1.0.53"
|
serde_json = "1.0.53"
|
||||||
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "solana-log-analyzer"
|
name = "solana-log-analyzer"
|
||||||
|
@ -200,7 +200,7 @@ fn main() {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("iftop")
|
SubCommand::with_name("iftop")
|
||||||
.about("Process iftop log file")
|
.about("Process iftop log file")
|
||||||
|
@ -20,6 +20,7 @@ serde_derive = "1.0.103"
|
|||||||
socket2 = "0.3.12"
|
socket2 = "0.3.12"
|
||||||
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
tokio = "0.1"
|
tokio = "0.1"
|
||||||
tokio-codec = "0.1"
|
tokio-codec = "0.1"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ use clap::{App, Arg};
|
|||||||
fn main() {
|
fn main() {
|
||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
let matches = App::new("solana-ip-address")
|
let matches = App::new("solana-ip-address")
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("host_port")
|
Arg::with_name("host_port")
|
||||||
.index(1)
|
.index(1)
|
||||||
|
@ -4,7 +4,7 @@ use std::net::{SocketAddr, TcpListener};
|
|||||||
fn main() {
|
fn main() {
|
||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
let matches = App::new("solana-ip-address-server")
|
let matches = App::new("solana-ip-address-server")
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("port")
|
Arg::with_name("port")
|
||||||
.index(1)
|
.index(1)
|
||||||
|
@ -22,6 +22,7 @@ solana-metrics = { path = "../metrics", version = "1.2.0" }
|
|||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
solana-stake-program = { path = "../programs/stake", version = "1.2.0" }
|
||||||
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serial_test = "0.4.0"
|
serial_test = "0.4.0"
|
||||||
|
@ -119,7 +119,7 @@ fn main() {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.setting(AppSettings::SubcommandRequiredElseHelp)
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("data_file")
|
Arg::with_name("data_file")
|
||||||
|
@ -15,6 +15,7 @@ log = "0.4.8"
|
|||||||
libc = "0.2.69"
|
libc = "0.2.69"
|
||||||
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
||||||
solana-logger = { path = "../logger", version = "1.2.0" }
|
solana-logger = { path = "../logger", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[target."cfg(unix)".dependencies]
|
[target."cfg(unix)".dependencies]
|
||||||
unix_socket2 = "0.5.4"
|
unix_socket2 = "0.5.4"
|
||||||
|
@ -101,7 +101,7 @@ fn main() {
|
|||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("user")
|
Arg::with_name("user")
|
||||||
.long("user")
|
.long("user")
|
||||||
|
@ -27,6 +27,7 @@ solana-metrics = { path = "../metrics", version = "1.2.0" }
|
|||||||
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
solana-net-utils = { path = "../net-utils", version = "1.2.0" }
|
||||||
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
solana-runtime = { path = "../runtime", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
||||||
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
|
solana-vote-signer = { path = "../vote-signer", version = "1.2.0" }
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ pub fn main() {
|
|||||||
let default_genesis_archive_unpacked_size = &MAX_GENESIS_ARCHIVE_UNPACKED_SIZE.to_string();
|
let default_genesis_archive_unpacked_size = &MAX_GENESIS_ARCHIVE_UNPACKED_SIZE.to_string();
|
||||||
|
|
||||||
let matches = App::new(crate_name!()).about(crate_description!())
|
let matches = App::new(crate_name!()).about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(SKIP_SEED_PHRASE_VALIDATION_ARG.name)
|
Arg::with_name(SKIP_SEED_PHRASE_VALIDATION_ARG.name)
|
||||||
.long(SKIP_SEED_PHRASE_VALIDATION_ARG.long)
|
.long(SKIP_SEED_PHRASE_VALIDATION_ARG.long)
|
||||||
@ -1017,7 +1017,7 @@ pub fn main() {
|
|||||||
env::set_var("RUST_BACKTRACE", "1")
|
env::set_var("RUST_BACKTRACE", "1")
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("{} {}", crate_name!(), solana_clap_utils::version!());
|
info!("{} {}", crate_name!(), solana_version::version!());
|
||||||
info!("Starting validator with: {:#?}", std::env::args_os());
|
info!("Starting validator with: {:#?}", std::env::args_os());
|
||||||
|
|
||||||
solana_metrics::set_host_id(identity_keypair.pubkey().to_string());
|
solana_metrics::set_host_id(identity_keypair.pubkey().to_string());
|
||||||
|
2
version/.gitignore
vendored
Normal file
2
version/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/target/
|
||||||
|
/farf/
|
20
version/Cargo.toml
Normal file
20
version/Cargo.toml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[package]
|
||||||
|
name = "solana-version"
|
||||||
|
version = "1.2.0"
|
||||||
|
description = "Solana Version"
|
||||||
|
authors = ["Solana Maintainers <maintainers@solana.com>"]
|
||||||
|
repository = "https://github.com/solana-labs/solana"
|
||||||
|
license = "Apache-2.0"
|
||||||
|
homepage = "https://solana.com/"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
serde = "1.0.110"
|
||||||
|
serde_derive = "1.0.103"
|
||||||
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "solana_version"
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
targets = ["x86_64-unknown-linux-gnu"]
|
49
version/src/lib.rs
Normal file
49
version/src/lib.rs
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
extern crate serde_derive;
|
||||||
|
use serde_derive::{Deserialize, Serialize};
|
||||||
|
use solana_sdk::sanitize::Sanitize;
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
|
||||||
|
pub struct Version {
|
||||||
|
major: u16,
|
||||||
|
minor: u16,
|
||||||
|
patch: u16,
|
||||||
|
commit: Option<u32>, // first 4 bytes of the sha1 commit hash
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Version {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
major: env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(),
|
||||||
|
minor: env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(),
|
||||||
|
patch: env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(),
|
||||||
|
commit: option_env!("CI_COMMIT")
|
||||||
|
.map(|sha1| u32::from_str_radix(&sha1[..8], 16).unwrap()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Display for Version {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
"{}.{}.{} {}",
|
||||||
|
self.major,
|
||||||
|
self.minor,
|
||||||
|
self.patch,
|
||||||
|
match self.commit {
|
||||||
|
None => "devbuild".to_string(),
|
||||||
|
Some(commit) => format!("{:08x}", commit),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Sanitize for Version {}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! version {
|
||||||
|
() => {
|
||||||
|
&*format!("{}", $crate::Version::default())
|
||||||
|
};
|
||||||
|
}
|
@ -18,6 +18,7 @@ serde_json = "1.0.53"
|
|||||||
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
solana-clap-utils = { path = "../clap-utils", version = "1.2.0" }
|
||||||
solana-metrics = { path = "../metrics", version = "1.2.0" }
|
solana-metrics = { path = "../metrics", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["lib"]
|
crate-type = ["lib"]
|
||||||
|
@ -11,7 +11,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
|
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("port")
|
Arg::with_name("port")
|
||||||
.long("port")
|
.long("port")
|
||||||
|
@ -22,6 +22,7 @@ solana-logger = { path = "../logger", version = "1.2.0" }
|
|||||||
solana-metrics = { path = "../metrics", version = "1.2.0" }
|
solana-metrics = { path = "../metrics", version = "1.2.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
solana-sdk = { path = "../sdk", version = "1.2.0" }
|
||||||
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
solana-transaction-status = { path = "../transaction-status", version = "1.2.0" }
|
||||||
|
solana-version = { path = "../version", version = "1.2.0" }
|
||||||
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
solana-vote-program = { path = "../programs/vote", version = "1.2.0" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
@ -38,7 +38,7 @@ struct Config {
|
|||||||
fn get_config() -> Config {
|
fn get_config() -> Config {
|
||||||
let matches = App::new(crate_name!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
.version(solana_clap_utils::version!())
|
.version(solana_version::version!())
|
||||||
.after_help("ADDITIONAL HELP:
|
.after_help("ADDITIONAL HELP:
|
||||||
To receive a Slack, Discord and/or Telegram notification on sanity failure,
|
To receive a Slack, Discord and/or Telegram notification on sanity failure,
|
||||||
define environment variables before running `solana-watchtower`:
|
define environment variables before running `solana-watchtower`:
|
||||||
|
Reference in New Issue
Block a user