mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
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).
51 lines
1.2 KiB
Go
51 lines
1.2 KiB
Go
package handler
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/luxfi/consensus/core/router"
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
// Handler handles network messages
|
|
type Handler interface {
|
|
// HandleInbound handles inbound messages
|
|
HandleInbound(context.Context, Message) error
|
|
|
|
// HandleOutbound handles outbound messages
|
|
HandleOutbound(context.Context, Message) error
|
|
|
|
// Connected handles node connection
|
|
Connected(context.Context, ids.NodeID) error
|
|
|
|
// Disconnected handles node disconnection
|
|
Disconnected(context.Context, ids.NodeID) error
|
|
}
|
|
|
|
// Message represents a network message
|
|
type Message struct {
|
|
NodeID ids.NodeID
|
|
RequestID uint32
|
|
Op Op
|
|
Message []byte
|
|
}
|
|
|
|
// Op re-exports from core/router for consistency
|
|
type Op = router.Op
|
|
|
|
// Op constants re-exported from core/router
|
|
const (
|
|
GetAcceptedFrontier = router.GetAcceptedFrontier
|
|
AcceptedFrontier = router.AcceptedFrontier
|
|
GetAccepted = router.GetAccepted
|
|
Accepted = router.Accepted
|
|
Get = router.Get
|
|
Put = router.Put
|
|
PushQuery = router.PushQuery
|
|
PullQuery = router.PullQuery
|
|
Vote = router.Vote
|
|
GetContext = router.GetContext
|
|
Context = router.Context
|
|
Gossip = router.Gossip
|
|
)
|