Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4aa1de2
Custom OffchainConfig
dhaidashenko Sep 12, 2025
949106a
bump plugins
dhaidashenko Sep 23, 2025
ea0952b
custom ocr config
dhaidashenko Sep 23, 2025
4d7c61a
Merge branch 'develop' into feature/PLEX-1569-config-for-ocr-reads
dhaidashenko Sep 23, 2025
7f27990
bump common
dhaidashenko Sep 23, 2025
7dd7bad
bump evm plugin
dhaidashenko Sep 23, 2025
4eecd7a
remove merge artifcat
dhaidashenko Sep 23, 2025
f2a5e3d
bump chainlink common
dhaidashenko Sep 23, 2025
4eeb242
fix offchain config validation on ocr3 deployment
dhaidashenko Sep 24, 2025
093fbcc
fix vault error printing
dhaidashenko Sep 24, 2025
705b45c
bump evm capability
dhaidashenko Sep 24, 2025
a65bc54
Merge branch 'develop' into feature/PLEX-1569-config-for-ocr-reads
dhaidashenko Sep 24, 2025
bf74cbb
linter fixes
dhaidashenko Sep 24, 2025
e93cb8e
Enable input template generation for offchain config
dhaidashenko Sep 25, 2025
355d939
fix test
dhaidashenko Sep 25, 2025
89fa303
rollback redundant changes
dhaidashenko Sep 25, 2025
885b9a2
Fix view tests
dhaidashenko Sep 25, 2025
fa26fc6
Fix TestGenerateOCR3Config
dhaidashenko Sep 25, 2025
4af338b
Merge branch 'develop' into feature/PLEX-1569-config-for-ocr-reads
dhaidashenko Sep 25, 2025
1279026
bump ton
dhaidashenko Sep 26, 2025
acd2018
Merge branch 'fix/ton-dep' into feature/PLEX-1569-config-for-ocr-reads
dhaidashenko Sep 26, 2025
e48c707
Trigger Build
dhaidashenko Sep 26, 2025
9ecb6a5
Merge branch 'develop' into feature/PLEX-1569-config-for-ocr-reads
dhaidashenko Sep 26, 2025
715c965
Merge branch 'develop' into feature/PLEX-1569-config-for-ocr-reads
dhaidashenko Sep 29, 2025
6166fb2
bump evm capabilties
dhaidashenko Sep 29, 2025
d969508
Return error if multiple offchain cfgs are defined
dhaidashenko Sep 29, 2025
e7a3c41
fix chain cap offchain cfg definition
dhaidashenko Sep 29, 2025
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
4 changes: 2 additions & 2 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20250911201806-5a095deaeb52
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250917190204-8817bb81d880
github.com/smartcontractkit/chainlink-common v0.9.6
github.com/smartcontractkit/chainlink-data-streams v0.1.2
github.com/smartcontractkit/chainlink-deployments-framework v0.49.0
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20250915101441-709f87f7d401
Expand Down Expand Up @@ -479,7 +479,7 @@ require (
github.com/smartcontractkit/chainlink-aptos v0.0.0-20250916164650-970686360fbf // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250908144012-8184001834b5 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.2-0.20250227211209-7cd000095135 // indirect
github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250818175541-3389ac08a563 // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250717121125-2350c82883e2 // indirect
Expand Down
8 changes: 4 additions & 4 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1597,10 +1597,10 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250908144012-8
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250908144012-8184001834b5/go.mod h1:Ve1xD71bl193YIZQEoJMmBqLGQJdNs29bwbuObwvbhQ=
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 h1:QhcYGEhRLInr1/qh/3RJiVdvJ0nxBHKhPe65WLbSBnU=
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg=
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250917190204-8817bb81d880 h1:gbUrnSRp1PdPHQtYyZ5geQXV7ReY1/QZcxInU5ivR1Q=
github.com/smartcontractkit/chainlink-common v0.9.5-0.20250917190204-8817bb81d880/go.mod h1:EKFUYgf8IsArVMF8lzXNyIhdH6lM8mhyvztCSouZ+G8=
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 h1:ca2z5OXgnbBPQRxpwXwBLJsUA1+cAp5ncfW4Ssvd6eY=
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1/go.mod h1:NZv/qKYGFRnkjOYBouajnDfFoZ+WDa6H2KNmSf1dnKc=
github.com/smartcontractkit/chainlink-common v0.9.6 h1:xE6x3kujV0NC7AMo/LdCszVTc2ZR9bQWOlZvYiYvuoY=
github.com/smartcontractkit/chainlink-common v0.9.6/go.mod h1:1r3aM96KHAESfnayJ3BTHCkP1qJS1BEG1r4czeoaXlA=
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 h1:hvqATtrZ0iMRTI80cpBot/3JFbjz2j+2tvpfooVhRHw=
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4/go.mod h1:eKGyfTKzr0/PeR7qKN4l2FcW9p+HzyKUwAfGhm/5YZc=
github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20250415235644-8703639403c7 h1:9wh1G+WbXwPVqf0cfSRSgwIcaXTQgvYezylEAfwmrbw=
github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20250415235644-8703639403c7/go.mod h1:yaDOAZF6MNB+NGYpxGCUc+owIdKrjvFW0JODdTcQ3V0=
github.com/smartcontractkit/chainlink-data-streams v0.1.2 h1:g/UmFJa/E1Zmc7NO20ob5SijxQen51DhnqTLr2f7BEc=
Expand Down
14 changes: 8 additions & 6 deletions core/scripts/keystone/src/testdata/SampleConfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"OracleConfig": {
"MaxQueryLengthBytes": 1000000,
"MaxObservationLengthBytes": 1000000,
"MaxReportLengthBytes": 1000000,
"MaxBatchSize": 20,
"UniqueReports": true,
"RequestTimeout": "30s",
"DeltaProgressMillis": 5000,
"DeltaResendMillis": 5000,
"DeltaInitialMillis": 5000,
Expand All @@ -23,6 +18,13 @@
"MaxDurationShouldAcceptMillis": 1000,
"MaxDurationShouldTransmitMillis": 1000,

"MaxFaultyOracles": 1
"MaxFaultyOracles": 1,
"ConsensusCapOffchainConfig": {
"MaxQueryLengthBytes": 1000000,
"MaxObservationLengthBytes": 1000000,
"MaxReportLengthBytes": 1000000,
"MaxBatchSize": 20,
"RequestTimeout": "30s"
}
}
}
118 changes: 30 additions & 88 deletions deployment/cre/ocr3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/durationpb"

chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper"
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
mcmstypes "github.com/smartcontractkit/mcms/types"

capocr3types "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types"
"google.golang.org/protobuf/proto"

ocr3_capability "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/ocr3_capability_1_0_0"

Expand All @@ -47,71 +43,6 @@ type MCMSConfig struct {
MinDuration time.Duration
}

type OracleConfig struct {
MaxQueryLengthBytes uint32
MaxObservationLengthBytes uint32
MaxReportLengthBytes uint32
MaxOutcomeLengthBytes uint32
MaxReportCount uint32
MaxBatchSize uint32
OutcomePruningThreshold uint64
UniqueReports bool
RequestTimeout time.Duration

DeltaProgressMillis uint32
DeltaResendMillis uint32
DeltaInitialMillis uint32
DeltaRoundMillis uint32
DeltaGraceMillis uint32
DeltaCertifiedCommitRequestMillis uint32
DeltaStageMillis uint32
MaxRoundsPerEpoch uint64
TransmissionSchedule []int

MaxDurationQueryMillis uint32
MaxDurationObservationMillis uint32
MaxDurationShouldAcceptMillis uint32
MaxDurationShouldTransmitMillis uint32

MaxFaultyOracles int
}

func (oc *OracleConfig) UnmarshalJSON(data []byte) error {
type aliasT OracleConfig
temp := &struct {
RequestTimeout string `json:"RequestTimeout"`
*aliasT
}{
aliasT: (*aliasT)(oc),
}
if err := json.Unmarshal(data, temp); err != nil {
return fmt.Errorf("failed to unmarshal OracleConfig: %w", err)
}

if temp.RequestTimeout == "" {
oc.RequestTimeout = 0
} else {
requestTimeout, err := time.ParseDuration(temp.RequestTimeout)
if err != nil {
return fmt.Errorf("failed to parse RequestTimeout: %w", err)
}
oc.RequestTimeout = requestTimeout
}

return nil
}

func (oc OracleConfig) MarshalJSON() ([]byte, error) {
type aliasT OracleConfig
return json.Marshal(&struct {
RequestTimeout string `json:"RequestTimeout"`
*aliasT
}{
RequestTimeout: oc.RequestTimeout.String(),
aliasT: (*aliasT)(&oc),
})
}

type NodeKeys struct {
EthAddress string `json:"EthAddress"`
AptosAccount string `json:"AptosAccount"`
Expand Down Expand Up @@ -301,27 +232,21 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets focr.OCRSecret
})
}

// let's keep reqTimeout as nil if it's 0, so we can use the default value within `chainlink-common`.
// See: https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/factory.go#L73
cfgBytes := reportingPluginConfigOverride
if cfgBytes == nil {
var reqTimeout *durationpb.Duration
if cfg.RequestTimeout > 0 {
reqTimeout = durationpb.New(cfg.RequestTimeout)
offchainCfg, err := getOffchainCfg(cfg)
if err != nil {
return OCR2OracleConfig{}, fmt.Errorf("failed to get offchain config: %w", err)
}
var err2 error
cfgBytes, err2 = proto.Marshal(&capocr3types.ReportingPluginConfig{
MaxQueryLengthBytes: cfg.MaxQueryLengthBytes,
MaxObservationLengthBytes: cfg.MaxObservationLengthBytes,
MaxReportLengthBytes: cfg.MaxReportLengthBytes,
MaxOutcomeLengthBytes: cfg.MaxOutcomeLengthBytes,
MaxReportCount: cfg.MaxReportCount,
MaxBatchSize: cfg.MaxBatchSize,
OutcomePruningThreshold: cfg.OutcomePruningThreshold,
RequestTimeout: reqTimeout,
})
if err2 != nil {
return OCR2OracleConfig{}, fmt.Errorf("failed to marshal ReportingPluginConfig: %w", err2)
if offchainCfg != nil {
offchainCfgAsProto, err := offchainCfg.ToProto()
if err != nil {
return OCR2OracleConfig{}, fmt.Errorf("failed to convert offchainConfig to proto: %w", err)
}
cfgBytes, err = proto.Marshal(offchainCfgAsProto)
if err != nil {
return OCR2OracleConfig{}, fmt.Errorf("failed to marshal offchainConfig to proto: %w", err)
}
}
}

Expand Down Expand Up @@ -373,6 +298,23 @@ func GenerateOCR3Config(cfg OracleConfig, nca []NodeKeys, secrets focr.OCRSecret
return config, nil
}

func getOffchainCfg(oracleCfg OracleConfig) (offchainConfig, error) {
var result offchainConfig
if oracleCfg.ConsensusCapOffchainConfig != nil {
result = oracleCfg.ConsensusCapOffchainConfig
}

if oracleCfg.ChainCapOffchainConfig != nil {
if result != nil {
return nil, fmt.Errorf("multiple offchain configs specified: %+v. Only one allowed", oracleCfg)
}

result = oracleCfg.ChainCapOffchainConfig
}

return result, nil
}

type ConfigureOCR3Request struct {
Cfg *OracleConfig
Chain cldf_evm.Chain
Expand Down
18 changes: 10 additions & 8 deletions deployment/cre/ocr3/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ var wantOCR3Config = `{

var ocr3Cfg = `
{
"MaxQueryLengthBytes": 1000000,
"MaxObservationLengthBytes": 1000000,
"MaxReportLengthBytes": 1000000,
"MaxOutcomeLengthBytes": 1000000,
"MaxReportCount": 20,
"MaxBatchSize": 20,
"OutcomePruningThreshold": 3600,
"ConsensusCapOffchainConfig": {
"MaxQueryLengthBytes": 1000000,
"MaxObservationLengthBytes": 1000000,
"MaxReportLengthBytes": 1000000,
"MaxOutcomeLengthBytes": 1000000,
"MaxReportCount": 20,
"MaxBatchSize": 20,
"OutcomePruningThreshold": 3600,
"RequestTimeout": "30s"
},
"UniqueReports": true,
"RequestTimeout": "30s",
"DeltaProgressMillis": 5000,
"DeltaResendMillis": 5000,
"DeltaInitialMillis": 5000,
Expand Down
Loading
Loading