Skip to content

Commit

Permalink
Merge pull request #449 from dashevo/backport-pr-444
Browse files Browse the repository at this point in the history
chore(backport): allow `create-proof-block-range` to be `0`
  • Loading branch information
shotonoff authored Aug 31, 2022
2 parents 38dcdf3 + 814198e commit d9674de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ func DefaultConsensusConfig() *ConsensusConfig {
WalPath: filepath.Join(defaultDataDir, "cs.wal", "wal"),
CreateEmptyBlocks: true,
CreateEmptyBlocksInterval: 0 * time.Second,
CreateProofBlockRange: 1,
CreateProofBlockRange: 0,
PeerGossipSleepDuration: 100 * time.Millisecond,
PeerQueryMaj23SleepDuration: 2000 * time.Millisecond,
DoubleSignCheckHeight: int64(0),
Expand Down Expand Up @@ -1137,8 +1137,8 @@ func (cfg *ConsensusConfig) ValidateBasic() error {
if cfg.CreateEmptyBlocksInterval < 0 {
return errors.New("create-empty-blocks-interval can't be negative")
}
if cfg.CreateProofBlockRange < 1 {
return errors.New("create-proof-block-range must be greater or equal to 1")
if cfg.CreateProofBlockRange < 0 {
return errors.New("create-proof-block-range must be greater or equal to 0")
}
if cfg.PeerGossipSleepDuration < 0 {
return errors.New("peer-gossip-sleep-duration can't be negative")
Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestMempoolNoProgressUntilTxsAvailable(t *testing.T) {
defer cancel()

baseConfig := configSetup(t)
for proofBlockRange := int64(1); proofBlockRange <= 3; proofBlockRange++ {
for proofBlockRange := int64(0); proofBlockRange <= 3; proofBlockRange++ {
t.Logf("Checking proof block range %d", proofBlockRange)
config, err := ResetConfig(t.TempDir(), "consensus_mempool_txs_available_test")
require.NoError(t, err)
Expand Down

0 comments on commit d9674de

Please sign in to comment.