Files
zeekayandHanzo Dev d83191e286 feat(proposervm): configurable window duration (fast local cadence) + strict-PQ classical-proposer refusal
Two changes, both node-local:

1. CADENCE — proposer.WindowDuration (the proposer-slot spacing, a validator's min build
   delay = slot index x WindowDuration) was a hardcoded 5s const tuned for mainnet-scale
   validator sets, flooring small/local block cadence at 5s per slot. It is now a
   startup-configurable var (default 5s, unchanged for mainnet) set via the new
   --proposervm-window-duration flag → node.Config → ManagerConfig → proposervm.Config →
   proposer.SetWindowDuration at VM init. Read by both the windower delay math and
   TimeToSlot, so they stay consistent. Measured on a 5-node strict-PQ net: 5s→1s took
   sustained C-Chain from 44 TPS / 14s-per-block to 104 TPS / 3.8s-per-block, still 5/5
   byte-identical finality.

2. SECURITY (cryptographer MEDIUM-1) — postForkCommonComponents.Verify now refuses a block
   carrying a CLASSICAL secp256k1 proposer identity when the chain is strict-PQ
   (StakingMLDSASigner set), UNCONDITIONALLY (before the consensusState==Ready gate, so it
   also holds during bootstrap/state-sync). Fills the documented-but-unwired 'proposer'
   SchemeGate site: the downgrade defense is now an explicit fail-closed in-perimeter gate,
   not merely emergent from 20-byte NodeID collision-resistance + upstream enforcement.
   Adds SignedBlock.HasClassicalProposer(). Mirrors contract.RefuseUnderStrictPQ.

Pins consensus v1.36.7 (consume-on-error build loop — kills the non-leader BuildBlock spin).
Block + proposervm VM tests green.

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-07-15 22:24:36 -07:00

285 lines
19 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package config
// the HTTPWriteTimeoutKey was moved here so that it would not generate the
// false-positive linter error "G101: Potential hardcoded credentials" when running golangci-lint.
const HTTPWriteTimeoutKey = "http-write-timeout" // #nosec G101
const (
DataDirKey = "data-dir"
ConfigFileKey = "config-file"
ConfigContentKey = "config-file-content"
ConfigContentTypeKey = "config-file-content-type"
VersionKey = "version"
VersionJSONKey = "version-json"
GenesisFileKey = "genesis-file"
GenesisFileContentKey = "genesis-file-content"
GenesisRawBytesKey = "genesis-raw-bytes"
GenesisDBKey = "genesis-db"
GenesisDBTypeKey = "genesis-db-type"
GenesisBlockLimitKey = "genesis-block-limit"
UpgradeFileKey = "upgrade-file"
UpgradeFileContentKey = "upgrade-file-content"
NetworkNameKey = "network-id"
MainnetKey = "mainnet"
TestnetKey = "testnet"
LocalnetKey = "localnet"
DynamicFeesBandwidthWeightKey = "dynamic-fees-bandwidth-weight"
DynamicFeesDBReadWeightKey = "dynamic-fees-db-read-weight"
DynamicFeesDBWriteWeightKey = "dynamic-fees-db-write-weight"
DynamicFeesComputeWeightKey = "dynamic-fees-compute-weight"
DynamicFeesMaxGasCapacityKey = "dynamic-fees-max-gas-capacity"
DynamicFeesMaxGasPerSecondKey = "dynamic-fees-max-gas-per-second"
DynamicFeesTargetGasPerSecondKey = "dynamic-fees-target-gas-per-second"
DynamicFeesMinGasPriceKey = "dynamic-fees-min-gas-price"
DynamicFeesExcessConversionConstantKey = "dynamic-fees-excess-conversion-constant"
ValidatorFeesCapacityKey = "validator-fees-capacity"
ValidatorFeesTargetKey = "validator-fees-target"
ValidatorFeesMinPriceKey = "validator-fees-min-price"
ValidatorFeesExcessConversionConstantKey = "validator-fees-excess-conversion-constant"
TxFeeKey = "tx-fee"
CreateAssetTxFeeKey = "create-asset-tx-fee"
UptimeRequirementKey = "uptime-requirement"
MinValidatorStakeKey = "min-validator-stake"
MaxValidatorStakeKey = "max-validator-stake"
MinDelegatorStakeKey = "min-delegator-stake"
MinDelegatorFeeKey = "min-delegation-fee"
MinStakeDurationKey = "min-stake-duration"
MaxStakeDurationKey = "max-stake-duration"
StakeMaxConsumptionRateKey = "stake-max-consumption-rate"
StakeMinConsumptionRateKey = "stake-min-consumption-rate"
StakeMintingPeriodKey = "stake-minting-period"
StakeSupplyCapKey = "stake-supply-cap"
DBTypeKey = "db-type"
DBReadOnlyKey = "db-read-only"
DBPathKey = "db-dir"
DBConfigFileKey = "db-config-file"
DBConfigContentKey = "db-config-file-content"
PChainDBTypeKey = "p-chain-db-type"
XChainDBTypeKey = "x-chain-db-type"
CChainDBTypeKey = "c-chain-db-type"
PublicIPKey = "public-ip"
PublicIPResolutionFreqKey = "public-ip-resolution-frequency"
PublicIPResolutionServiceKey = "public-ip-resolution-service"
HTTPHostKey = "http-host"
HTTPPortKey = "http-port"
HTTPSEnabledKey = "http-tls-enabled"
HTTPSKeyFileKey = "http-tls-key-file"
HTTPSKeyContentKey = "http-tls-key-file-content"
HTTPSCertFileKey = "http-tls-cert-file"
HTTPSCertContentKey = "http-tls-cert-file-content"
HTTPAllowedOrigins = "http-allowed-origins"
HTTPAllowedHostsKey = "http-allowed-hosts"
HTTPShutdownTimeoutKey = "http-shutdown-timeout"
HTTPShutdownWaitKey = "http-shutdown-wait"
HTTPReadTimeoutKey = "http-read-timeout"
HTTPReadHeaderTimeoutKey = "http-read-header-timeout"
HTTPIdleTimeoutKey = "http-idle-timeout"
StateSyncIPsKey = "state-sync-ips"
StateSyncIDsKey = "state-sync-ids"
BootstrapNodesKey = "bootstrap-nodes"
BootstrapIPsKey = "bootstrap-ips"
BootstrapIDsKey = "bootstrap-ids"
SkipBootstrapKey = "skip-bootstrap"
EnableAutominingKey = "enable-automining"
StakingHostKey = "staking-host"
StakingPortKey = "staking-port"
StakingEphemeralCertEnabledKey = "staking-ephemeral-cert-enabled"
StakingTLSKeyPathKey = "staking-tls-key-file"
StakingTLSKeyContentKey = "staking-tls-key-file-content"
StakingCertPathKey = "staking-tls-cert-file"
StakingCertContentKey = "staking-tls-cert-file-content"
StakingEphemeralSignerEnabledKey = "staking-ephemeral-signer-enabled"
StakingSignerKeyPathKey = "staking-signer-key-file"
StakingSignerKeyContentKey = "staking-signer-key-file-content"
StakingKMSEndpointKey = "staking-kms-endpoint"
StakingKMSSecretPathKey = "staking-kms-secret-path"
StakingKMSTokenKey = "staking-kms-token"
// Strict-PQ staking identity (FIPS 204 ML-DSA-65). When set, the node
// uses the ML-DSA-65 public key as the NodeID source via
// ids.NodeIDSchemeMLDSA65.DeriveMLDSA(chainID, pubKey), replacing the
// classical TLS-cert NodeID derivation. Strict-PQ profiles require
// these; classical-compat chains ignore them.
StakingMLDSAKeyPathKey = "staking-mldsa-key-file"
StakingMLDSAKeyContentKey = "staking-mldsa-key-file-content"
StakingMLDSAPubKeyPathKey = "staking-mldsa-pub-key-file"
StakingMLDSAPubKeyContentKey = "staking-mldsa-pub-key-file-content"
// Strict-PQ handshake KEM (FIPS 203 ML-KEM-768). Peer-facing public
// key is published in the validator-set entry so peers can encapsulate
// to it for session-key establishment with no classical fallback.
HandshakeMLKEMKeyPathKey = "handshake-mlkem-key-file"
HandshakeMLKEMKeyContentKey = "handshake-mlkem-key-file-content"
HandshakeMLKEMPubKeyPathKey = "handshake-mlkem-pub-key-file"
HandshakeMLKEMPubKeyContentKey = "handshake-mlkem-pub-key-file-content"
SybilProtectionEnabledKey = "sybil-protection-enabled"
SybilProtectionDisabledWeightKey = "sybil-protection-disabled-weight"
NetworkInitialTimeoutKey = "network-initial-timeout"
NetworkMinimumTimeoutKey = "network-minimum-timeout"
NetworkMaximumTimeoutKey = "network-maximum-timeout"
NetworkMaximumInboundTimeoutKey = "network-maximum-inbound-timeout"
NetworkTimeoutHalflifeKey = "network-timeout-halflife"
NetworkTimeoutCoefficientKey = "network-timeout-coefficient"
NetworkHealthMinPeersKey = "network-health-min-conn-peers"
NetworkHealthMaxTimeSinceMsgReceivedKey = "network-health-max-time-since-msg-received"
NetworkHealthMaxTimeSinceMsgSentKey = "network-health-max-time-since-msg-sent"
NetworkHealthMaxPortionSendQueueFillKey = "network-health-max-portion-send-queue-full"
NetworkHealthMaxSendFailRateKey = "network-health-max-send-fail-rate"
NetworkHealthMaxOutstandingDurationKey = "network-health-max-outstanding-request-duration"
NetworkPeerListNumValidatorIPsKey = "network-peer-list-num-validator-ips"
NetworkPeerListPullGossipFreqKey = "network-peer-list-pull-gossip-frequency"
NetworkPeerListBloomResetFreqKey = "network-peer-list-bloom-reset-frequency"
NetworkInitialReconnectDelayKey = "network-initial-reconnect-delay"
NetworkReadHandshakeTimeoutKey = "network-read-handshake-timeout"
NetworkPingTimeoutKey = "network-ping-timeout"
NetworkPingFrequencyKey = "network-ping-frequency"
NetworkMaxReconnectDelayKey = "network-max-reconnect-delay"
NetworkCompressionTypeKey = "network-compression-type"
NetworkMaxClockDifferenceKey = "network-max-clock-difference"
NetworkAllowPrivateIPsKey = "network-allow-private-ips"
NetworkRequireValidatorToConnectKey = "network-require-validator-to-connect"
NetworkPeerReadBufferSizeKey = "network-peer-read-buffer-size"
NetworkPeerWriteBufferSizeKey = "network-peer-write-buffer-size"
NetworkTCPProxyEnabledKey = "network-tcp-proxy-enabled"
NetworkTCPProxyReadTimeoutKey = "network-tcp-proxy-read-timeout"
NetworkTLSKeyLogFileKey = "network-tls-key-log-file-unsafe"
NetworkInboundConnUpgradeThrottlerCooldownKey = "network-inbound-connection-throttling-cooldown"
NetworkInboundThrottlerMaxConnsPerSecKey = "network-inbound-connection-throttling-max-conns-per-sec"
NetworkOutboundConnectionThrottlingRpsKey = "network-outbound-connection-throttling-rps"
NetworkOutboundConnectionTimeoutKey = "network-outbound-connection-timeout"
NetworkNoIngressValidatorConnectionsGracePeriodKey = "network-no-ingress-connections-grace-period"
BenchlistFailThresholdKey = "benchlist-fail-threshold"
BenchlistDurationKey = "benchlist-duration"
BenchlistMinFailingDurationKey = "benchlist-min-failing-duration"
LogsDirKey = "log-dir"
LogLevelKey = "log-level"
LogDisplayLevelKey = "log-display-level"
LogFormatKey = "log-format"
LogRotaterMaxSizeKey = "log-rotater-max-size"
LogRotaterMaxFilesKey = "log-rotater-max-files"
LogRotaterMaxAgeKey = "log-rotater-max-age"
LogRotaterCompressEnabledKey = "log-rotater-compress-enabled"
LogDisableDisplayPluginLogsKey = "log-disable-display-plugin-logs"
ConsensusSampleSizeKey = "consensus-sample-size"
ConsensusQuorumSizeKey = "consensus-quorum-size"
ConsensusPreferenceQuorumSizeKey = "consensus-preference-quorum-size"
ConsensusConfidenceQuorumSizeKey = "consensus-confidence-quorum-size"
ConsensusCommitThresholdKey = "consensus-commit-threshold"
ConsensusConcurrentRepollsKey = "consensus-concurrent-repolls"
ConsensusOptimalProcessingKey = "consensus-optimal-processing"
ConsensusMaxProcessingKey = "consensus-max-processing"
ConsensusMaxTimeProcessingKey = "consensus-max-time-processing"
PartialSyncPrimaryNetworkKey = "partial-sync-primary-network"
TrackChainsKey = "track-chains"
TrackAllChainsKey = "track-all-chains"
DexValidatorKey = "dex-validator"
AdminAPIEnabledKey = "api-admin-enabled"
InfoAPIEnabledKey = "api-info-enabled"
KeystoreAPIEnabledKey = "api-keystore-enabled"
MetricsAPIEnabledKey = "api-metrics-enabled"
HealthAPIEnabledKey = "api-health-enabled"
MeterVMsEnabledKey = "meter-vms-enabled"
ConsensusAppConcurrencyKey = "consensus-app-concurrency"
ConsensusShutdownTimeoutKey = "consensus-shutdown-timeout"
ConsensusFrontierPollFrequencyKey = "consensus-frontier-poll-frequency"
ProposerVMUseCurrentHeightKey = "proposervm-use-current-height"
ProposerVMMinBlockDelayKey = "proposervm-min-block-delay"
ProposerVMWindowDurationKey = "proposervm-window-duration"
FdLimitKey = "fd-limit"
IndexEnabledKey = "index-enabled"
IndexAllowIncompleteKey = "index-allow-incomplete"
RouterHealthMaxDropRateKey = "router-health-max-drop-rate"
RouterHealthMaxOutstandingRequestsKey = "router-health-max-outstanding-requests"
HealthCheckFreqKey = "health-check-frequency"
HealthCheckAveragerHalflifeKey = "health-check-averager-halflife"
PluginDirKey = "plugin-dir"
BootstrapBeaconConnectionTimeoutKey = "bootstrap-beacon-connection-timeout"
BootstrapMaxTimeGetAncestorsKey = "bootstrap-max-time-get-ancestors"
BootstrapAncestorsMaxContainersSentKey = "bootstrap-ancestors-max-containers-sent"
BootstrapAncestorsMaxContainersReceivedKey = "bootstrap-ancestors-max-containers-received"
ChainDataDirKey = "chain-data-dir"
ChainConfigDirKey = "chain-config-dir"
ChainConfigContentKey = "chain-config-content"
ImportChainDataKey = "import-chain-data"
NetConfigDirKey = "net-config-dir"
NetConfigContentKey = "net-config-content"
ProfileDirKey = "profile-dir"
ProfileContinuousEnabledKey = "profile-continuous-enabled"
ProfileContinuousFreqKey = "profile-continuous-freq"
ProfileContinuousMaxFilesKey = "profile-continuous-max-files"
InboundThrottlerAtLargeAllocSizeKey = "throttler-inbound-at-large-alloc-size"
InboundThrottlerVdrAllocSizeKey = "throttler-inbound-validator-alloc-size"
InboundThrottlerNodeMaxAtLargeBytesKey = "throttler-inbound-node-max-at-large-bytes"
InboundThrottlerMaxProcessingMsgsPerNodeKey = "throttler-inbound-node-max-processing-msgs"
InboundThrottlerBandwidthRefillRateKey = "throttler-inbound-bandwidth-refill-rate"
InboundThrottlerBandwidthMaxBurstSizeKey = "throttler-inbound-bandwidth-max-burst-size"
InboundThrottlerCPUMaxRecheckDelayKey = "throttler-inbound-cpu-max-recheck-delay"
InboundThrottlerDiskMaxRecheckDelayKey = "throttler-inbound-disk-max-recheck-delay"
CPUVdrAllocKey = "throttler-inbound-cpu-validator-alloc"
CPUMaxNonVdrUsageKey = "throttler-inbound-cpu-max-non-validator-usage"
CPUMaxNonVdrNodeUsageKey = "throttler-inbound-cpu-max-non-validator-node-usage"
SystemTrackerFrequencyKey = "system-tracker-frequency"
SystemTrackerProcessingHalflifeKey = "system-tracker-processing-halflife"
SystemTrackerCPUHalflifeKey = "system-tracker-cpu-halflife"
SystemTrackerDiskHalflifeKey = "system-tracker-disk-halflife"
SystemTrackerRequiredAvailableDiskSpaceKey = "system-tracker-disk-required-available-space"
SystemTrackerWarningThresholdAvailableDiskSpaceKey = "system-tracker-disk-warning-threshold-available-space"
DiskVdrAllocKey = "throttler-inbound-disk-validator-alloc"
DiskMaxNonVdrUsageKey = "throttler-inbound-disk-max-non-validator-usage"
DiskMaxNonVdrNodeUsageKey = "throttler-inbound-disk-max-non-validator-node-usage"
OutboundThrottlerAtLargeAllocSizeKey = "throttler-outbound-at-large-alloc-size"
OutboundThrottlerVdrAllocSizeKey = "throttler-outbound-validator-alloc-size"
OutboundThrottlerNodeMaxAtLargeBytesKey = "throttler-outbound-node-max-at-large-bytes"
UptimeMetricFreqKey = "uptime-metric-freq"
VMAliasesFileKey = "vm-aliases-file"
VMAliasesContentKey = "vm-aliases-file-content"
ChainAliasesFileKey = "chain-aliases-file"
ChainAliasesContentKey = "chain-aliases-file-content"
TracingEndpointKey = "tracing-endpoint"
TracingInsecureKey = "tracing-insecure"
TracingSampleRateKey = "tracing-sample-rate"
TracingExporterTypeKey = "tracing-exporter-type"
TracingHeadersKey = "tracing-headers"
ProcessContextFileKey = "process-context-file"
// Development and LP Keys
DevModeKey = "automine"
LPSupportKey = "lp-support"
LPObjectKey = "lp-object"
// GPU Acceleration Keys
GPUEnabledKey = "gpu-enabled"
GPUBackendKey = "gpu-backend"
GPUDeviceKey = "gpu-device"
GPULogLevelKey = "gpu-log-level"
// POA Mode Keys
POAModeEnabledKey = "poa-mode-enabled"
POASingleNodeModeKey = "poa-single-node-mode"
POAMinBlockTimeKey = "poa-min-block-time"
POAAuthorizedNodesKey = "poa-authorized-nodes"
// Force flags
ForceIgnoreChecksumKey = "force-ignore-checksum"
// Low Memory / Dev Light Mode Keys
LowMemoryKey = "low-memory"
MemoryProfileKey = "memory-profile"
DevLightKey = "dev-light"
ConfigProfileKey = "config-profile"
DBCacheSizeKey = "db-cache-size"
DBMemtableSizeKey = "db-memtable-size"
StateCacheSizeKey = "state-cache-size"
BlockCacheSizeKey = "block-cache-size"
DisableBloomFiltersKey = "disable-bloom-filters"
LazyChainLoadingKey = "lazy-chain-loading"
SingleValidatorModeKey = "single-validator-mode"
// VM Transport Keys
VMTransportKey = "vm-transport"
VMTransportTimeoutKey = "vm-transport-timeout"
)