Skip to content

Commit

Permalink
Added S4 config to Functions script (#9778)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Smirnov authored Jul 12, 2023
1 parent 7531372 commit d2b02e7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/scripts/functions/src/generate_ocr2_config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ type ThresholdOffchainConfig struct {
RequireLocalRequestCheck bool
}

type S4ReportingPluginConfig struct {
MaxQueryLengthBytes uint32
MaxObservationLengthBytes uint32
MaxReportLengthBytes uint32
NSnapshotShards uint32
MaxObservationEntries uint32
MaxReportEntries uint32
MaxDeleteExpiredEntries uint32
}

type OracleConfigSource struct {
MaxQueryLengthBytes uint32
MaxObservationLengthBytes uint32
Expand All @@ -44,6 +54,8 @@ type OracleConfigSource struct {

ThresholdOffchainConfig ThresholdOffchainConfig

S4ReportingPluginConfig S4ReportingPluginConfig

DeltaProgressMillis uint32
DeltaResendMillis uint32
DeltaRoundMillis uint32
Expand Down Expand Up @@ -210,6 +222,15 @@ func (g *generateOCR2Config) Run(args []string) {
RequestTotalBytesLimit: cfg.ThresholdOffchainConfig.RequestTotalBytesLimit,
RequireLocalRequestCheck: cfg.ThresholdOffchainConfig.RequireLocalRequestCheck,
},
S4PluginConfig: &config.S4ReportingPluginConfig{
MaxQueryLengthBytes: cfg.S4ReportingPluginConfig.MaxQueryLengthBytes,
MaxObservationLengthBytes: cfg.S4ReportingPluginConfig.MaxObservationLengthBytes,
MaxReportLengthBytes: cfg.S4ReportingPluginConfig.MaxReportLengthBytes,
NSnapshotShards: cfg.S4ReportingPluginConfig.NSnapshotShards,
MaxObservationEntries: cfg.S4ReportingPluginConfig.MaxObservationEntries,
MaxReportEntries: cfg.S4ReportingPluginConfig.MaxReportEntries,
MaxDeleteExpiredEntries: cfg.S4ReportingPluginConfig.MaxDeleteExpiredEntries,
},
},
})
if err != nil {
Expand Down
10 changes: 10 additions & 0 deletions core/scripts/functions/src/sample_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
"RequireLocalRequestCheck": true
},

"S4ReportingPluginConfig": {
"MaxQueryLengthBytes": 50000,
"MaxObservationLengthBytes": 50000,
"MaxReportLengthBytes": 50000,
"NSnapshotShards": 1,
"MaxObservationEntries": 1000,
"MaxReportEntries": 1000,
"MaxDeleteExpiredEntries": 1000
},

"DeltaProgressMillis": 30000,
"DeltaResendMillis": 10000,
"DeltaRoundMillis": 10000,
Expand Down

0 comments on commit d2b02e7

Please sign in to comment.