mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
fix: gofmt -s across repo (CI format check)
This commit is contained in:
+4
-4
@@ -10,10 +10,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/luxfi/filesystem/perms"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
"github.com/luxfi/node/node"
|
"github.com/luxfi/node/node"
|
||||||
"github.com/luxfi/node/utils"
|
"github.com/luxfi/node/utils"
|
||||||
"github.com/luxfi/filesystem/perms"
|
|
||||||
"github.com/luxfi/sys/ulimit"
|
"github.com/luxfi/sys/ulimit"
|
||||||
|
|
||||||
nodeconfig "github.com/luxfi/node/config/node"
|
nodeconfig "github.com/luxfi/node/config/node"
|
||||||
@@ -58,9 +58,9 @@ func New(config nodeconfig.Config) (App, error) {
|
|||||||
infoLevel, _ := log.ToLevel("info")
|
infoLevel, _ := log.ToLevel("info")
|
||||||
logFactory := log.NewFactoryWithConfig(log.Config{
|
logFactory := log.NewFactoryWithConfig(log.Config{
|
||||||
RotatingWriterConfig: log.RotatingWriterConfig{
|
RotatingWriterConfig: log.RotatingWriterConfig{
|
||||||
MaxSize: 8, // 8MB per log file (reasonable for standard profile)
|
MaxSize: 8, // 8MB per log file (reasonable for standard profile)
|
||||||
MaxFiles: 5, // Keep 5 rotated files
|
MaxFiles: 5, // Keep 5 rotated files
|
||||||
MaxAge: 7, // 7 days retention
|
MaxAge: 7, // 7 days retention
|
||||||
Directory: config.DatabaseConfig.Path,
|
Directory: config.DatabaseConfig.Path,
|
||||||
},
|
},
|
||||||
DisplayLevel: infoLevel,
|
DisplayLevel: infoLevel,
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
validators "github.com/luxfi/validators"
|
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
metrics "github.com/luxfi/metric"
|
metrics "github.com/luxfi/metric"
|
||||||
|
validators "github.com/luxfi/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewManager creates a new benchlist manager
|
// NewManager creates a new benchlist manager
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/luxfi/crypto/hash"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
"github.com/luxfi/crypto/hash"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchmarkHashingComputeHash256 benchmarks SHA256 hashing performance
|
// BenchmarkHashingComputeHash256 benchmarks SHA256 hashing performance
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/luxfi/crypto/hash"
|
||||||
"github.com/luxfi/database/memdb"
|
"github.com/luxfi/database/memdb"
|
||||||
"github.com/luxfi/database/prefixdb"
|
"github.com/luxfi/database/prefixdb"
|
||||||
"github.com/luxfi/database/versiondb"
|
"github.com/luxfi/database/versiondb"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/crypto/hash"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchmarkMemoryDatabase benchmarks in-memory database operations
|
// BenchmarkMemoryDatabase benchmarks in-memory database operations
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/luxfi/ids"
|
|
||||||
compression "github.com/luxfi/compress"
|
compression "github.com/luxfi/compress"
|
||||||
|
"github.com/luxfi/ids"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchmarkMessageCompression benchmarks message compression
|
// BenchmarkMessageCompression benchmarks message compression
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,9 +6,9 @@ package lru
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/luxfi/container/linked"
|
||||||
"github.com/luxfi/node/cache"
|
"github.com/luxfi/node/cache"
|
||||||
"github.com/luxfi/utils"
|
"github.com/luxfi/utils"
|
||||||
"github.com/luxfi/container/linked"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ cache.Cacher[struct{}, struct{}] = (*Cache[struct{}, struct{}])(nil)
|
var _ cache.Cacher[struct{}, struct{}] = (*Cache[struct{}, struct{}])(nil)
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,9 +6,9 @@ package lru
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/luxfi/container/linked"
|
||||||
"github.com/luxfi/node/cache"
|
"github.com/luxfi/node/cache"
|
||||||
"github.com/luxfi/utils"
|
"github.com/luxfi/utils"
|
||||||
"github.com/luxfi/container/linked"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ cache.Cacher[struct{}, any] = (*SizedCache[struct{}, any])(nil)
|
var _ cache.Cacher[struct{}, any] = (*SizedCache[struct{}, any])(nil)
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,8 +6,8 @@ package cache
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/luxfi/utils"
|
|
||||||
"github.com/luxfi/container/linked"
|
"github.com/luxfi/container/linked"
|
||||||
|
"github.com/luxfi/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Cacher[struct{}, struct{}] = (*LRU[struct{}, struct{}])(nil)
|
var _ Cacher[struct{}, struct{}] = (*LRU[struct{}, struct{}])(nil)
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,8 +6,8 @@ package cache
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/luxfi/utils"
|
|
||||||
"github.com/luxfi/container/linked"
|
"github.com/luxfi/container/linked"
|
||||||
|
"github.com/luxfi/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Cacher[struct{}, any] = (*sizedLRU[struct{}, any])(nil)
|
var _ Cacher[struct{}, any] = (*sizedLRU[struct{}, any])(nil)
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/luxfi/vm/chain"
|
|
||||||
consensusvertex "github.com/luxfi/consensus/engine/vertex"
|
consensusvertex "github.com/luxfi/consensus/engine/vertex"
|
||||||
"github.com/luxfi/database"
|
"github.com/luxfi/database"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/node/vms/platformvm/fx"
|
"github.com/luxfi/node/vms/platformvm/fx"
|
||||||
"github.com/luxfi/runtime"
|
"github.com/luxfi/runtime"
|
||||||
vmcore "github.com/luxfi/vm"
|
vmcore "github.com/luxfi/vm"
|
||||||
|
"github.com/luxfi/vm/chain"
|
||||||
"github.com/luxfi/warp"
|
"github.com/luxfi/warp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -345,7 +345,7 @@ type ManagerConfig struct {
|
|||||||
PartialSyncPrimaryNetwork bool
|
PartialSyncPrimaryNetwork bool
|
||||||
Server server.Server // Handles HTTP API calls
|
Server server.Server // Handles HTTP API calls
|
||||||
AtomicMemory *atomic.Memory
|
AtomicMemory *atomic.Memory
|
||||||
UTXOAssetID ids.ID
|
UTXOAssetID ids.ID
|
||||||
SkipBootstrap bool // Skip bootstrapping and start processing immediately
|
SkipBootstrap bool // Skip bootstrapping and start processing immediately
|
||||||
EnableAutomining bool // Enable automining in POA mode
|
EnableAutomining bool // Enable automining in POA mode
|
||||||
XChainID ids.ID // ID of the X-Chain,
|
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,
|
XChainID: m.XChainID,
|
||||||
CChainID: m.CChainID,
|
CChainID: m.CChainID,
|
||||||
UTXOAssetID: m.UTXOAssetID,
|
UTXOAssetID: m.UTXOAssetID,
|
||||||
ChainDataDir: chainDataDir,
|
ChainDataDir: chainDataDir,
|
||||||
|
|
||||||
BCLookup: m,
|
BCLookup: m,
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/luxfi/vm"
|
|
||||||
"github.com/luxfi/constants"
|
"github.com/luxfi/constants"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
"github.com/luxfi/metric"
|
"github.com/luxfi/metric"
|
||||||
"github.com/luxfi/node/nets"
|
"github.com/luxfi/node/nets"
|
||||||
"github.com/luxfi/node/vms"
|
"github.com/luxfi/node/vms"
|
||||||
|
"github.com/luxfi/vm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestNew tests creating a new manager
|
// TestNew tests creating a new manager
|
||||||
@@ -106,9 +106,9 @@ func TestQueueChainCreation(t *testing.T) {
|
|||||||
chainID := ids.GenerateTestID()
|
chainID := ids.GenerateTestID()
|
||||||
netID := ids.GenerateTestID()
|
netID := ids.GenerateTestID()
|
||||||
chainParams := ChainParameters{
|
chainParams := ChainParameters{
|
||||||
ID: chainID,
|
ID: chainID,
|
||||||
ChainID: netID,
|
ChainID: netID,
|
||||||
VMID: ids.GenerateTestID(),
|
VMID: ids.GenerateTestID(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Queue the chain
|
// Queue the chain
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func (s *mockServer) AddAliasesWithReadLock(endpoint string, aliases ...string)
|
|||||||
func (s *mockServer) Dispatch() error { return nil }
|
func (s *mockServer) Dispatch() error { return nil }
|
||||||
func (s *mockServer) RegisterChain(chainName string, rt *runtime.Runtime, vm vm.VM) {
|
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 (s *mockServer) SetRootInfoProvider(_ server.RootInfoProvider) {}
|
||||||
|
|
||||||
func TestHandlerManager_RegisterChainHandlers(t *testing.T) {
|
func TestHandlerManager_RegisterChainHandlers(t *testing.T) {
|
||||||
|
|||||||
+6
-6
@@ -35,12 +35,12 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// Flags
|
// Flags
|
||||||
outputPath string
|
outputPath string
|
||||||
inputPath string
|
inputPath string
|
||||||
sinceVer uint64
|
sinceVer uint64
|
||||||
dataDir string
|
dataDir string
|
||||||
dbType string
|
dbType string
|
||||||
noCompress bool
|
noCompress bool
|
||||||
forceRestore bool
|
forceRestore bool
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -12,16 +12,16 @@ import (
|
|||||||
|
|
||||||
// CeremonyState holds the full state of a powers-of-tau ceremony.
|
// CeremonyState holds the full state of a powers-of-tau ceremony.
|
||||||
type CeremonyState struct {
|
type CeremonyState struct {
|
||||||
Circuit string `json:"circuit"`
|
Circuit string `json:"circuit"`
|
||||||
NumConstraints int `json:"numConstraints"`
|
NumConstraints int `json:"numConstraints"`
|
||||||
PowersNeeded int `json:"powersNeeded"`
|
PowersNeeded int `json:"powersNeeded"`
|
||||||
Participants int `json:"participants"`
|
Participants int `json:"participants"`
|
||||||
TauG1 []G1Point `json:"tauG1"`
|
TauG1 []G1Point `json:"tauG1"`
|
||||||
TauG2 []G2Point `json:"tauG2"`
|
TauG2 []G2Point `json:"tauG2"`
|
||||||
AlphaG1 []G1Point `json:"alphaG1"`
|
AlphaG1 []G1Point `json:"alphaG1"`
|
||||||
BetaG1 []G1Point `json:"betaG1"`
|
BetaG1 []G1Point `json:"betaG1"`
|
||||||
BetaG2 G2Point `json:"betaG2"`
|
BetaG2 G2Point `json:"betaG2"`
|
||||||
Contributions []Contribution `json:"contributions"`
|
Contributions []Contribution `json:"contributions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contribution records a single participant's contribution.
|
// Contribution records a single participant's contribution.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func main() {
|
|||||||
"allocations": []map[string]interface{}{
|
"allocations": []map[string]interface{}{
|
||||||
{
|
{
|
||||||
"evmAddr": "0x9011E888251AB053B7bD1cdB598Db4f9DEd94714",
|
"evmAddr": "0x9011E888251AB053B7bD1cdB598Db4f9DEd94714",
|
||||||
"utxoAddr": zooAddr,
|
"utxoAddr": zooAddr,
|
||||||
"initialAmount": 0,
|
"initialAmount": 0,
|
||||||
"unlockSchedule": []map[string]interface{}{
|
"unlockSchedule": []map[string]interface{}{
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/luxfi/crypto/hash"
|
"github.com/luxfi/crypto/hash"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
)
|
)
|
||||||
@@ -13,15 +13,15 @@ func main() {
|
|||||||
fmt.Println("Usage: go run main.go <genesis_file>")
|
fmt.Println("Usage: go run main.go <genesis_file>")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := os.ReadFile(os.Args[1])
|
data, err := os.ReadFile(os.Args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error reading file: %v\n", err)
|
fmt.Printf("Error reading file: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("File size: %d bytes\n", len(data))
|
fmt.Printf("File size: %d bytes\n", len(data))
|
||||||
|
|
||||||
// Compute hash the same way luxd does
|
// Compute hash the same way luxd does
|
||||||
rawHash := hash.ComputeHash256(data)
|
rawHash := hash.ComputeHash256(data)
|
||||||
id, err := ids.ToID(rawHash)
|
id, err := ids.ToID(rawHash)
|
||||||
@@ -29,6 +29,6 @@ func main() {
|
|||||||
fmt.Printf("Error converting to ID: %v\n", err)
|
fmt.Printf("Error converting to ID: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Genesis ID: %s\n", id.String())
|
fmt.Printf("Genesis ID: %s\n", id.String())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func (c *ChainDatabaseConfig) GetDatabaseType(chainAlias string) string {
|
|||||||
func (c *ChainDatabaseConfig) Validate() error {
|
func (c *ChainDatabaseConfig) Validate() error {
|
||||||
validTypes := map[string]bool{
|
validTypes := map[string]bool{
|
||||||
"pebbledb": true,
|
"pebbledb": true,
|
||||||
"zapdb": true,
|
"zapdb": true,
|
||||||
"memdb": true,
|
"memdb": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1746,7 +1746,6 @@ func GetNodeConfig(v *viper.Viper) (node.Config, error) {
|
|||||||
}
|
}
|
||||||
nodeConfig.TrackAllChains = v.GetBool(TrackAllChainsKey)
|
nodeConfig.TrackAllChains = v.GetBool(TrackAllChainsKey)
|
||||||
|
|
||||||
|
|
||||||
// HTTP APIs
|
// HTTP APIs
|
||||||
nodeConfig.HTTPConfig, err = getHTTPConfig(v)
|
nodeConfig.HTTPConfig, err = getHTTPConfig(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import (
|
|||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/luxfi/constants"
|
|
||||||
consensusconfig "github.com/luxfi/consensus/config"
|
consensusconfig "github.com/luxfi/consensus/config"
|
||||||
|
"github.com/luxfi/constants"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/node/chains"
|
"github.com/luxfi/node/chains"
|
||||||
"github.com/luxfi/node/genesis/builder"
|
"github.com/luxfi/node/genesis/builder"
|
||||||
|
|||||||
+13
-13
@@ -13,14 +13,14 @@ import (
|
|||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
|
compression "github.com/luxfi/compress"
|
||||||
"github.com/luxfi/constants"
|
"github.com/luxfi/constants"
|
||||||
"github.com/luxfi/genesis/pkg/genesis"
|
"github.com/luxfi/genesis/pkg/genesis"
|
||||||
|
"github.com/luxfi/net/dynamicip"
|
||||||
"github.com/luxfi/node/genesis/builder"
|
"github.com/luxfi/node/genesis/builder"
|
||||||
"github.com/luxfi/node/trace"
|
"github.com/luxfi/node/trace"
|
||||||
"github.com/luxfi/node/vms/components/gas"
|
"github.com/luxfi/node/vms/components/gas"
|
||||||
"github.com/luxfi/node/vms/proposervm"
|
"github.com/luxfi/node/vms/proposervm"
|
||||||
compression "github.com/luxfi/compress"
|
|
||||||
"github.com/luxfi/net/dynamicip"
|
|
||||||
"github.com/luxfi/sys/ulimit"
|
"github.com/luxfi/sys/ulimit"
|
||||||
|
|
||||||
consensusconfig "github.com/luxfi/consensus/config"
|
consensusconfig "github.com/luxfi/consensus/config"
|
||||||
@@ -48,19 +48,19 @@ var (
|
|||||||
defaultStakingSignerKeyPath = filepath.Join(defaultStakingPath, "signer.key")
|
defaultStakingSignerKeyPath = filepath.Join(defaultStakingPath, "signer.key")
|
||||||
// Strict-PQ default paths — mirror downstream-tenant CLI `<tenantctl> key gen`
|
// Strict-PQ default paths — mirror downstream-tenant CLI `<tenantctl> key gen`
|
||||||
// layout so the operator init container + lqd see the same files.
|
// layout so the operator init container + lqd see the same files.
|
||||||
defaultStakingMLDSAKeyPath = filepath.Join(defaultStakingPath, "mldsa.key")
|
defaultStakingMLDSAKeyPath = filepath.Join(defaultStakingPath, "mldsa.key")
|
||||||
defaultStakingMLDSAPubKeyPath = filepath.Join(defaultStakingPath, "mldsa.pub")
|
defaultStakingMLDSAPubKeyPath = filepath.Join(defaultStakingPath, "mldsa.pub")
|
||||||
defaultHandshakeMLKEMKeyPath = filepath.Join(defaultStakingPath, "mlkem.key")
|
defaultHandshakeMLKEMKeyPath = filepath.Join(defaultStakingPath, "mlkem.key")
|
||||||
defaultHandshakeMLKEMPubKeyPath = filepath.Join(defaultStakingPath, "mlkem.pub")
|
defaultHandshakeMLKEMPubKeyPath = filepath.Join(defaultStakingPath, "mlkem.pub")
|
||||||
defaultConfigDir = filepath.Join(defaultUnexpandedDataDir, "configs")
|
defaultConfigDir = filepath.Join(defaultUnexpandedDataDir, "configs")
|
||||||
defaultChainConfigDir = filepath.Join(defaultConfigDir, "chains")
|
defaultChainConfigDir = filepath.Join(defaultConfigDir, "chains")
|
||||||
defaultVMConfigDir = filepath.Join(defaultConfigDir, "vms")
|
defaultVMConfigDir = filepath.Join(defaultConfigDir, "vms")
|
||||||
defaultVMAliasFilePath = filepath.Join(defaultVMConfigDir, "aliases.json")
|
defaultVMAliasFilePath = filepath.Join(defaultVMConfigDir, "aliases.json")
|
||||||
defaultChainAliasFilePath = filepath.Join(defaultChainConfigDir, "aliases.json")
|
defaultChainAliasFilePath = filepath.Join(defaultChainConfigDir, "aliases.json")
|
||||||
defaultNetConfigDir = filepath.Join(defaultConfigDir, "chains")
|
defaultNetConfigDir = filepath.Join(defaultConfigDir, "chains")
|
||||||
defaultPluginDir = filepath.Join(defaultUnexpandedDataDir, "plugins", "current")
|
defaultPluginDir = filepath.Join(defaultUnexpandedDataDir, "plugins", "current")
|
||||||
defaultChainDataDir = filepath.Join(defaultUnexpandedDataDir, "chainData")
|
defaultChainDataDir = filepath.Join(defaultUnexpandedDataDir, "chainData")
|
||||||
defaultProcessContextPath = filepath.Join(defaultUnexpandedDataDir, DefaultProcessContextFilename)
|
defaultProcessContextPath = filepath.Join(defaultUnexpandedDataDir, DefaultProcessContextFilename)
|
||||||
)
|
)
|
||||||
|
|
||||||
func deprecateFlags(fs *pflag.FlagSet) error {
|
func deprecateFlags(fs *pflag.FlagSet) error {
|
||||||
|
|||||||
+36
-36
@@ -78,36 +78,36 @@ const (
|
|||||||
HTTPReadTimeoutKey = "http-read-timeout"
|
HTTPReadTimeoutKey = "http-read-timeout"
|
||||||
HTTPReadHeaderTimeoutKey = "http-read-header-timeout"
|
HTTPReadHeaderTimeoutKey = "http-read-header-timeout"
|
||||||
|
|
||||||
HTTPIdleTimeoutKey = "http-idle-timeout"
|
HTTPIdleTimeoutKey = "http-idle-timeout"
|
||||||
StateSyncIPsKey = "state-sync-ips"
|
StateSyncIPsKey = "state-sync-ips"
|
||||||
StateSyncIDsKey = "state-sync-ids"
|
StateSyncIDsKey = "state-sync-ids"
|
||||||
BootstrapNodesKey = "bootstrap-nodes"
|
BootstrapNodesKey = "bootstrap-nodes"
|
||||||
BootstrapIPsKey = "bootstrap-ips"
|
BootstrapIPsKey = "bootstrap-ips"
|
||||||
BootstrapIDsKey = "bootstrap-ids"
|
BootstrapIDsKey = "bootstrap-ids"
|
||||||
SkipBootstrapKey = "skip-bootstrap"
|
SkipBootstrapKey = "skip-bootstrap"
|
||||||
EnableAutominingKey = "enable-automining"
|
EnableAutominingKey = "enable-automining"
|
||||||
StakingHostKey = "staking-host"
|
StakingHostKey = "staking-host"
|
||||||
StakingPortKey = "staking-port"
|
StakingPortKey = "staking-port"
|
||||||
StakingEphemeralCertEnabledKey = "staking-ephemeral-cert-enabled"
|
StakingEphemeralCertEnabledKey = "staking-ephemeral-cert-enabled"
|
||||||
StakingTLSKeyPathKey = "staking-tls-key-file"
|
StakingTLSKeyPathKey = "staking-tls-key-file"
|
||||||
StakingTLSKeyContentKey = "staking-tls-key-file-content"
|
StakingTLSKeyContentKey = "staking-tls-key-file-content"
|
||||||
StakingCertPathKey = "staking-tls-cert-file"
|
StakingCertPathKey = "staking-tls-cert-file"
|
||||||
StakingCertContentKey = "staking-tls-cert-file-content"
|
StakingCertContentKey = "staking-tls-cert-file-content"
|
||||||
StakingEphemeralSignerEnabledKey = "staking-ephemeral-signer-enabled"
|
StakingEphemeralSignerEnabledKey = "staking-ephemeral-signer-enabled"
|
||||||
StakingSignerKeyPathKey = "staking-signer-key-file"
|
StakingSignerKeyPathKey = "staking-signer-key-file"
|
||||||
StakingSignerKeyContentKey = "staking-signer-key-file-content"
|
StakingSignerKeyContentKey = "staking-signer-key-file-content"
|
||||||
StakingKMSEndpointKey = "staking-kms-endpoint"
|
StakingKMSEndpointKey = "staking-kms-endpoint"
|
||||||
StakingKMSSecretPathKey = "staking-kms-secret-path"
|
StakingKMSSecretPathKey = "staking-kms-secret-path"
|
||||||
StakingKMSTokenKey = "staking-kms-token"
|
StakingKMSTokenKey = "staking-kms-token"
|
||||||
// Strict-PQ staking identity (FIPS 204 ML-DSA-65). When set, the node
|
// 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
|
// uses the ML-DSA-65 public key as the NodeID source via
|
||||||
// ids.NodeIDSchemeMLDSA65.DeriveMLDSA(chainID, pubKey), replacing the
|
// ids.NodeIDSchemeMLDSA65.DeriveMLDSA(chainID, pubKey), replacing the
|
||||||
// classical TLS-cert NodeID derivation. Strict-PQ profiles require
|
// classical TLS-cert NodeID derivation. Strict-PQ profiles require
|
||||||
// these; classical-compat chains ignore them.
|
// these; classical-compat chains ignore them.
|
||||||
StakingMLDSAKeyPathKey = "staking-mldsa-key-file"
|
StakingMLDSAKeyPathKey = "staking-mldsa-key-file"
|
||||||
StakingMLDSAKeyContentKey = "staking-mldsa-key-file-content"
|
StakingMLDSAKeyContentKey = "staking-mldsa-key-file-content"
|
||||||
StakingMLDSAPubKeyPathKey = "staking-mldsa-pub-key-file"
|
StakingMLDSAPubKeyPathKey = "staking-mldsa-pub-key-file"
|
||||||
StakingMLDSAPubKeyContentKey = "staking-mldsa-pub-key-file-content"
|
StakingMLDSAPubKeyContentKey = "staking-mldsa-pub-key-file-content"
|
||||||
// Strict-PQ handshake KEM (FIPS 203 ML-KEM-768). Peer-facing public
|
// Strict-PQ handshake KEM (FIPS 203 ML-KEM-768). Peer-facing public
|
||||||
// key is published in the validator-set entry so peers can encapsulate
|
// key is published in the validator-set entry so peers can encapsulate
|
||||||
// to it for session-key establishment with no classical fallback.
|
// to it for session-key establishment with no classical fallback.
|
||||||
@@ -264,17 +264,17 @@ const (
|
|||||||
ForceIgnoreChecksumKey = "force-ignore-checksum"
|
ForceIgnoreChecksumKey = "force-ignore-checksum"
|
||||||
|
|
||||||
// Low Memory / Dev Light Mode Keys
|
// Low Memory / Dev Light Mode Keys
|
||||||
LowMemoryKey = "low-memory"
|
LowMemoryKey = "low-memory"
|
||||||
MemoryProfileKey = "memory-profile"
|
MemoryProfileKey = "memory-profile"
|
||||||
DevLightKey = "dev-light"
|
DevLightKey = "dev-light"
|
||||||
ConfigProfileKey = "config-profile"
|
ConfigProfileKey = "config-profile"
|
||||||
DBCacheSizeKey = "db-cache-size"
|
DBCacheSizeKey = "db-cache-size"
|
||||||
DBMemtableSizeKey = "db-memtable-size"
|
DBMemtableSizeKey = "db-memtable-size"
|
||||||
StateCacheSizeKey = "state-cache-size"
|
StateCacheSizeKey = "state-cache-size"
|
||||||
BlockCacheSizeKey = "block-cache-size"
|
BlockCacheSizeKey = "block-cache-size"
|
||||||
DisableBloomFiltersKey = "disable-bloom-filters"
|
DisableBloomFiltersKey = "disable-bloom-filters"
|
||||||
LazyChainLoadingKey = "lazy-chain-loading"
|
LazyChainLoadingKey = "lazy-chain-loading"
|
||||||
SingleValidatorModeKey = "single-validator-mode"
|
SingleValidatorModeKey = "single-validator-mode"
|
||||||
|
|
||||||
// VM Transport Keys
|
// VM Transport Keys
|
||||||
VMTransportKey = "vm-transport"
|
VMTransportKey = "vm-transport"
|
||||||
|
|||||||
+10
-10
@@ -10,23 +10,23 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/node/server/http"
|
|
||||||
"github.com/luxfi/node/benchlist"
|
"github.com/luxfi/node/benchlist"
|
||||||
"github.com/luxfi/node/chains"
|
"github.com/luxfi/node/chains"
|
||||||
"github.com/luxfi/node/genesis/builder"
|
"github.com/luxfi/node/genesis/builder"
|
||||||
"github.com/luxfi/node/network"
|
"github.com/luxfi/node/network"
|
||||||
|
"github.com/luxfi/node/server/http"
|
||||||
// "github.com/luxfi/consensus/core/router" // Unused
|
// "github.com/luxfi/consensus/core/router" // Unused
|
||||||
"github.com/luxfi/crypto/bls"
|
"github.com/luxfi/crypto/bls"
|
||||||
"github.com/luxfi/crypto/mldsa"
|
"github.com/luxfi/crypto/mldsa"
|
||||||
mlkemcrypto "github.com/luxfi/crypto/mlkem"
|
mlkemcrypto "github.com/luxfi/crypto/mlkem"
|
||||||
"github.com/luxfi/node/nets"
|
"github.com/luxfi/node/nets"
|
||||||
"github.com/luxfi/node/network/tracker"
|
"github.com/luxfi/node/network/tracker"
|
||||||
"github.com/luxfi/node/upgrade"
|
|
||||||
"github.com/luxfi/node/trace"
|
"github.com/luxfi/node/trace"
|
||||||
|
"github.com/luxfi/node/upgrade"
|
||||||
// "github.com/luxfi/log" // Unused
|
// "github.com/luxfi/log" // Unused
|
||||||
"github.com/luxfi/math/set"
|
"github.com/luxfi/math/set"
|
||||||
"github.com/luxfi/timer"
|
|
||||||
"github.com/luxfi/node/utils/profiler"
|
"github.com/luxfi/node/utils/profiler"
|
||||||
|
"github.com/luxfi/timer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type APIIndexerConfig struct {
|
type APIIndexerConfig struct {
|
||||||
@@ -101,13 +101,13 @@ type StakingConfig struct {
|
|||||||
// publishes in its validator-set entry so peers can encapsulate to it
|
// publishes in its validator-set entry so peers can encapsulate to it
|
||||||
// for session-key establishment with no classical fallback. The
|
// for session-key establishment with no classical fallback. The
|
||||||
// HandshakeMLKEMPriv stays local to the pod.
|
// HandshakeMLKEMPriv stays local to the pod.
|
||||||
StakingMLDSA *mldsa.PrivateKey `json:"-"`
|
StakingMLDSA *mldsa.PrivateKey `json:"-"`
|
||||||
StakingMLDSAPub []byte `json:"-"`
|
StakingMLDSAPub []byte `json:"-"`
|
||||||
HandshakeMLKEMPriv *mlkemcrypto.PrivateKey `json:"-"`
|
HandshakeMLKEMPriv *mlkemcrypto.PrivateKey `json:"-"`
|
||||||
HandshakeMLKEMPub []byte `json:"-"`
|
HandshakeMLKEMPub []byte `json:"-"`
|
||||||
// File paths kept for log-line context, mirroring StakingKeyPath etc.
|
// File paths kept for log-line context, mirroring StakingKeyPath etc.
|
||||||
StakingMLDSAKeyPath string `json:"stakingMLDSAKeyPath,omitempty"`
|
StakingMLDSAKeyPath string `json:"stakingMLDSAKeyPath,omitempty"`
|
||||||
StakingMLDSAPubPath string `json:"stakingMLDSAPubPath,omitempty"`
|
StakingMLDSAPubPath string `json:"stakingMLDSAPubPath,omitempty"`
|
||||||
HandshakeMLKEMKeyPath string `json:"handshakeMLKEMKeyPath,omitempty"`
|
HandshakeMLKEMKeyPath string `json:"handshakeMLKEMKeyPath,omitempty"`
|
||||||
HandshakeMLKEMPubPath string `json:"handshakeMLKEMPubPath,omitempty"`
|
HandshakeMLKEMPubPath string `json:"handshakeMLKEMPubPath,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -169,7 +169,7 @@ type Config struct {
|
|||||||
|
|
||||||
// Genesis information
|
// Genesis information
|
||||||
GenesisBytes []byte `json:"-"`
|
GenesisBytes []byte `json:"-"`
|
||||||
UTXOAssetID ids.ID `json:"utxoAssetID"`
|
UTXOAssetID ids.ID `json:"utxoAssetID"`
|
||||||
|
|
||||||
// ID of the network this node should connect to
|
// ID of the network this node should connect to
|
||||||
NetworkID uint32 `json:"networkID"`
|
NetworkID uint32 `json:"networkID"`
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/luxfi/runtime"
|
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
|
"github.com/luxfi/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -68,32 +68,32 @@ type MLDSAWork struct {
|
|||||||
|
|
||||||
// BlockVerifyWork contains all verification batches for a single block.
|
// BlockVerifyWork contains all verification batches for a single block.
|
||||||
type BlockVerifyWork struct {
|
type BlockVerifyWork struct {
|
||||||
BLS *BLSWork
|
BLS *BLSWork
|
||||||
Corona *CoronaWork
|
Corona *CoronaWork
|
||||||
ZK *ZKWork
|
ZK *ZKWork
|
||||||
MLDSA *MLDSAWork
|
MLDSA *MLDSAWork
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockVerifyResult contains verification results for all batch types.
|
// BlockVerifyResult contains verification results for all batch types.
|
||||||
type BlockVerifyResult struct {
|
type BlockVerifyResult struct {
|
||||||
BLSValid []bool
|
BLSValid []bool
|
||||||
CoronaValid []bool
|
CoronaValid []bool
|
||||||
ZKValid bool
|
ZKValid bool
|
||||||
MLDSAValid []bool
|
MLDSAValid []bool
|
||||||
|
|
||||||
GPUUsed bool
|
GPUUsed bool
|
||||||
BLSTime time.Duration
|
BLSTime time.Duration
|
||||||
CoronaTime time.Duration
|
CoronaTime time.Duration
|
||||||
ZKTime time.Duration
|
ZKTime time.Duration
|
||||||
MLDSATime time.Duration
|
MLDSATime time.Duration
|
||||||
TotalTime time.Duration
|
TotalTime time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
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")
|
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")
|
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")
|
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.
|
// VerifyBlock dispatches all verification work for a block through the GPU pipeline.
|
||||||
|
|||||||
@@ -79,10 +79,10 @@ func TestGPUPipeline_AllFourTypes(t *testing.T) {
|
|||||||
pipeline := NewGPUVerifyPipeline()
|
pipeline := NewGPUVerifyPipeline()
|
||||||
|
|
||||||
work := &BlockVerifyWork{
|
work := &BlockVerifyWork{
|
||||||
BLS: makeBLSWork(5),
|
BLS: makeBLSWork(5),
|
||||||
Corona: makeCoronaWork(3),
|
Corona: makeCoronaWork(3),
|
||||||
ZK: makeZKWork(2),
|
ZK: makeZKWork(2),
|
||||||
MLDSA: makeMLDSAWork(10),
|
MLDSA: makeMLDSAWork(10),
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := pipeline.VerifyBlock(work)
|
result, err := pipeline.VerifyBlock(work)
|
||||||
@@ -276,10 +276,10 @@ func BenchmarkGPUPipeline(b *testing.B) {
|
|||||||
pipeline := NewGPUVerifyPipeline()
|
pipeline := NewGPUVerifyPipeline()
|
||||||
|
|
||||||
work := &BlockVerifyWork{
|
work := &BlockVerifyWork{
|
||||||
BLS: makeBLSWork(100),
|
BLS: makeBLSWork(100),
|
||||||
Corona: makeCoronaWork(50),
|
Corona: makeCoronaWork(50),
|
||||||
ZK: makeZKWork(10),
|
ZK: makeZKWork(10),
|
||||||
MLDSA: makeMLDSAWork(200),
|
MLDSA: makeMLDSAWork(200),
|
||||||
}
|
}
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ func generateValidatorStates(n int) []ValidatorState {
|
|||||||
_, _ = rand.Read(rtKey)
|
_, _ = rand.Read(rtKey)
|
||||||
|
|
||||||
states[i] = ValidatorState{
|
states[i] = ValidatorState{
|
||||||
NodeID: ids.GenerateTestNodeID(),
|
NodeID: ids.GenerateTestNodeID(),
|
||||||
Weight: 1000,
|
Weight: 1000,
|
||||||
BLSPubKey: blsKey,
|
BLSPubKey: blsKey,
|
||||||
CoronaKey: rtKey,
|
CoronaKey: rtKey,
|
||||||
Active: true,
|
Active: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return states
|
return states
|
||||||
@@ -575,13 +575,13 @@ func TestQuasarMemoryPressure(t *testing.T) {
|
|||||||
_, _ = rand.Read(blockID[:])
|
_, _ = rand.Read(blockID[:])
|
||||||
|
|
||||||
finality := &QuantumFinality{
|
finality := &QuantumFinality{
|
||||||
BlockID: blockID,
|
BlockID: blockID,
|
||||||
PChainHeight: uint64(i),
|
PChainHeight: uint64(i),
|
||||||
QChainHeight: uint64(i),
|
QChainHeight: uint64(i),
|
||||||
BLSProof: make([]byte, 96),
|
BLSProof: make([]byte, 96),
|
||||||
CoronaProof: make([]byte, 1024),
|
CoronaProof: make([]byte, 1024),
|
||||||
TotalWeight: 1000,
|
TotalWeight: 1000,
|
||||||
SignerWeight: 700,
|
SignerWeight: 700,
|
||||||
}
|
}
|
||||||
q.SetFinalized(blockID, finality)
|
q.SetFinalized(blockID, finality)
|
||||||
}
|
}
|
||||||
@@ -913,10 +913,10 @@ func TestQuasarEdgeCases(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
finality := &QuantumFinality{
|
finality := &QuantumFinality{
|
||||||
BLSProof: nil,
|
BLSProof: nil,
|
||||||
CoronaProof: nil,
|
CoronaProof: nil,
|
||||||
TotalWeight: 1000,
|
TotalWeight: 1000,
|
||||||
SignerWeight: 700,
|
SignerWeight: 700,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = q.Verify(finality)
|
err = q.Verify(finality)
|
||||||
@@ -928,10 +928,10 @@ func TestQuasarEdgeCases(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
finality := &QuantumFinality{
|
finality := &QuantumFinality{
|
||||||
BLSProof: []byte("proof"),
|
BLSProof: []byte("proof"),
|
||||||
CoronaProof: []byte("proof"),
|
CoronaProof: []byte("proof"),
|
||||||
TotalWeight: 1000,
|
TotalWeight: 1000,
|
||||||
SignerWeight: 500, // Only 50%, needs 67%
|
SignerWeight: 500, // Only 50%, needs 67%
|
||||||
}
|
}
|
||||||
|
|
||||||
err = q.Verify(finality)
|
err = q.Verify(finality)
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ func TestConcurrentPruningStress(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
numWriters = 8
|
numWriters = 8
|
||||||
opsPerWriter = 5000
|
opsPerWriter = 5000
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+45
-45
@@ -61,15 +61,15 @@ import (
|
|||||||
// 2. t-of-n validators completed Corona threshold (post-quantum secure)
|
// 2. t-of-n validators completed Corona threshold (post-quantum secure)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrQuasarNotStarted = errors.New("quasar not started")
|
ErrQuasarNotStarted = errors.New("quasar not started")
|
||||||
ErrPChainNotConnected = errors.New("P-Chain not connected")
|
ErrPChainNotConnected = errors.New("P-Chain not connected")
|
||||||
ErrQChainNotConnected = errors.New("Q-Chain not connected")
|
ErrQChainNotConnected = errors.New("Q-Chain not connected")
|
||||||
ErrCoronaNotConnected = errors.New("Corona coordinator not connected")
|
ErrCoronaNotConnected = errors.New("Corona coordinator not connected")
|
||||||
ErrInsufficientWeight = errors.New("insufficient validator weight")
|
ErrInsufficientWeight = errors.New("insufficient validator weight")
|
||||||
ErrInsufficientSigners = errors.New("insufficient Corona signers")
|
ErrInsufficientSigners = errors.New("insufficient Corona signers")
|
||||||
ErrFinalityFailed = errors.New("hybrid finality verification failed")
|
ErrFinalityFailed = errors.New("hybrid finality verification failed")
|
||||||
ErrBLSFailed = errors.New("BLS aggregation failed")
|
ErrBLSFailed = errors.New("BLS aggregation failed")
|
||||||
ErrCoronaFailed = errors.New("Corona threshold signing failed")
|
ErrCoronaFailed = errors.New("Corona threshold signing failed")
|
||||||
)
|
)
|
||||||
|
|
||||||
// PChainProvider provides P-Chain state and finality events
|
// PChainProvider provides P-Chain state and finality events
|
||||||
@@ -87,11 +87,11 @@ type QuantumSignerFallback interface {
|
|||||||
// ValidatorState represents a validator's current state
|
// ValidatorState represents a validator's current state
|
||||||
// Each validator has BOTH BLS and Corona keys
|
// Each validator has BOTH BLS and Corona keys
|
||||||
type ValidatorState struct {
|
type ValidatorState struct {
|
||||||
NodeID ids.NodeID
|
NodeID ids.NodeID
|
||||||
Weight uint64
|
Weight uint64
|
||||||
BLSPubKey []byte // BLS public key for aggregate signatures
|
BLSPubKey []byte // BLS public key for aggregate signatures
|
||||||
CoronaKey []byte // Corona public key share for threshold sigs
|
CoronaKey []byte // Corona public key share for threshold sigs
|
||||||
Active bool
|
Active bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// FinalityEvent represents a P-Chain finality event
|
// FinalityEvent represents a P-Chain finality event
|
||||||
@@ -104,18 +104,18 @@ type FinalityEvent struct {
|
|||||||
|
|
||||||
// QuantumFinality represents a block that achieved hybrid quantum finality
|
// QuantumFinality represents a block that achieved hybrid quantum finality
|
||||||
type QuantumFinality struct {
|
type QuantumFinality struct {
|
||||||
BlockID ids.ID
|
BlockID ids.ID
|
||||||
PChainHeight uint64
|
PChainHeight uint64
|
||||||
QChainHeight uint64
|
QChainHeight uint64
|
||||||
BLSProof []byte // Aggregated BLS signature (96 bytes)
|
BLSProof []byte // Aggregated BLS signature (96 bytes)
|
||||||
CoronaProof []byte // Serialized Corona threshold signature
|
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
|
CoronaSigners []ids.NodeID // Which validators participated in Corona
|
||||||
TotalWeight uint64
|
TotalWeight uint64
|
||||||
SignerWeight uint64
|
SignerWeight uint64
|
||||||
BLSLatency time.Duration
|
BLSLatency time.Duration
|
||||||
CoronaLatency time.Duration
|
CoronaLatency time.Duration
|
||||||
Timestamp time.Time
|
Timestamp time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quasar binds P-Chain and Q-Chain consensus into hybrid quantum finality
|
// 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()
|
coronaProof = coronaSig.Bytes()
|
||||||
}
|
}
|
||||||
finality := &QuantumFinality{
|
finality := &QuantumFinality{
|
||||||
BlockID: event.BlockID,
|
BlockID: event.BlockID,
|
||||||
PChainHeight: event.Height,
|
PChainHeight: event.Height,
|
||||||
QChainHeight: q.qHeight,
|
QChainHeight: q.qHeight,
|
||||||
BLSProof: blsProof,
|
BLSProof: blsProof,
|
||||||
CoronaProof: coronaProof,
|
CoronaProof: coronaProof,
|
||||||
SignerBitset: signerBitset,
|
SignerBitset: signerBitset,
|
||||||
CoronaSigners: coronaSigners,
|
CoronaSigners: coronaSigners,
|
||||||
TotalWeight: totalWeight,
|
TotalWeight: totalWeight,
|
||||||
SignerWeight: signerWeight,
|
SignerWeight: signerWeight,
|
||||||
BLSLatency: blsLatency,
|
BLSLatency: blsLatency,
|
||||||
CoronaLatency: coronaLatency,
|
CoronaLatency: coronaLatency,
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
q.finalized[event.BlockID] = finality
|
q.finalized[event.BlockID] = finality
|
||||||
@@ -590,13 +590,13 @@ func (q *Quasar) Stats() QuasarStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return QuasarStats{
|
return QuasarStats{
|
||||||
PChainHeight: q.pHeight,
|
PChainHeight: q.pHeight,
|
||||||
QChainHeight: q.qHeight,
|
QChainHeight: q.qHeight,
|
||||||
FinalizedBlocks: len(q.finalized),
|
FinalizedBlocks: len(q.finalized),
|
||||||
Threshold: q.threshold,
|
Threshold: q.threshold,
|
||||||
QuorumNum: q.quorumNum,
|
QuorumNum: q.quorumNum,
|
||||||
QuorumDen: q.quorumDen,
|
QuorumDen: q.quorumDen,
|
||||||
Running: q.running,
|
Running: q.running,
|
||||||
CoronaParties: coronaStats.NumParties,
|
CoronaParties: coronaStats.NumParties,
|
||||||
CoronaThreshold: coronaStats.Threshold,
|
CoronaThreshold: coronaStats.Threshold,
|
||||||
CoronaReady: coronaStats.Initialized,
|
CoronaReady: coronaStats.Initialized,
|
||||||
@@ -605,13 +605,13 @@ func (q *Quasar) Stats() QuasarStats {
|
|||||||
|
|
||||||
// QuasarStats contains quasar statistics
|
// QuasarStats contains quasar statistics
|
||||||
type QuasarStats struct {
|
type QuasarStats struct {
|
||||||
PChainHeight uint64
|
PChainHeight uint64
|
||||||
QChainHeight uint64
|
QChainHeight uint64
|
||||||
FinalizedBlocks int
|
FinalizedBlocks int
|
||||||
Threshold int
|
Threshold int
|
||||||
QuorumNum uint64
|
QuorumNum uint64
|
||||||
QuorumDen uint64
|
QuorumDen uint64
|
||||||
Running bool
|
Running bool
|
||||||
CoronaParties int
|
CoronaParties int
|
||||||
CoronaThreshold int
|
CoronaThreshold int
|
||||||
CoronaReady bool
|
CoronaReady bool
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ func (s *BLSSignature) Signers() []ids.NodeID { return s.signers }
|
|||||||
|
|
||||||
// QuasarSignature combines BLS and Corona signatures for P/Q security
|
// QuasarSignature combines BLS and Corona signatures for P/Q security
|
||||||
type QuasarSignature struct {
|
type QuasarSignature struct {
|
||||||
bls *BLSSignature
|
bls *BLSSignature
|
||||||
corona *CoronaSignature
|
corona *CoronaSignature
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ func (s *QuasarSignature) Signers() []ids.NodeID {
|
|||||||
return s.bls.Signers()
|
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 }
|
func (s *QuasarSignature) Corona() *CoronaSignature { return s.corona }
|
||||||
|
|
||||||
// QuasarSigner combines classical and post-quantum signers
|
// QuasarSigner combines classical and post-quantum signers
|
||||||
|
|||||||
+1
-1
@@ -7,9 +7,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/luxfi/consensus/utils/set"
|
"github.com/luxfi/consensus/utils/set"
|
||||||
validators "github.com/luxfi/validators"
|
|
||||||
"github.com/luxfi/constants"
|
"github.com/luxfi/constants"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
|
validators "github.com/luxfi/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFullValidatorFunctionality(t *testing.T) {
|
func TestFullValidatorFunctionality(t *testing.T) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
package debug
|
package debug
|
||||||
|
|
||||||
import (
|
import (
|
||||||
validators "github.com/luxfi/validators"
|
|
||||||
"github.com/luxfi/constants"
|
"github.com/luxfi/constants"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
|
validators "github.com/luxfi/validators"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ import (
|
|||||||
"github.com/luxfi/net/endpoints"
|
"github.com/luxfi/net/endpoints"
|
||||||
"github.com/luxfi/node/vms/components/gas"
|
"github.com/luxfi/node/vms/components/gas"
|
||||||
"github.com/luxfi/node/vms/platformvm/genesis"
|
"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/reward"
|
||||||
"github.com/luxfi/node/vms/platformvm/signer"
|
"github.com/luxfi/node/vms/platformvm/signer"
|
||||||
pchaintxs "github.com/luxfi/node/vms/platformvm/txs"
|
pchaintxs "github.com/luxfi/node/vms/platformvm/txs"
|
||||||
"github.com/luxfi/node/vms/platformvm/validators/fee"
|
"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/bls12381fx"
|
||||||
"github.com/luxfi/utxo/ed25519fx"
|
"github.com/luxfi/utxo/ed25519fx"
|
||||||
"github.com/luxfi/utxo/mldsafx"
|
"github.com/luxfi/utxo/mldsafx"
|
||||||
@@ -38,8 +38,8 @@ import (
|
|||||||
"github.com/luxfi/utxo/secp256r1fx"
|
"github.com/luxfi/utxo/secp256r1fx"
|
||||||
"github.com/luxfi/utxo/slhdsafx"
|
"github.com/luxfi/utxo/slhdsafx"
|
||||||
|
|
||||||
genesiscfg "github.com/luxfi/genesis/pkg/genesis"
|
|
||||||
genesisconfigs "github.com/luxfi/genesis/configs"
|
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
|
// Chain alias vars are derived from the single source of truth (Registry
|
||||||
|
|||||||
@@ -160,10 +160,10 @@ func TestGetConfig(t *testing.T) {
|
|||||||
|
|
||||||
func TestGetConfigAllocations(t *testing.T) {
|
func TestGetConfigAllocations(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
networkID uint32
|
networkID uint32
|
||||||
minAllocs int
|
minAllocs int
|
||||||
minStakers int
|
minStakers int
|
||||||
}{
|
}{
|
||||||
{"Mainnet", constants.MainnetID, 50, 1},
|
{"Mainnet", constants.MainnetID, 50, 1},
|
||||||
{"Testnet", constants.TestnetID, 50, 1},
|
{"Testnet", constants.TestnetID, 50, 1},
|
||||||
|
|||||||
@@ -126,4 +126,3 @@ func VMAliasesMap() map[ids.ID][]string {
|
|||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,8 +9,8 @@ import (
|
|||||||
|
|
||||||
"github.com/luxfi/formatting"
|
"github.com/luxfi/formatting"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/rpc"
|
|
||||||
"github.com/luxfi/node/utils/json"
|
"github.com/luxfi/node/utils/json"
|
||||||
|
"github.com/luxfi/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import (
|
|||||||
|
|
||||||
"github.com/luxfi/formatting"
|
"github.com/luxfi/formatting"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
|
"github.com/luxfi/node/utils/json"
|
||||||
"github.com/luxfi/rpc"
|
"github.com/luxfi/rpc"
|
||||||
"github.com/luxfi/utils"
|
"github.com/luxfi/utils"
|
||||||
"github.com/luxfi/node/utils/json"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type mockClient struct {
|
type mockClient struct {
|
||||||
|
|||||||
+1
-1
@@ -8,13 +8,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/luxfi/runtime"
|
|
||||||
"github.com/luxfi/database"
|
"github.com/luxfi/database"
|
||||||
"github.com/luxfi/database/prefixdb"
|
"github.com/luxfi/database/prefixdb"
|
||||||
"github.com/luxfi/database/versiondb"
|
"github.com/luxfi/database/versiondb"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
nodeconsensus "github.com/luxfi/node/consensus"
|
nodeconsensus "github.com/luxfi/node/consensus"
|
||||||
|
"github.com/luxfi/runtime"
|
||||||
"github.com/luxfi/timer/mockable"
|
"github.com/luxfi/timer/mockable"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,9 +15,9 @@ import (
|
|||||||
"github.com/luxfi/database/prefixdb"
|
"github.com/luxfi/database/prefixdb"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/log"
|
"github.com/luxfi/log"
|
||||||
"github.com/luxfi/node/server/http"
|
|
||||||
"github.com/luxfi/node/chains"
|
"github.com/luxfi/node/chains"
|
||||||
nodeconsensus "github.com/luxfi/node/consensus"
|
nodeconsensus "github.com/luxfi/node/consensus"
|
||||||
|
"github.com/luxfi/node/server/http"
|
||||||
"github.com/luxfi/node/utils/json"
|
"github.com/luxfi/node/utils/json"
|
||||||
"github.com/luxfi/runtime"
|
"github.com/luxfi/runtime"
|
||||||
"github.com/luxfi/timer/mockable"
|
"github.com/luxfi/timer/mockable"
|
||||||
|
|||||||
+1
-1
@@ -6,8 +6,8 @@ package message
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/luxfi/metric"
|
|
||||||
compression "github.com/luxfi/compress"
|
compression "github.com/luxfi/compress"
|
||||||
|
"github.com/luxfi/metric"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Creator = (*creator)(nil)
|
var _ Creator = (*creator)(nil)
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
compression "github.com/luxfi/compress"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/node/proto/p2p"
|
"github.com/luxfi/node/proto/p2p"
|
||||||
"github.com/luxfi/timer/mockable"
|
"github.com/luxfi/timer/mockable"
|
||||||
compression "github.com/luxfi/compress"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_newMsgBuilder(t *testing.T) {
|
func Test_newMsgBuilder(t *testing.T) {
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import (
|
|||||||
time "time"
|
time "time"
|
||||||
|
|
||||||
ids "github.com/luxfi/ids"
|
ids "github.com/luxfi/ids"
|
||||||
|
"github.com/luxfi/net/endpoints"
|
||||||
message "github.com/luxfi/node/message"
|
message "github.com/luxfi/node/message"
|
||||||
p2p "github.com/luxfi/node/proto/p2p"
|
p2p "github.com/luxfi/node/proto/p2p"
|
||||||
"github.com/luxfi/net/endpoints"
|
|
||||||
gomock "go.uber.org/mock/gomock"
|
gomock "go.uber.org/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,12 +8,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
compression "github.com/luxfi/compress"
|
||||||
"github.com/luxfi/constants"
|
"github.com/luxfi/constants"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/metric"
|
"github.com/luxfi/metric"
|
||||||
"github.com/luxfi/node/proto/p2p"
|
"github.com/luxfi/node/proto/p2p"
|
||||||
"github.com/luxfi/timer/mockable"
|
"github.com/luxfi/timer/mockable"
|
||||||
compression "github.com/luxfi/compress"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
compression "github.com/luxfi/compress"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/node/proto/p2p"
|
"github.com/luxfi/node/proto/p2p"
|
||||||
compression "github.com/luxfi/compress"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
compression "github.com/luxfi/compress"
|
||||||
"github.com/luxfi/ids"
|
"github.com/luxfi/ids"
|
||||||
"github.com/luxfi/node/proto/p2p"
|
"github.com/luxfi/node/proto/p2p"
|
||||||
"github.com/luxfi/node/staking"
|
"github.com/luxfi/node/staking"
|
||||||
compression "github.com/luxfi/compress"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMessage(t *testing.T) {
|
func TestMessage(t *testing.T) {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import (
|
|||||||
time "time"
|
time "time"
|
||||||
|
|
||||||
ids "github.com/luxfi/ids"
|
ids "github.com/luxfi/ids"
|
||||||
p2p "github.com/luxfi/node/proto/p2p"
|
|
||||||
"github.com/luxfi/net/endpoints"
|
"github.com/luxfi/net/endpoints"
|
||||||
|
p2p "github.com/luxfi/node/proto/p2p"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockOutboundMsgBuilder is a mock of OutboundMsgBuilder interface.
|
// MockOutboundMsgBuilder is a mock of OutboundMsgBuilder interface.
|
||||||
|
|||||||
+55
-55
@@ -17,37 +17,37 @@ const (
|
|||||||
// Message is the top-level P2P message container
|
// Message is the top-level P2P message container
|
||||||
type Message struct {
|
type Message struct {
|
||||||
// Only one of these should be set
|
// Only one of these should be set
|
||||||
CompressedZstd []byte
|
CompressedZstd []byte
|
||||||
Ping *Ping
|
Ping *Ping
|
||||||
Pong *Pong
|
Pong *Pong
|
||||||
Handshake *Handshake
|
Handshake *Handshake
|
||||||
GetPeerList *GetPeerList
|
GetPeerList *GetPeerList
|
||||||
PeerList *PeerList
|
PeerList *PeerList
|
||||||
GetStateSummaryFrontier *GetStateSummaryFrontier
|
GetStateSummaryFrontier *GetStateSummaryFrontier
|
||||||
StateSummaryFrontier *StateSummaryFrontier
|
StateSummaryFrontier *StateSummaryFrontier
|
||||||
GetAcceptedStateSummary *GetAcceptedStateSummary
|
GetAcceptedStateSummary *GetAcceptedStateSummary
|
||||||
AcceptedStateSummary *AcceptedStateSummary
|
AcceptedStateSummary *AcceptedStateSummary
|
||||||
GetAcceptedFrontier *GetAcceptedFrontier
|
GetAcceptedFrontier *GetAcceptedFrontier
|
||||||
AcceptedFrontier *AcceptedFrontier
|
AcceptedFrontier *AcceptedFrontier
|
||||||
GetAccepted *GetAccepted
|
GetAccepted *GetAccepted
|
||||||
Accepted *Accepted
|
Accepted *Accepted
|
||||||
GetAncestors *GetAncestors
|
GetAncestors *GetAncestors
|
||||||
Ancestors *Ancestors
|
Ancestors *Ancestors
|
||||||
Get *Get
|
Get *Get
|
||||||
Put *Put
|
Put *Put
|
||||||
PushQuery *PushQuery
|
PushQuery *PushQuery
|
||||||
PullQuery *PullQuery
|
PullQuery *PullQuery
|
||||||
Chits *Chits
|
Chits *Chits
|
||||||
Request *Request
|
Request *Request
|
||||||
Response *Response
|
Response *Response
|
||||||
Gossip *Gossip
|
Gossip *Gossip
|
||||||
BFT *BFT
|
BFT *BFT
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ping message
|
// Ping message
|
||||||
type Ping struct {
|
type Ping struct {
|
||||||
Uptime uint32
|
Uptime uint32
|
||||||
ChainIds []*ChainPingEntry
|
ChainIds []*ChainPingEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChainPingEntry is the per-chain payload in Ping/Pong.
|
// ChainPingEntry is the per-chain payload in Ping/Pong.
|
||||||
@@ -59,24 +59,24 @@ type ChainPingEntry struct {
|
|||||||
|
|
||||||
// Pong message
|
// Pong message
|
||||||
type Pong struct {
|
type Pong struct {
|
||||||
Uptime uint32
|
Uptime uint32
|
||||||
ChainIds []*ChainPingEntry
|
ChainIds []*ChainPingEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handshake message
|
// Handshake message
|
||||||
type Handshake struct {
|
type Handshake struct {
|
||||||
NetworkId uint32
|
NetworkId uint32
|
||||||
MyTime uint64
|
MyTime uint64
|
||||||
IpAddr []byte
|
IpAddr []byte
|
||||||
IpPort uint32
|
IpPort uint32
|
||||||
IpSigningTime uint64
|
IpSigningTime uint64
|
||||||
IpNodeIdSig []byte
|
IpNodeIdSig []byte
|
||||||
TrackedChains [][]byte
|
TrackedChains [][]byte
|
||||||
Client *Client
|
Client *Client
|
||||||
SupportedAcps []uint32
|
SupportedAcps []uint32
|
||||||
ObjectedAcps []uint32
|
ObjectedAcps []uint32
|
||||||
KnownPeers *BloomFilter
|
KnownPeers *BloomFilter
|
||||||
IpBlsSig []byte
|
IpBlsSig []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client info in handshake
|
// Client info in handshake
|
||||||
@@ -210,9 +210,9 @@ type GetAncestors struct {
|
|||||||
EngineType EngineType
|
EngineType EngineType
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetAncestors) GetChainId() []byte { return m.ChainId }
|
func (m *GetAncestors) GetChainId() []byte { return m.ChainId }
|
||||||
func (m *GetAncestors) GetRequestId() uint32 { return m.RequestId }
|
func (m *GetAncestors) GetRequestId() uint32 { return m.RequestId }
|
||||||
func (m *GetAncestors) GetDeadline() uint64 { return m.Deadline }
|
func (m *GetAncestors) GetDeadline() uint64 { return m.Deadline }
|
||||||
func (m *GetAncestors) GetEngineType() EngineType { return m.EngineType }
|
func (m *GetAncestors) GetEngineType() EngineType { return m.EngineType }
|
||||||
|
|
||||||
// Ancestors message
|
// Ancestors message
|
||||||
@@ -240,10 +240,10 @@ func (m *Get) GetDeadline() uint64 { return m.Deadline }
|
|||||||
|
|
||||||
// Put message
|
// Put message
|
||||||
type Put struct {
|
type Put struct {
|
||||||
ChainId []byte
|
ChainId []byte
|
||||||
RequestId uint32
|
RequestId uint32
|
||||||
Container []byte
|
Container []byte
|
||||||
EngineType EngineType
|
EngineType EngineType
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Put) GetChainId() []byte { return m.ChainId }
|
func (m *Put) GetChainId() []byte { return m.ChainId }
|
||||||
@@ -251,11 +251,11 @@ func (m *Put) GetRequestId() uint32 { return m.RequestId }
|
|||||||
|
|
||||||
// PushQuery message
|
// PushQuery message
|
||||||
type PushQuery struct {
|
type PushQuery struct {
|
||||||
ChainId []byte
|
ChainId []byte
|
||||||
RequestId uint32
|
RequestId uint32
|
||||||
Deadline uint64
|
Deadline uint64
|
||||||
Container []byte
|
Container []byte
|
||||||
EngineType EngineType
|
EngineType EngineType
|
||||||
RequestedHeight uint64
|
RequestedHeight uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,11 +279,11 @@ func (m *PullQuery) GetDeadline() uint64 { return m.Deadline }
|
|||||||
|
|
||||||
// Chits message
|
// Chits message
|
||||||
type Chits struct {
|
type Chits struct {
|
||||||
ChainId []byte
|
ChainId []byte
|
||||||
RequestId uint32
|
RequestId uint32
|
||||||
PreferredId []byte
|
PreferredId []byte
|
||||||
PreferredIdAtHeight []byte
|
PreferredIdAtHeight []byte
|
||||||
AcceptedId []byte
|
AcceptedId []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Chits) GetChainId() []byte { return m.ChainId }
|
func (m *Chits) GetChainId() []byte { return m.ChainId }
|
||||||
|
|||||||
+7
-8
@@ -11,12 +11,12 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Message type tags for ZAP encoding
|
// Message type tags for ZAP encoding
|
||||||
tagCompressedZstd = 1
|
tagCompressedZstd = 1
|
||||||
tagPing = 2
|
tagPing = 2
|
||||||
tagPong = 3
|
tagPong = 3
|
||||||
tagHandshake = 4
|
tagHandshake = 4
|
||||||
tagGetPeerList = 5
|
tagGetPeerList = 5
|
||||||
tagPeerList = 6
|
tagPeerList = 6
|
||||||
tagGetStateSummaryFrontier = 7
|
tagGetStateSummaryFrontier = 7
|
||||||
tagStateSummaryFrontier = 8
|
tagStateSummaryFrontier = 8
|
||||||
tagGetAcceptedStateSummary = 9
|
tagGetAcceptedStateSummary = 9
|
||||||
@@ -35,13 +35,12 @@ const (
|
|||||||
tagRequest = 22
|
tagRequest = 22
|
||||||
tagResponse = 23
|
tagResponse = 23
|
||||||
tagGossip = 24
|
tagGossip = 24
|
||||||
tagBFT = 25
|
tagBFT = 25
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidMessage = errors.New("invalid wire message")
|
ErrInvalidMessage = errors.New("invalid wire message")
|
||||||
ErrUnknownTag = errors.New("unknown message tag")
|
ErrUnknownTag = errors.New("unknown message tag")
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Buffer for zero-copy encoding
|
// Buffer for zero-copy encoding
|
||||||
|
|||||||
+4
-4
@@ -19,7 +19,7 @@ func getPMPRouter() *pmpRouter {
|
|||||||
// pmpRouter stub for minimal build
|
// pmpRouter stub for minimal build
|
||||||
type pmpRouter struct{}
|
type pmpRouter struct{}
|
||||||
|
|
||||||
func (*pmpRouter) SupportsNAT() bool { return false }
|
func (*pmpRouter) SupportsNAT() bool { return false }
|
||||||
func (*pmpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil }
|
func (*pmpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil }
|
||||||
func (*pmpRouter) UnmapPort(_, _ uint16) error { return nil }
|
func (*pmpRouter) UnmapPort(_, _ uint16) error { return nil }
|
||||||
func (*pmpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil }
|
func (*pmpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil }
|
||||||
|
|||||||
+4
-4
@@ -19,7 +19,7 @@ func getUPnPRouter() *upnpRouter {
|
|||||||
// upnpRouter stub for minimal build
|
// upnpRouter stub for minimal build
|
||||||
type upnpRouter struct{}
|
type upnpRouter struct{}
|
||||||
|
|
||||||
func (*upnpRouter) SupportsNAT() bool { return false }
|
func (*upnpRouter) SupportsNAT() bool { return false }
|
||||||
func (*upnpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil }
|
func (*upnpRouter) MapPort(_, _ uint16, _ string, _ time.Duration) error { return nil }
|
||||||
func (*upnpRouter) UnmapPort(_, _ uint16) error { return nil }
|
func (*upnpRouter) UnmapPort(_, _ uint16) error { return nil }
|
||||||
func (*upnpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil }
|
func (*upnpRouter) ExternalIP() (netip.Addr, error) { return netip.Addr{}, nil }
|
||||||
|
|||||||
Reference in New Issue
Block a user