From 8a2899ab4a21593767c1f09b124cb2a29f76af0a Mon Sep 17 00:00:00 2001 From: archipelago Date: Wed, 29 Apr 2026 15:47:51 -0400 Subject: [PATCH] chore: release v1.7.47-alpha MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sync-perf tuning for bitcoin/bitcoin-core/bitcoin-knots/electrumx. - Drop the --cpus=2 cap on bitcoin/electrumx variants. Script verification is parallelizable; the cap halved IBD speed on 4-8 core machines. - Bump bitcoin --memory 4g→8g so dbcache=4096 has headroom for mempool + connection buffers + I/O. 4g was OOM-prone during heavy IBD. - Bump electrumx --memory 1g→2g + add CACHE_MB=2048 + MAX_SEND=10MB. - bitcoin-core CLI args gain -dbcache=4096 -par=0 -maxconnections=125. - bitcoin-knots manifest matched (1024MB pruned / 4096MB full + par=0). Future v2: host-RAM-aware dbcache scaling. Co-Authored-By: Claude Opus 4.7 (1M context) --- CHANGELOG.md | 5 +++ apps/bitcoin-core/manifest.yml | 9 ++++-- core/Cargo.lock | 2 +- core/archipelago/Cargo.toml | 2 +- .../archipelago/src/api/rpc/package/config.rs | 32 +++++++++++++++++-- .../src/api/rpc/package/install.rs | 13 +++++++- neode-ui/package.json | 2 +- 7 files changed, 56 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0acc0a83..022f2a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v1.7.47-alpha (2026-04-29) + +- Bitcoin Knots/Core sync is now significantly faster. The container now uses every available core for script verification (was capped at 2) and has 8GB of memory instead of 4GB so its 4GB UTXO cache has headroom for the mempool and peer connections. Existing nodes pick up the new limits on next install/update; freshly-installed nodes start at full speed. +- ElectrumX initial indexing is faster too. Its container memory bumped from 1GB to 2GB and its internal cache is now 2GB (default was 1.2GB). + ## v1.7.46-alpha (2026-04-29) - Health monitor no longer pages "Auto-restart failed" for orphaned containers. After a variant switch (bitcoin-core ↔ bitcoin-knots) the previous variant's container could survive uninstall and the health monitor would try restarting it forever. Now skipped silently with a debug log. diff --git a/apps/bitcoin-core/manifest.yml b/apps/bitcoin-core/manifest.yml index 4c3d670f..8abd96ed 100644 --- a/apps/bitcoin-core/manifest.yml +++ b/apps/bitcoin-core/manifest.yml @@ -12,11 +12,16 @@ app: network: archy-net entrypoint: ["sh", "-lc"] custom_args: + # Sync-speed flags: -par=0 uses every core (was capped at 2 by + # --cpus=2, now removed for bitcoin/electrumx). -dbcache sized to + # the IBD sweet spot — 4GB on full nodes, 1GB on pruned. Container + # --memory=8g (config.rs::get_memory_limit) leaves headroom for + # mempool + connections. - >- if [ "${DISK_GB:-0}" -lt 1000 ]; then - exec bitcoind -server=1 -prune=550 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0:8332 -listen=1 -bind=0.0.0.0:8333 -dbcache=512 -rpcuser="${BITCOIN_RPC_USER}" -rpcpassword="${BITCOIN_RPC_PASS}"; + exec bitcoind -server=1 -prune=550 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0:8332 -listen=1 -bind=0.0.0.0:8333 -dbcache=1024 -par=0 -maxconnections=125 -rpcuser="${BITCOIN_RPC_USER}" -rpcpassword="${BITCOIN_RPC_PASS}"; else - exec bitcoind -server=1 -txindex=1 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0:8332 -listen=1 -bind=0.0.0.0:8333 -dbcache=4096 -rpcuser="${BITCOIN_RPC_USER}" -rpcpassword="${BITCOIN_RPC_PASS}"; + exec bitcoind -server=1 -txindex=1 -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0:8332 -listen=1 -bind=0.0.0.0:8333 -dbcache=4096 -par=0 -maxconnections=125 -rpcuser="${BITCOIN_RPC_USER}" -rpcpassword="${BITCOIN_RPC_PASS}"; fi derived_env: - key: DISK_GB diff --git a/core/Cargo.lock b/core/Cargo.lock index fe457273..ef63a988 100644 --- a/core/Cargo.lock +++ b/core/Cargo.lock @@ -80,7 +80,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "archipelago" -version = "1.7.46-alpha" +version = "1.7.47-alpha" dependencies = [ "anyhow", "archipelago-container", diff --git a/core/archipelago/Cargo.toml b/core/archipelago/Cargo.toml index e73ebde9..e4ec5d63 100644 --- a/core/archipelago/Cargo.toml +++ b/core/archipelago/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "archipelago" -version = "1.7.46-alpha" +version = "1.7.47-alpha" edition = "2021" description = "Archipelago Bitcoin Node OS - Native backend" authors = ["Archipelago Team"] diff --git a/core/archipelago/src/api/rpc/package/config.rs b/core/archipelago/src/api/rpc/package/config.rs index 941c46e5..92169665 100644 --- a/core/archipelago/src/api/rpc/package/config.rs +++ b/core/archipelago/src/api/rpc/package/config.rs @@ -244,13 +244,19 @@ pub(super) fn get_health_check_args(app_id: &str, _rpc_pass: &str) -> Vec &'static str { match app_id { - // Heavy apps - "bitcoin" | "bitcoin-core" | "bitcoin-knots" => "4g", + // Heavy apps. Bitcoin: dbcache uses ~4GB; the daemon also needs + // headroom for mempool + connection buffers + script-verifier + // memory + I/O. 4g caused OOM-cascades during IBD. 8g is the + // floor; ideally this would be host-RAM aware (next pass). + "bitcoin" | "bitcoin-core" | "bitcoin-knots" => "8g", + // ElectrumX: bumped from 1g to 2g so its CACHE_MB has somewhere + // to live during initial blockchain indexing. CACHE_MB=2048 in + // env vars below requires this much. + "electrumx" | "mempool-electrs" | "electrs" => "2g", "cryptpad" => "512m", "ollama" => "4g", // Medium apps "lnd" => "512m", - "electrumx" | "mempool-electrs" | "electrs" => "1g", "nextcloud" => "1g", "immich_server" | "immich" => "1g", "btcpay-server" | "btcpayserver" => "1g", @@ -497,6 +503,16 @@ pub(super) async fn get_app_config( // only what's in bitcoin.conf + argv. The shared bitcoin.conf // carries rpcauth; we inject the networking flags as CLI args so // RPC is reachable from the bitcoin-ui companion container. + // + // Sync-speed flags: + // -dbcache=4096 — UTXO set cache; 4GB is the sweet spot before + // diminishing returns. Container has --memory=8g now so + // there's headroom for mempool + connections. + // -par=0 — use all available cores for script + // verification (defaults to NCPU-1 capped at 16). Was + // effectively pinned at 2 by --cpus=2 (now removed). + // -maxconnections=125 — default but explicit, so ops can + // tune downward on bandwidth-constrained nodes. Some(vec![ "-server=1".to_string(), "-rpcbind=0.0.0.0".to_string(), @@ -504,6 +520,9 @@ pub(super) async fn get_app_config( "-rpcport=8332".to_string(), "-printtoconsole=1".to_string(), "-datadir=/home/bitcoin/.bitcoin".to_string(), + "-dbcache=4096".to_string(), + "-par=0".to_string(), + "-maxconnections=125".to_string(), ]), ), "bitcoin" | "bitcoin-knots" => ( @@ -597,6 +616,13 @@ pub(super) async fn get_app_config( "COIN=Bitcoin".to_string(), "DB_DIRECTORY=/data".to_string(), "SERVICES=tcp://:50001,rpc://0.0.0.0:8000".to_string(), + // Sync-speed: bigger LRU/write cache during initial + // history index. Default is 1200MB, container now + // gets 2g (config.rs::get_memory_limit) so 2048 fits. + "CACHE_MB=2048".to_string(), + // Block-fetcher concurrency — defaults are conservative + // for shared hosts; 4 is plenty for one bitcoind backend. + "MAX_SEND=10000000".to_string(), ], None, None, diff --git a/core/archipelago/src/api/rpc/package/install.rs b/core/archipelago/src/api/rpc/package/install.rs index 674b7d63..5c485e93 100644 --- a/core/archipelago/src/api/rpc/package/install.rs +++ b/core/archipelago/src/api/rpc/package/install.rs @@ -567,7 +567,18 @@ impl RpcHandler { let memory_limit = get_memory_limit(package_id); let mem_arg = format!("--memory={}", memory_limit); run_args.push(&mem_arg); - run_args.push("--cpus=2"); + // Bitcoin (and friends) need every core they can get during initial + // blockchain download — script verification is parallelizable and + // the limiting factor on most home boxes. --cpus=2 was halving sync + // speed for 4-8 core machines. ElectrumX likewise scales with cores + // during its initial reorg/indexing phase. + let cpu_capped = !matches!( + package_id, + "bitcoin" | "bitcoin-core" | "bitcoin-knots" | "electrumx" | "electrs" | "mempool-electrs" + ); + if cpu_capped { + run_args.push("--cpus=2"); + } // Uptime Kuma image entrypoint (`extra/entrypoint.sh`) attempts // `setpriv --clear-groups` and fails under our rootless + cap-drop diff --git a/neode-ui/package.json b/neode-ui/package.json index 7b1b7f04..d559d709 100644 --- a/neode-ui/package.json +++ b/neode-ui/package.json @@ -1,7 +1,7 @@ { "name": "neode-ui", "private": true, - "version": "1.7.46-alpha", + "version": "1.7.47-alpha", "type": "module", "scripts": { "start": "./start-dev.sh",