Add vanilla parity harness and harden server boundaries

This commit is contained in:
Daniar Mannanov 2026-08-10 22:52:44 +03:00
parent 1924cb5591
commit ca019756ec
25 changed files with 1118 additions and 217 deletions

View file

@ -153,6 +153,9 @@ func validateConfig(cfg Config) error {
if cfg.MaxViewDistance < 2 || cfg.MaxViewDistance > 16 {
return fmt.Errorf("server: max view distance must be between 2 and 16")
}
if cfg.CompressionThreshold < -1 || cfg.CompressionThreshold > protocol.MaxPacketSize {
return fmt.Errorf("server: compression threshold must be -1 or between 0 and %d", protocol.MaxPacketSize)
}
return nil
}