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

add ocr offchainConfig and chain config structs #36

Merged
merged 11 commits into from
Aug 6, 2024
Merged

Conversation

makramkd
Copy link
Collaborator

@makramkd makramkd commented Jul 19, 2024

We need to define the offchainConfig and chain config structs. The configuration has been organized so as to make maximal use of blue-green deployments. Things in ChainConfig should not be changed very often if at all, and will affect all DONs.

Things in OCR offchainConfig will be scoped to a particular plugin instance.

Related PR in ccip: smartcontractkit/ccip#1264

pluginconfig/execute.go Outdated Show resolved Hide resolved
chainconfig/chainconfig.go Outdated Show resolved Hide resolved
// Writer indicates that the node can contribute by sending reports to the destination chain.
// Being a Writer guarantees that the node can also read from the destination chain.
Writer bool `json:"writer"`
type ExecuteOffchainConfig struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the difference between this and ExecutePluginConfig? There is some overlap in values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will get posted on-chain and will inform what ends up in ExecutePluginConfig

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some comments to the struct to this effect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've ended up embedding this struct in the ExecutePluginConfig struct, which holds configuration not just from the offchain config but from the general OCR config.

Comment on lines 47 to 49
// ArbitrumPriceSource is the source of the TOKEN/USD price data of a particular token
// on Arbitrum.
type ArbitrumPriceSource struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that the commit plugin can fetch token prices from the feeds that are deployed on arbitrum

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add some more detailed comments.

Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem fine. A lot of them aren't used yet, how big of an issue would it be to add them in as needed? I'd be tempted to throw in lots of TODO comments on the things which still need to be implemented.

@makramkd
Copy link
Collaborator Author

makramkd commented Aug 6, 2024

Agreed @winder I've created a few tickets for what needs to be used.

Copy link

github-actions bot commented Aug 6, 2024

Test Coverage

Branch Coverage
CCIP-2836 76.0%
ccip-develop 76.5%

Comment on lines +22 to +23
// OffchainConfig is the offchain config set for the exec DON.
OffchainConfig ExecuteOffchainConfig `json:"offchainConfig"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I was wondering if they overlapped completely like this.

You could fully embed it as well, most off the shelf decoders will append changes rather than overwrite them. Not sure if our custom decoders work that way.

Suggested change
// OffchainConfig is the offchain config set for the exec DON.
OffchainConfig ExecuteOffchainConfig `json:"offchainConfig"`
// ExecuteOffchainConfig is the offchain config set for the exec DON.
ExecuteOffchainConfig`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do this direct embed but I think it makes it harder to determine from the usage sites where that field actually comes from; since we have like 3+ kinds of configs I think the more explicit we can be the better

@makramkd makramkd merged commit 6ae4005 into ccip-develop Aug 6, 2024
2 checks passed
@makramkd makramkd deleted the CCIP-2836 branch August 6, 2024 14:24
makramkd added a commit to smartcontractkit/ccip that referenced this pull request Aug 6, 2024
## Motivation

We want to define and use the appropriate OCR offchain config for each
plugin.

## Solution

Requires smartcontractkit/chainlink-ccip#36
asoliman92 pushed a commit to smartcontractkit/chainlink that referenced this pull request Aug 7, 2024
We want to define and use the appropriate OCR offchain config for each
plugin.

Requires smartcontractkit/chainlink-ccip#36
asoliman92 added a commit to smartcontractkit/chainlink that referenced this pull request Aug 7, 2024
* Fix compilation for launcher, diff

Make application.go ready for adding more fixes


* Fix launcher tests

* ks-409 fix the mock trigger to ensure events are sent (#14047)

* Add ccip to job orm

* Add capabilities directory under BUSL license

* Prep to instantiate separate registrysyncer for CCIP

* Move registrySyncer creation into ccip delegate

* [chore] Change registrysyncer config to bytes

* Fix launcher diff tests after changing structs in syncer

* Fix linting

* MAke simulated backend client work with chains other than 1337

* core/capabilities/ccip: use OCR offchain config (#1264)

We want to define and use the appropriate OCR offchain config for each
plugin.

Requires smartcontractkit/chainlink-ccip#36

* Cleaning up

* Add capabilities types to mockery

---------

Co-authored-by: Cedric Cordenier <cedric.cordenier@smartcontract.com>
Co-authored-by: Matthew Pendrey <matthew.pendrey@gmail.com>
Co-authored-by: Makram <makramkd@users.noreply.github.com>
github-merge-queue bot pushed a commit to smartcontractkit/chainlink that referenced this pull request Aug 7, 2024
* [CCIP Merge] Add ccip capabilities directory [CCIP-2943] (#14044)

* Add ccip capabilities directory

* [CCIP Merge] Capabilities fix [CCIP-2943] (#14048)

* Fix compilation for launcher, diff

Make application.go ready for adding more fixes


* Fix launcher tests

* ks-409 fix the mock trigger to ensure events are sent (#14047)

* Add ccip to job orm

* Add capabilities directory under BUSL license

* Prep to instantiate separate registrysyncer for CCIP

* Move registrySyncer creation into ccip delegate

* [chore] Change registrysyncer config to bytes

* Fix launcher diff tests after changing structs in syncer

* Fix linting

* MAke simulated backend client work with chains other than 1337

* core/capabilities/ccip: use OCR offchain config (#1264)

We want to define and use the appropriate OCR offchain config for each
plugin.

Requires smartcontractkit/chainlink-ccip#36

* Cleaning up

* Add capabilities types to mockery

---------

Co-authored-by: Cedric Cordenier <cedric.cordenier@smartcontract.com>
Co-authored-by: Matthew Pendrey <matthew.pendrey@gmail.com>
Co-authored-by: Makram <makramkd@users.noreply.github.com>

* make modgraph

* Add changeset

* Fix test with new TxMgr constructor

---------

Co-authored-by: Cedric Cordenier <cedric.cordenier@smartcontract.com>
Co-authored-by: Matthew Pendrey <matthew.pendrey@gmail.com>
Co-authored-by: Makram <makramkd@users.noreply.github.com>
asoliman92 pushed a commit to smartcontractkit/chainlink that referenced this pull request Aug 27, 2024
We want to define and use the appropriate OCR offchain config for each
plugin.

Requires smartcontractkit/chainlink-ccip#36
asoliman92 pushed a commit to smartcontractkit/chainlink that referenced this pull request Aug 28, 2024
## Motivation

We want to define and use the appropriate OCR offchain config for each
plugin.

## Solution

Requires smartcontractkit/chainlink-ccip#36
asoliman92 pushed a commit to smartcontractkit/chainlink that referenced this pull request Aug 28, 2024
## Motivation

We want to define and use the appropriate OCR offchain config for each
plugin.

## Solution

Requires smartcontractkit/chainlink-ccip#36
asoliman92 pushed a commit to smartcontractkit/chainlink that referenced this pull request Aug 28, 2024
We want to define and use the appropriate OCR offchain config for each
plugin.

Requires smartcontractkit/chainlink-ccip#36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants