Skip to content

Feat/testnet4 deployment support#3932

Open
lionakhnazarov wants to merge 21 commits intothreshold-network:mainfrom
lionakhnazarov:feat/testnet4-deployment-support
Open

Feat/testnet4 deployment support#3932
lionakhnazarov wants to merge 21 commits intothreshold-network:mainfrom
lionakhnazarov:feat/testnet4-deployment-support

Conversation

@lionakhnazarov
Copy link
Copy Markdown
Collaborator

feat: Bitcoin testnet4 defaults + Sepolia Hardhat/deploy tooling

Summary

This PR wires the Go client to Bitcoin testnet4 when using the Sepolia Ethereum mapping, adds an embedded Electrum URL list for testnet4, and updates ECDSA / random-beacon Hardhat config and deploy scripts so Sepolia deployments and redeploys work reliably with local artifacts and deployer accounts.

Client (Go)

  • Adds bitcoin.Testnet4 and extends Network.String() so embedded Electrum resolution can use _electrum_urls/testnet4.
  • Maps SepoliaBitcoin testnet4 in config/network (replacing the legacy testnet mapping).
  • Adds config/_electrum_urls/testnet4 with a default Electrum server URL and extends config/electrum_test.go accordingly.

Solidity / Hardhat

  • ECDSA hardhat.config.ts: makes contract verification optional (@nomicfoundation/hardhat-verify), adjusts Sepolia named accounts to use index 0 (works with ACCOUNTS_PRIVATE_KEYS), trims external deployment paths for Sepolia to avoid RPC issues with stale transactionHash in npm artifacts, and relaxes typing where needed.
  • Deploy scripts (02_deploy_dkg_validator, 03_deploy_wallet_registry): supports forced compile via THRESHOLD_FORCE_DKG_COMPILE, and sets skipIfAlreadyDeployed: false for DKG validator where bytecode must be refreshed after Solidity changes.
  • Random beacon: updates export.json, hardhat.config.ts, 05_approve_random_beacon_in_token_staking.ts, and yarn.lock (large lockfile refresh).

Other

  • CI: trivial newline-only edits at EOF in contracts-ecdsa.yml and contracts-random-beacon.yml.
  • config/peers_test.go: adds an extra expected bootstrap peer for the testnet test case (consider splitting out if this PR should stay scoped only to testnet4/Sepolia tooling).

How to test

  • go test ./config/... ./pkg/bitcoin/...
  • From solidity/ecdsa / solidity/random-beacon: yarn install and deploy or dry-run against Sepolia as you normally do for this stack.

Notes / follow-ups

  • Review whether the Electrum URL and deployer/account choices in config are appropriate for a public merge (or replace with placeholders and document env overrides).
  • Consider moving peers_test.go and pure lockfile/export churn to separate commits or PRs if reviewers want a minimal diff.
  • Regenerate OpenZeppelin / deployment JSON locally and commit if your workflow expects those artifacts in-repo.

lionakhnazarov and others added 21 commits December 12, 2025 14:16
- Introduced Testnet4 configuration in  with a new Electrum server URL.
- Updated  to include Testnet4 for Bitcoin networks.
- Added Testnet4 constant in  for better network identification.
- Adjusted test cases in  for improved readability.
- Updated Hardhat configuration files to streamline deployment processes and handle potential errors during verification.
…ort.json file

- Removed a defunct Thesis Electrum URL from the expected peers in .
- Deleted the  file as it is no longer needed, streamlining the project structure.
…ackage.json and yarn.lock for ECDSA and random-beacon
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.

1 participant