From fadc46f3b5a9a61ece9f9872e8de74b7a77c1f19 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 21 Aug 2023 04:00:52 +0000 Subject: [PATCH 1/3] Add a missing `[workspace]` tag in rust-gbt Cargo to build in git If cargo detects its being run in a git tree, it looks for a top-level `Cargo.toml`. When failing to find one, it errors out, saying "current package believes it's in a workspace when it's not." Instead, we add a `[workspace]` tag to let cargo know that rust-gbt is not, in fact, in a rust workspace. --- backend/rust-gbt/Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/rust-gbt/Cargo.toml b/backend/rust-gbt/Cargo.toml index 09fde52e2..790dd6214 100644 --- a/backend/rust-gbt/Cargo.toml +++ b/backend/rust-gbt/Cargo.toml @@ -6,6 +6,8 @@ authors = ["mononaut"] edition = "2021" publish = false +[workspace] + [lib] crate-type = ["cdylib"] From 6088fffc0943b133b725d8bae02647c2cf1d1659 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 21 Aug 2023 04:03:37 +0000 Subject: [PATCH 2/3] Drop MSRV to 1.63 Debian bookworm ships with 1.63, and since the change is trivial, there's little reason to not support people running mempool on Debian. --- .github/workflows/ci.yml | 4 ++-- backend/rust-gbt/src/gbt.rs | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b9b1594b..b99454097 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: node-version: ${{ matrix.node }} registry-url: "https://registry.npmjs.org" - - name: Install 1.70.x Rust toolchain - uses: dtolnay/rust-toolchain@1.70 + - name: Install 1.63.x Rust toolchain + uses: dtolnay/rust-toolchain@1.63 - name: Install if: ${{ matrix.flavor == 'dev'}} diff --git a/backend/rust-gbt/src/gbt.rs b/backend/rust-gbt/src/gbt.rs index 0bf7f9999..fb28dc299 100644 --- a/backend/rust-gbt/src/gbt.rs +++ b/backend/rust-gbt/src/gbt.rs @@ -335,13 +335,15 @@ fn set_relatives(txid: u32, audit_pool: &mut AuditPool) { let mut total_sigops: u32 = 0; for ancestor_id in &ancestors { - let Some(ancestor) = audit_pool + if let Some(ancestor) = audit_pool .get(*ancestor_id as usize) - .expect("audit_pool contains all ancestors") else { todo!() }; - total_fee += ancestor.fee; - total_sigop_adjusted_weight += ancestor.sigop_adjusted_weight; - total_sigop_adjusted_vsize += ancestor.sigop_adjusted_vsize; - total_sigops += ancestor.sigops; + .expect("audit_pool contains all ancestors") + { + total_fee += ancestor.fee; + total_sigop_adjusted_weight += ancestor.sigop_adjusted_weight; + total_sigop_adjusted_vsize += ancestor.sigop_adjusted_vsize; + total_sigops += ancestor.sigops; + } else { todo!() }; } if let Some(Some(tx)) = audit_pool.get_mut(txid as usize) { From 122a721d7ab53f3f6740fd8c5270b2c2b12d6097 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 21 Aug 2023 05:04:33 +0000 Subject: [PATCH 3/3] sign cla --- contributors/TheBlueMatt.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 contributors/TheBlueMatt.txt diff --git a/contributors/TheBlueMatt.txt b/contributors/TheBlueMatt.txt new file mode 100644 index 000000000..77b39e982 --- /dev/null +++ b/contributors/TheBlueMatt.txt @@ -0,0 +1,3 @@ +I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file with sha256 hash c80c5ee4c71c5a76a1f6cd35339bd0c45b25b491933ea7b02a66470e9f43a6fd. + +Signed: TheBlueMatt