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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Emit CLI warning log msg on non 64-bit node hardware.
([\#3215](https://github.com/anoma/namada/pull/3215))
20 changes: 20 additions & 0 deletions crates/apps/src/lib/node/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,28 @@ pub fn migrating_state() -> Option<BlockHeight> {
height.parse::<u64>().ok().map(BlockHeight)
}

/// Emit a header of warning log msgs if the host does not have
/// a 64-bit CPU.
fn emit_warning_on_non_64bit_cpu() {
if std::mem::size_of::<usize>() != 8 {
tracing::warn!("");
tracing::warn!(
"Your machine has a {}-bit CPU...",
8 * std::mem::size_of::<usize>()
);
tracing::warn!("");
tracing::warn!("A majority of nodes will run on 64-bit hardware!");
tracing::warn!("");
tracing::warn!("While not immediately being problematic, non 64-bit");
tracing::warn!("nodes may run into spurious consensus failures.");
tracing::warn!("");
}
}

/// Run the ledger with an async runtime
pub fn run(config: config::Ledger, wasm_dir: PathBuf) {
emit_warning_on_non_64bit_cpu();

let logical_cores = num_cpus::get();
tracing::info!("Available logical cores: {}", logical_cores);

Expand Down