ci: restore relay integration test (btcd+relayd) and fix relay verify addr check - #1319
Merged
Conversation
plugin/dapp/relay/cmd/build.sh has had its relayd build section commented out since 2021 (739e84e), so build/ci/relay was never created and `make docker-compose dapp=relay` silently returned 0 (the fake-green job deleted in b04a1b8). Restore the OUT_DIR build so the btcd+relayd testcase.sh runs again. Also fix wait_btcd_up: docker-compose v1 no longer exists on the ubuntu-22.04 runners, and the awk picked the CREATED column instead of STATUS, so the loop could never see btcd as up. Use docker inspect instead. Add a real ci_relay workflow to replace the deleted fake one. Co-Authored-By: Claude <noreply@anthropic.com>
btcd simnet integration test creates orders with simnet addresses ('S...'),
but verifyBtcTxContent hardcoded MainNetParams when extracting addresses
from the raw tx outputs, so simnet output addresses were re-encoded as
mainnet '1...' addresses and never matched order.XAddr. The RelayVerify tx
was rejected with ErrRelayVerifyAddrNotFound and the order stayed in
confirming forever (relay testcase: 'wrong relay status finish real buy
order id').
Pick the network params that successfully decode order.XAddr (mainnet/
testnet3/regtest/simnet), falling back to MainNet. Add a simnet regression
test, and dump relayd/chain33 logs in testcase.sh when the finish wait
times out.
Co-Authored-By: Claude <noreply@anthropic.com>
Remote iteration on the agents/relayed branch is done; the workflow now only runs on master pushes and pull requests, matching the other workflows. Co-Authored-By: Claude <noreply@anthropic.com>
bysomeone
approved these changes
Sep 3, 2026
bysomeone
left a comment
Collaborator
There was a problem hiding this comment.
确认之前指出的 relay 假绿已修复为真绿:
build.sh恢复 relayd 构建后build/ci/relay正常生成,ci_relay不再走 "not exist or is system dir" 空转路径;失败沿set -e→docker-compose-pre.sh exit 1→ make → job 非零,无假绿出口。- CI 实测(run 33709615255)起 8 容器(chain33×6 + relayd + btcd simnet),真实订单走到 finished、余额断言通过。
- relay verify addr 网络参数修复正确:按地址自身网络解码,主网行为无回归,确定性纯函数无分叉风险,simnet 单测有效。
两个非阻塞提示:
ForkRelayVerifyBtcTx注册于 height 0(默认恒开),此改动会解冻此前卡在 confirming 的订单;若 relay 在运行中的链上启用,升级需各验证节点同步。ci_relay依赖的是第三方 2019 年预编译镜像suyanlong/btcd-run:latest(无固定版本、未维护),该镜像不可用会让全仓 CI 变红且难以复现。同为 btcd 依赖,仓库内 rgbx 的做法(plugin/dapp/rgbx/cmd/ci/Dockerfile.btcd)是构建时 clone 官方btcsuite/btcd(固定 v0.24.x)现场编译,不依赖第三方预编译镜像——建议 ci_relay 参考该做法,或至少固定镜像版本,避免依赖未锁版本的latest。
Owner
Author
|
🎉 This PR is included in version 1.71.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
问题
relay 集成测试自 2021 年起从未真正运行:
plugin/dapp/relay/cmd/build.sh的 relayd 构建段被注释(739e84e44),build/ci/relay从不生成,make docker-compose dapp=relay打印 "dapp=relay not exist or is system dir" 后返回 0 —— 原build_relay.yml因此是假绿,已在 b04a1b8 删除,但真测试一直没有替代。变更
build.sh重新生成build/ci/relay(relayd 二进制 + toml + Dockerfile-relayd + docker-compose-relay.yml + testcase.sh)。ci_relayworkflow(.github/workflows/build_relay.yml):make build_ci+make docker-compose dapp=relay,触发条件与其他 workflow 一致(master push + pull_request)。wait_btcd_up:原实现用 v1 语法docker-compose ps(ubuntu-22.04 runner 已没有)且awk '{print $5}'取到的是 CREATED 列而非 STATUS,btcd 正常也会永远重启直到超时失败。改为docker inspect判容器状态。verifyBtcTxContent硬编码MainNetParams解析输出地址,simnet 订单地址('S...')被重编码成 mainnet 地址后永远匹配不上,RelayVerify 交易被拒(ErrRelayVerifyAddrNotFound),订单永远卡在 confirming。改为按order.XAddr能解码成功的网络参数解析(mainnet/testnet3/regtest/simnet,失败回退 MainNet)。验证
go test ./plugin/dapp/relay/...全绿,shellcheck/gofmt 干净。🤖 Generated with Claude Code