Skip to content

Commit

Permalink
Merge pull request #92 from orbs-network/feature/reftime
Browse files Browse the repository at this point in the history
Add PrevBlockReferenceTime to lean helix in/out
  • Loading branch information
noambergIL authored Apr 5, 2020
2 parents ba90b6f + eced6fd commit f9be59b
Show file tree
Hide file tree
Showing 23 changed files with 176 additions and 100 deletions.
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
github.com/go-playground/ansi v2.1.0+incompatible h1:f9ldskdk1seTFmYjbmPaYB+WYsDKWc4UXcGb+e9JrN8=
github.com/go-playground/ansi v2.1.0+incompatible/go.mod h1:OCdnfTFO/GfFtp+ktUt+PhElbGOwyTRUuRUsA+Y5pSU=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU=
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs=
github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs=
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q=
github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg=
github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk=
github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw=
github.com/gobuffalo/packr/v2 v2.5.2/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08=
Expand Down Expand Up @@ -76,6 +79,7 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
Expand Down Expand Up @@ -114,6 +118,7 @@ github.com/orbs-network/membuffers v0.3.2 h1:dpUJXBTjvFkNputqIjCfBJnAJszZALtfuWc
github.com/orbs-network/membuffers v0.3.2/go.mod h1:M5ABv0m0XBGoJbX+7UKVY02hLF4XhS2SlZVEVABMc6M=
github.com/orbs-network/membuffers v0.3.4 h1:CZZDYwrmHZAcBobiRTd4cRjrPSUMEmF+CDhSxI0D83A=
github.com/orbs-network/membuffers v0.3.4/go.mod h1:M5ABv0m0XBGoJbX+7UKVY02hLF4XhS2SlZVEVABMc6M=
github.com/orbs-network/pbparser v0.2.0 h1:yCyJiHY2Nh1PFpa+7tLSbFvUZ3XScVyjKVZ/bNBsCMg=
github.com/orbs-network/pbparser v0.2.0/go.mod h1:WSzcxgH5xzywQm0YSASbD7RcdxBXZgqZaDVK8M+8DJ8=
github.com/orbs-network/scribe v0.1.0 h1:Kn/EQpifQFae+F7HRIoTIipUsSHZNcfQ3HJOhD/b+8M=
github.com/orbs-network/scribe v0.1.0/go.mod h1:FmGcbukz5eolO+mqzxwmuy4RF4UEoLfGJIeEDAoGsBU=
Expand Down Expand Up @@ -141,6 +146,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
Expand Down
4 changes: 2 additions & 2 deletions mainloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ func GetMemberIdsFromBlockProof(blockProofBytes []byte) ([]primitives.MemberId,
return committeeMembers, nil
}

func (m *MainLoop) ValidateBlockConsensus(ctx context.Context, block interfaces.Block, blockProofBytes []byte, maybePrevBlockProofBytes []byte) error {
func (m *MainLoop) ValidateBlockConsensus(ctx context.Context, block interfaces.Block, blockProofBytes []byte, prevBlock interfaces.Block, maybePrevBlockProofBytes []byte) error {
if m.worker == nil {
panic("ValidateBlockConsensus() worker is nil")
}
return m.worker.ValidateBlockConsensus(ctx, block, blockProofBytes, maybePrevBlockProofBytes)
return m.worker.ValidateBlockConsensus(ctx, block, blockProofBytes, prevBlock, maybePrevBlockProofBytes)
}

// Called from outside to indicate Node Sync
Expand Down
29 changes: 29 additions & 0 deletions services/blockheight/test/block_height_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2019 the lean-helix-go authors
// This file is part of the lean-helix-go library in the Orbs project.
//
// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
// The above notice should be included in all copies or substantial portions of the software.

package test

import (
"github.com/orbs-network/lean-helix-go/services/blockheight"
"github.com/orbs-network/lean-helix-go/services/interfaces"
"github.com/orbs-network/lean-helix-go/spec/types/go/primitives"
"github.com/orbs-network/lean-helix-go/test/mocks"
"github.com/stretchr/testify/require"
"testing"
)

func TestGenesisBlockHeight(t *testing.T) {
actual := blockheight.GetBlockHeight(interfaces.GenesisBlock)
require.Equal(t, primitives.BlockHeight(0), actual)
}

func TestBasicBlockHeight(t *testing.T) {
block1 := mocks.ABlock(interfaces.GenesisBlock)
block2 := mocks.ABlock(block1)
block3 := mocks.ABlock(block2)
actual := blockheight.GetBlockHeight(block3)
require.Equal(t, primitives.BlockHeight(3), actual)
}
28 changes: 0 additions & 28 deletions services/blockheight/test/blockheight_test.go

This file was deleted.

40 changes: 20 additions & 20 deletions services/blockproof/test/blockproof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func TestAValidBlockProof(t *testing.T) {

blockProof := genBlockProofMessages(net.InstanceId, block3, 6, 0, node1, node2, node3).Raw()
prevBlockProof := genBlockProofMessages(net.InstanceId, block2, 3, 0, node1, node2, node3).Raw()
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, blockProof, prevBlockProof))
require.Error(t, node0.ValidateBlockConsensus(ctx, nil, blockProof, prevBlockProof))
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, blockProof, block2, prevBlockProof))
require.Error(t, node0.ValidateBlockConsensus(ctx, nil, blockProof, nil, prevBlockProof))
})
}

Expand All @@ -134,7 +134,7 @@ func TestAValidBlockProofWithNilPrevBlockProof(t *testing.T) {
node3 := net.Nodes[3]

blockProof := genBlockProofMessages(net.InstanceId, block3, 6, 0, node1, node2, node3).Raw()
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, blockProof, nil))
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, blockProof, block2, nil))
})
}

Expand All @@ -154,10 +154,10 @@ func TestThatWeDoNotAcceptNilBlockProof(t *testing.T) {

prevBlockProof := genBlockProofMessages(net.InstanceId, block2, 3, 0, node1, node2, node3).Raw()

require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, nil, prevBlockProof))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, []byte{}, prevBlockProof))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, nil, []byte{}))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, []byte{}, []byte{}))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, nil, block2, prevBlockProof))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, []byte{}, block2, prevBlockProof))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, nil, block2, []byte{}))
require.Error(t, net.Nodes[0].ValidateBlockConsensus(ctx, block3, []byte{}, block2, []byte{}))
})
}

Expand Down Expand Up @@ -233,11 +233,11 @@ func TestThatBlockRefInsideProofValidation(t *testing.T) {
RandomSeedSignature: goodRSS,
}).Build()

require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, goodProof.Raw(), goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, nilBlockRefProof.Raw(), goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockHeightProof.Raw(), goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badMessageTypeProof.Raw(), goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockHash.Raw(), goodPrevProof.Raw()))
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, goodProof.Raw(), block2, goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, nilBlockRefProof.Raw(), block2, goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockHeightProof.Raw(), block2, goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badMessageTypeProof.Raw(), block2, goodPrevProof.Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockHash.Raw(), block2, goodPrevProof.Raw()))
})
}

Expand Down Expand Up @@ -332,12 +332,12 @@ func TestCommitsWhenValidatingBlockProof(t *testing.T) {
RandomSeedSignature: goodRSS,
}

require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, goodProof.Build().Raw(), goodPrevProof.Build().Raw()), "should succeed with good proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, noQuorumProof.Build().Raw(), goodPrevProof.Build().Raw()), "should fail on not enough nodes in proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockRefBlockHeightProof.Build().Raw(), goodPrevProof.Build().Raw()), "should fail on bad block height in proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockRefInstanceIdProof.Build().Raw(), goodPrevProof.Build().Raw()), "should fail on bad instance ID")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, duplicateNodesProof.Build().Raw(), goodPrevProof.Build().Raw()), "should fail on duplicate nodes in proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, unknownNodeProof.Build().Raw(), goodPrevProof.Build().Raw()), "should fail on unknown node in proof")
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, goodProof.Build().Raw(), block2, goodPrevProof.Build().Raw()), "should succeed with good proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, noQuorumProof.Build().Raw(), block2, goodPrevProof.Build().Raw()), "should fail on not enough nodes in proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockRefBlockHeightProof.Build().Raw(), block2, goodPrevProof.Build().Raw()), "should fail on bad block height in proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, badBlockRefInstanceIdProof.Build().Raw(), block2, goodPrevProof.Build().Raw()), "should fail on bad instance ID")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, duplicateNodesProof.Build().Raw(), block2, goodPrevProof.Build().Raw()), "should fail on duplicate nodes in proof")
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, unknownNodeProof.Build().Raw(), block2, goodPrevProof.Build().Raw()), "should fail on unknown node in proof")
})
}

Expand Down Expand Up @@ -376,7 +376,7 @@ func TestRandomSeedSignatureValidation(t *testing.T) {
Nodes: generateSignatures(blockHeight, goodBlockRef.Build(), node0, node1, node2),
}

require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, goodProof.Build().Raw(), goodPrevProof.Build().Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, noRSSProof.Build().Raw(), goodPrevProof.Build().Raw()))
require.Nil(t, node0.ValidateBlockConsensus(ctx, block3, goodProof.Build().Raw(), block2, goodPrevProof.Build().Raw()))
require.Error(t, node0.ValidateBlockConsensus(ctx, block3, noRSSProof.Build().Raw(), block2, goodPrevProof.Build().Raw()))
})
}
20 changes: 20 additions & 0 deletions services/blockreferencetime/ref_time.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2019 the lean-helix-go authors
// This file is part of the lean-helix-go library in the Orbs project.
//
// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
// The above notice should be included in all copies or substantial portions of the software.

package blockreferencetime

import (
"github.com/orbs-network/lean-helix-go/services/interfaces"
"github.com/orbs-network/lean-helix-go/spec/types/go/primitives"
)

func GetBlockReferenceTime(block interfaces.Block) primitives.TimestampSeconds {
if block == interfaces.GenesisBlock {
return 0
} else {
return block.ReferenceTime()
}
}
1 change: 1 addition & 0 deletions services/interfaces/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ var GenesisBlock Block = nil

type Block interface {
Height() primitives.BlockHeight
ReferenceTime() primitives.TimestampSeconds
}
2 changes: 1 addition & 1 deletion services/interfaces/external_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Communication interface {

type Membership interface {
MyMemberId() primitives.MemberId
RequestOrderedCommittee(ctx context.Context, blockHeight primitives.BlockHeight, randomSeed uint64) ([]primitives.MemberId, error)
RequestOrderedCommittee(ctx context.Context, blockHeight primitives.BlockHeight, randomSeed uint64, prevBlockReferenceTime primitives.TimestampSeconds) ([]primitives.MemberId, error)
}

type BlockUtils interface {
Expand Down
12 changes: 6 additions & 6 deletions services/leanhelixterm/leanhelix_term.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"encoding/hex"
"fmt"
"github.com/orbs-network/lean-helix-go/services/blockheight"
"github.com/orbs-network/lean-helix-go/services/blockreferencetime"
"github.com/orbs-network/lean-helix-go/services/interfaces"
"github.com/orbs-network/lean-helix-go/services/logger"
"github.com/orbs-network/lean-helix-go/services/messagesfactory"
Expand All @@ -36,10 +37,11 @@ func NewLeanHelixTerm(ctx context.Context, logger logger.LHLogger, config *inter
prevBlockProof := protocol.BlockProofReader(prevBlockProofBytes)
randomSeed := randomseed.CalculateRandomSeed(prevBlockProof.RandomSeedSignature())
blockHeight := blockheight.GetBlockHeight(prevBlock) + 1
prevBlockRefTime := blockreferencetime.GetBlockReferenceTime(prevBlock)
myMemberId := config.Membership.MyMemberId()
messageFactory := messagesfactory.NewMessageFactory(config.InstanceId, config.KeyManager, myMemberId, randomSeed)

committeeMembers, err := requestOrderedCommitteePersist(state, blockHeight, randomSeed, config, logger)
committeeMembers, err := requestOrderedCommitteePersist(state, blockHeight, randomSeed, prevBlockRefTime, config, logger)
if err != nil {
logger.Info("ERROR RECEIVING COMMITTEE: H=%d, error=%s", blockHeight, err)
}
Expand All @@ -51,7 +53,7 @@ func NewLeanHelixTerm(ctx context.Context, logger logger.LHLogger, config *inter
return termNotInCommittee(randomSeed, config)
}

logger.Debug("RECEIVED COMMITTEE: H=%d, prevBlockProof=%s, randomSeed=%d, members=%s, isParticipating=%t", blockHeight, printShortBlockProofBytes(prevBlockProofBytes), randomSeed, termincommittee.ToCommitteeMembersStr(committeeMembers), isParticipating)
logger.Debug("RECEIVED COMMITTEE: H=%d, prevBlockProof=%s, randomSeed=%d, refTime=%d, members=%s, isParticipating=%t", blockHeight, printShortBlockProofBytes(prevBlockProofBytes), randomSeed, prevBlockRefTime, termincommittee.ToCommitteeMembersStr(committeeMembers), isParticipating)
logger.ConsensusTrace("got committee for the current consensus round", nil, log.StringableSlice("committee", committeeMembers))

termInCommittee := termincommittee.NewTermInCommittee(logger, config, state, messageFactory, electionTrigger, committeeMembers, prevBlock, canBeFirstLeader, CommitsToProof(logger, config.KeyManager, onCommit))
Expand All @@ -61,7 +63,7 @@ func NewLeanHelixTerm(ctx context.Context, logger logger.LHLogger, config *inter
}
}

func requestOrderedCommitteePersist(s *state.State, blockHeight primitives.BlockHeight, randomSeed uint64, config *interfaces.Config, logger logger.LHLogger) ([]primitives.MemberId, error) {
func requestOrderedCommitteePersist(s *state.State, blockHeight primitives.BlockHeight, randomSeed uint64, prevBlockReferenceTime primitives.TimestampSeconds, config *interfaces.Config, logger logger.LHLogger) ([]primitives.MemberId, error) {
const maxView = primitives.View(math.MaxUint64)
ctx, err := s.Contexts.For(state.NewHeightView(blockHeight, maxView)) // term-level context
if err != nil {
Expand All @@ -77,7 +79,7 @@ func requestOrderedCommitteePersist(s *state.State, blockHeight primitives.Block
return nil, errors.Wrap(ctx.Err(), "requestOrderedCommitteePersist: context terminated")
}

committeeMembers, err := config.Membership.RequestOrderedCommittee(ctx, blockHeight, randomSeed)
committeeMembers, err := config.Membership.RequestOrderedCommittee(ctx, blockHeight, randomSeed, prevBlockReferenceTime)
if err == nil {
return committeeMembers, nil
}
Expand All @@ -98,7 +100,6 @@ func requestOrderedCommitteePersist(s *state.State, blockHeight primitives.Block
}
}


func termNotInCommittee(randomSeed uint64, config *interfaces.Config) *LeanHelixTerm {
return &LeanHelixTerm{
ConsensusMessagesFilter: NewConsensusMessagesFilter(nil, config.KeyManager, randomSeed),
Expand Down Expand Up @@ -128,4 +129,3 @@ func printShortBlockProofBytes(b []byte) string {
}
return fmt.Sprintf("%s..%s", hex.EncodeToString(b[:6]), hex.EncodeToString(b[len(b)-6:]))
}

29 changes: 14 additions & 15 deletions services/quorum/test/quorum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@
package test

import (
"github.com/orbs-network/lean-helix-go/services/blockheight"
"github.com/orbs-network/lean-helix-go/services/interfaces"
"github.com/orbs-network/lean-helix-go/spec/types/go/primitives"
"github.com/orbs-network/lean-helix-go/test/mocks"
"github.com/orbs-network/lean-helix-go/services/quorum"
"github.com/stretchr/testify/require"
"testing"
)

func TestGenesisBlockHeight(t *testing.T) {
actual := blockheight.GetBlockHeight(interfaces.GenesisBlock)
require.Equal(t, primitives.BlockHeight(0), actual)
}

func TestBasicBlockHeight(t *testing.T) {
block1 := mocks.ABlock(interfaces.GenesisBlock)
block2 := mocks.ABlock(block1)
block3 := mocks.ABlock(block2)
actual := blockheight.GetBlockHeight(block3)
require.Equal(t, primitives.BlockHeight(3), actual)
func TestCommitteeQuorum(t *testing.T) {
require.Equal(t, 3, quorum.CalcQuorumSize(4))
require.Equal(t, 4, quorum.CalcQuorumSize(5))
require.Equal(t, 5, quorum.CalcQuorumSize(6))
require.Equal(t, 5, quorum.CalcQuorumSize(7))
require.Equal(t, 6, quorum.CalcQuorumSize(8))
require.Equal(t, 7, quorum.CalcQuorumSize(9))
require.Equal(t, 7, quorum.CalcQuorumSize(10))
require.Equal(t, 8, quorum.CalcQuorumSize(11))
require.Equal(t, 9, quorum.CalcQuorumSize(12))
require.Equal(t, 15, quorum.CalcQuorumSize(21))
require.Equal(t, 15, quorum.CalcQuorumSize(22))
require.Equal(t, 67, quorum.CalcQuorumSize(100))
}
Loading

0 comments on commit f9be59b

Please sign in to comment.