From 202285bae34a41012b9ecc6001653a564ad495ba Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 5 Mar 2026 17:05:55 -0300 Subject: [PATCH 1/2] ci: switch to bitcoin/bitcoin#33922 (DO NOT MERGE) --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2985a39..e3f178f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,12 @@ jobs: key: ccache-${{ runner.os }}-${{ github.sha }} restore-keys: ccache-${{ runner.os }}- - name: Checkout Bitcoin Core - run: git clone --depth 1 --branch master https://github.com/bitcoin/bitcoin.git + run: | + git clone --depth 1 https://github.com/bitcoin/bitcoin.git + # DO NOT MERGE: switch to bitcoin/bitcoin#33922 PR branch + cd bitcoin + git fetch --depth 1 origin pull/33922/head:pr-33922 + git checkout pr-33922 - name: Build Bitcoin Core run: | cd bitcoin From 45ea30aac74c662647f457e6b19e2fef63368034 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 5 Mar 2026 17:06:06 -0300 Subject: [PATCH 2/2] mining: add getMemoryLoad capnp definition and test coverage --- capnp/mining.capnp | 5 +++++ tests/test.rs | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/capnp/mining.capnp b/capnp/mining.capnp index f790e12..44a241b 100644 --- a/capnp/mining.capnp +++ b/capnp/mining.capnp @@ -23,6 +23,7 @@ interface Mining $Proxy.wrap("interfaces::Mining") { createNewBlock @4 (context :Proxy.Context, options: BlockCreateOptions, cooldown: Bool = true) -> (result: BlockTemplate); checkBlock @5 (context :Proxy.Context, block: Data, options: BlockCheckOptions) -> (reason: Text, debug: Text, result: Bool); interrupt @6 () -> (); + getMemoryLoad @7 (context :Proxy.Context) -> (result: MemoryLoad); } interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") { @@ -44,6 +45,10 @@ struct BlockCreateOptions $Proxy.wrap("node::BlockCreateOptions") { coinbaseOutputMaxAdditionalSigops @2 :UInt64 = .defaultCoinbaseOutputMaxAdditionalSigops $Proxy.name("coinbase_output_max_additional_sigops"); } +struct MemoryLoad $Proxy.wrap("interfaces::MemoryLoad") { + usage @0 :UInt64; +} + struct BlockWaitOptions $Proxy.wrap("node::BlockWaitOptions") { timeout @0 : Float64 = .maxDouble $Proxy.name("timeout"); feeThreshold @1 : Int64 = .maxMoney $Proxy.name("fee_threshold"); diff --git a/tests/test.rs b/tests/test.rs index bf7e0d2..5c4badc 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -69,7 +69,7 @@ fn mining_constants() { ); } -/// isTestChain, isInitialBlockDownload, getTip. +/// isTestChain, isInitialBlockDownload, getTip, getMemoryLoad. #[tokio::test] #[serial_test::parallel] async fn mining_basic_queries() { @@ -96,6 +96,13 @@ async fn mining_basic_queries() { let tip_hash = tip.get_hash().unwrap(); assert_eq!(tip_hash.len(), 32, "block hash must be 32 bytes"); assert!(tip.get_height() >= 0, "height must be non-negative"); + + // getMemoryLoad + let mut req = mining.get_memory_load_request(); + req.get().get_context().unwrap().set_thread(thread.clone()); + let resp = req.send().promise.await.unwrap(); + let memory_load = resp.get().unwrap().get_result().unwrap(); + let _usage: u64 = memory_load.get_usage(); }) .await; }