feat(go): add testnet4 mapping and harden runtime integration behavior - #4002
Conversation
72b052e to
5b40e26
Compare
99015a1 to
dc687c9
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds Bitcoin Testnet4 and Electrum network plumbing; implements ordered Electrum fee fallback and network-gated low-fee fallback; adds maintainer preflight verification with IdleOnPreflightFailure flag; waits for retarget transactions to be mined/confirmed; reads TBTC group parameters from an optional on-chain validator; and improves watcher lifecycle and multiple tests. ChangesBitcoin testnet4 and maintainer improvements
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
754346d to
dc687c9
Compare
9ade31f to
5b40e26
Compare
## Stack Context Follow-up to #4002 (`stack/testnet4-04-go-testnet4-runtime`). Base: `stack/testnet4-04-go-testnet4-runtime` Addresses three runtime/operability issues surfaced during review of #4002. ## What's in this PR ### 1) Bound the synchronous retarget wait — `pkg/chain/ethereum/bitcoin_difficulty.go` `waitDeployBackendTransactionMined` previously called `bind.WaitMined(context.Background(), …)` with no timeout, then `BlockCounter.WaitForBlockHeight` (which has no context parameter). A stalled RPC or chain that stopped producing blocks would hang the maintainer indefinitely on every `Retarget` / `RetargetWithRefund` call — including on mainnet. Both waits are now bounded under a shared 10-minute deadline. A small `waitForBlockHeightCtx` shim adapts the context-less `BlockCounter` interface, with a regression test verifying it returns `context.DeadlineExceeded` when the counter blocks forever. ### 2) Warn loudly about Sepolia DKG fragility — `pkg/tbtc/tbtc.go`, `pkg/chain/ethereum/tbtc.go` The Sepolia/Developer `defaultGroupParameters` returns `{GroupSize:3, GroupQuorum:3, HonestThreshold:2}`. Quorum equals size — a single offline operator prevents DKG progress. - Elevated the existing `Infof` to `Warnf` and spelled out the operational consequence. - Added a `Warnf` in `pkg/chain/ethereum/tbtc.go` where the `EcdsaDkgValidator` `ErrAddressNotConfigured` branch previously fell through silently. Operators now see at startup whether group sizing is coming from on-chain values or compile-time defaults. No sizing values are changed. ### 3) Document the testnet3 → testnet4 wiring as breaking No code change in this PR; the startup banner at `config/config.go:101` already prints the resolved Bitcoin network. Operator-facing note is captured here and should be folded into release notes when #4002 lands. After #4002 lands, `network.Type=Testnet` (Sepolia) resolves to `bitcoin.Testnet4` rather than `bitcoin.Testnet` (testnet3). Existing Sepolia operators will switch both the embedded Electrum URL set and the Bitcoin network on upgrade. Pin to a pre-#4002 build to remain on testnet3. ## Test Plan - [x] `go build ./...` - [x] `go vet ./pkg/chain/ethereum/... ./pkg/tbtc/...` - [x] `go test ./pkg/chain/ethereum/...` - [x] `go test ./pkg/tbtc/` - [x] New regression: `TestWaitForBlockHeightCtx_DeadlineExceeded`, `TestWaitForBlockHeightCtx_ReturnsImmediatelyOnSuccess`
3b156d8 to
979333c
Compare
…#4019) ## Problem PR #4002 added an Electrum fee-estimate fallback: when `blockchain.estimatefee` returns no estimate for any confirmation target (common on quiet testnet4 mempools, which answer `-32603` for every target), `EstimateSatPerVByteFee` returns a hardcoded `2` sat/vByte instead of an error. That fallback is network-blind. Before, an oracle failure returned an error and no transaction was broadcast on a guessed feerate (fail-safe). After, the same failure yields a fixed `2` sat/vByte that flows into the production tBTC proposal fee paths (`tbtcpg/deposit_sweep.go`, `redemptions.go`, `moving_funds.go`, `moved_funds_sweep.go`) on mainnet as well, with no minimum-feerate floor in `TransactionFeeEstimator.EstimateFee`. On mainnet a `2` sat/vByte transaction can be left unconfirmable under congestion, or evicted if the dynamic mempool minimum feerate rises above it — stalling sweeps and redemptions (delayed mints / undelivered BTC). The funds are not lost, but operations can get stuck. ## Solution Gate the fallback to networks where an underpriced transaction is economically harmless — `testnet`, `testnet4`, `regtest`. On `mainnet`, and on any unset or unknown network, the oracle failure is surfaced as an error so callers do not broadcast at a guessed feerate (fail-closed default). - A new `electrum.Config.Network` field carries the resolved Bitcoin network into the connection. It is set from the client configuration in `config.resolveElectrum`, tagged `mapstructure:"-"`, and assigned after config unmarshal — so a config-file key cannot re-enable the fallback on mainnet. - The fallback decision is factored into pure helpers (`feeFallbackResult` and `lowFeeFallbackAllowed`) so it can be tested deterministically without a live Electrum client. - testnet4's existing graceful degradation is preserved; only mainnet (and unknown-network) behavior changes — back to the pre-#4002 fail-safe. ## Tests - New unit test `TestFeeFallbackResult` covers the decision per network: mainnet and unknown fail safe with an error; testnet/testnet4/regtest use the fallback; transport-level failures always error. - `config.TestResolveElectrum` now asserts the resolved network is propagated into the Electrum config. - The Electrum integration test configs carry their network so the integration path exercises the gate rather than defaulting to `Unknown`. - Local CI is green: `gofmt -l`, `go vet`, `go build ./...`, `go test` (changed packages), `go vet -tags=integration` (compile), Staticcheck 2025.1.1, and gosec (0 issues). ## Notes This is a follow-up to the review of #4002 and is based on its head branch (`stack/testnet4-04-go-testnet4-runtime`), so the diff is scoped to this fix.
979333c to
0e373f5
Compare
…lows (#4000) ## Stack Context This is **PR 2/4** in the reorganization stack. Base: #3999 (`stack/testnet4-01-ci-yarn`) Next: #4001 ## What Changed ### 1) ECDSA deploy/runtime logic - Contract-level adjustments: - `solidity/ecdsa/contracts/WalletRegistry.sol` - Deploy script updates for deployment flow and account/approval behavior: - `solidity/ecdsa/deploy/00_resolve_reimbursement_pool.ts` - `solidity/ecdsa/deploy/00_resolve_token_staking.ts` - `solidity/ecdsa/deploy/01_deploy_ecdsa_sortition_pool.ts` - `solidity/ecdsa/deploy/02_deploy_dkg_validator.ts` - `solidity/ecdsa/deploy/03_deploy_wallet_registry.ts` - `solidity/ecdsa/deploy/07_approve_wallet_registry.ts` - `solidity/ecdsa/deploy/09_deploy_wallet_registry_governance.ts` - Added verification helper: - `solidity/ecdsa/deploy/etherscanVerification.ts` - Hardhat runtime/config updates: - `solidity/ecdsa/hardhat.config.ts` - Wallet owner initialization logic update: - `solidity/ecdsa/tasks/initialize-wallet-owner.ts` ### 2) ECDSA test/fixture/type updates - Tests: - `solidity/ecdsa/test/WalletRegistry.Authorization.test.ts` - `solidity/ecdsa/test/WalletRegistry.CustomErrors.test.ts` - `solidity/ecdsa/test/WalletRegistry.Rewards.test.ts` - `solidity/ecdsa/test/WalletRegistry.Slashing.test.ts` - `solidity/ecdsa/test/WalletRegistry.Upgrade.test.ts` - `solidity/ecdsa/test/WalletRegistry.WalletCreation.test.ts` - `solidity/ecdsa/test/WalletRegistryGovernance.test.ts` - Fixtures/utilities: - `solidity/ecdsa/test/fixtures/index.ts` - `solidity/ecdsa/test/utils/operators.ts` - Added types: - `solidity/ecdsa/types/TokenStaking.extensions.d.ts` - `solidity/ecdsa/types/chai.d.ts` ### 3) Random beacon deploy/config/test alignment - Deploy/config: - `solidity/random-beacon/deploy/05_approve_random_beacon_in_token_staking.ts` - `solidity/random-beacon/hardhat.config.ts` - Tests/fixtures/utilities: - `solidity/random-beacon/test/RandomBeacon.Authorization.test.ts` - `solidity/random-beacon/test/RandomBeacon.Callback.test.ts` - `solidity/random-beacon/test/RandomBeacon.GroupCreation.test.ts` - `solidity/random-beacon/test/RandomBeacon.Relay.test.ts` - `solidity/random-beacon/test/RandomBeacon.Rewards.test.ts` - `solidity/random-beacon/test/system/e2e.test.ts` - `solidity/random-beacon/test/fixtures/index.ts` - `solidity/random-beacon/test/utils/operators.ts` - Added types: - `solidity/random-beacon/types/TokenStaking.extensions.d.ts` ### 4) Embedded export deploy scripts for ECDSA external random-beacon export - Added scripts under: - `solidity/ecdsa/external/random-beacon-export/deploy/01_*.js ... 09_*.js` ## Out of Scope - Generated `deployments/sepolia` JSON snapshots (handled in #4001). - Go/Testnet4 runtime changes (handled in #4002). ## Test Plan - [ ] `cd solidity/ecdsa && yarn test` - [ ] `cd solidity/random-beacon && yarn test` - [ ] Spot-check deployment flows for expected skip/redeploy behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added deployment verification helper wrappers for improved error resilience. * Introduced random beacon deployment automation with network-aware initialization. * Enhanced wallet governance initialization with additional consistency validation. * **Bug Fixes** * Made deployment scripts network-aware to gracefully skip unavailable contracts on local development networks. * Added ABI-level feature detection to prevent failures when calling unsupported contract methods. * Improved deployment transaction handling with environment-based gas price configuration. * **Documentation** * Updated contract documentation with expanded guidance on beneficiary address resolution behavior. * Added deployment guidelines for vendored external contracts. * **Tests** * Updated test suites to use allowlist-based authorization by default with legacy fallback support. * Enhanced test utilities with improved compatibility helpers for legacy contract interactions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
0e373f5 to
219a732
Compare
## Stack Context This is **PR 3/4** in the reorganization stack. Base: #4000 (`stack/testnet4-02-solidity-logic`) Next: #4002 ## What Changed ### 1) Added generated Sepolia deployment snapshots (ECDSA) - Added full deployment artifacts under: - `solidity/ecdsa/deployments/sepolia/.chainId` - `solidity/ecdsa/deployments/sepolia/.migrations.json` - `solidity/ecdsa/deployments/sepolia/*.json` (Allowlist, BLS, Beacon*, Ecdsa*, RandomBeacon*, ReimbursementPool, T, TokenStaking, WalletRegistry*) ### 2) Added generated Sepolia deployment snapshots (Random Beacon) - Added full deployment artifacts under: - `solidity/random-beacon/deployments/sepolia/.chainId` - `solidity/random-beacon/deployments/sepolia/*.json` (BLS, Beacon*, RandomBeacon*, ReimbursementPool, T, TokenStaking) ### 3) Repo hygiene - Removed legacy export artifact: `solidity/random-beacon/export.json` - Gitignored Yarn Berry runtime state (`.yarn/install-state.gz`) in `solidity/random-beacon` to match the ecdsa package. - Gitignored `gasReporterOutput.json` in both `solidity/ecdsa` and `solidity/random-beacon` (regenerated on every test run, not a source artifact). ## Why This Slice Exists This PR intentionally isolates generated/deployment snapshot churn so logic review stays focused in adjacent PRs. ## Out of Scope - Deploy/runtime logic changes. - Go runtime/network mapping changes. ## Test Plan - [ ] Regenerated artifact set matches expected deployment outputs. - [ ] No non-generated behavior changes are introduced in this PR. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Sepolia testnet support with full deployment artifacts and allowlist-enabled registry flows. * **Improvements** * Stronger deployment safety checks and clearer errors for missing upstream contracts. * Verification now fails on mainnet but is tolerant on non-mainnet. * CI/dev housekeeping: ignore gas reporter outputs and set Sepolia chain IDs. * **Documentation** * Expanded guidance for vendored deploy script regeneration and usage. * **Tests** * Test fixtures updated to require explicit allowlist mode. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
ffc61eb to
cd7ee40
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/bitcoin/electrum/electrum.go`:
- Around line 1064-1073: The current block returns the fallback fee whenever
sawFeeOracleFailure is true, which masks transport/auth and other non-oracle
failures; change the logic in the function that computes fee estimates so that
you only apply defaultFallbackSatPerVByteWhenEstimateFails when there were
exclusively oracle "no estimate" responses (sawFeeOracleFailure == true AND no
transport/auth or other failures), otherwise propagate lastErr (or return an
explicit error). Concretely, add a boolean (e.g., sawNonOracleFailure) or
inspect lastErr/error types (using errors.Is or by checking known transport/auth
error values) alongside sawFeeOracleFailure, update the conditional around
logger.Warnf/return so the fallback path runs only when no non-oracle failures
were observed, and ensure logger.Warnf still includes lastErr when returning the
fallback and return lastErr when non-oracle failures occurred. Use the existing
symbols sawFeeOracleFailure, lastErr,
defaultFallbackSatPerVByteWhenEstimateFails, and logger.Warnf to locate and
modify the code.
In `@pkg/chain/ethereum/bitcoin_difficulty.go`:
- Around line 141-159: The current waitDeployBackendTransactionMined uses
bind.WaitMined(context.Background(), bdc.client, tx) which can block forever if
the returned tx is replaced; change it to use a bounded, replacement-aware wait:
create a context with a reasonable timeout/deadline and use the mining-waiter
API that the contract binding uses (e.g., the MiningWaiter/ForceMining return
path) or poll by sender+nonce/block number instead of waiting for the original
tx hash; specifically, replace the bind.WaitMined call to (1) derive/capture the
tx sender and nonce from the original tx, (2) create ctx, cancel :=
context.WithTimeout(...) and defer cancel, and (3) poll for a receipt via
bdc.client.TransactionReceipt(ctx, hash) in a loop that also checks for
replacement by inspecting the pending tx for the same nonce or by asking the
miner/waiter for the final mined tx, returning when a receipt for the final
mined tx is found or when ctx times out; keep the existing receipt.Status and
blockCounter handling but ensure errors include context timeout vs replacement
cases.
In `@pkg/chain/ethereum/ecdsa_dkg_validator_chain.go`:
- Around line 122-135: Add an explicit consistency check that the
validator-supplied group threshold does not exceed the active threshold: after
computing groupQuorum (activeThreshold) and honestThreshold (groupThreshold) add
a guard like "if honestThreshold > groupQuorum { return nil,
fmt.Errorf(\"groupThreshold/honestThreshold [%d] exceeds
activeThreshold/groupQuorum [%d]\", honestThreshold, groupQuorum) }" so
validators cannot submit groupThreshold > activeThreshold; reference the
existing variables groupQuorum and honestThreshold to locate where to insert
this check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 968743ff-8ca1-4ad3-9912-6b5300d0a22f
📒 Files selected for processing (30)
cmd/flags.gocmd/flags_test.gocmd/start.goconfig/_electrum_urls/testnet4config/config_test.goconfig/contracts.goconfig/electrum_test.goconfig/network/network.gopkg/bitcoin/bitcoin.gopkg/bitcoin/electrum/electrum.gopkg/bitcoin/electrum/electrum_integration_test.gopkg/bitcoin/electrum/electrum_test.gopkg/chain/ethereum/bitcoin_difficulty.gopkg/chain/ethereum/ecdsa_dkg_validator_chain.gopkg/chain/ethereum/ethereum.gopkg/chain/ethereum/ethereum_integration_test.gopkg/chain/ethereum/tbtc.gopkg/chain/local_v1/blockcounter.gopkg/internal/dkgtest/dkgtest.gopkg/maintainer/btcdiff/bitcoin_difficulty.gopkg/maintainer/btcdiff/bitcoin_difficulty_test.gopkg/maintainer/btcdiff/config.gopkg/maintainer/btcdiff/errors.gopkg/tbtc/coordination_test.gopkg/tbtc/inactivity.gopkg/tbtc/inactivity_test.gopkg/tbtc/tbtc.gotest/config.jsontest/config.tomltest/config.yaml
…f runtime paths Introduces testnet4 configuration and electrum URL wiring, updates chain integrations including DKG validator support, and improves btcdiff/TBTC runtime and reliability-oriented tests. Co-authored-by: Cursor <cursoragent@cursor.com>
WaitMined previously used context.Background() with no timeout, and the follow-up confirmation-depth wait called the context-less BlockCounter.WaitForBlockHeight. If the RPC stalls or the chain stops producing blocks, the maintainer would hang indefinitely on every Retarget / RetargetWithRefund call. Wrap both waits under a 10-minute shared deadline and add a context shim around WaitForBlockHeight so callers can enforce timeouts on the context-less BlockCounter interface.
Elevate the Sepolia/Developer defaultGroupParameters log to Warn level and spell out that GroupQuorum equals GroupSize (3/3/2), so all three operators must stay online for DKG to progress. Also emit a Warn when the EcdsaDkgValidator contract address is not configured. The fallthrough was previously silent, leaving operators unaware that group sizing was coming from compile-time defaults rather than the on-chain validator.
When the Electrum fee oracle returns no estimate for any confirmation target, EstimateSatPerVByteFee returned a hardcoded 2 sat/vByte for every network. On mainnet this turns a fail-safe (error, no broadcast) into a fail-broadcast: the tBTC sweep and redemption fee paths build and broadcast transactions at a feerate that can be left unconfirmable or evicted under congestion, stalling sweeps and redemptions. Gate the fallback to test networks (testnet, testnet4, regtest) via a new Electrum Config.Network field resolved from the client configuration. On mainnet, and on any unset or unknown network, the oracle failure is surfaced as an error so callers do not broadcast at a guessed feerate. The field is tagged mapstructure:"-" and set after config unmarshal, so a config key cannot re-enable the fallback on mainnet. Add a unit test covering the fallback decision per network and propagate the resolved network into the Electrum integration test configs.
- electrum: only use the low-fee fallback when every failure was a benign fee-oracle "no estimate" response. Previously the fallback was returned whenever sawFeeOracleFailure was set, even if a transport/auth (non-oracle) failure was also seen, masking real connectivity errors. Track sawNonOracleFailure and fail safe (surface the error) when one occurred. - ecdsa_dkg_validator_chain: enforce groupThreshold <= activeThreshold (HonestThreshold <= GroupQuorum) in addition to the existing <= groupSize guard, so a validator returning groupThreshold > activeThreshold cannot produce inconsistent TBTC GroupParameters. The third finding (bind.WaitMined(context.Background()) unbounded wait in bitcoin_difficulty.go) was already resolved by including #4013's bounded-wait fix in this branch. Co-authored-by: Cursor <cursoragent@cursor.com>
cd7ee40 to
2d040dc
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/chain/ethereum/bitcoin_difficulty.go`:
- Around line 185-201: waitForBlockHeightCtx currently spawns a goroutine that
blocks forever in bc.WaitForBlockHeight when ctx times out, leaking goroutines;
change the approach to use a non-blocking channel-based waiter instead: add or
use a BlockCounter method that returns a channel (e.g.,
WaitForBlockHeightChan(blockNumber) <-chan error or BlockHeightWaiter) and then
implement waitForBlockHeightCtx to select between ctx.Done() and that channel,
returning whichever happens first; update callers and the BlockCounter
implementation to provide the channel-based waiter so no parked goroutines
remain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6bd4d665-ca18-4f63-bdba-42d3cbd1c1d8
📒 Files selected for processing (33)
cmd/flags.gocmd/flags_test.gocmd/start.goconfig/_electrum_urls/testnet4config/config_test.goconfig/contracts.goconfig/electrum.goconfig/electrum_test.goconfig/network/network.gopkg/bitcoin/bitcoin.gopkg/bitcoin/electrum/config.gopkg/bitcoin/electrum/electrum.gopkg/bitcoin/electrum/electrum_integration_test.gopkg/bitcoin/electrum/electrum_test.gopkg/chain/ethereum/bitcoin_difficulty.gopkg/chain/ethereum/bitcoin_difficulty_test.gopkg/chain/ethereum/ecdsa_dkg_validator_chain.gopkg/chain/ethereum/ethereum.gopkg/chain/ethereum/ethereum_integration_test.gopkg/chain/ethereum/tbtc.gopkg/chain/local_v1/blockcounter.gopkg/internal/dkgtest/dkgtest.gopkg/maintainer/btcdiff/bitcoin_difficulty.gopkg/maintainer/btcdiff/bitcoin_difficulty_test.gopkg/maintainer/btcdiff/config.gopkg/maintainer/btcdiff/errors.gopkg/tbtc/coordination_test.gopkg/tbtc/inactivity.gopkg/tbtc/inactivity_test.gopkg/tbtc/tbtc.gotest/config.jsontest/config.tomltest/config.yaml
✅ Files skipped from review due to trivial changes (5)
- test/config.yaml
- test/config.json
- test/config.toml
- config/config_test.go
- config/_electrum_urls/testnet4
🚧 Files skipped from review as they are similar to previous changes (20)
- cmd/start.go
- pkg/maintainer/btcdiff/config.go
- pkg/chain/ethereum/ethereum.go
- pkg/tbtc/inactivity.go
- pkg/bitcoin/bitcoin.go
- cmd/flags.go
- pkg/chain/ethereum/ethereum_integration_test.go
- config/network/network.go
- pkg/tbtc/coordination_test.go
- pkg/maintainer/btcdiff/errors.go
- config/electrum_test.go
- pkg/internal/dkgtest/dkgtest.go
- pkg/maintainer/btcdiff/bitcoin_difficulty.go
- pkg/tbtc/inactivity_test.go
- pkg/chain/ethereum/tbtc.go
- pkg/chain/local_v1/blockcounter.go
- pkg/maintainer/btcdiff/bitcoin_difficulty_test.go
- pkg/tbtc/tbtc.go
- pkg/bitcoin/electrum/electrum_integration_test.go
- pkg/chain/ethereum/ecdsa_dkg_validator_chain.go
…e buildup Addresses a follow-up CodeRabbit finding on PR #4002. The previous shim spawned a goroutine parked in the context-less BlockCounter.WaitForBlockHeight; when the parent context expired first the goroutine lingered until the chain advanced, so repeated retargets during a prolonged chain stall could accumulate parked goroutines. Poll the non-blocking CurrentBlock under the caller's context instead. The wait returns as soon as the height is reached or the context fires, and leaves no goroutine behind. Tests updated to drive the stub via CurrentBlock. Co-authored-by: Cursor <cursoragent@cursor.com>
Stack Context
This is PR 4/4 in the reorganization stack.
Base: #4001 (
stack/testnet4-03-deployment-artifacts)What Changed
1) CLI/config wiring for Testnet4
cmd/flags.go,cmd/flags_test.go,cmd/start.goconfig/_electrum_urls/testnet4config/network/network.goconfig/config_test.goconfig/electrum_test.goconfig/contracts.go2) Bitcoin/Electrum behavior and tests
pkg/bitcoin/bitcoin.gopkg/bitcoin/electrum/electrum.gopkg/bitcoin/electrum/electrum_integration_test.gopkg/bitcoin/electrum/electrum_test.go3) Ethereum chain integration + TBTC wiring
pkg/chain/ethereum/bitcoin_difficulty.gopkg/chain/ethereum/ecdsa_dkg_validator_chain.go(new)pkg/chain/ethereum/ethereum.gopkg/chain/ethereum/ethereum_integration_test.gopkg/chain/ethereum/tbtc.go4) Runtime reliability and maintainer logic
pkg/chain/local_v1/blockcounter.gopkg/internal/dkgtest/dkgtest.gopkg/maintainer/btcdiff/bitcoin_difficulty.gopkg/maintainer/btcdiff/bitcoin_difficulty_test.gopkg/maintainer/btcdiff/config.gopkg/maintainer/btcdiff/errors.go(new)5) TBTC logic/tests and integration test config updates
pkg/tbtc/inactivity.gopkg/tbtc/inactivity_test.gopkg/tbtc/tbtc.gopkg/tbtc/coordination_test.gopkg/tbtcpg/internal/test/marshaling.gotest/config.json,test/config.toml,test/config.yamlTest Plan
go test ./config/... ./pkg/bitcoin/...go test ./pkg/maintainer/btcdiff/... ./pkg/tbtc/...go test ./pkg/chain/ethereum/...Summary by CodeRabbit
New Features
Improvements