Skip to content

Commit

Permalink
Full node streaming remove minimum for snapshot interval flag (#2138)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Sep 17, 2024
1 parent f6ff1a5 commit a00ddb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
4 changes: 0 additions & 4 deletions protocol/app/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ func (f *Flags) Validate() error {
}
}

if f.FullNodeStreamingSnapshotInterval > 0 && f.FullNodeStreamingSnapshotInterval < 50 {
return fmt.Errorf("full node streaming snapshot interval must be >= 50 blocks or zero")
}

return nil
}

Expand Down
16 changes: 2 additions & 14 deletions protocol/app/flags/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,27 +202,15 @@ func TestValidate(t *testing.T) {
},
expectedErr: fmt.Errorf("full node streaming batch size must be positive number"),
},
"failure - full node streaming enabled with <= 49 snapshot interval": {
"success - full node streaming enabled with 20 snapshot interval": {
flags: flags.Flags{
NonValidatingFullNode: true,
GrpcEnable: true,
GrpcStreamingEnabled: true,
GrpcStreamingFlushIntervalMs: 100,
GrpcStreamingMaxBatchSize: 2000,
GrpcStreamingMaxChannelBufferSize: 2000,
FullNodeStreamingSnapshotInterval: 49,
},
expectedErr: fmt.Errorf("full node streaming snapshot interval must be >= 50 blocks or zero"),
},
"success - full node streaming enabled with 50 snapshot interval": {
flags: flags.Flags{
NonValidatingFullNode: true,
GrpcEnable: true,
GrpcStreamingEnabled: true,
GrpcStreamingFlushIntervalMs: 100,
GrpcStreamingMaxBatchSize: 2000,
GrpcStreamingMaxChannelBufferSize: 2000,
FullNodeStreamingSnapshotInterval: 50,
FullNodeStreamingSnapshotInterval: 20,
},
},
}
Expand Down

0 comments on commit a00ddb9

Please sign in to comment.