Skip to content
Merged
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
46 changes: 27 additions & 19 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[workspace]
resolver = "2"
members = [".", "crates/sentrix-primitives", "crates/sentrix-wallet", "crates/sentrix-trie", "crates/sentrix-staking", "crates/sentrix-evm", "crates/sentrix-bft", "crates/sentrix-codec", "crates/sentrix-nft", "crates/sentrix-core", "crates/sentrix-network", "crates/sentrix-precompiles", "crates/sentrix-rpc", "crates/sentrix-rpc-types", "crates/sentrix-storage", "crates/sentrix-wire", "crates/sentrix-proto", "crates/sentrix-grpc", "crates/sentrix-prom-exporter", "bin/sentrix", "bin/sentrix-faucet"]
members = [".", "crates/sentrix-primitives", "crates/sentrix-wallet", "crates/sentrix-trie", "crates/sentrix-staking", "crates/sentrix-evm", "crates/sentrix-bft", "crates/sentrix-codec", "crates/sentrix-nft", "crates/sentrix-core", "crates/sentrix-fork-heights", "crates/sentrix-network", "crates/sentrix-precompiles", "crates/sentrix-rpc", "crates/sentrix-rpc-types", "crates/sentrix-storage", "crates/sentrix-wire", "crates/sentrix-proto", "crates/sentrix-grpc", "crates/sentrix-prom-exporter", "bin/sentrix", "bin/sentrix-faucet"]

# Single source of truth for fields every workspace member shares.
# Future version bumps = edit `version` here only; each member inherits via
# `version.workspace = true`. Same goes for edition/license/repository so
# they can't drift across crates.
[workspace.package]
version = "2.2.36"
version = "2.2.37"
edition = "2024"
license = "BUSL-1.1"
repository = "https://github.com/sentrix-labs/sentrix"
Expand Down
1 change: 1 addition & 0 deletions crates/sentrix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sentrix-staking = { path = "../sentrix-staking" }
sentrix-evm = { path = "../sentrix-evm" }
sentrix-bft = { path = "../sentrix-bft" }
sentrix-nft = { path = "../sentrix-nft" }
sentrix-fork-heights = { path = "../sentrix-fork-heights" }

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
6 changes: 5 additions & 1 deletion crates/sentrix-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ pub mod blockchain_trie_ops;
pub mod chain_params;
pub mod chain_queries;
pub(crate) mod divergence;
pub mod fork_heights;
// Fork-activation heights live in their own crate now (pure consts + env +
// chain-id selection, no consensus-state coupling). Re-exported so the
// fleet-wide `sentrix_core::fork_heights::*` / `crate::fork_heights::*` call
// sites keep resolving unchanged.
pub use sentrix_fork_heights as fork_heights;
pub mod genesis;
pub mod mempool;
pub mod nft;
Expand Down
10 changes: 10 additions & 0 deletions crates/sentrix-fork-heights/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "sentrix-fork-heights"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Sentrix fork-activation heights — chain-id-aware fork schedule (consts + env overrides) shared across the node"
publish = false

[dependencies]
tracing = "0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ pub fn get_reward_apply_path_height() -> u64 {
/// Default `u64::MAX` makes this return false for all heights —
/// the mainnet-safe-default-pre-activation pattern.
///
/// **Use [`crate::Blockchain::voyager_mode_for`] in consensus paths** —
/// **Use `Blockchain::voyager_mode_for` (sentrix-core) in consensus paths** —
/// it ORs this check with the runtime persisted `voyager_activated`
/// flag, so post-activation chains don't depend on the env var being
/// set correctly. The 2026-04-26 mainnet stall happened because
Expand Down Expand Up @@ -609,7 +609,17 @@ pub fn is_bft_gate_relax_height(height: u64) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use crate::test_util::env_test_lock;

/// Serialises env-var-mutating tests within this crate (env is
/// process-global). Inlined on extraction — was `crate::test_util`
/// back when these lived in sentrix-core.
fn env_test_lock() -> std::sync::MutexGuard<'static, ()> {
use std::sync::{Mutex, OnceLock};
static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
LOCK.get_or_init(|| Mutex::new(()))
.lock()
.unwrap_or_else(|e| e.into_inner())
}

/// Each fork-height reader is `env::var` parse → fallback. We
/// exercise the env-set + env-unset paths once for one
Expand Down
Loading