Skip to content
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
17 changes: 16 additions & 1 deletion deployment/cre/ocr3/ocr3_1/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,26 @@ func Test_GenerateOCR3_1Config_ConsensusQueueOffchainConfig(t *testing.T) {
t.Errorf("encoded limits mismatch (-want +got):\n%s", diff)
}

// Asserts the defaults decode on the node and keep the blob quotas the plugin needs.
t.Run("defaults are valid", func(t *testing.T) {
b, err := DefaultConsensusQueueOffchainConfig().Marshal()
require.NoError(t, err)
_, err = queuepb.Decode(b)
decoded, err := queuepb.Decode(b)
require.NoError(t, err)
got, err := decoded.OCRLimits()
require.NoError(t, err)

want := ocr3_1types.ReportingPluginLimits{
MaxObservationBytes: 512 * 1024,
MaxKeyValueModifiedKeys: 4,
MaxKeyValueModifiedKeysPlusValuesBytes: 10 * 1024 * 1024,
MaxBlobPayloadBytes: 5 * 1024 * 1024,
MaxPerOracleUnexpiredBlobCumulativePayloadBytes: 100 * 1024 * 1024,
MaxPerOracleUnexpiredBlobCount: 100,
}
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("default limits mismatch (-want +got):\n%s", diff)
}
})

t.Run("invalid limits fail to marshal", func(t *testing.T) {
Expand Down
13 changes: 9 additions & 4 deletions deployment/cre/ocr3/ocr3_1/oracle_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,19 @@ type ConsensusQueueLimits struct {
}

// DefaultConsensusQueueOffchainConfig returns starting limits for a consensus-queue DON.
// The plugin has no queries, reports or blobs yet, so those limits are zero.
// The plugin broadcasts trigger events as blobs, so the blob quotas hold every blob in a full observation,
// and it writes a fixed handful of KV keys per round.
// The plugin has no queries or reports, so those limits are zero.
// The node never applies defaults itself. Different node versions would otherwise disagree under the same digest.
func DefaultConsensusQueueOffchainConfig() *ConsensusQueueOffchainConfig {
return &ConsensusQueueOffchainConfig{
Limits: ConsensusQueueLimits{
MaxObservationBytes: 256 * 1024,
MaxKeyValueModifiedKeys: 1_000,
MaxKeyValueModifiedKeysPlusValuesBytes: 4 * 1024 * 1024,
MaxObservationBytes: 512 * 1024,
MaxKeyValueModifiedKeys: 4,
MaxKeyValueModifiedKeysPlusValuesBytes: 10 * 1024 * 1024,
MaxBlobPayloadBytes: 5 * 1024 * 1024,
MaxPerOracleUnexpiredBlobCumulativePayloadBytes: 100 * 1024 * 1024,
MaxPerOracleUnexpiredBlobCount: 100,
},
}
}
Expand Down
Loading