Skip to content

Commit

Permalink
Remove zstd Cortina check (ava-labs#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrubabasu committed May 3, 2023
1 parent 850c6fd commit eb8b52a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/avalanchego/utils/storage"
"github.com/ava-labs/avalanchego/utils/timer"
"github.com/ava-labs/avalanchego/version"
"github.com/ava-labs/avalanchego/vms/platformvm/reward"
"github.com/ava-labs/avalanchego/vms/proposervm"
)
Expand Down Expand Up @@ -84,7 +83,6 @@ var (
errMissingStakingSigningKeyFile = errors.New("missing staking signing key file")
errTracingEndpointEmpty = fmt.Errorf("%s cannot be empty", TracingEndpointKey)
errPluginDirNotADirectory = errors.New("plugin dir is not a directory")
errZstdNotSupported = errors.New("zstd compression not supported until v1.10")
errCannotReadDirectory = errors.New("cannot read directory")
errUnmarshalling = errors.New("unmarshalling failed")
errFileDoesNotExist = errors.New("file does not exist")
Expand Down Expand Up @@ -309,7 +307,6 @@ func getNetworkConfig(
v *viper.Viper,
stakingEnabled bool,
halflife time.Duration,
networkID uint32, // TODO remove after cortina upgrade
) (network.Config, error) {
// Set the max number of recent inbound connections upgraded to be
// equal to the max number of inbound connections per second.
Expand Down Expand Up @@ -339,13 +336,7 @@ func getNetworkConfig(
}
}

cortinaTime := version.GetCortinaTime(networkID)
if compressionType == compression.TypeZstd && !time.Now().After(cortinaTime) {
// TODO remove after cortina upgrade
return network.Config{}, errZstdNotSupported
}
config := network.Config{
// Throttling
ThrottlerConfig: network.ThrottlerConfig{
MaxInboundConnsPerSec: maxInboundConnsPerSec,
InboundConnUpgradeThrottlerConfig: throttling.InboundConnUpgradeThrottlerConfig{
Expand Down Expand Up @@ -1386,7 +1377,7 @@ func GetNodeConfig(v *viper.Viper) (node.Config, error) {
}

// Network Config
nodeConfig.NetworkConfig, err = getNetworkConfig(v, nodeConfig.EnableStaking, healthCheckAveragerHalflife, nodeConfig.NetworkID)
nodeConfig.NetworkConfig, err = getNetworkConfig(v, nodeConfig.EnableStaking, healthCheckAveragerHalflife)
if err != nil {
return node.Config{}, err
}
Expand Down

0 comments on commit eb8b52a

Please sign in to comment.