Skip to content

Commit f26adc0

Browse files
committed
Lighthouse v0.2.0 (Medalla) (#1452)
## Issue Addressed NA ## Proposed Changes - Moves the git-based versioning we were doing into the `lighthouse_version` crate in `common`. - Removes the `beacon_node/version` crate, replacing it with `lighthouse_version`. - Bumps the version to `v0.2.0`. ## Additional Info There are now two types of version string: 1. `const VERSION: &str = Lighthouse/v0.2.0-1419501f2+` 1. `version_with_platform() = Lighthouse/v0.2.0-1419501f2+/x86_64-linux` (1) is handy cause it's a `const` and shorter. (2) has platform info so it's more useful. Note that the plus-sign (`+`) indicates the the git commit is dirty (it used to be `(modified)` but I had to shorten it to fit into graffiti). These version strings are now included on: - `lighthouse --version` - `lcli --version` - `curl localhost:5052/node/version` - p2p messages when we communicate our version You can update the version by changing this constant (version is not related to a `Cargo.toml`): https://github.com/sigp/lighthouse/blob/b9ad7102d56f4827b8b74447c7121174a3e97bbc/common/lighthouse_version/src/lib.rs#L4-L15
1 parent d4dd258 commit f26adc0

File tree

20 files changed

+83
-84
lines changed

20 files changed

+83
-84
lines changed

Cargo.lock

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ members = [
1111
"beacon_node/rest_api",
1212
"beacon_node/store",
1313
"beacon_node/timer",
14-
"beacon_node/version",
1514
"beacon_node/websocket_server",
1615

1716
"boot_node",
@@ -27,6 +26,7 @@ members = [
2726
"common/eth2_wallet_manager",
2827
"common/hashset_delay",
2928
"common/lighthouse_metrics",
29+
"common/lighthouse_version",
3030
"common/logging",
3131
"common/remote_beacon_node",
3232
"common/rest_types",

beacon_node/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "beacon_node"
33
version = "0.1.2"
4-
authors = ["Paul Hauner <[email protected]>", "Age Manning <[email protected]"]
4+
authors = ["Paul Hauner <[email protected]>", "Sigma Prime <[email protected]>"]
55
edition = "2018"
66

77
[lib]
@@ -20,7 +20,6 @@ beacon_chain = { path = "beacon_chain" }
2020
types = { path = "../consensus/types" }
2121
store = { path = "./store" }
2222
client = { path = "client" }
23-
version = { path = "version" }
2423
clap = "2.33.0"
2524
rand = "0.7.3"
2625
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] }
@@ -40,3 +39,4 @@ eth2_ssz = "0.1.2"
4039
serde = "1.0.110"
4140
clap_utils = { path = "../common/clap_utils" }
4241
hyper = "0.13.5"
42+
lighthouse_version = { path = "../common/lighthouse_version" }

beacon_node/beacon_chain/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "beacon_chain"
33
version = "0.1.2"
4-
authors = ["Paul Hauner <[email protected]>", "Age Manning <[email protected]>"]
4+
authors = ["Paul Hauner <[email protected]>"]
55
edition = "2018"
66

77
[features]

beacon_node/eth2_libp2p/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ serde_derive = "1.0.110"
1414
eth2_ssz = "0.1.2"
1515
eth2_ssz_derive = "0.1.0"
1616
slog = { version = "2.5.2", features = ["max_level_trace"] }
17-
version = { path = "../version" }
17+
lighthouse_version = { path = "../../common/lighthouse_version" }
1818
tokio = { version = "0.2.21", features = ["time", "macros"] }
1919
futures = "0.3.5"
2020
error-chain = "0.12.2"

beacon_node/eth2_libp2p/src/behaviour/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
7777

7878
let identify = Identify::new(
7979
"lighthouse/libp2p".into(),
80-
version::version(),
80+
lighthouse_version::version_with_platform(),
8181
local_key.public(),
8282
);
8383

beacon_node/eth2_libp2p/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl Default for Config {
131131
discv5_config,
132132
boot_nodes: vec![],
133133
libp2p_nodes: vec![],
134-
client_version: version::version(),
134+
client_version: lighthouse_version::version_with_platform(),
135135
disable_discovery: false,
136136
topics,
137137
}

beacon_node/rest_api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ beacon_chain = { path = "../beacon_chain" }
1212
network = { path = "../network" }
1313
eth2_libp2p = { path = "../eth2_libp2p" }
1414
store = { path = "../store" }
15-
version = { path = "../version" }
1615
serde = { version = "1.0.110", features = ["derive"] }
1716
serde_json = "1.0.52"
1817
serde_yaml = "0.8.11"
@@ -40,6 +39,7 @@ environment = { path = "../../lighthouse/environment" }
4039
uhttp_sse = "0.5.1"
4140
bus = "2.2.3"
4241
itertools = "0.9.0"
42+
lighthouse_version = { path = "../../common/lighthouse_version" }
4343

4444
[dev-dependencies]
4545
assert_matches = "1.3.0"

beacon_node/rest_api/src/node.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ use crate::response_builder::ResponseBuilder;
22
use crate::{ApiError, ApiResult};
33
use eth2_libp2p::{types::SyncState, NetworkGlobals};
44
use hyper::{Body, Request};
5+
use lighthouse_version::version_with_platform;
56
use rest_types::{Health, SyncingResponse, SyncingStatus};
67
use std::sync::Arc;
78
use types::{EthSpec, Slot};
89

910
/// Read the version string from the current Lighthouse build.
1011
pub fn get_version(req: Request<Body>) -> ApiResult {
11-
ResponseBuilder::new(&req)?.body_no_ssz(&version::version())
12+
ResponseBuilder::new(&req)?.body_no_ssz(&version_with_platform())
1213
}
1314

1415
pub fn syncing<T: EthSpec>(

beacon_node/rest_api/tests/test.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use types::{
2424
RelativeEpoch, Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedRoot, Slot,
2525
SubnetId, Validator,
2626
};
27-
use version;
2827

2928
type E = MinimalEthSpec;
3029

@@ -764,7 +763,11 @@ fn get_version() {
764763
.block_on(remote_node.http.node().get_version())
765764
.expect("should fetch eth2 config from http api");
766765

767-
assert_eq!(version::version(), version, "result should be as expected");
766+
assert_eq!(
767+
lighthouse_version::version_with_platform(),
768+
version,
769+
"result should be as expected"
770+
);
768771
}
769772

770773
#[test]

0 commit comments

Comments
 (0)