diff --git a/app/app.go b/app/app.go index a1e17ebde..b0d97e6d6 100644 --- a/app/app.go +++ b/app/app.go @@ -10,10 +10,10 @@ import ( "sync" "syscall" + "github.com/luxfi/filesystem/perms" "github.com/luxfi/log" "github.com/luxfi/node/node" "github.com/luxfi/node/utils" - "github.com/luxfi/filesystem/perms" "github.com/luxfi/sys/ulimit" nodeconfig "github.com/luxfi/node/config/node" @@ -58,9 +58,9 @@ func New(config nodeconfig.Config) (App, error) { infoLevel, _ := log.ToLevel("info") logFactory := log.NewFactoryWithConfig(log.Config{ RotatingWriterConfig: log.RotatingWriterConfig{ - MaxSize: 8, // 8MB per log file (reasonable for standard profile) - MaxFiles: 5, // Keep 5 rotated files - MaxAge: 7, // 7 days retention + MaxSize: 8, // 8MB per log file (reasonable for standard profile) + MaxFiles: 5, // Keep 5 rotated files + MaxAge: 7, // 7 days retention Directory: config.DatabaseConfig.Path, }, DisplayLevel: infoLevel, diff --git a/benchlist/manager.go b/benchlist/manager.go index b6ec935ac..b62b65fb5 100644 --- a/benchlist/manager.go +++ b/benchlist/manager.go @@ -7,10 +7,10 @@ import ( "sync" "time" - validators "github.com/luxfi/validators" "github.com/luxfi/ids" "github.com/luxfi/log" metrics "github.com/luxfi/metric" + validators "github.com/luxfi/validators" ) // NewManager creates a new benchlist manager diff --git a/benchmarks/consensus_benchmark_test.go b/benchmarks/consensus_benchmark_test.go index f98f38652..f6fee0aaf 100644 --- a/benchmarks/consensus_benchmark_test.go +++ b/benchmarks/consensus_benchmark_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" + "github.com/luxfi/crypto/hash" "github.com/luxfi/ids" "github.com/luxfi/log" - "github.com/luxfi/crypto/hash" ) // BenchmarkHashingComputeHash256 benchmarks SHA256 hashing performance diff --git a/benchmarks/database_benchmark_test.go b/benchmarks/database_benchmark_test.go index 41838a12f..061d82ddd 100644 --- a/benchmarks/database_benchmark_test.go +++ b/benchmarks/database_benchmark_test.go @@ -7,11 +7,11 @@ import ( "fmt" "testing" + "github.com/luxfi/crypto/hash" "github.com/luxfi/database/memdb" "github.com/luxfi/database/prefixdb" "github.com/luxfi/database/versiondb" "github.com/luxfi/ids" - "github.com/luxfi/crypto/hash" ) // BenchmarkMemoryDatabase benchmarks in-memory database operations diff --git a/benchmarks/network_benchmark_test.go b/benchmarks/network_benchmark_test.go index aa922e394..e0a8f8304 100644 --- a/benchmarks/network_benchmark_test.go +++ b/benchmarks/network_benchmark_test.go @@ -9,8 +9,8 @@ import ( "encoding/binary" "testing" - "github.com/luxfi/ids" compression "github.com/luxfi/compress" + "github.com/luxfi/ids" ) // BenchmarkMessageCompression benchmarks message compression diff --git a/cache/lru/cache.go b/cache/lru/cache.go index d8306d460..82577c5f9 100644 --- a/cache/lru/cache.go +++ b/cache/lru/cache.go @@ -6,9 +6,9 @@ package lru import ( "sync" + "github.com/luxfi/container/linked" "github.com/luxfi/node/cache" "github.com/luxfi/utils" - "github.com/luxfi/container/linked" ) var _ cache.Cacher[struct{}, struct{}] = (*Cache[struct{}, struct{}])(nil) diff --git a/cache/lru/sized_cache.go b/cache/lru/sized_cache.go index 59cbc00ca..979f49fb5 100644 --- a/cache/lru/sized_cache.go +++ b/cache/lru/sized_cache.go @@ -6,9 +6,9 @@ package lru import ( "sync" + "github.com/luxfi/container/linked" "github.com/luxfi/node/cache" "github.com/luxfi/utils" - "github.com/luxfi/container/linked" ) var _ cache.Cacher[struct{}, any] = (*SizedCache[struct{}, any])(nil) diff --git a/cache/lru_cache.go b/cache/lru_cache.go index c7941a93b..9225dbf6b 100644 --- a/cache/lru_cache.go +++ b/cache/lru_cache.go @@ -6,8 +6,8 @@ package cache import ( "sync" - "github.com/luxfi/utils" "github.com/luxfi/container/linked" + "github.com/luxfi/utils" ) var _ Cacher[struct{}, struct{}] = (*LRU[struct{}, struct{}])(nil) diff --git a/cache/lru_sized_cache.go b/cache/lru_sized_cache.go index e9d3d793e..d2a53f528 100644 --- a/cache/lru_sized_cache.go +++ b/cache/lru_sized_cache.go @@ -6,8 +6,8 @@ package cache import ( "sync" - "github.com/luxfi/utils" "github.com/luxfi/container/linked" + "github.com/luxfi/utils" ) var _ Cacher[struct{}, any] = (*sizedLRU[struct{}, any])(nil) diff --git a/chains/linearizable_vm.go b/chains/linearizable_vm.go index 550ddc4e1..39e468603 100644 --- a/chains/linearizable_vm.go +++ b/chains/linearizable_vm.go @@ -8,13 +8,13 @@ import ( "errors" "sync" - "github.com/luxfi/vm/chain" consensusvertex "github.com/luxfi/consensus/engine/vertex" "github.com/luxfi/database" "github.com/luxfi/ids" "github.com/luxfi/node/vms/platformvm/fx" "github.com/luxfi/runtime" vmcore "github.com/luxfi/vm" + "github.com/luxfi/vm/chain" "github.com/luxfi/warp" ) diff --git a/chains/manager.go b/chains/manager.go index 21425218d..2500690af 100644 --- a/chains/manager.go +++ b/chains/manager.go @@ -345,7 +345,7 @@ type ManagerConfig struct { PartialSyncPrimaryNetwork bool Server server.Server // Handles HTTP API calls AtomicMemory *atomic.Memory - UTXOAssetID ids.ID + UTXOAssetID ids.ID SkipBootstrap bool // Skip bootstrapping and start processing immediately EnableAutomining bool // Enable automining in POA mode XChainID ids.ID // ID of the X-Chain, @@ -915,7 +915,7 @@ func (m *manager) buildChain(chainParams ChainParameters, sb nets.Net) (*chainIn XChainID: m.XChainID, CChainID: m.CChainID, - UTXOAssetID: m.UTXOAssetID, + UTXOAssetID: m.UTXOAssetID, ChainDataDir: chainDataDir, BCLookup: m, diff --git a/chains/manager_test.go b/chains/manager_test.go index 4dac0c2db..123630a4a 100644 --- a/chains/manager_test.go +++ b/chains/manager_test.go @@ -10,13 +10,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/luxfi/vm" "github.com/luxfi/constants" "github.com/luxfi/ids" "github.com/luxfi/log" "github.com/luxfi/metric" "github.com/luxfi/node/nets" "github.com/luxfi/node/vms" + "github.com/luxfi/vm" ) // TestNew tests creating a new manager @@ -106,9 +106,9 @@ func TestQueueChainCreation(t *testing.T) { chainID := ids.GenerateTestID() netID := ids.GenerateTestID() chainParams := ChainParameters{ - ID: chainID, + ID: chainID, ChainID: netID, - VMID: ids.GenerateTestID(), + VMID: ids.GenerateTestID(), } // Queue the chain diff --git a/chains/rpc/handler_manager_test.go b/chains/rpc/handler_manager_test.go index 3a6e55f65..7e0ad47f6 100644 --- a/chains/rpc/handler_manager_test.go +++ b/chains/rpc/handler_manager_test.go @@ -70,7 +70,7 @@ func (s *mockServer) AddAliasesWithReadLock(endpoint string, aliases ...string) func (s *mockServer) Dispatch() error { return nil } func (s *mockServer) RegisterChain(chainName string, rt *runtime.Runtime, vm vm.VM) { } -func (s *mockServer) Shutdown() error { return nil } +func (s *mockServer) Shutdown() error { return nil } func (s *mockServer) SetRootInfoProvider(_ server.RootInfoProvider) {} func TestHandlerManager_RegisterChainHandlers(t *testing.T) { diff --git a/cmd/backup/main.go b/cmd/backup/main.go index 32d00eccf..23ada8ae5 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -35,12 +35,12 @@ import ( var ( // Flags - outputPath string - inputPath string - sinceVer uint64 - dataDir string - dbType string - noCompress bool + outputPath string + inputPath string + sinceVer uint64 + dataDir string + dbType string + noCompress bool forceRestore bool ) diff --git a/cmd/ceremony/types.go b/cmd/ceremony/types.go index ae95198aa..774660586 100644 --- a/cmd/ceremony/types.go +++ b/cmd/ceremony/types.go @@ -12,16 +12,16 @@ import ( // CeremonyState holds the full state of a powers-of-tau ceremony. type CeremonyState struct { - Circuit string `json:"circuit"` - NumConstraints int `json:"numConstraints"` - PowersNeeded int `json:"powersNeeded"` - Participants int `json:"participants"` - TauG1 []G1Point `json:"tauG1"` - TauG2 []G2Point `json:"tauG2"` - AlphaG1 []G1Point `json:"alphaG1"` - BetaG1 []G1Point `json:"betaG1"` - BetaG2 G2Point `json:"betaG2"` - Contributions []Contribution `json:"contributions"` + Circuit string `json:"circuit"` + NumConstraints int `json:"numConstraints"` + PowersNeeded int `json:"powersNeeded"` + Participants int `json:"participants"` + TauG1 []G1Point `json:"tauG1"` + TauG2 []G2Point `json:"tauG2"` + AlphaG1 []G1Point `json:"alphaG1"` + BetaG1 []G1Point `json:"betaG1"` + BetaG2 G2Point `json:"betaG2"` + Contributions []Contribution `json:"contributions"` } // Contribution records a single participant's contribution. diff --git a/cmd/gen_zoo_addr/gen_zoo_addr.go b/cmd/gen_zoo_addr/gen_zoo_addr.go index e2d8d881f..35ddd14b7 100644 --- a/cmd/gen_zoo_addr/gen_zoo_addr.go +++ b/cmd/gen_zoo_addr/gen_zoo_addr.go @@ -29,7 +29,7 @@ func main() { "allocations": []map[string]interface{}{ { "evmAddr": "0x9011E888251AB053B7bD1cdB598Db4f9DEd94714", - "utxoAddr": zooAddr, + "utxoAddr": zooAddr, "initialAmount": 0, "unlockSchedule": []map[string]interface{}{ { diff --git a/cmd/genesishash/main.go b/cmd/genesishash/main.go index f39377751..c9d70cf5f 100644 --- a/cmd/genesishash/main.go +++ b/cmd/genesishash/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" "os" - + "github.com/luxfi/crypto/hash" "github.com/luxfi/ids" ) @@ -13,15 +13,15 @@ func main() { fmt.Println("Usage: go run main.go ") os.Exit(1) } - + data, err := os.ReadFile(os.Args[1]) if err != nil { fmt.Printf("Error reading file: %v\n", err) os.Exit(1) } - + fmt.Printf("File size: %d bytes\n", len(data)) - + // Compute hash the same way luxd does rawHash := hash.ComputeHash256(data) id, err := ids.ToID(rawHash) @@ -29,6 +29,6 @@ func main() { fmt.Printf("Error converting to ID: %v\n", err) os.Exit(1) } - + fmt.Printf("Genesis ID: %s\n", id.String()) } diff --git a/config/chain_db_config.go b/config/chain_db_config.go index adf60e607..98e1422f2 100644 --- a/config/chain_db_config.go +++ b/config/chain_db_config.go @@ -46,7 +46,7 @@ func (c *ChainDatabaseConfig) GetDatabaseType(chainAlias string) string { func (c *ChainDatabaseConfig) Validate() error { validTypes := map[string]bool{ "pebbledb": true, - "zapdb": true, + "zapdb": true, "memdb": true, } diff --git a/config/config.go b/config/config.go index 415278c79..f99519314 100644 --- a/config/config.go +++ b/config/config.go @@ -1746,7 +1746,6 @@ func GetNodeConfig(v *viper.Viper) (node.Config, error) { } nodeConfig.TrackAllChains = v.GetBool(TrackAllChainsKey) - // HTTP APIs nodeConfig.HTTPConfig, err = getHTTPConfig(v) if err != nil { diff --git a/config/config_test.go b/config/config_test.go index 4b3fbdf90..764bce4f4 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -16,8 +16,8 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/require" - "github.com/luxfi/constants" consensusconfig "github.com/luxfi/consensus/config" + "github.com/luxfi/constants" "github.com/luxfi/ids" "github.com/luxfi/node/chains" "github.com/luxfi/node/genesis/builder" diff --git a/config/flags.go b/config/flags.go index f8da36e7e..ddb5577f9 100644 --- a/config/flags.go +++ b/config/flags.go @@ -13,14 +13,14 @@ import ( "github.com/spf13/pflag" "github.com/spf13/viper" + compression "github.com/luxfi/compress" "github.com/luxfi/constants" "github.com/luxfi/genesis/pkg/genesis" + "github.com/luxfi/net/dynamicip" "github.com/luxfi/node/genesis/builder" "github.com/luxfi/node/trace" "github.com/luxfi/node/vms/components/gas" "github.com/luxfi/node/vms/proposervm" - compression "github.com/luxfi/compress" - "github.com/luxfi/net/dynamicip" "github.com/luxfi/sys/ulimit" consensusconfig "github.com/luxfi/consensus/config" @@ -48,19 +48,19 @@ var ( defaultStakingSignerKeyPath = filepath.Join(defaultStakingPath, "signer.key") // Strict-PQ default paths — mirror downstream-tenant CLI ` key gen` // layout so the operator init container + lqd see the same files. - defaultStakingMLDSAKeyPath = filepath.Join(defaultStakingPath, "mldsa.key") - defaultStakingMLDSAPubKeyPath = filepath.Join(defaultStakingPath, "mldsa.pub") + defaultStakingMLDSAKeyPath = filepath.Join(defaultStakingPath, "mldsa.key") + defaultStakingMLDSAPubKeyPath = filepath.Join(defaultStakingPath, "mldsa.pub") defaultHandshakeMLKEMKeyPath = filepath.Join(defaultStakingPath, "mlkem.key") defaultHandshakeMLKEMPubKeyPath = filepath.Join(defaultStakingPath, "mlkem.pub") - defaultConfigDir = filepath.Join(defaultUnexpandedDataDir, "configs") - defaultChainConfigDir = filepath.Join(defaultConfigDir, "chains") - defaultVMConfigDir = filepath.Join(defaultConfigDir, "vms") - defaultVMAliasFilePath = filepath.Join(defaultVMConfigDir, "aliases.json") - defaultChainAliasFilePath = filepath.Join(defaultChainConfigDir, "aliases.json") - defaultNetConfigDir = filepath.Join(defaultConfigDir, "chains") - defaultPluginDir = filepath.Join(defaultUnexpandedDataDir, "plugins", "current") - defaultChainDataDir = filepath.Join(defaultUnexpandedDataDir, "chainData") - defaultProcessContextPath = filepath.Join(defaultUnexpandedDataDir, DefaultProcessContextFilename) + defaultConfigDir = filepath.Join(defaultUnexpandedDataDir, "configs") + defaultChainConfigDir = filepath.Join(defaultConfigDir, "chains") + defaultVMConfigDir = filepath.Join(defaultConfigDir, "vms") + defaultVMAliasFilePath = filepath.Join(defaultVMConfigDir, "aliases.json") + defaultChainAliasFilePath = filepath.Join(defaultChainConfigDir, "aliases.json") + defaultNetConfigDir = filepath.Join(defaultConfigDir, "chains") + defaultPluginDir = filepath.Join(defaultUnexpandedDataDir, "plugins", "current") + defaultChainDataDir = filepath.Join(defaultUnexpandedDataDir, "chainData") + defaultProcessContextPath = filepath.Join(defaultUnexpandedDataDir, DefaultProcessContextFilename) ) func deprecateFlags(fs *pflag.FlagSet) error { diff --git a/config/keys.go b/config/keys.go index ef891877d..dec70d929 100644 --- a/config/keys.go +++ b/config/keys.go @@ -78,36 +78,36 @@ const ( 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" + 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" + 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. @@ -264,17 +264,17 @@ const ( 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" + 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" diff --git a/config/node/config.go b/config/node/config.go index 114f3ce3d..2be1e8059 100644 --- a/config/node/config.go +++ b/config/node/config.go @@ -10,23 +10,23 @@ import ( "time" "github.com/luxfi/ids" - "github.com/luxfi/node/server/http" "github.com/luxfi/node/benchlist" "github.com/luxfi/node/chains" "github.com/luxfi/node/genesis/builder" "github.com/luxfi/node/network" + "github.com/luxfi/node/server/http" // "github.com/luxfi/consensus/core/router" // Unused "github.com/luxfi/crypto/bls" "github.com/luxfi/crypto/mldsa" mlkemcrypto "github.com/luxfi/crypto/mlkem" "github.com/luxfi/node/nets" "github.com/luxfi/node/network/tracker" - "github.com/luxfi/node/upgrade" "github.com/luxfi/node/trace" + "github.com/luxfi/node/upgrade" // "github.com/luxfi/log" // Unused "github.com/luxfi/math/set" - "github.com/luxfi/timer" "github.com/luxfi/node/utils/profiler" + "github.com/luxfi/timer" ) type APIIndexerConfig struct { @@ -101,13 +101,13 @@ type StakingConfig struct { // publishes in its validator-set entry so peers can encapsulate to it // for session-key establishment with no classical fallback. The // HandshakeMLKEMPriv stays local to the pod. - StakingMLDSA *mldsa.PrivateKey `json:"-"` - StakingMLDSAPub []byte `json:"-"` - HandshakeMLKEMPriv *mlkemcrypto.PrivateKey `json:"-"` - HandshakeMLKEMPub []byte `json:"-"` + StakingMLDSA *mldsa.PrivateKey `json:"-"` + StakingMLDSAPub []byte `json:"-"` + HandshakeMLKEMPriv *mlkemcrypto.PrivateKey `json:"-"` + HandshakeMLKEMPub []byte `json:"-"` // File paths kept for log-line context, mirroring StakingKeyPath etc. - StakingMLDSAKeyPath string `json:"stakingMLDSAKeyPath,omitempty"` - StakingMLDSAPubPath string `json:"stakingMLDSAPubPath,omitempty"` + StakingMLDSAKeyPath string `json:"stakingMLDSAKeyPath,omitempty"` + StakingMLDSAPubPath string `json:"stakingMLDSAPubPath,omitempty"` HandshakeMLKEMKeyPath string `json:"handshakeMLKEMKeyPath,omitempty"` HandshakeMLKEMPubPath string `json:"handshakeMLKEMPubPath,omitempty"` } @@ -169,7 +169,7 @@ type Config struct { // Genesis information GenesisBytes []byte `json:"-"` - UTXOAssetID ids.ID `json:"utxoAssetID"` + UTXOAssetID ids.ID `json:"utxoAssetID"` // ID of the network this node should connect to NetworkID uint32 `json:"networkID"` diff --git a/consensus/acceptor.go b/consensus/acceptor.go index 16cc477f2..9057c5eaf 100644 --- a/consensus/acceptor.go +++ b/consensus/acceptor.go @@ -9,9 +9,9 @@ import ( "go.uber.org/zap" - "github.com/luxfi/runtime" "github.com/luxfi/ids" "github.com/luxfi/log" + "github.com/luxfi/runtime" ) var ( diff --git a/consensus/quasar/gpu_pipeline.go b/consensus/quasar/gpu_pipeline.go index c544fefcd..aaf2d8257 100644 --- a/consensus/quasar/gpu_pipeline.go +++ b/consensus/quasar/gpu_pipeline.go @@ -68,32 +68,32 @@ type MLDSAWork struct { // BlockVerifyWork contains all verification batches for a single block. type BlockVerifyWork struct { - BLS *BLSWork + BLS *BLSWork Corona *CoronaWork - ZK *ZKWork - MLDSA *MLDSAWork + ZK *ZKWork + MLDSA *MLDSAWork } // BlockVerifyResult contains verification results for all batch types. type BlockVerifyResult struct { - BLSValid []bool + BLSValid []bool CoronaValid []bool - ZKValid bool - MLDSAValid []bool + ZKValid bool + MLDSAValid []bool - GPUUsed bool - BLSTime time.Duration + GPUUsed bool + BLSTime time.Duration CoronaTime time.Duration - ZKTime time.Duration - MLDSATime time.Duration - TotalTime time.Duration + ZKTime time.Duration + MLDSATime time.Duration + TotalTime time.Duration } var ( - ErrBLSSizeMismatch = errors.New("BLS batch size mismatch: messages, signatures, and pubkeys must have equal length") + ErrBLSSizeMismatch = errors.New("BLS batch size mismatch: messages, signatures, and pubkeys must have equal length") ErrCoronaSizeMismatch = errors.New("Corona batch size mismatch: messages, signatures, and pubkeys must have equal length") - ErrZKSizeMismatch = errors.New("ZK batch size mismatch: scalars and bases must have equal length") - ErrMLDSASizeMismatch = errors.New("ML-DSA batch size mismatch: messages, signatures, and pubkeys must have equal length") + ErrZKSizeMismatch = errors.New("ZK batch size mismatch: scalars and bases must have equal length") + ErrMLDSASizeMismatch = errors.New("ML-DSA batch size mismatch: messages, signatures, and pubkeys must have equal length") ) // VerifyBlock dispatches all verification work for a block through the GPU pipeline. diff --git a/consensus/quasar/gpu_pipeline_test.go b/consensus/quasar/gpu_pipeline_test.go index dc57112fb..300191d40 100644 --- a/consensus/quasar/gpu_pipeline_test.go +++ b/consensus/quasar/gpu_pipeline_test.go @@ -79,10 +79,10 @@ func TestGPUPipeline_AllFourTypes(t *testing.T) { pipeline := NewGPUVerifyPipeline() work := &BlockVerifyWork{ - BLS: makeBLSWork(5), + BLS: makeBLSWork(5), Corona: makeCoronaWork(3), - ZK: makeZKWork(2), - MLDSA: makeMLDSAWork(10), + ZK: makeZKWork(2), + MLDSA: makeMLDSAWork(10), } result, err := pipeline.VerifyBlock(work) @@ -276,10 +276,10 @@ func BenchmarkGPUPipeline(b *testing.B) { pipeline := NewGPUVerifyPipeline() work := &BlockVerifyWork{ - BLS: makeBLSWork(100), + BLS: makeBLSWork(100), Corona: makeCoronaWork(50), - ZK: makeZKWork(10), - MLDSA: makeMLDSAWork(200), + ZK: makeZKWork(10), + MLDSA: makeMLDSAWork(200), } b.ResetTimer() diff --git a/consensus/quasar/integration_test.go b/consensus/quasar/integration_test.go index c11768bef..0b857a8ca 100644 --- a/consensus/quasar/integration_test.go +++ b/consensus/quasar/integration_test.go @@ -116,11 +116,11 @@ func generateValidatorStates(n int) []ValidatorState { _, _ = rand.Read(rtKey) states[i] = ValidatorState{ - NodeID: ids.GenerateTestNodeID(), - Weight: 1000, - BLSPubKey: blsKey, + NodeID: ids.GenerateTestNodeID(), + Weight: 1000, + BLSPubKey: blsKey, CoronaKey: rtKey, - Active: true, + Active: true, } } return states @@ -575,13 +575,13 @@ func TestQuasarMemoryPressure(t *testing.T) { _, _ = rand.Read(blockID[:]) finality := &QuantumFinality{ - BlockID: blockID, - PChainHeight: uint64(i), - QChainHeight: uint64(i), - BLSProof: make([]byte, 96), - CoronaProof: make([]byte, 1024), - TotalWeight: 1000, - SignerWeight: 700, + BlockID: blockID, + PChainHeight: uint64(i), + QChainHeight: uint64(i), + BLSProof: make([]byte, 96), + CoronaProof: make([]byte, 1024), + TotalWeight: 1000, + SignerWeight: 700, } q.SetFinalized(blockID, finality) } @@ -913,10 +913,10 @@ func TestQuasarEdgeCases(t *testing.T) { require.NoError(t, err) finality := &QuantumFinality{ - BLSProof: nil, - CoronaProof: nil, - TotalWeight: 1000, - SignerWeight: 700, + BLSProof: nil, + CoronaProof: nil, + TotalWeight: 1000, + SignerWeight: 700, } err = q.Verify(finality) @@ -928,10 +928,10 @@ func TestQuasarEdgeCases(t *testing.T) { require.NoError(t, err) finality := &QuantumFinality{ - BLSProof: []byte("proof"), - CoronaProof: []byte("proof"), - TotalWeight: 1000, - SignerWeight: 500, // Only 50%, needs 67% + BLSProof: []byte("proof"), + CoronaProof: []byte("proof"), + TotalWeight: 1000, + SignerWeight: 500, // Only 50%, needs 67% } err = q.Verify(finality) diff --git a/consensus/quasar/oom_test.go b/consensus/quasar/oom_test.go index 1d7ccee26..13b5de7f1 100644 --- a/consensus/quasar/oom_test.go +++ b/consensus/quasar/oom_test.go @@ -401,7 +401,7 @@ func TestConcurrentPruningStress(t *testing.T) { require.NoError(t, err) const ( - numWriters = 8 + numWriters = 8 opsPerWriter = 5000 ) diff --git a/consensus/quasar/quasar.go b/consensus/quasar/quasar.go index 217203bcd..60c52c686 100644 --- a/consensus/quasar/quasar.go +++ b/consensus/quasar/quasar.go @@ -61,15 +61,15 @@ import ( // 2. t-of-n validators completed Corona threshold (post-quantum secure) var ( - ErrQuasarNotStarted = errors.New("quasar not started") - ErrPChainNotConnected = errors.New("P-Chain not connected") - ErrQChainNotConnected = errors.New("Q-Chain not connected") - ErrCoronaNotConnected = errors.New("Corona coordinator not connected") - ErrInsufficientWeight = errors.New("insufficient validator weight") - ErrInsufficientSigners = errors.New("insufficient Corona signers") - ErrFinalityFailed = errors.New("hybrid finality verification failed") - ErrBLSFailed = errors.New("BLS aggregation failed") - ErrCoronaFailed = errors.New("Corona threshold signing failed") + ErrQuasarNotStarted = errors.New("quasar not started") + ErrPChainNotConnected = errors.New("P-Chain not connected") + ErrQChainNotConnected = errors.New("Q-Chain not connected") + ErrCoronaNotConnected = errors.New("Corona coordinator not connected") + ErrInsufficientWeight = errors.New("insufficient validator weight") + ErrInsufficientSigners = errors.New("insufficient Corona signers") + ErrFinalityFailed = errors.New("hybrid finality verification failed") + ErrBLSFailed = errors.New("BLS aggregation failed") + ErrCoronaFailed = errors.New("Corona threshold signing failed") ) // PChainProvider provides P-Chain state and finality events @@ -87,11 +87,11 @@ type QuantumSignerFallback interface { // ValidatorState represents a validator's current state // Each validator has BOTH BLS and Corona keys type ValidatorState struct { - NodeID ids.NodeID - Weight uint64 - BLSPubKey []byte // BLS public key for aggregate signatures + NodeID ids.NodeID + Weight uint64 + BLSPubKey []byte // BLS public key for aggregate signatures CoronaKey []byte // Corona public key share for threshold sigs - Active bool + Active bool } // FinalityEvent represents a P-Chain finality event @@ -104,18 +104,18 @@ type FinalityEvent struct { // QuantumFinality represents a block that achieved hybrid quantum finality type QuantumFinality struct { - BlockID ids.ID - PChainHeight uint64 - QChainHeight uint64 - BLSProof []byte // Aggregated BLS signature (96 bytes) + BlockID ids.ID + PChainHeight uint64 + QChainHeight uint64 + BLSProof []byte // Aggregated BLS signature (96 bytes) CoronaProof []byte // Serialized Corona threshold signature - SignerBitset []byte // Which validators signed BLS + SignerBitset []byte // Which validators signed BLS CoronaSigners []ids.NodeID // Which validators participated in Corona - TotalWeight uint64 - SignerWeight uint64 - BLSLatency time.Duration + TotalWeight uint64 + SignerWeight uint64 + BLSLatency time.Duration CoronaLatency time.Duration - Timestamp time.Time + Timestamp time.Time } // Quasar binds P-Chain and Q-Chain consensus into hybrid quantum finality @@ -369,18 +369,18 @@ func (q *Quasar) processFinality(ctx context.Context, event FinalityEvent) error coronaProof = coronaSig.Bytes() } finality := &QuantumFinality{ - BlockID: event.BlockID, - PChainHeight: event.Height, - QChainHeight: q.qHeight, - BLSProof: blsProof, + BlockID: event.BlockID, + PChainHeight: event.Height, + QChainHeight: q.qHeight, + BLSProof: blsProof, CoronaProof: coronaProof, - SignerBitset: signerBitset, + SignerBitset: signerBitset, CoronaSigners: coronaSigners, - TotalWeight: totalWeight, - SignerWeight: signerWeight, - BLSLatency: blsLatency, + TotalWeight: totalWeight, + SignerWeight: signerWeight, + BLSLatency: blsLatency, CoronaLatency: coronaLatency, - Timestamp: time.Now(), + Timestamp: time.Now(), } q.finalized[event.BlockID] = finality @@ -590,13 +590,13 @@ func (q *Quasar) Stats() QuasarStats { } return QuasarStats{ - PChainHeight: q.pHeight, - QChainHeight: q.qHeight, - FinalizedBlocks: len(q.finalized), - Threshold: q.threshold, - QuorumNum: q.quorumNum, - QuorumDen: q.quorumDen, - Running: q.running, + PChainHeight: q.pHeight, + QChainHeight: q.qHeight, + FinalizedBlocks: len(q.finalized), + Threshold: q.threshold, + QuorumNum: q.quorumNum, + QuorumDen: q.quorumDen, + Running: q.running, CoronaParties: coronaStats.NumParties, CoronaThreshold: coronaStats.Threshold, CoronaReady: coronaStats.Initialized, @@ -605,13 +605,13 @@ func (q *Quasar) Stats() QuasarStats { // QuasarStats contains quasar statistics type QuasarStats struct { - PChainHeight uint64 - QChainHeight uint64 - FinalizedBlocks int - Threshold int - QuorumNum uint64 - QuorumDen uint64 - Running bool + PChainHeight uint64 + QChainHeight uint64 + FinalizedBlocks int + Threshold int + QuorumNum uint64 + QuorumDen uint64 + Running bool CoronaParties int CoronaThreshold int CoronaReady bool diff --git a/consensus/quasar/types.go b/consensus/quasar/types.go index 5f1039bda..6a6ab3d4b 100644 --- a/consensus/quasar/types.go +++ b/consensus/quasar/types.go @@ -181,7 +181,7 @@ func (s *BLSSignature) Signers() []ids.NodeID { return s.signers } // QuasarSignature combines BLS and Corona signatures for P/Q security type QuasarSignature struct { - bls *BLSSignature + bls *BLSSignature corona *CoronaSignature } @@ -211,7 +211,7 @@ func (s *QuasarSignature) Signers() []ids.NodeID { return s.bls.Signers() } -func (s *QuasarSignature) BLS() *BLSSignature { return s.bls } +func (s *QuasarSignature) BLS() *BLSSignature { return s.bls } func (s *QuasarSignature) Corona() *CoronaSignature { return s.corona } // QuasarSigner combines classical and post-quantum signers diff --git a/debug/full_test.go b/debug/full_test.go index 5ba7751c6..dcb97206e 100644 --- a/debug/full_test.go +++ b/debug/full_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/luxfi/consensus/utils/set" - validators "github.com/luxfi/validators" "github.com/luxfi/constants" "github.com/luxfi/ids" + validators "github.com/luxfi/validators" ) func TestFullValidatorFunctionality(t *testing.T) { diff --git a/debug/simple_test.go b/debug/simple_test.go index daa1d53ce..542f2e0d9 100644 --- a/debug/simple_test.go +++ b/debug/simple_test.go @@ -4,9 +4,9 @@ package debug import ( - validators "github.com/luxfi/validators" "github.com/luxfi/constants" "github.com/luxfi/ids" + validators "github.com/luxfi/validators" "testing" ) diff --git a/genesis/builder/builder.go b/genesis/builder/builder.go index a6df655c3..b80e05fe9 100644 --- a/genesis/builder/builder.go +++ b/genesis/builder/builder.go @@ -23,11 +23,11 @@ import ( "github.com/luxfi/net/endpoints" "github.com/luxfi/node/vms/components/gas" "github.com/luxfi/node/vms/platformvm/genesis" - xvmgenesis "github.com/luxfi/node/vms/xvm/genesis" "github.com/luxfi/node/vms/platformvm/reward" "github.com/luxfi/node/vms/platformvm/signer" pchaintxs "github.com/luxfi/node/vms/platformvm/txs" "github.com/luxfi/node/vms/platformvm/validators/fee" + xvmgenesis "github.com/luxfi/node/vms/xvm/genesis" "github.com/luxfi/utxo/bls12381fx" "github.com/luxfi/utxo/ed25519fx" "github.com/luxfi/utxo/mldsafx" @@ -38,8 +38,8 @@ import ( "github.com/luxfi/utxo/secp256r1fx" "github.com/luxfi/utxo/slhdsafx" - genesiscfg "github.com/luxfi/genesis/pkg/genesis" genesisconfigs "github.com/luxfi/genesis/configs" + genesiscfg "github.com/luxfi/genesis/pkg/genesis" ) // Chain alias vars are derived from the single source of truth (Registry diff --git a/genesis/builder/builder_test.go b/genesis/builder/builder_test.go index 955802452..98bc289a6 100644 --- a/genesis/builder/builder_test.go +++ b/genesis/builder/builder_test.go @@ -160,10 +160,10 @@ func TestGetConfig(t *testing.T) { func TestGetConfigAllocations(t *testing.T) { tests := []struct { - name string - networkID uint32 - minAllocs int - minStakers int + name string + networkID uint32 + minAllocs int + minStakers int }{ {"Mainnet", constants.MainnetID, 50, 1}, {"Testnet", constants.TestnetID, 50, 1}, diff --git a/genesis/builder/registry.go b/genesis/builder/registry.go index 4717ca144..a4181b101 100644 --- a/genesis/builder/registry.go +++ b/genesis/builder/registry.go @@ -126,4 +126,3 @@ func VMAliasesMap() map[ids.ID][]string { } return m } - diff --git a/indexer/client.go b/indexer/client.go index 9f5559152..bc03ab32f 100644 --- a/indexer/client.go +++ b/indexer/client.go @@ -9,8 +9,8 @@ import ( "github.com/luxfi/formatting" "github.com/luxfi/ids" - "github.com/luxfi/rpc" "github.com/luxfi/node/utils/json" + "github.com/luxfi/rpc" ) type Client struct { diff --git a/indexer/client_test.go b/indexer/client_test.go index 3414821c4..7863f60c6 100644 --- a/indexer/client_test.go +++ b/indexer/client_test.go @@ -11,9 +11,9 @@ import ( "github.com/luxfi/formatting" "github.com/luxfi/ids" + "github.com/luxfi/node/utils/json" "github.com/luxfi/rpc" "github.com/luxfi/utils" - "github.com/luxfi/node/utils/json" ) type mockClient struct { diff --git a/indexer/index.go b/indexer/index.go index cf6fab9e3..adf0820ec 100644 --- a/indexer/index.go +++ b/indexer/index.go @@ -8,13 +8,13 @@ import ( "fmt" "sync" - "github.com/luxfi/runtime" "github.com/luxfi/database" "github.com/luxfi/database/prefixdb" "github.com/luxfi/database/versiondb" "github.com/luxfi/ids" "github.com/luxfi/log" nodeconsensus "github.com/luxfi/node/consensus" + "github.com/luxfi/runtime" "github.com/luxfi/timer/mockable" ) diff --git a/indexer/indexer.go b/indexer/indexer.go index 1feb4dd0b..1795fc9ba 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -15,9 +15,9 @@ import ( "github.com/luxfi/database/prefixdb" "github.com/luxfi/ids" "github.com/luxfi/log" - "github.com/luxfi/node/server/http" "github.com/luxfi/node/chains" nodeconsensus "github.com/luxfi/node/consensus" + "github.com/luxfi/node/server/http" "github.com/luxfi/node/utils/json" "github.com/luxfi/runtime" "github.com/luxfi/timer/mockable" diff --git a/message/creator.go b/message/creator.go index 064633c35..5a5f9ea91 100644 --- a/message/creator.go +++ b/message/creator.go @@ -6,8 +6,8 @@ package message import ( "time" - "github.com/luxfi/metric" compression "github.com/luxfi/compress" + "github.com/luxfi/metric" ) var _ Creator = (*creator)(nil) diff --git a/message/inbound_msg_builder_test.go b/message/inbound_msg_builder_test.go index f4ad72956..c0b90268a 100644 --- a/message/inbound_msg_builder_test.go +++ b/message/inbound_msg_builder_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/require" + compression "github.com/luxfi/compress" "github.com/luxfi/ids" "github.com/luxfi/node/proto/p2p" "github.com/luxfi/timer/mockable" - compression "github.com/luxfi/compress" ) func Test_newMsgBuilder(t *testing.T) { diff --git a/message/messagemock/outbound_message_builder.go b/message/messagemock/outbound_message_builder.go index 9ccec1ae6..c679f0ea9 100644 --- a/message/messagemock/outbound_message_builder.go +++ b/message/messagemock/outbound_message_builder.go @@ -15,9 +15,9 @@ import ( time "time" ids "github.com/luxfi/ids" + "github.com/luxfi/net/endpoints" message "github.com/luxfi/node/message" p2p "github.com/luxfi/node/proto/p2p" - "github.com/luxfi/net/endpoints" gomock "go.uber.org/mock/gomock" ) diff --git a/message/messages.go b/message/messages.go index f4f75e8a0..98babe92e 100644 --- a/message/messages.go +++ b/message/messages.go @@ -8,12 +8,12 @@ import ( "fmt" "time" + compression "github.com/luxfi/compress" "github.com/luxfi/constants" "github.com/luxfi/ids" "github.com/luxfi/metric" "github.com/luxfi/node/proto/p2p" "github.com/luxfi/timer/mockable" - compression "github.com/luxfi/compress" ) const ( diff --git a/message/messages_benchmark_test.go b/message/messages_benchmark_test.go index fb0dd76cb..67b222746 100644 --- a/message/messages_benchmark_test.go +++ b/message/messages_benchmark_test.go @@ -12,9 +12,9 @@ import ( "github.com/stretchr/testify/require" + compression "github.com/luxfi/compress" "github.com/luxfi/ids" "github.com/luxfi/node/proto/p2p" - compression "github.com/luxfi/compress" ) var ( diff --git a/message/messages_test.go b/message/messages_test.go index 2baef9558..00b14a495 100644 --- a/message/messages_test.go +++ b/message/messages_test.go @@ -12,10 +12,10 @@ import ( "github.com/stretchr/testify/require" + compression "github.com/luxfi/compress" "github.com/luxfi/ids" "github.com/luxfi/node/proto/p2p" "github.com/luxfi/node/staking" - compression "github.com/luxfi/compress" ) func TestMessage(t *testing.T) { diff --git a/message/mock_outbound_message_builder.go b/message/mock_outbound_message_builder.go index 851cadd9a..dece8e8a4 100644 --- a/message/mock_outbound_message_builder.go +++ b/message/mock_outbound_message_builder.go @@ -17,8 +17,8 @@ import ( time "time" ids "github.com/luxfi/ids" - p2p "github.com/luxfi/node/proto/p2p" "github.com/luxfi/net/endpoints" + p2p "github.com/luxfi/node/proto/p2p" ) // MockOutboundMsgBuilder is a mock of OutboundMsgBuilder interface. diff --git a/message/wire/types.go b/message/wire/types.go index 31393eb07..fae393190 100644 --- a/message/wire/types.go +++ b/message/wire/types.go @@ -17,37 +17,37 @@ const ( // Message is the top-level P2P message container type Message struct { // Only one of these should be set - CompressedZstd []byte - Ping *Ping - Pong *Pong - Handshake *Handshake - GetPeerList *GetPeerList - PeerList *PeerList - GetStateSummaryFrontier *GetStateSummaryFrontier - StateSummaryFrontier *StateSummaryFrontier - GetAcceptedStateSummary *GetAcceptedStateSummary - AcceptedStateSummary *AcceptedStateSummary - GetAcceptedFrontier *GetAcceptedFrontier - AcceptedFrontier *AcceptedFrontier - GetAccepted *GetAccepted - Accepted *Accepted - GetAncestors *GetAncestors - Ancestors *Ancestors - Get *Get - Put *Put - PushQuery *PushQuery - PullQuery *PullQuery - Chits *Chits - Request *Request - Response *Response - Gossip *Gossip + CompressedZstd []byte + Ping *Ping + Pong *Pong + Handshake *Handshake + GetPeerList *GetPeerList + PeerList *PeerList + GetStateSummaryFrontier *GetStateSummaryFrontier + StateSummaryFrontier *StateSummaryFrontier + GetAcceptedStateSummary *GetAcceptedStateSummary + AcceptedStateSummary *AcceptedStateSummary + GetAcceptedFrontier *GetAcceptedFrontier + AcceptedFrontier *AcceptedFrontier + GetAccepted *GetAccepted + Accepted *Accepted + GetAncestors *GetAncestors + Ancestors *Ancestors + Get *Get + Put *Put + PushQuery *PushQuery + PullQuery *PullQuery + Chits *Chits + Request *Request + Response *Response + Gossip *Gossip BFT *BFT } // Ping message type Ping struct { - Uptime uint32 - ChainIds []*ChainPingEntry + Uptime uint32 + ChainIds []*ChainPingEntry } // ChainPingEntry is the per-chain payload in Ping/Pong. @@ -59,24 +59,24 @@ type ChainPingEntry struct { // Pong message type Pong struct { - Uptime uint32 - ChainIds []*ChainPingEntry + Uptime uint32 + ChainIds []*ChainPingEntry } // Handshake message type Handshake struct { - NetworkId uint32 - MyTime uint64 - IpAddr []byte - IpPort uint32 - IpSigningTime uint64 - IpNodeIdSig []byte + NetworkId uint32 + MyTime uint64 + IpAddr []byte + IpPort uint32 + IpSigningTime uint64 + IpNodeIdSig []byte TrackedChains [][]byte - Client *Client - SupportedAcps []uint32 - ObjectedAcps []uint32 - KnownPeers *BloomFilter - IpBlsSig []byte + Client *Client + SupportedAcps []uint32 + ObjectedAcps []uint32 + KnownPeers *BloomFilter + IpBlsSig []byte } // Client info in handshake @@ -210,9 +210,9 @@ type GetAncestors struct { EngineType EngineType } -func (m *GetAncestors) GetChainId() []byte { return m.ChainId } -func (m *GetAncestors) GetRequestId() uint32 { return m.RequestId } -func (m *GetAncestors) GetDeadline() uint64 { return m.Deadline } +func (m *GetAncestors) GetChainId() []byte { return m.ChainId } +func (m *GetAncestors) GetRequestId() uint32 { return m.RequestId } +func (m *GetAncestors) GetDeadline() uint64 { return m.Deadline } func (m *GetAncestors) GetEngineType() EngineType { return m.EngineType } // Ancestors message @@ -240,10 +240,10 @@ func (m *Get) GetDeadline() uint64 { return m.Deadline } // Put message type Put struct { - ChainId []byte - RequestId uint32 - Container []byte - EngineType EngineType + ChainId []byte + RequestId uint32 + Container []byte + EngineType EngineType } func (m *Put) GetChainId() []byte { return m.ChainId } @@ -251,11 +251,11 @@ func (m *Put) GetRequestId() uint32 { return m.RequestId } // PushQuery message type PushQuery struct { - ChainId []byte - RequestId uint32 - Deadline uint64 - Container []byte - EngineType EngineType + ChainId []byte + RequestId uint32 + Deadline uint64 + Container []byte + EngineType EngineType RequestedHeight uint64 } @@ -279,11 +279,11 @@ func (m *PullQuery) GetDeadline() uint64 { return m.Deadline } // Chits message type Chits struct { - ChainId []byte - RequestId uint32 - PreferredId []byte + ChainId []byte + RequestId uint32 + PreferredId []byte PreferredIdAtHeight []byte - AcceptedId []byte + AcceptedId []byte } func (m *Chits) GetChainId() []byte { return m.ChainId } diff --git a/message/wire/zap.go b/message/wire/zap.go index dddc48d1a..9a0d11acd 100644 --- a/message/wire/zap.go +++ b/message/wire/zap.go @@ -11,12 +11,12 @@ import ( const ( // Message type tags for ZAP encoding - tagCompressedZstd = 1 - tagPing = 2 - tagPong = 3 - tagHandshake = 4 - tagGetPeerList = 5 - tagPeerList = 6 + tagCompressedZstd = 1 + tagPing = 2 + tagPong = 3 + tagHandshake = 4 + tagGetPeerList = 5 + tagPeerList = 6 tagGetStateSummaryFrontier = 7 tagStateSummaryFrontier = 8 tagGetAcceptedStateSummary = 9 @@ -35,13 +35,12 @@ const ( tagRequest = 22 tagResponse = 23 tagGossip = 24 - tagBFT = 25 + tagBFT = 25 ) var ( ErrInvalidMessage = errors.New("invalid wire message") ErrUnknownTag = errors.New("unknown message tag") - ) // Buffer for zero-copy encoding diff --git a/nat/pmp.go b/nat/pmp.go index 28a32d7e5..9aa6449c9 100644 --- a/nat/pmp.go +++ b/nat/pmp.go @@ -19,7 +19,7 @@ func getPMPRouter() *pmpRouter { // pmpRouter stub for minimal build type pmpRouter struct{} -func (*pmpRouter) SupportsNAT() bool { return false } -func (*pmpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil } -func (*pmpRouter) UnmapPort(_, _ uint16) error { return nil } -func (*pmpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil } +func (*pmpRouter) SupportsNAT() bool { return false } +func (*pmpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil } +func (*pmpRouter) UnmapPort(_, _ uint16) error { return nil } +func (*pmpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil } diff --git a/nat/upnp.go b/nat/upnp.go index a5b04774e..408ec93e7 100644 --- a/nat/upnp.go +++ b/nat/upnp.go @@ -19,7 +19,7 @@ func getUPnPRouter() *upnpRouter { // upnpRouter stub for minimal build type upnpRouter struct{} -func (*upnpRouter) SupportsNAT() bool { return false } -func (*upnpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil } -func (*upnpRouter) UnmapPort(_, _ uint16) error { return nil } -func (*upnpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil } +func (*upnpRouter) SupportsNAT() bool { return false } +func (*upnpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil } +func (*upnpRouter) UnmapPort(_, _ uint16) error { return nil } +func (*upnpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil }