Skip to content

Commit 3e2ade9

Browse files
authored
Remove chainx validation rule between max age and rebroadcast interval (#953)
Simply require the timestamp age to be more than 1 ms. 4X of chain rebroadcast interval is unnecessarily unflexible.
1 parent f8d3309 commit 3e2ade9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

manifest/manifest.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,9 @@ func (cx *ChainExchangeConfig) Validate() error {
273273
case cx.RebroadcastInterval < 1*time.Millisecond:
274274
// The timestamp precision is set to milliseconds. Therefore, the rebroadcast interval must not be less than a millisecond.
275275
return fmt.Errorf("chain exchange rebroadcast interval cannot be less than 1ms, got: %s", cx.RebroadcastInterval)
276-
case cx.MaxTimestampAge < 4*cx.RebroadcastInterval:
277-
// The 4X is made up, but the idea is that the max timestamp age should give enough time for message propagation across at least a pair of nodes.
278-
return fmt.Errorf("chain exchange max timestamp age must be at least 4x the rebroadcast interval (%s), got: %s", cx.RebroadcastInterval, cx.MaxTimestampAge)
279-
276+
case cx.MaxTimestampAge < 1*time.Millisecond:
277+
// The 1 ms is arbitrarily chosen as a reasonable non-zero minimum.
278+
return fmt.Errorf("chain exchange max timestamp age must not be less than 1ms, got: %s", cx.MaxTimestampAge)
280279
default:
281280
return nil
282281
}

0 commit comments

Comments
 (0)