Feat/testnet4 deployment support#3932
Open
lionakhnazarov wants to merge 90 commits into
Open
Conversation
- 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
…abi version in ECDSA and random-beacon
…g in deployment scripts
… script for improved environment isolation
…ardhat-verify after Hardhat 3 upgrade, clarifying API compatibility
…ent for mainnet compatibility
… replace deprecated IP address
…encies in package-lock.json and package.json
…n test networks to improve reliability
…ailable data for various networks
…ervers and adding error handling for integration tests
…to skip outdated public endpoints
lrsaturnino
reviewed
Apr 22, 2026
Comment on lines
+482
to
+484
| (, address beneficiary, ) = _currentAuthorizationSource().rolesOf( | ||
| stakingProvider | ||
| ); |
Member
There was a problem hiding this comment.
Body now routes beneficiary lookup through _currentAuthorizationSource() (allowlist when set), but the docstring above (lines 452–478) still says NOT MIGRATED: Beneficiary lookup remains on TokenStaking and explicitly notes the two sources return different beneficiaries for delegated setups. A mainnet spot-check confirms the divergence for at least one live staking provider.
withdrawRewards returns 0 today per TIP-092/100 so the immediate impact is bounded, but the new bytecode ships on the next redeploy. Could we either revert this one-liner, or update the docstring and split it into its own commit? It currently lives inside one titled as a test refactor, which makes the contract change easy to miss.
…tOwner function with governance checks and error handling
… addresses, transaction hashes, and gas usage metrics
withdrawRewards resolves the beneficiary via _currentAuthorizationSource(). Replace stale NOT MIGRATED / TokenStaking-only commentary with accurate routing, delegated-setup divergence, TIP-092/100 reward halt context, and future reactivation semantics. Made-with: Cursor
…s and update Hardhat configuration for plugin compatibility
…resses, transaction hashes, and gas metrics for multiple contracts
…specific group parameters for improved deployment on testnets
…for enhanced group parameter configuration
…ain for reliable retargeting
…aintainer for handling preflight errors gracefully
…improved transaction confirmation reliability
…ficulty maintainer's pre-retarget validation for better handling of minimum-difficulty blocks
…resses, transaction hashes, and gas metrics for multiple contracts
4 tasks
lionakhnazarov
added a commit
that referenced
this pull request
May 5, 2026
…3932) (#3949) ## Summary Follow-up to #3932 (`feat/testnet4-deployment-support`) addressing all valid findings from the multi-agent review. Each fix is a separate commit for bisectability. - **F1** `fix(ethereum)`: Replace `context.Background()` with 30-min timeout in `waitDeployBackendTransactionMined` to prevent indefinite blocking on stuck transactions - **F2** `docs(local_v1)`: Document lazy watcher cleanup and add `defer ticker.Stop()` in `localBlockCounter.count()` - **F3** `fix(electrum)`: Gate static fee fallback on non-mainnet; add `network bitcoin.Network` param to `Connect` (compiler-enforced, not config struct drift) - **F4** `fix(electrum)`: Replace string-based `-32603` detection with typed `feeOracleFailure` sentinel (`errors.As`); fix ticker leak in `keepAlive` - **F5** `fix(ecdsa)`: Add `CodeAt` preflight before ABI calls in `ecdsaWalletGroupParametersFromValidator` to fail fast on wrong/undeployed address - **F6** `refactor(tbtc)`: Extract named `groupParametersProvider` interface (was anonymous inline) - **F7** `fix(btcdiff)`: Escalate idle log from `Infof` to `Errorf` after 20 consecutive idle ticks; reset counter on proven epoch - **F8** `fix(ecdsa)`: Add `groupQuorum >= honestThreshold` invariant check after existing range checks - **F9** `fix(deploy)`: Log warning when `EcdsaDkgValidator` is redeployed on non-mainnet (WalletRegistry must be updated to point to new address) - **F10** `fix(deploy)`: Remove unreachable try/catch in `07_approve_wallet_registry.ts`; the `ifaceHasFunction` ABI guard is the authoritative check ## Test plan - [ ] Go unit tests pass: `go test ./pkg/...` - [ ] TypeScript compiles: `cd solidity/ecdsa && npx hardhat compile` - [ ] CI green on all required checks - [ ] Electrum callers compile with updated `Connect` signature (network param added) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
…ialization for improved readability
…ic block sequence and simplifying timeout handling for better reliability
…n to ensure proper behavior when multiple members submit claims
…g in DKG execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
It fixes several failures that were blocking branch validation, including Yarn/Corepack mismatches in Docker and docs workflows, Git/Yarn checkout issues in GitHub Actions, stale random-beacon deploy exports used by ECDSA tests, and flaky/incompatible Go integration tests caused by provider rate limits, Electrum timeouts, and local block watcher race conditions.
Client (Go)
bitcoin.Testnet4and extendsNetwork.String()so embedded Electrum resolution can use_electrum_urls/testnet4.config/network(replacing the legacy testnet mapping).config/_electrum_urls/testnet4with a default Electrum server URL and extendsconfig/electrum_test.goaccordingly.Solidity / Hardhat
hardhat.config.ts: makes contract verification optional (@nomicfoundation/hardhat-verify), adjusts Sepolia named accounts to use index0(works withACCOUNTS_PRIVATE_KEYS), trimsexternaldeployment paths for Sepolia to avoid RPC issues with staletransactionHashin npm artifacts, and relaxes typing where needed.02_deploy_dkg_validator,03_deploy_wallet_registry): supports forced compile viaTHRESHOLD_FORCE_DKG_COMPILE, and setsskipIfAlreadyDeployed: falsefor DKG validator where bytecode must be refreshed after Solidity changes.export.json,hardhat.config.ts,05_approve_random_beacon_in_token_staking.ts, and yarn.lock (large lockfile refresh).Other
contracts-ecdsa.ymlandcontracts-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).ecdsaandrandom-beaconto include.yarnrc.ymland use Corepack withyarn@4.8.1.random-beaconexport deploy path for ECDSA so CI does not depend on gitignored sibling exports or stale npm exports.05_approve_random_beacon_in_token_staking.jsflow to skip networks whereTokenStakingdoes not exposeapproveApplication.WalletRegistryGovernancetest fixture setup to load the full deployment fixture soTand other external deployments are available.local_v1block counter watcher shutdown behavior and increased watcher buffering to reduce flaky coordination-layer test failures.How to test
go test ./config/... ./pkg/bitcoin/...solidity/ecdsa/solidity/random-beacon:yarn installand deploy or dry-run against Sepolia as you normally do for this stack.Notes / follow-ups
peers_test.goand pure lockfile/export churn to separate commits or PRs if reviewers want a minimal diff.