diff --git a/node/pkg/node/options.go b/node/pkg/node/options.go index a5d4a59535..48f2e8c5af 100644 --- a/node/pkg/node/options.go +++ b/node/pkg/node/options.go @@ -103,6 +103,7 @@ func GuardianOptionP2P( ccqBootstrapPeers, ccqPort, ccqAllowedPeers), + p2p.WithProcessorFeaturesFunc(processor.GetFeatures), ) if err != nil { return err diff --git a/node/pkg/p2p/p2p.go b/node/pkg/p2p/p2p.go index bb1238daee..486496e833 100644 --- a/node/pkg/p2p/p2p.go +++ b/node/pkg/p2p/p2p.go @@ -528,6 +528,15 @@ func Run(params *RunParams) func(ctx context.Context) error { } features := make([]string, 0) + if GossipCutoverComplete() { + features = append(features, "p2p:new_gossip") + } + if params.processorFeaturesFunc != nil { + flag := params.processorFeaturesFunc() + if flag != "" { + features = append(features, flag) + } + } if params.gov != nil { if params.gov.IsFlowCancelEnabled() { features = append(features, "governor:fc") diff --git a/node/pkg/p2p/run_params.go b/node/pkg/p2p/run_params.go index 1ac48a8e05..558117d6fa 100644 --- a/node/pkg/p2p/run_params.go +++ b/node/pkg/p2p/run_params.go @@ -55,6 +55,7 @@ type ( gov *governor.ChainGovernor components *Components ibcFeaturesFunc func() string + processorFeaturesFunc func() string gatewayRelayerEnabled bool ccqEnabled bool signedQueryReqC chan<- *gossipv1.SignedQueryRequest @@ -108,6 +109,14 @@ func WithComponents(components *Components) RunOpt { } } +// WithProcessorFeaturesFunc is used to set the processor features function. +func WithProcessorFeaturesFunc(processorFeaturesFunc func() string) RunOpt { + return func(p *RunParams) error { + p.processorFeaturesFunc = processorFeaturesFunc + return nil + } +} + // WithSignedObservationListener is used to set the channel to receive `SignedObservation` messages. func WithSignedObservationListener(obsvRecvC chan<- *common.MsgWithTimeStamp[gossipv1.SignedObservation]) RunOpt { return func(p *RunParams) error { diff --git a/node/pkg/processor/processor.go b/node/pkg/processor/processor.go index 7527124f35..1a2ad16438 100644 --- a/node/pkg/processor/processor.go +++ b/node/pkg/processor/processor.go @@ -471,3 +471,11 @@ func (p *Processor) vaaWriter(ctx context.Context) error { } } } + +// GetFeatures returns the processor feature string that can be published in heartbeat messages. +func GetFeatures() string { + if batchCutoverComplete() { + return "processor:batching" + } + return "" +}