From c81fa9f6081a73ce088838a4964731f61b3f673f Mon Sep 17 00:00:00 2001 From: springrain Date: Sat, 9 Oct 2021 15:47:44 +0800 Subject: [PATCH 1/2] Compatible container runtime, listening ":port" --- bcs/network/p2pv1/server.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bcs/network/p2pv1/server.go b/bcs/network/p2pv1/server.go index d76ac87c..cbbaa689 100644 --- a/bcs/network/p2pv1/server.go +++ b/bcs/network/p2pv1/server.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "net" + "strings" "time" "github.com/golang/protobuf/proto" @@ -142,6 +143,12 @@ func (p *P2PServerV1) serve() { panic(fmt.Sprintf("address error: address=%s", err)) } + //Compatible container runtime, listening ":port" + portIndex := strings.LastIndex(ip, ":") + if portIndex > 0 { + ip = ip[portIndex:] + } + l, err := net.Listen(network, ip) if err != nil { panic(err) From 240136717190b5416102b64af9b1ef87d9e264d6 Mon Sep 17 00:00:00 2001 From: springrain Date: Sat, 9 Oct 2021 16:33:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bcs/consensus/xpoa/xpoa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bcs/consensus/xpoa/xpoa.go b/bcs/consensus/xpoa/xpoa.go index b5260a59..95b500d9 100644 --- a/bcs/consensus/xpoa/xpoa.go +++ b/bcs/consensus/xpoa/xpoa.go @@ -227,7 +227,7 @@ func (x *xpoaConsensus) CheckMinerMatch(ctx xcontext.XContext, block cctx.BlockI // 包装成统一入口访问smr err = x.smr.CheckProposal(block, justify, validators) if err != nil { - x.log.Error("consensus:tdpos:CheckMinerMatch: bft IsQuorumCertValidate failed", "proposalQC:[height]", block.GetHeight(), + x.log.Error("consensus:xpoa:CheckMinerMatch: bft IsQuorumCertValidate failed", "proposalQC:[height]", block.GetHeight(), "proposalQC:[id]", utils.F(block.GetBlockid()), "justifyQC:[height]", justify.GetProposalView(), "justifyQC:[id]", utils.F(justify.GetProposalId()), "error", err) return false, err @@ -259,7 +259,7 @@ func (x *xpoaConsensus) ProcessBeforeMiner(timestamp int64) ([]byte, []byte, err } // 重做时还需要装载标定节点TipHeight,复用TargetBits作为回滚记录,便于追块时获取准确快照高度 if truncate { - x.log.Warn("consensus:tdpos:ProcessBeforeMiner: last block not confirmed, walk to previous block", + x.log.Warn("consensus:xpoa:ProcessBeforeMiner: last block not confirmed, walk to previous block", "target", utils.F(qc.GetProposalId()), "ledger", tipBlock.GetHeight()) storage.TargetBits = int32(tipBlock.GetHeight()) bytes, _ := json.Marshal(storage)