Skip to content

EdgeMesh v1.17.0;libp2p relay无法生效no reservation #583

@zhengzhankui

Description

@zhengzhankui

环境:EdgeMesh v1.17.0;libp2p 版本( go.mod 里是 go-libp2p v0.28.2)
现象:relay 节点持续 NO_RESERVATION (204);看不到 reserving relay slot for
根因分析:
pkg/tunnel/module.go 使用 EnableAutoRelayWithPeerSource(..., WithMinCandidates(0), ...)
在 go-libp2p autorelay 中,只有 numCandidates < minCandidates 才会调用 peerSource;minCandidates=0 导致 peerSource 永远不被调用,reservation 永远不会发生
修复:改为 WithMinCandidates(1)(单 relay 建议加 WithNumRelays(1))
验证:relay 侧出现 reserving relay slot for ...,且不再报 NO_RESERVATION
建议:把MinCandidates的配置也放到配置文件中,而不是写在代码中

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions