Skip to content

Commit 3b858ea

Browse files
authored
Merge branch 'develop' into fix/4145
2 parents ffde1b4 + 6651b31 commit 3b858ea

File tree

16 files changed

+92
-38
lines changed

16 files changed

+92
-38
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
### Added
1111

12+
### Changed
13+
14+
### Fixed
15+
16+
## [3.1.0.0.5]
17+
18+
### Added
19+
1220
- Add miner configuration option `tenure_extend_cost_threshold` to specify the percentage of the tenure budget that must be spent before a time-based tenure extend is attempted
1321

1422
### Changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/release-process.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ The timing of the next Stacking cycle can be found [here](https://stx.eco/dao/to
6464
- Add cherry-picked commits to the `feat/X.Y.Z.A.n-pr_number` branch
6565
- Merge `feat/X.Y.Z.A.n-pr_number` into `release/X.Y.Z.A.n`.
6666

67-
4. Open a PR to update the [CHANGELOG](../CHANGELOG.md) file in the `release/X.Y.Z.A.n` branch.
67+
4. Open a PR to update the [CHANGELOG](../CHANGELOG.md) in the `release/X.Y.Z.A.n` branch.
6868

6969
- Create a chore branch from `release/X.Y.Z.A.n`, ex: `chore/X.Y.Z.A.n-changelog`.
7070
- Add summaries of all Pull Requests to the `Added`, `Changed` and `Fixed` sections.
71+
- Update the `stacks_node_version` string in [versions.toml](../versions.toml) to match this release.
7172

7273
- Pull requests merged into `develop` can be found [here](https://github.com/stacks-network/stacks-core/pulls?q=is%3Apr+is%3Aclosed+base%3Adevelop+sort%3Aupdated-desc).
7374

libsigner/src/libsigner.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ use blockstack_lib::version_string;
5353
use clarity::codec::StacksMessageCodec;
5454
use clarity::vm::types::QualifiedContractIdentifier;
5555
use lazy_static::lazy_static;
56+
use stacks_common::versions::STACKS_SIGNER_VERSION;
5657

5758
pub use crate::error::{EventError, RPCError};
5859
pub use crate::events::{
@@ -80,7 +81,12 @@ pub trait SignerMessage<T: MessageSlotID>: StacksMessageCodec {
8081
lazy_static! {
8182
/// The version string for the signer
8283
pub static ref VERSION_STRING: String = {
83-
let pkg_version = option_env!("STACKS_NODE_VERSION").unwrap_or(env!("CARGO_PKG_VERSION"));
84+
let pkg_version = option_env!("STACKS_NODE_VERSION").or(Some(STACKS_SIGNER_VERSION));
8485
version_string("stacks-signer", pkg_version)
8586
};
8687
}
88+
89+
#[test]
90+
fn test_version_string() {
91+
assert!(VERSION_STRING.contains(format!("stacks-signer {}", STACKS_SIGNER_VERSION).as_str()));
92+
}

stacks-common/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ keywords = [ "stacks", "stx", "bitcoin", "crypto", "blockstack", "decentralized"
1212
readme = "README.md"
1313
resolver = "2"
1414
edition = "2021"
15+
build = "build.rs"
1516

1617
[lib]
1718
name = "stacks_common"
@@ -73,6 +74,9 @@ serde = []
7374
bech32_std = []
7475
bech32_strict = []
7576

77+
[build-dependencies]
78+
toml = "0.5.6"
79+
7680
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(any(target_os="windows"))))'.dependencies]
7781
sha2 = { version = "0.10", features = ["asm"] }
7882

stacks-common/build.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
use std::path::Path;
2+
use std::{env, fs};
3+
4+
use toml::Value;
5+
6+
fn main() {
7+
let toml_file = "../versions.toml";
8+
let toml_content = fs::read_to_string(toml_file).expect("Failed to read versions.toml");
9+
10+
let config: Value = toml::from_str(&toml_content).expect("Failed to parse TOML");
11+
12+
let mut rust_code = String::from("// Auto-generated code from versions.toml\n\n");
13+
14+
let Value::Table(table) = config else {
15+
panic!("Invalid value type in versions.toml: {config:?}");
16+
};
17+
for (key, val) in table {
18+
let Value::String(s) = val else {
19+
panic!("Invalid value type in versions.toml: {val:?}");
20+
};
21+
rust_code.push_str(&format!(
22+
"pub const {}: &str = {s:?};\n",
23+
key.to_uppercase()
24+
));
25+
}
26+
27+
let out_dir = env::var_os("OUT_DIR").unwrap();
28+
let dest_path = Path::new(&out_dir).join("versions.rs");
29+
fs::write(&dest_path, rust_code).expect("Failed to write generated code");
30+
31+
// Tell Cargo to rerun this script if the TOML file changes
32+
println!("cargo:rerun-if-changed={toml_file}");
33+
}

stacks-common/src/libcommon.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ pub mod consts {
9797
pub const MICROSTACKS_PER_STACKS: u32 = 1_000_000;
9898
}
9999

100+
pub mod versions {
101+
include!(concat!(env!("OUT_DIR"), "/versions.rs"));
102+
}
103+
100104
/// This test asserts that the constant above doesn't change.
101105
/// This exists because the constant above is used by Epoch 2.5 instantiation code.
102106
///

stacks-signer/CHANGELOG.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
### Added
1111

12+
### Changed
13+
14+
## [3.1.0.0.5.0]
15+
16+
### Added
17+
1218
- Add `dry_run` configuration option to `stacks-signer` config toml. Dry run mode will
1319
run the signer binary as if it were a registered signer. Instead of broadcasting
1420
`StackerDB` messages, it logs `INFO` messages. Other interactions with the `stacks-node`
@@ -17,44 +23,44 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1723

1824
## [3.1.0.0.4.0]
1925

20-
## Added
26+
### Added
2127

2228
- When a new block proposal is received while the signer is waiting for an existing proposal to be validated, the signer will wait until the existing block is done validating before submitting the new one for validating. ([#5453](https://github.com/stacks-network/stacks-core/pull/5453))
2329
- Introduced two new prometheus metrics:
2430
- `stacks_signer_block_validation_latencies_histogram`: the validation_time_ms reported by the node when validating a block proposal
2531
- `stacks_signer_block_response_latencies_histogram`: the "end-to-end" time it takes for the signer to issue a block response
2632

27-
## Changed
33+
### Changed
2834

2935
## [3.1.0.0.3.0]
3036

31-
## Added
37+
### Added
3238

3339
- Introduced the `block_proposal_max_age_secs` configuration option for signers, enabling them to automatically ignore block proposals that exceed the specified age in seconds.
3440

35-
## Changed
41+
### Changed
3642
- Improvements to the stale signer cleanup logic: deletes the prior signer if it has no remaining unprocessed blocks in its database
3743
- Signers now listen to new block events from the stacks node to determine whether a block has been successfully appended to the chain tip
3844

39-
# [3.1.0.0.2.1]
45+
## [3.1.0.0.2.1]
4046

41-
## Added
47+
### Added
4248

43-
## Changed
49+
### Changed
4450

4551
- Prevent old reward cycle signers from processing block validation response messages that do not apply to blocks from their cycle.
4652

47-
# [3.1.0.0.2.1]
53+
## [3.1.0.0.2.1]
4854

49-
## Added
55+
### Added
5056

51-
## Changed
57+
### Changed
5258

5359
- Prevent old reward cycle signers from processing block validation response messages that do not apply to blocks from their cycle.
5460

5561
## [3.1.0.0.2.0]
5662

57-
## Added
63+
### Added
5864

5965
- **SIP-029 consensus rules, activating in epoch 3.1 at block 875,000** (see [SIP-029](https://github.com/will-corcoran/sips/blob/feat/sip-029-halving-alignment/sips/sip-029/sip-029-halving-alignment.md) for details)
6066

stacks-signer/release-process.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ The timing of the next Stacking cycle can be found [here](https://stx.eco/dao/to
6363
- Add cherry-picked commits to the `feat/signer-X.Y.Z.A.n.x-pr_number` branch
6464
- Merge `feat/signer-X.Y.Z.A.n.x-pr_number` into `release/signer-X.Y.Z.A.n.x`.
6565

66-
4. Open a PR to update the [CHANGELOG](./CHANGELOG.md) file in the `release/signer-X.Y.Z.A.n.x` branch.
66+
4. Open a PR to update the [CHANGELOG](./CHANGELOG.md) in the `release/signer-X.Y.Z.A.n.x` branch.
6767

6868
- Create a chore branch from `release/signer-X.Y.Z.A.n.x`, ex: `chore/signer-X.Y.Z.A.n.x-changelog`.
6969
- Add summaries of all Pull Requests to the `Added`, `Changed` and `Fixed` sections.
70+
- Update the `stacks_signer_version` string in [versions.toml](../versions.toml) to match this release.
7071

7172
- Pull requests merged into `develop` can be found [here](https://github.com/stacks-network/stacks-core/pulls?q=is%3Apr+is%3Aclosed+base%3Adevelop+sort%3Aupdated-desc).
7273

stackslib/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern crate stacks_common;
4545
#[macro_use]
4646
pub extern crate clarity;
4747

48+
use stacks_common::versions::STACKS_NODE_VERSION;
4849
pub use stacks_common::{address, codec, types, util};
4950

5051
#[macro_use]
@@ -79,16 +80,17 @@ const BUILD_TYPE: &str = "debug";
7980
#[cfg(not(debug_assertions))]
8081
const BUILD_TYPE: &str = "release";
8182

82-
pub fn version_string(pkg_name: &str, pkg_version: &str) -> String {
83-
let git_branch = GIT_BRANCH.map(String::from).unwrap_or("".to_string());
83+
pub fn version_string(pkg_name: &str, pkg_version: Option<&str>) -> String {
84+
let pkg_version = pkg_version.unwrap_or(STACKS_NODE_VERSION);
85+
let git_branch = GIT_BRANCH.unwrap_or("");
8486
let git_commit = GIT_COMMIT.unwrap_or("");
8587
let git_tree_clean = GIT_TREE_CLEAN.unwrap_or("");
8688

8789
format!(
8890
"{} {} ({}:{}{}, {} build, {} [{}])",
8991
pkg_name,
9092
pkg_version,
91-
&git_branch,
93+
git_branch,
9294
git_commit,
9395
git_tree_clean,
9496
BUILD_TYPE,

stackslib/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ fn main() {
316316
"{}",
317317
&blockstack_lib::version_string(
318318
option_env!("CARGO_PKG_NAME").unwrap_or(&argv[0]),
319-
option_env!("CARGO_PKG_VERSION").unwrap_or("0.0.0.0")
319+
option_env!("STACKS_NODE_VERSION")
320320
)
321321
);
322322
process::exit(0);

stackslib/src/net/api/getinfo.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,7 @@ impl RPCPeerInfoData {
111111
coinbase_height: u64,
112112
ibd: bool,
113113
) -> RPCPeerInfoData {
114-
let server_version = version_string(
115-
"stacks-node",
116-
option_env!("STACKS_NODE_VERSION")
117-
.or(option_env!("CARGO_PKG_VERSION"))
118-
.unwrap_or("0.0.0.0"),
119-
);
114+
let server_version = version_string("stacks-node", option_env!("STACKS_NODE_VERSION"));
120115
let (unconfirmed_tip, unconfirmed_seq) = match chainstate.unconfirmed_state {
121116
Some(ref unconfirmed) => {
122117
if unconfirmed.num_mined_txs() > 0 {

stackslib/src/net/api/getstxtransfercost.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use crate::net::httpcore::{
4242
};
4343
use crate::net::p2p::PeerNetwork;
4444
use crate::net::{Error as NetError, HttpServerError, StacksNodeState};
45-
use crate::version_string;
4645

4746
pub(crate) const SINGLESIG_TX_TRANSFER_LEN: u64 = 180;
4847

testnet/stacks-node/src/main.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,7 @@ fn main() {
433433
}
434434

435435
fn version() -> String {
436-
stacks::version_string(
437-
"stacks-node",
438-
option_env!("STACKS_NODE_VERSION")
439-
.or(option_env!("CARGO_PKG_VERSION"))
440-
.unwrap_or("0.0.0.0"),
441-
)
436+
stacks::version_string("stacks-node", option_env!("STACKS_NODE_VERSION"))
442437
}
443438

444439
fn print_help() {
@@ -456,7 +451,7 @@ SUBCOMMANDS:
456451
457452
mainnet\t\tStart a node that will join and stream blocks from the public mainnet.
458453
459-
mocknet\t\tStart a node based on a fast local setup emulating a burnchain. Ideal for smart contract development.
454+
mocknet\t\tStart a node based on a fast local setup emulating a burnchain. Ideal for smart contract development.
460455
461456
helium\t\tStart a node based on a local setup relying on a local instance of bitcoind.
462457
\t\tThe following bitcoin.conf is expected:

testnet/stacks-node/src/neon_node.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,12 +2211,7 @@ impl BlockMinerThread {
22112211
/// Only used in mock signing to generate a peer info view
22122212
fn generate_peer_info(&self) -> PeerInfo {
22132213
// Create a peer info view of the current state
2214-
let server_version = version_string(
2215-
"stacks-node",
2216-
option_env!("STACKS_NODE_VERSION")
2217-
.or(option_env!("CARGO_PKG_VERSION"))
2218-
.unwrap_or("0.0.0.0"),
2219-
);
2214+
let server_version = version_string("stacks-node", option_env!("STACKS_NODE_VERSION"));
22202215
let stacks_tip_height = self.burn_block.canonical_stacks_tip_height;
22212216
let stacks_tip = self.burn_block.canonical_stacks_tip_hash;
22222217
let stacks_tip_consensus_hash = self.burn_block.canonical_stacks_tip_consensus_hash;

versions.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Update these values when a new release is created.
2+
# `stacks-common/build.rs` will automatically update `versions.rs` with these values.
3+
stacks_node_version = "3.1.0.0.4"
4+
stacks_signer_version = "3.1.0.0.4.0"

0 commit comments

Comments
 (0)