Skip to content

Commit 4afb833

Browse files
committed
[PRODCRE-792] Per-method onchain config for capabilities V2
1 parent 75577eb commit 4afb833

3 files changed

Lines changed: 471 additions & 56 deletions

File tree

pkg/capabilities/capabilities.go

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,13 @@ type RemoteTargetConfig struct {
490490
}
491491

492492
type RemoteExecutableConfig struct {
493-
RequestHashExcludedAttributes []string
494-
RegistrationRefresh time.Duration
495-
RegistrationExpiry time.Duration
493+
RequestHashExcludedAttributes []string // v1 only
494+
495+
Schedule string
496+
DeltaStage time.Duration
497+
RequestTimeout time.Duration
498+
ServerMaxParallelRequests int
499+
RequestHasherType string
496500
}
497501

498502
// NOTE: consider splitting this config into values stored in Registry (KS-118)
@@ -522,12 +526,31 @@ func (c *RemoteExecutableConfig) ApplyDefaults() {
522526
if c == nil {
523527
return
524528
}
525-
if c.RegistrationRefresh == 0 {
526-
c.RegistrationRefresh = DefaultRegistrationRefresh
527-
}
528-
if c.RegistrationExpiry == 0 {
529-
c.RegistrationExpiry = DefaultRegistrationExpiry
530-
}
529+
}
530+
531+
type AggregatorType int
532+
type TransmissionSchedule int
533+
type RequestHasherType int
534+
535+
const (
536+
AggregatorType_Mode AggregatorType = 0
537+
AggregatorType_SignedReport AggregatorType = 1
538+
539+
Schedule_AllAtOnce TransmissionSchedule = 0
540+
Schedule_OneAtATime TransmissionSchedule = 1
541+
542+
RequestHasherType_Mode RequestHasherType = 0
543+
RequestHasherType_SignedReport RequestHasherType = 1
544+
)
545+
546+
type AggregatorConfig struct {
547+
AggregatorType AggregatorType
548+
}
549+
550+
type CapabilityMethodConfig struct {
551+
RemoteTriggerConfig *RemoteTriggerConfig
552+
RemoteExecutableConfig *RemoteExecutableConfig
553+
AggregatorConfig *AggregatorConfig
531554
}
532555

533556
type CapabilityConfiguration struct {
@@ -541,4 +564,7 @@ type CapabilityConfiguration struct {
541564
RemoteTriggerConfig *RemoteTriggerConfig
542565
RemoteTargetConfig *RemoteTargetConfig
543566
RemoteExecutableConfig *RemoteExecutableConfig
567+
568+
// v2 / "NoDAG" capabilities
569+
CapabilityMethodConfig map[string]CapabilityMethodConfig
544570
}

0 commit comments

Comments
 (0)