Skip to content

Commit

Permalink
added separate single keys test with equivalent proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
ssd04 committed Dec 23, 2024
1 parent 5c42932 commit 30f6c12
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions integrationTests/consensus/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,26 @@ func TestConsensusBLSFullTestSingleKeys(t *testing.T) {
t.Skip("this is not a short test")
}

logger.SetLogLevel("*:TRACE")

runFullConsensusTest(t, blsConsensusType, 1)
runFullConsensusTest(t, blsConsensusType, 1, false)
}

func TestConsensusBLSFullTestMultiKeys(t *testing.T) {
if testing.Short() {
t.Skip("this is not a short test")
}

runFullConsensusTest(t, blsConsensusType, 5)
runFullConsensusTest(t, blsConsensusType, 5, false)
}

func TestConsensusBLSFullTestSingleKeys_WithEquivalentProofs(t *testing.T) {
if testing.Short() {
t.Skip("this is not a short test")
}

logger.ToggleLoggerName(true)
logger.SetLogLevel("*:DEBUG,consensus:TRACE")

Check failure on line 57 in integrationTests/consensus/consensus_test.go

View workflow job for this annotation

GitHub Actions / golangci linter

Error return value of `logger.SetLogLevel` is not checked (errcheck)

runFullConsensusTest(t, blsConsensusType, 1, true)
}

func TestConsensusBLSNotEnoughValidators(t *testing.T) {
Expand Down Expand Up @@ -231,10 +240,15 @@ func checkBlockProposedEveryRound(numCommBlock uint64, nonceForRoundMap map[uint
}
}

func runFullConsensusTest(t *testing.T, consensusType string, numKeysOnEachNode int) {
numMetaNodes := uint32(2)
numNodes := uint32(2)
consensusSize := uint32(2 * numKeysOnEachNode)
func runFullConsensusTest(
t *testing.T,
consensusType string,
numKeysOnEachNode int,
withEquivalentProofs bool,
) {
numMetaNodes := uint32(4)
numNodes := uint32(4)
consensusSize := uint32(3 * numKeysOnEachNode)
numInvalid := uint32(0)
roundTime := uint64(1000)
numCommBlock := uint64(8)
Expand All @@ -246,8 +260,15 @@ func runFullConsensusTest(t *testing.T, consensusType string, numKeysOnEachNode
)

enableEpochsConfig := integrationTests.CreateEnableEpochsConfig()
enableEpochsConfig.EquivalentMessagesEnableEpoch = 0
enableEpochsConfig.FixedOrderInConsensusEnableEpoch = 0

equivalentProodsActivationEpoch := integrationTests.UnreachableEpoch
if withEquivalentProofs {
equivalentProodsActivationEpoch = 0
}

enableEpochsConfig.EquivalentMessagesEnableEpoch = equivalentProodsActivationEpoch
enableEpochsConfig.FixedOrderInConsensusEnableEpoch = equivalentProodsActivationEpoch

nodes := initNodesAndTest(
numMetaNodes,
numNodes,
Expand Down

0 comments on commit 30f6c12

Please sign in to comment.