mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
fix: Format Go files per gofmt and goimports requirements
- doc.go: Convert spaces to tabs for proper Go formatting - validator/validatorstest/test.go: Add validators import alias - engine/chain/chaintest/test_blocks.go: Add consensustest import alias - engine/chain/block/blocktest/test.go: Add consensustest import alias These formatting fixes resolve all lint errors from golangci-lint.
This commit is contained in:
@@ -61,11 +61,11 @@ at runtime for dynamic consensus algorithm selection.
|
||||
|
||||
The Photon→Quasar consensus flow provides fast, quantum-secure finalization:
|
||||
|
||||
1. Photon Phase: Emit proposals at light speed
|
||||
2. Wave Phase: Amplify through network via QZMQ
|
||||
3. Focus Phase: Converge on best options using AI
|
||||
4. Prism Phase: Refract through DAG for validation
|
||||
5. Horizon Phase: Finalize with quantum certificate
|
||||
1. Photon Phase: Emit proposals at light speed
|
||||
2. Wave Phase: Amplify through network via QZMQ
|
||||
3. Focus Phase: Converge on best options using AI
|
||||
4. Prism Phase: Refract through DAG for validation
|
||||
5. Horizon Phase: Finalize with quantum certificate
|
||||
|
||||
Example:
|
||||
|
||||
@@ -135,26 +135,26 @@ The consensus system integrates with the Lux DEX for cross-chain operations:
|
||||
|
||||
Benchmark results (Apple M1 Max):
|
||||
|
||||
Operation Latency Throughput
|
||||
───────────────── ───────── ────────────
|
||||
Model Inference 1.5 μs 666K ops/sec
|
||||
Consensus Vote 529 ns 1.9M ops/sec
|
||||
Feature Extract 37 ns 27M ops/sec
|
||||
Sigmoid 5.6 ns 179M ops/sec
|
||||
Photon Emit 245 ms 4 proposals/sec
|
||||
Full Consensus 200-300 ms 3-5 blocks/sec
|
||||
Operation Latency Throughput
|
||||
───────────────── ───────── ────────────
|
||||
Model Inference 1.5 μs 666K ops/sec
|
||||
Consensus Vote 529 ns 1.9M ops/sec
|
||||
Feature Extract 37 ns 27M ops/sec
|
||||
Sigmoid 5.6 ns 179M ops/sec
|
||||
Photon Emit 245 ms 4 proposals/sec
|
||||
Full Consensus 200-300 ms 3-5 blocks/sec
|
||||
|
||||
# Examples
|
||||
|
||||
Progressive tutorial examples are provided in examples/:
|
||||
|
||||
01-simple-bridge Cross-chain bridge basics
|
||||
02-ai-payment AI payment validation
|
||||
03-qzmq-networking Quantum-secure messaging
|
||||
04-grpc-service gRPC API integration
|
||||
05-python-client Python integration
|
||||
06-nodejs-client TypeScript integration
|
||||
07-ai-consensus Dynamic AI consensus
|
||||
01-simple-bridge Cross-chain bridge basics
|
||||
02-ai-payment AI payment validation
|
||||
03-qzmq-networking Quantum-secure messaging
|
||||
04-grpc-service gRPC API integration
|
||||
05-python-client Python integration
|
||||
06-nodejs-client TypeScript integration
|
||||
07-ai-consensus Dynamic AI consensus
|
||||
|
||||
Each example includes runnable code, comprehensive tests, and detailed documentation.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/consensus/test/helpers"
|
||||
consensustest "github.com/luxfi/consensus/test/helpers"
|
||||
"github.com/luxfi/ids"
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/luxfi/consensus/core/choices"
|
||||
"github.com/luxfi/consensus/test/helpers"
|
||||
consensustest "github.com/luxfi/consensus/test/helpers"
|
||||
"github.com/luxfi/ids"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package validatorstest
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/luxfi/consensus/validator"
|
||||
validators "github.com/luxfi/consensus/validator"
|
||||
"github.com/luxfi/ids"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user