Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node: Add cutover feature flags to heartbeats #4092

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions node/pkg/node/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func GuardianOptionP2P(
ccqBootstrapPeers,
ccqPort,
ccqAllowedPeers),
p2p.WithProcessorFeaturesFunc(processor.GetFeatures),
)
if err != nil {
return err
Expand Down
9 changes: 9 additions & 0 deletions node/pkg/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions node/pkg/p2p/run_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type (
gov *governor.ChainGovernor
components *Components
ibcFeaturesFunc func() string
processorFeaturesFunc func() string
gatewayRelayerEnabled bool
ccqEnabled bool
signedQueryReqC chan<- *gossipv1.SignedQueryRequest
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions node/pkg/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}
Loading