24 Commits
Author SHA1 Message Date
zeekayandHanzo Dev d047dc7311 notifier: answer an unset logger where the loop starts, not where it logs
forwardNotification logs on its first statement and runs on the goroutine Start
spawns, so a NotificationForwarder holding no logger dies there — and a panic on
that goroutine takes the process with it, since nothing above it can recover.

The logger can go unset two ways: NewNotificationForwarder stores whatever it is
handed, and Log is exported, so a struct literal can simply omit it. Start is the
one place the loop begins and the only route to run(), so answering it there
covers both ways at once, which defaulting in the constructor alone would not.

This is the same answer bootstrap.New, summary.New and the engine's NewWithConfig
already give; the forwarder was the remaining exported constructor without it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-01 22:40:08 -07:00
zeekayandHanzo Dev cdd2656fb4 router: reserve the state-sync op-space (frontier round + App transport)
Appends seven ops above the existing op-space — GetStateSummaryFrontier,
StateSummaryFrontier, GetAcceptedStateSummary, AcceptedStateSummary, and the
AppRequest/AppResponse/AppError EVM fetch transport — so a node can route the
messages a pruned peer needs to re-fetch state instead of dropping them at the
chain router. Additive: every pre-existing wire value is unchanged. This is the
routing layer for state sync; the handler methods and sync-client driver that
consume these ops land on top.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-15 08:17:08 -07:00
zeekay dc6a123973 consensus(router): route inbound app-Gossip to the chain handler (α-of-K vote/cert delivery)
The α-of-K quorum vote/cert envelopes (BroadcastVote / GossipCert) ride on
p2p app-Gossip, but the handler.Op enum had no Gossip op, so the node's
inbound router dropped every GossipOp as 'unhandled message op'. The chain
handler's Gossip demux (HandleIncomingVote / HandleIncomingCert) was therefore
unreachable: no votes ingested, no cert assembled, cert-gated finality never
fired (zero Chits, frozen height) on every K>1 network.

Append a Gossip op (kept LAST so PushQuery=6 / Vote=8 / Context=10 wire bytes
are unchanged) and re-export it from networking/handler so the node can route
GossipOp -> handler.Gossip. Append-only; cert gate / VerifyWeighted untouched.
engine/chain quorum/cert/vote/finalize tests pass (CGO_ENABLED=0).
2026-06-25 15:19:11 -07:00
zeekay 257cacb84a chore: sync dependencies and format code 2026-02-04 15:44:47 -08:00
zeekay 5470201505 refactor: remove CGO dependencies, clean up MLX/GPU code 2026-01-11 20:39:40 -08:00
zeekay 4e046cf50d refactor: update dependencies and engine improvements 2026-01-05 01:28:53 -08:00
zeekay 26132a93bf Remove unused vm import 2025-12-19 08:49:11 -08:00
zeekay 4aac78700d Refactor: remove dead code, add thread safety, improve test coverage
- Remove unused packages: engine/dag/{getter,bootstrap,vertex/vertexmock},
  engine/pq/{bootstrap,block}, core/{tracker,verify}
- Add sync.RWMutex to protocol/wave for thread-safe map access
- Increase engine/dag test coverage from 11.7% to 98.3%
- Add comprehensive tests for DAG consensus, vertex, and engine
- All 27 packages pass tests, 16 at 100% coverage
2025-12-13 07:42:01 +00:00
zeekay bca5f6c9de Fix more imports/tests 2025-12-12 17:00:55 -08:00
zeekay a851dd3f94 Add context exports and VM notification support
- Export GetValidatorState, GetChainID, GetNetID, WithContext, FromContext
  from root consensus package for clean single-import usage
- Add VMMessage and MessageType for VM-to-engine notifications
- Add BlockBuilder interface for VMs that can build blocks
- Add SetVM, Notify, and buildBlock methods to Transitive engine
2025-12-10 01:15:32 +00:00
zeekay d3c95c6e4c Replace symlinks with actual directories for Go module compatibility 2025-09-27 03:26:38 +00:00
zeekay fee6b3564f Update and re-organize 2025-09-24 04:01:37 -05:00
zeekay 769f316d04 fix: resolve linting issues for CI
- Fixed assignOp issues: replaced x = x + y with x += y
- Fixed deprecated GetSubnetID to use GetNetID
- Added error check for verkle witness SetBytes
- Added nolint comment for simulation randomness (not security-critical)
- Formatted all Go code with gofmt
2025-08-25 22:10:31 -05:00
zeekay ace766cace fix: resolve critical linting issues
- Fix SA4031 nil check error in engine/pq/consensus.go by replacing unreachable nil check with proper certificate validation
- Fix SA9003 empty branch error in engine/pq/engine_test.go by adding meaningful log statement
- Fix integer overflow G115 in quasar.go by avoiding conversion of addition result
- Separate deprecated GetSubnetID export to avoid SA1019 in main exports
- Format all Go files with gofmt
- All tests still passing with 100% success rate
2025-08-23 13:19:08 -05:00
zeekay af0bbdc3d6 feat: complete integration of all three consensus engines
- Implement chain, DAG, and post-quantum consensus engines with full test coverage
- Create IntegratedEngine in node package combining all three engines
- Add production-ready cmd tools (params, checker, sim, zmq-bench)
- Implement Acceptor interface for node consensus integration
- Add WithBlockTime method to config Parameters
- Ensure all tests pass across consensus and node packages
- Remove stub implementations and add proper production code
- Fix config validation with detailed error messages
- Clean up duplicate files and unused code
2025-08-21 19:25:56 -05:00
zeekay c4faaef66f Refactor: Clean Wave-first consensus architecture
- Minimal, idiomatic Go structure
- Prism (sampler) with cut/refract selection
- Wave (threshold voting with α/β parameters)
- DAG helpers (Horizon/Flare)
- Nova finalizer
- Verkle hooks interface
- Quasar overlay for dual certificates
- FPC enabled by default in WaveConfig
- Clean separation: core algorithms vs named protocols
- Runnable fastchain example demonstrating the flow
2025-08-18 21:51:35 -05:00
zeekay fe5c421ae2 Fix import paths and reorganize consensus structure
- Fixed engine/core imports to use just core
- Renamed Message type to MessageType to avoid conflicts
- Created protocol/chain package with consensus interface
- Updated all chain imports to use protocol/chain
- Updated wave import to use protocol/wave
- Added bench target to Makefile 'all' rule
- Fixed package conflicts in core
2025-08-15 22:51:22 -05:00
zeekay 0a738af172 Format code with gofmt and goimports - fix all formatting issues 2025-08-15 19:37:25 -05:00
zeekay 47ee674092 Fix all remaining build errors - consensus module builds cleanly
- Comment out unused imports and code pending API completion
- Fix type mismatches (TxRef -> [32]byte, witness.Cache pointer)
- Update networking handler metric import alias
- Stub out incomplete FPC and witness APIs
- Fix chainEngine.Stop() call signature

All packages now build successfully with FPC enabled by default.
2025-08-15 17:15:07 +00:00
zeekay 4fb9569ea0 Merge latest changes from upstream consensus
# Conflicts:
#	benchmark/zmq_consensus_test.go
#	bootstrap/common.go
#	cmd/benchmark-old/main.go
#	config/presets.go
#	config/types.go
#	consensustest/context.go
#	context.go
#	core/interfaces/context.go
#	core/utils/factory.go
#	ctx.go
#	dagkit/dagkit.go
#	engine/chain/block/block.go
#	engine/chain/engine.go
#	engine/chain/engine_test.go
#	engine/dag/dagkit/dagkit.go
#	engine/dag/engine.go
#	engine/dag/engine_test.go
#	engine/dag/prism/prism.go
#	engine/dag/prism/prism_test.go
#	engine/enginetest/sender.go
#	engine/graph/engine.go
#	engine/graph/tx.go
#	engine/graph/vertex.go
#	engine/graph/vertex/vertex.go
#	engine/graph/vertex/vertexmock/mock.go
#	engine/graph/vertex/vertextest/vertex.go
#	engine/graph/vertex/vm.go
#	engine/pq/engine.go
#	engines/dag/internal/dagkit/dagkit.go
#	engines/dag/internal/prism/prism.go
#	engines/dag/internal/prism/prism_test.go
#	enginetest/engine.go
#	focus/ray.go
#	focus/ray_test.go
#	go.mod
#	go.sum
#	initializable.go
#	networking/router/handler.go
#	networking/sender/sender.go
#	nova/nova.go
#	prism/prism.go
#	prism/prism_test.go
#	protocol/nebula/engine_test.go
#	protocol/nebula/nebula.go
#	protocol/nebula/nebula_dag_test.go
#	protocol/quasar/engine.go
#	protocol/quasar/quasar_test.go
#	sampling/parameters.go
#	tests/consensus_performance_test.go
#	tests/consensus_reversibility_test.go
#	tests/consensus_test.go
#	tests/integration_test.go
#	tests/mixed_test.go
#	tests/virtuous_test.go
#	wavefpc/integration_test.go
#	witness/witness.go
2025-08-15 14:58:30 +00:00
zeekay fb5647bbc0 Updates to Wave 2025-08-15 01:14:18 -05:00
zeekay 542d38cc79 Update context types for compatibility with node package
- Add Context type alias pointing to Runtime for backward compatibility
- Add ChainContext struct for consensus-specific context
- Add GetChainContext and related helper functions
- Add StateHolder pointer type support
- Add missing interface definitions
- Update all references from interfaces.Context to interfaces.Runtime
2025-08-15 02:39:17 +00:00
zeekay f0c95be76b fix: update consensus module interfaces for node integration
- Fix tracker, handler, and sender interfaces
- Add chain consensus utilities
- Update getter, queue, state, and VM interfaces
- Ensure compatibility with node without snow packages
2025-08-15 00:01:29 +00:00
zeekay 676ef65219 Restructure consensus module to pure protocol logic
- Move from protocol/ to protocols/ directory structure
- Create core/interfaces for pure protocol abstractions
- Implement protocols/prism for shared sampling/quorum logic
- Add protocols/nova (Snowman), photon, pulse, wave, nebula
- Create engine/ packages for orchestration (chain, dag, pq)
- Add networking/ abstractions without implementation details
- Remove choices/, threshold/, utils/validator duplicates
- Export consensus context and types from root package
- Add compatibility layers for node integration

This creates a pure consensus protocol implementation with no node dependencies.
2025-08-14 03:44:03 +00:00