Skip to content

feat: support testnet4 - #144

Merged
philippem merged 2 commits into
Blockstream:new-indexfrom
zoedberg:testnet4
Jun 19, 2025
Merged

feat: support testnet4#144
philippem merged 2 commits into
Blockstream:new-indexfrom
zoedberg:testnet4

Conversation

@zoedberg

Copy link
Copy Markdown

I have rebased the code from #91 since that has merge conflicts and it seems it's dormant since 2 months. I also removed some changes that I think were not necessary (probably there to update rust-bitcoin, which has been already done on the updated tip) and formatted the code with the latest Rust stable version. Moreover I would have renamed the existing Testnet variant to Testnet3, but this is not a decision I should take so let me know if this looks good to you or if you want me to make some changes.

@zoedberg zoedberg changed the title feat: testnet4 is supported with the latest rust-bitcoin feat: support testnet4 Feb 24, 2025
@pseudozach

Copy link
Copy Markdown

what's next for this PR? how can we help get this merged so esplora can have testnet4 support?

@zoedberg

Copy link
Copy Markdown
Author

The PR is waiting for a review. As soon as this gets merged I will open a PR on https://github.com/Blockstream/esplora/ (esplora code is ready but it requires electrs code to be merged into the default branch).

@pseudozach pseudozach left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@RCasatta would you have time to take a look please and thank you 🙏

PR is just adding testnet4 related ports and variables afaict.

@RCasatta RCasatta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, some minor comments

checked used port 48332 matches bitcoin core

Comment thread Cargo.toml Outdated
Comment thread src/chain.rs Outdated
Comment thread src/new_index/mempool.rs
RCasatta
RCasatta previously approved these changes Jun 9, 2025

@RCasatta RCasatta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 2163573

I didn't test it actually works on testnet4 but it should

@zoedberg

zoedberg commented Jun 9, 2025

Copy link
Copy Markdown
Author

@RCasatta if you prefer to test it before merging you can use Blockstream/esplora#570 (just remember to change the clone url in contrib/Dockerfile.base)

@shesek shesek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One tiny nit, all looks good other than that. Thanks!

Comment thread src/config.rs Outdated
@shesek

shesek commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

I confirmed that d51c0dc matches the changes introduced by cargo fmt (minus one minor difference, probably due to a different cargo version)

$ git checkout new-index # 208491fa40a993a47, zoed/testnet4^^
$ cargo fmt
$ git diff zoed/testnet4^ # d51c0dc2b668d9d7043
diff --git a/src/new_index/mempool.rs b/src/new_index/mempool.rs
index 6d318d2..e11754b 100644
--- a/src/new_index/mempool.rs
+++ b/src/new_index/mempool.rs
@@ -3,7 +3,6 @@ use itertools::{Either, Itertools};
 
 #[cfg(not(feature = "liquid"))]
 use bitcoin::consensus::encode::serialize;
-use electrs_macros::trace;
 #[cfg(feature = "liquid")]
 use elements::{encode::serialize, AssetId};
 
@@ -23,6 +22,7 @@ use crate::new_index::{
 };
 use crate::util::fees::{make_fee_histogram, TxFeeInfo};
 use crate::util::{extract_tx_prevouts, full_hash, get_prev_outpoints, is_spendable, Bytes};
+use electrs_macros::trace;
 
 #[cfg(feature = "liquid")]
 use crate::elements::asset;

@RCasatta RCasatta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 117d952

@philippem

Copy link
Copy Markdown
Collaborator

tack

@philippem
philippem merged commit cd270cd into Blockstream:new-index Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants