From 191442ddc60f36d4a40a4b4f29fc6947caf542ad Mon Sep 17 00:00:00 2001 From: Yilun Date: Mon, 26 Apr 2021 05:49:18 -0700 Subject: [PATCH] Disable sigchain objection temporarily Signed-off-by: Yilun --- config/config.go | 8 ++++---- node/neighbor.go | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/config.go b/config/config.go index 0eb7047a3..83307df9d 100644 --- a/config/config.go +++ b/config/config.go @@ -171,12 +171,12 @@ var ( values: []bool{true, false}, } SigChainVerifySkipNode = HeightDependentBool{ - heights: []uint32{2570000, 0}, - values: []bool{true, false}, + heights: []uint32{2570120, 2570000, 0}, + values: []bool{false, true, false}, } SigChainObjection = HeightDependentBool{ - heights: []uint32{2570000, 0}, - values: []bool{true, false}, + heights: []uint32{2570120, 2570000, 0}, + values: []bool{false, true, false}, } MinGenIDRegistrationFee = HeightDependentInt64{ heights: []uint32{2570000, 0}, diff --git a/node/neighbor.go b/node/neighbor.go index 7a3cd42d5..d7a0f0189 100644 --- a/node/neighbor.go +++ b/node/neighbor.go @@ -427,6 +427,10 @@ func (localNode *LocalNode) maybeAddRemoteNode(remoteNode *nnetnode.RemoteNode) } func (localNode *LocalNode) VerifySigChain(sc *pb.SigChain, height uint32) error { + if !config.SigChainObjection.GetValueAtHeight(height) { + return nil + } + c, ok := localNode.nnet.Network.(*chord.Chord) if !ok { log.Fatal("Overlay is not chord") @@ -491,7 +495,7 @@ func (localNode *LocalNode) VerifySigChainObjection(sc *pb.SigChain, reporterID // only needs to verify node to node hop, and no need to check last node to // node hop because it could be successor for i := 1; i < sc.Length()-3; i++ { - dist := chord.Distance(sc.Elems[i].Id, sc.DestId, config.NodeIDBytes*8) + dist := chord.Distance(sc.Elems[i].Id, sc.Elems[i+1].Id, config.NodeIDBytes*8) fingerIdx := dist.BitLen() - 1 fingerStartID := chord.PowerOffset(sc.Elems[i].Id, uint32(fingerIdx), config.NodeIDBytes*8) if chord.BetweenLeftIncl(fingerStartID, sc.Elems[i+1].Id, reporterID) {