From ca0ff47c05a9a3db54a77e2e82ac1e63e5e5af06 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 25 Sep 2020 23:06:23 +0300 Subject: [PATCH] update dbft, pick timer improvements and other optimizations --- go.mod | 2 +- go.sum | 4 ++-- pkg/consensus/consensus.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3e0b21957..67c40b3ee 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-redis/redis v6.10.2+incompatible github.com/gorilla/websocket v1.4.2 github.com/mr-tron/base58 v1.1.2 - github.com/nspcc-dev/dbft v0.0.0-20200814063241-c789b8863620 + github.com/nspcc-dev/dbft v0.0.0-20200925163137-8f3b9ab3b720 github.com/nspcc-dev/rfc6979 v0.2.0 github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.2.1 diff --git a/go.sum b/go.sum index e046fc8ff..6eb200f99 100644 --- a/go.sum +++ b/go.sum @@ -156,8 +156,8 @@ github.com/nspcc-dev/dbft v0.0.0-20200117124306-478e5cfbf03a h1:ajvxgEe9qY4vvoSm github.com/nspcc-dev/dbft v0.0.0-20200117124306-478e5cfbf03a/go.mod h1:/YFK+XOxxg0Bfm6P92lY5eDSLYfp06XOdL8KAVgXjVk= github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1 h1:yEx9WznS+rjE0jl0dLujCxuZSIb+UTjF+005TJu/nNI= github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1/go.mod h1:O0qtn62prQSqizzoagHmuuKoz8QMkU3SzBoKdEvm3aQ= -github.com/nspcc-dev/dbft v0.0.0-20200814063241-c789b8863620 h1:h7hrQ+OFU06C76FHjXmNen7d2J/Gx8MuXSydLSXeB7E= -github.com/nspcc-dev/dbft v0.0.0-20200814063241-c789b8863620/go.mod h1:1FYQXSbb6/9HQIkoF8XO7W/S8N7AZRkBsgwbcXRvk0E= +github.com/nspcc-dev/dbft v0.0.0-20200925163137-8f3b9ab3b720 h1:e/lFQUIPnWErf2yiHjp2HyPhf0nyo3lp4hMm8IlQX1U= +github.com/nspcc-dev/dbft v0.0.0-20200925163137-8f3b9ab3b720/go.mod h1:I5D0W3tu3epdt2RMCTxS//HDr4S+OHRqajouQTOAHI8= github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg= github.com/nspcc-dev/neofs-crypto v0.2.0 h1:ftN+59WqxSWz/RCgXYOfhmltOOqU+udsNQSvN6wkFck= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 7e14d8e22..cca8d060e 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -189,7 +189,8 @@ func (s *service) Start() { func (s *service) eventLoop() { for { select { - case hv := <-s.dbft.Timer.C(): + case <-s.dbft.Timer.C(): + hv := s.dbft.Timer.HV() s.log.Debug("timer fired", zap.Uint32("height", hv.Height), zap.Uint("view", uint(hv.View)))