Skip to content

Commit

Permalink
Disable sigchain objection temporarily
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang authored and gdmmx committed Apr 26, 2021
1 parent 0df3899 commit 191442d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
6 changes: 5 additions & 1 deletion node/neighbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 191442d

Please sign in to comment.