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

Remove AppConfig from ChainScoped #12636

Merged
merged 30 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
10dd057
Remove AppConfig from ChainScoped
dimriou Mar 21, 2024
ad462a1
Fix shell_local
dimriou Mar 21, 2024
6c83d67
Update configs for services
dimriou Mar 21, 2024
02db5eb
Extend relay configs
dimriou Apr 1, 2024
d1257f1
Merge branch 'develop' into fix_configs
dimriou Apr 8, 2024
2ddcf5e
Add DefaultQueryTimeout as arg
dimriou Apr 8, 2024
c5867e3
Fix lint
dimriou Apr 8, 2024
02125d6
Fix test cases in cmd
dimriou Apr 8, 2024
94b7dd3
Add changeset
dimriou Apr 8, 2024
5957e46
Merge branch 'develop' into fix_configs
dimriou Apr 10, 2024
651ec1d
Remove unnecessary OCR check
dimriou Apr 10, 2024
4530827
Merge branch 'develop' into fix_configs
dimriou Apr 11, 2024
42d2bc3
Update chain scoped mock
dimriou Apr 11, 2024
24d0fca
Merge branch 'develop' into fix_configs
dimriou Apr 16, 2024
c8f2957
Merge branch 'develop' into fix_configs
dimriou Apr 17, 2024
aae4c00
Add default cases for relay args
dimriou Apr 17, 2024
efce3a1
Merge branch 'develop' into fix_configs
dimriou Apr 18, 2024
1a5d05c
Remove unused Database config from OCR
dimriou Apr 18, 2024
d64be4b
Add changeset
dimriou Apr 18, 2024
ec8e7ce
Remove DefaultTimeout config from RelayArgs
dimriou Apr 18, 2024
5d58498
Address comments
dimriou Apr 18, 2024
ca25411
Remove unnecessary changeset
dimriou Apr 18, 2024
f0518c1
Remove defaultquerytimeout from RelayConfig
dimriou Apr 18, 2024
48a9b75
Update remaining relays
dimriou Apr 19, 2024
cd3c82f
Handle services collectively
dimriou Apr 19, 2024
66035d7
Merge branch 'develop' into fix_configs
dimriou Apr 22, 2024
d20e5c6
Update relayConfigsWithDefaults
dimriou Apr 22, 2024
3fec5d0
Merge branch 'develop' into fix_configs
dimriou Apr 22, 2024
7910a77
Update configs through JSONConfig
dimriou Apr 22, 2024
8515dd7
Fix lint
dimriou Apr 22, 2024
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
5 changes: 5 additions & 0 deletions .changeset/tame-lies-change.md
jmank88 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Remove AppConfig from chain scoped config to enable EVM extraction
17 changes: 5 additions & 12 deletions core/chains/evm/config/chain_scoped.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ import (

commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml"
"github.com/smartcontractkit/chainlink/v2/core/config"
)

func NewTOMLChainScopedConfig(appCfg config.AppConfig, tomlConfig *toml.EVMConfig, lggr logger.Logger) *ChainScoped {
func NewTOMLChainScopedConfig(tomlConfig *toml.EVMConfig, lggr logger.Logger) *ChainScoped {
return &ChainScoped{
AppConfig: appCfg,
evmConfig: &EVMConfig{C: tomlConfig},
lggr: lggr}
}

// ChainScoped implements config.ChainScopedConfig with a gencfg.BasicConfig and EVMConfig.
type ChainScoped struct {
config.AppConfig
lggr logger.Logger

evmConfig *EVMConfig
Expand All @@ -47,14 +44,10 @@ func (c *ChainScoped) BlockEmissionIdleWarningThreshold() time.Duration {
func (c *ChainScoped) Validate() (err error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jmank88 I think this check will now fail in libocr. Is there another place we can move it to?

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean? I don't think we can change libocr types. Why are they tangled up in this?

Copy link
Contributor

@jmank88 jmank88 Apr 10, 2024

Choose a reason for hiding this comment

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

Oh, as long as it is not called by libocr, then yeah I think we can move it somewhere else, but I don't know where off the top of my head. Is there somewhere in the delegate(s) that makes sense? Whenever LocalConfig is actually used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Turns out LocalConfig is used in two places, here and here, and they both call ocr.SanityCheckLocalConfig() afterwards, so I'd say it's ok if we simply remove it from chain_scoped.

// Most per-chain validation is done on startup, but this combines globals as well.
lc := ocrtypes.LocalConfig{
BlockchainTimeout: c.OCR().BlockchainTimeout(),
ContractConfigConfirmations: c.EVM().OCR().ContractConfirmations(),
ContractConfigTrackerPollInterval: c.OCR().ContractPollInterval(),
ContractConfigTrackerSubscribeInterval: c.OCR().ContractSubscribeInterval(),
ContractTransmitterTransmitTimeout: c.EVM().OCR().ContractTransmitterTransmitTimeout(),
DatabaseTimeout: c.EVM().OCR().DatabaseTimeout(),
DataSourceTimeout: c.OCR().ObservationTimeout(),
DataSourceGracePeriod: c.EVM().OCR().ObservationGracePeriod(),
ContractConfigConfirmations: c.EVM().OCR().ContractConfirmations(),
ContractTransmitterTransmitTimeout: c.EVM().OCR().ContractTransmitterTransmitTimeout(),
DatabaseTimeout: c.EVM().OCR().DatabaseTimeout(),
DataSourceGracePeriod: c.EVM().OCR().ObservationGracePeriod(),
}
if ocrerr := ocr.SanityCheckLocalConfig(lc); ocrerr != nil {
err = multierr.Append(err, ocrerr)
Expand Down
2 changes: 0 additions & 2 deletions core/chains/evm/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
"github.com/smartcontractkit/chainlink/v2/core/config"
)

type EVM interface {
Expand Down Expand Up @@ -148,7 +147,6 @@ type NodePool interface {
//
//go:generate mockery --quiet --name ChainScopedConfig --output ./mocks/ --case=underscore
type ChainScopedConfig interface {
config.AppConfig
Validate() error

EVM() EVM
Expand Down
Loading
Loading