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 26 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/four-shoes-trade.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": patch
---

Removed AppConfig from Evm config #internal
28 changes: 1 addition & 27 deletions core/chains/evm/config/chain_scoped.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,21 @@ import (
"math/big"
"time"

"go.uber.org/multierr"

ocr "github.com/smartcontractkit/libocr/offchainreporting"
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types"

"github.com/smartcontractkit/chainlink-common/pkg/assets"
"github.com/smartcontractkit/chainlink-common/pkg/logger"

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 @@ -44,24 +36,6 @@ func (c *ChainScoped) BlockEmissionIdleWarningThreshold() time.Duration {
return c.EVM().NodeNoNewHeadsThreshold()
}

func (c *ChainScoped) Validate() (err error) {
// 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(),
}
if ocrerr := ocr.SanityCheckLocalConfig(lc); ocrerr != nil {
err = multierr.Append(err, ocrerr)
}
return
}

type EVMConfig struct {
C *toml.EVMConfig
}
Expand Down
4 changes: 0 additions & 4 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,8 +147,5 @@ type NodePool interface {
//
//go:generate mockery --quiet --name ChainScopedConfig --output ./mocks/ --case=underscore
type ChainScopedConfig interface {
config.AppConfig
Validate() error

EVM() EVM
}
Loading
Loading