From a52422b808105dc302bc159fb52bd1405a7671d7 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Wed, 26 Oct 2022 11:27:27 -0500 Subject: [PATCH] core/web/resolver: test config v2 --- core/web/resolver/config_test.go | 80 +++ .../testdata/config-empty-effective.toml | 191 +++++++ core/web/resolver/testdata/config-full.toml | 362 +++++++++++++ .../config-multi-chain-effective.toml | 507 ++++++++++++++++++ .../resolver/testdata/config-multi-chain.toml | 109 ++++ 5 files changed, 1249 insertions(+) create mode 100644 core/web/resolver/testdata/config-empty-effective.toml create mode 100644 core/web/resolver/testdata/config-full.toml create mode 100644 core/web/resolver/testdata/config-multi-chain-effective.toml create mode 100644 core/web/resolver/testdata/config-multi-chain.toml diff --git a/core/web/resolver/config_test.go b/core/web/resolver/config_test.go index 1491f40930f..01e74d64d1b 100644 --- a/core/web/resolver/config_test.go +++ b/core/web/resolver/config_test.go @@ -1,14 +1,94 @@ package resolver import ( + _ "embed" + "encoding/json" + "fmt" "testing" + "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "gopkg.in/guregu/null.v4" "github.com/smartcontractkit/chainlink/core/internal/testutils/configtest" + "github.com/smartcontractkit/chainlink/core/logger" + "github.com/smartcontractkit/chainlink/core/services/chainlink" ) +var ( + //go:embed testdata/config-empty-effective.toml + configEmptyEffective string + //go:embed testdata/config-full.toml + configFull string + //go:embed testdata/config-multi-chain.toml + configMulti string + //go:embed testdata/config-multi-chain-effective.toml + configMultiEffective string +) + +func TestResolver_ConfigV2(t *testing.T) { + t.Parallel() + + query := ` + query FetchConfigV2 { + configv2 { + user + effective + } + }` + + testCases := []GQLTestCase{ + unauthorizedTestCase(GQLTestCase{query: query}, "configv2"), + { + name: "empty", + authenticated: true, + before: func(f *gqlTestFramework) { + var opts chainlink.GeneralConfigOpts + require.NoError(f.t, opts.ParseTOML("", "")) + cfg, err := opts.New(logger.TestLogger(f.t)) + require.NoError(t, err) + f.App.On("GetConfig").Return(cfg) + }, + query: query, + result: fmt.Sprintf(`{"configv2":{"user":"","effective":%s}}`, mustJSONMarshal(t, configEmptyEffective)), + }, + { + name: "full", + authenticated: true, + before: func(f *gqlTestFramework) { + var opts chainlink.GeneralConfigOpts + require.NoError(f.t, opts.ParseTOML(configFull, "")) + cfg, err := opts.New(logger.TestLogger(f.t)) + require.NoError(t, err) + f.App.On("GetConfig").Return(cfg) + }, + query: query, + result: fmt.Sprintf(`{"configv2":{"user":%s,"effective":%s}}`, mustJSONMarshal(t, configFull), mustJSONMarshal(t, configFull)), + }, + { + name: "partial", + authenticated: true, + before: func(f *gqlTestFramework) { + var opts chainlink.GeneralConfigOpts + require.NoError(f.t, opts.ParseTOML(configMulti, "")) + cfg, err := opts.New(logger.TestLogger(f.t)) + require.NoError(t, err) + f.App.On("GetConfig").Return(cfg) + }, + query: query, + result: fmt.Sprintf(`{"configv2":{"user":%s,"effective":%s}}`, mustJSONMarshal(t, configMulti), mustJSONMarshal(t, configMultiEffective)), + }, + } + + RunGQLTests(t, testCases) +} + +func mustJSONMarshal(t *testing.T, s string) string { + b, err := json.Marshal(s) + require.NoError(t, err) + return string(b) +} + func TestResolver_Config(t *testing.T) { t.Parallel() diff --git a/core/web/resolver/testdata/config-empty-effective.toml b/core/web/resolver/testdata/config-empty-effective.toml new file mode 100644 index 00000000000..3751e1c8557 --- /dev/null +++ b/core/web/resolver/testdata/config-empty-effective.toml @@ -0,0 +1,191 @@ +ExplorerURL = '' +InsecureFastScrypt = false +RootDir = '~/.chainlink' +ShutdownGracePeriod = '5s' + +[Feature] +FeedsManager = false +LogPoller = false +UICSAKeys = false + +[Database] +DefaultIdleInTxSessionTimeout = '1h0m0s' +DefaultLockTimeout = '15s' +DefaultQueryTimeout = '10s' +LogQueries = false +MaxIdleConns = 10 +MaxOpenConns = 20 +MigrateOnStartup = true + +[Database.Backup] +Dir = '' +Frequency = '1h0m0s' +Mode = 'none' +OnVersionUpgrade = true + +[Database.Listener] +MaxReconnectDuration = '10m0s' +MinReconnectInterval = '1m0s' +FallbackPollInterval = '30s' + +[Database.Lock] +LeaseDuration = '10s' +LeaseRefreshInterval = '1s' + +[TelemetryIngress] +UniConn = true +Logging = false +ServerPubKey = '' +URL = '' +BufferSize = 100 +MaxBatchSize = 50 +SendInterval = '500ms' +SendTimeout = '10s' +UseBatchSend = true + +[AuditLogger] +Enabled = false +ForwardToUrl = '' +JsonWrapperKey = '' +Headers = [] + +[Log] +Level = 'info' +JSONConsole = false +UnixTS = false + +[Log.File] +Dir = '' +MaxSize = '5.12gb' +MaxAgeDays = 0 +MaxBackups = 1 + +[WebServer] +AllowOrigins = 'http://localhost:3000,http://localhost:6688' +BridgeResponseURL = '' +HTTPWriteTimeout = '10s' +HTTPPort = 6688 +SecureCookies = true +SessionTimeout = '15m0s' +SessionReaperExpiration = '240h0m0s' + +[WebServer.MFA] +RPID = '' +RPOrigin = '' + +[WebServer.RateLimit] +Authenticated = 1000 +AuthenticatedPeriod = '1m0s' +Unauthenticated = 5 +UnauthenticatedPeriod = '20s' + +[WebServer.TLS] +CertPath = '' +ForceRedirect = false +Host = '' +HTTPSPort = 6689 +KeyPath = '' + +[JobPipeline] +ExternalInitiatorsEnabled = false +MaxRunDuration = '10m0s' +ReaperInterval = '1h0m0s' +ReaperThreshold = '24h0m0s' +ResultWriteQueueDepth = 100 + +[JobPipeline.HTTPRequest] +DefaultTimeout = '15s' +MaxSize = '32.77kb' + +[FluxMonitor] +DefaultTransactionQueueDepth = 1 +SimulateTransactions = false + +[OCR2] +Enabled = false +ContractConfirmations = 3 +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' + +[OCR] +Enabled = false +ObservationTimeout = '5s' +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +DefaultTransactionQueueDepth = 1 +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' +SimulateTransactions = false +TransmitterAddress = '' + +[P2P] +IncomingMessageBufferSize = 10 +OutgoingMessageBufferSize = 10 +PeerID = '' +TraceLogging = false + +[P2P.V1] +Enabled = true +AnnounceIP = '' +AnnouncePort = 0 +BootstrapCheckInterval = '20s' +DefaultBootstrapPeers = [] +DHTAnnouncementCounterUserPrefix = 0 +DHTLookupInterval = 10 +ListenIP = '0.0.0.0' +ListenPort = 0 +NewStreamTimeout = '10s' +PeerstoreWriteInterval = '5m0s' + +[P2P.V2] +Enabled = false +AnnounceAddresses = [] +DefaultBootstrappers = [] +DeltaDial = '15s' +DeltaReconcile = '1m0s' +ListenAddresses = [] + +[Keeper] +DefaultTransactionQueueDepth = 1 +GasPriceBufferPercent = 20 +GasTipCapBufferPercent = 20 +BaseFeeBufferPercent = 20 +MaxGracePeriod = 100 +TurnLookBack = 1000 +TurnFlagEnabled = false +UpkeepCheckGasPriceEnabled = false + +[Keeper.Registry] +CheckGasOverhead = 200000 +PerformGasOverhead = 300000 +MaxPerformDataSize = 5000 +SyncInterval = '30m0s' +SyncUpkeepQueueSize = 10 + +[AutoPprof] +Enabled = false +ProfileRoot = '' +PollInterval = '10s' +GatherDuration = '10s' +GatherTraceDuration = '5s' +MaxProfileSize = '100.00mb' +CPUProfileRate = 1 +MemProfileRate = 1 +BlockProfileRate = 1 +MutexProfileFraction = 1 +MemThreshold = '4.00gb' +GoroutineThreshold = 5000 + +[Pyroscope] +ServerAddress = '' +Environment = 'mainnet' + +[Sentry] +Debug = false +DSN = '' +Environment = '' +Release = '' diff --git a/core/web/resolver/testdata/config-full.toml b/core/web/resolver/testdata/config-full.toml new file mode 100644 index 00000000000..f8bca59ea8f --- /dev/null +++ b/core/web/resolver/testdata/config-full.toml @@ -0,0 +1,362 @@ +ExplorerURL = 'http://explorer.url' +InsecureFastScrypt = true +RootDir = 'test/root/dir' +ShutdownGracePeriod = '10s' + +[Feature] +FeedsManager = true +LogPoller = true +UICSAKeys = true + +[Database] +DefaultIdleInTxSessionTimeout = '1m0s' +DefaultLockTimeout = '1h0m0s' +DefaultQueryTimeout = '1s' +LogQueries = true +MaxIdleConns = 7 +MaxOpenConns = 13 +MigrateOnStartup = true + +[Database.Backup] +Dir = 'test/backup/dir' +Frequency = '1h0m0s' +Mode = 'full' +OnVersionUpgrade = true + +[Database.Listener] +MaxReconnectDuration = '1m0s' +MinReconnectInterval = '5m0s' +FallbackPollInterval = '2m0s' + +[Database.Lock] +LeaseDuration = '1m0s' +LeaseRefreshInterval = '1s' + +[TelemetryIngress] +UniConn = true +Logging = true +ServerPubKey = 'test-pub-key' +URL = 'https://prom.test' +BufferSize = 1234 +MaxBatchSize = 4321 +SendInterval = '1m0s' +SendTimeout = '5s' +UseBatchSend = true + +[AuditLogger] +Enabled = true +ForwardToUrl = 'http://localhost:9898' +JsonWrapperKey = 'event' +Headers = ['Authorization: token', 'X-SomeOther-Header: value with spaces | and a bar+*'] + +[Log] +Level = 'crit' +JSONConsole = true +UnixTS = true + +[Log.File] +Dir = 'log/file/dir' +MaxSize = '100.00gb' +MaxAgeDays = 17 +MaxBackups = 9 + +[WebServer] +AllowOrigins = '*' +BridgeResponseURL = 'https://bridge.response' +HTTPWriteTimeout = '1m0s' +HTTPPort = 56 +SecureCookies = true +SessionTimeout = '1h0m0s' +SessionReaperExpiration = '168h0m0s' + +[WebServer.MFA] +RPID = 'test-rpid' +RPOrigin = 'test-rp-origin' + +[WebServer.RateLimit] +Authenticated = 42 +AuthenticatedPeriod = '1s' +Unauthenticated = 7 +UnauthenticatedPeriod = '1m0s' + +[WebServer.TLS] +CertPath = 'tls/cert/path' +ForceRedirect = true +Host = 'tls-host' +HTTPSPort = 6789 +KeyPath = 'tls/key/path' + +[JobPipeline] +ExternalInitiatorsEnabled = true +MaxRunDuration = '1h0m0s' +ReaperInterval = '4h0m0s' +ReaperThreshold = '168h0m0s' +ResultWriteQueueDepth = 10 + +[JobPipeline.HTTPRequest] +DefaultTimeout = '1m0s' +MaxSize = '100.00mb' + +[FluxMonitor] +DefaultTransactionQueueDepth = 100 +SimulateTransactions = true + +[OCR2] +Enabled = true +ContractConfirmations = 11 +BlockchainTimeout = '3s' +ContractPollInterval = '1h0m0s' +ContractSubscribeInterval = '1m0s' +ContractTransmitterTransmitTimeout = '1m0s' +DatabaseTimeout = '8s' +KeyBundleID = '7a5f66bbe6594259325bf2b4f5b1a9c900000000000000000000000000000000' + +[OCR] +Enabled = true +ObservationTimeout = '11s' +BlockchainTimeout = '3s' +ContractPollInterval = '1h0m0s' +ContractSubscribeInterval = '1m0s' +DefaultTransactionQueueDepth = 12 +KeyBundleID = 'acdd42797a8b921b2910497badc5000600000000000000000000000000000000' +SimulateTransactions = true +TransmitterAddress = '0xa0788FC17B1dEe36f057c42B6F373A34B014687e' + +[P2P] +IncomingMessageBufferSize = 13 +OutgoingMessageBufferSize = 17 +PeerID = '12D3KooWMoejJznyDuEk5aX6GvbjaG12UzeornPCBNzMRqdwrFJw' +TraceLogging = true + +[P2P.V1] +Enabled = false +AnnounceIP = '1.2.3.4' +AnnouncePort = 1234 +BootstrapCheckInterval = '1m0s' +DefaultBootstrapPeers = ['foo', 'bar', 'should', 'these', 'be', 'typed'] +DHTAnnouncementCounterUserPrefix = 4321 +DHTLookupInterval = 9 +ListenIP = '4.3.2.1' +ListenPort = 9 +NewStreamTimeout = '1s' +PeerstoreWriteInterval = '1m0s' + +[P2P.V2] +Enabled = true +AnnounceAddresses = ['a', 'b', 'c'] +DefaultBootstrappers = ['12D3KooWMoejJznyDuEk5aX6GvbjaG12UzeornPCBNzMRqdwrFJw@foo:42/bar:10', '12D3KooWMoejJznyDuEk5aX6GvbjaG12UzeornPCBNzMRqdwrFJw@test:99'] +DeltaDial = '1m0s' +DeltaReconcile = '1s' +ListenAddresses = ['foo', 'bar'] + +[Keeper] +DefaultTransactionQueueDepth = 17 +GasPriceBufferPercent = 12 +GasTipCapBufferPercent = 43 +BaseFeeBufferPercent = 89 +MaxGracePeriod = 31 +TurnLookBack = 91 +TurnFlagEnabled = true +UpkeepCheckGasPriceEnabled = true + +[Keeper.Registry] +CheckGasOverhead = 90 +PerformGasOverhead = 4294967295 +MaxPerformDataSize = 5000 +SyncInterval = '1h0m0s' +SyncUpkeepQueueSize = 31 + +[AutoPprof] +Enabled = true +ProfileRoot = 'prof/root' +PollInterval = '1m0s' +GatherDuration = '12s' +GatherTraceDuration = '13s' +MaxProfileSize = '1.00gb' +CPUProfileRate = 7 +MemProfileRate = 9 +BlockProfileRate = 5 +MutexProfileFraction = 2 +MemThreshold = '1.00gb' +GoroutineThreshold = 999 + +[Pyroscope] +ServerAddress = 'http://localhost:4040' +Environment = 'tests' + +[Sentry] +Debug = true +DSN = 'sentry-dsn' +Environment = 'dev' +Release = 'v1.2.3' + +[[EVM]] +ChainID = '1' +Enabled = false +BlockBackfillDepth = 100 +BlockBackfillSkip = true +ChainType = 'Optimism' +FinalityDepth = 42 +FlagsContractAddress = '0xae4E781a6218A8031764928E88d457937A954fC3' +LinkContractAddress = '0x538aAaB4ea120b2bC2fe5D296852D948F07D849e' +LogBackfillBatchSize = 17 +LogPollInterval = '1m0s' +LogKeepBlocksDepth = 100000 +MinIncomingConfirmations = 13 +MinContractPayment = '9.223372036854775807 link' +NonceAutoSync = true +NoNewHeadsThreshold = '1m0s' +OperatorFactoryAddress = '0xa5B85635Be42F21f94F28034B7DA440EeFF0F418' +RPCDefaultBatchSize = 17 +RPCBlockQueryDelay = 10 + +[EVM.Transactions] +ForwardersEnabled = true +MaxInFlight = 19 +MaxQueued = 99 +ReaperInterval = '1m0s' +ReaperThreshold = '1m0s' +ResendAfterThreshold = '1h0m0s' + +[EVM.BalanceMonitor] +Enabled = true + +[EVM.GasEstimator] +Mode = 'L2Suggested' +PriceDefault = '9.223372036854775807 ether' +PriceMax = '281.474976710655 micro' +PriceMin = '13 wei' +LimitDefault = 12 +LimitMax = 17 +LimitMultiplier = '1.234' +LimitTransfer = 100 +BumpMin = '100 wei' +BumpPercent = 10 +BumpThreshold = 6 +BumpTxDepth = 6 +EIP1559DynamicFees = true +FeeCapDefault = '9.223372036854775807 ether' +TipCapDefault = '2 wei' +TipCapMin = '1 wei' + +[EVM.GasEstimator.LimitJobType] +OCR = 1001 +DR = 1002 +VRF = 1003 +FM = 1004 +Keeper = 1005 + +[EVM.GasEstimator.BlockHistory] +BatchSize = 17 +BlockHistorySize = 12 +CheckInclusionBlocks = 18 +CheckInclusionPercentile = 19 +EIP1559FeeCapBufferBlocks = 13 +TransactionPercentile = 15 + +[EVM.HeadTracker] +HistoryDepth = 15 +MaxBufferSize = 17 +SamplingInterval = '1h0m0s' + +[[EVM.KeySpecific]] +Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' + +[EVM.KeySpecific.GasEstimator] +PriceMax = '79.228162514264337593543950335 gether' + +[EVM.NodePool] +PollFailureThreshold = 5 +PollInterval = '1m0s' +SelectionMode = 'HighestHead' + +[EVM.OCR] +ContractConfirmations = 11 +ContractTransmitterTransmitTimeout = '1m0s' +DatabaseTimeout = '1s' +ObservationGracePeriod = '1s' + +[EVM.OCR2] +[EVM.OCR2.Automation] +GasLimit = 540 + +[[EVM.Nodes]] +Name = 'foo' +WSURL = 'wss://web.socket/test' +HTTPURL = 'https://foo.web' + +[[EVM.Nodes]] +Name = 'bar' +WSURL = 'wss://web.socket/test' +HTTPURL = 'https://bar.com' + +[[EVM.Nodes]] +Name = 'broadcast' +HTTPURL = 'http://broadcast.mirror' +SendOnly = true + +[[Solana]] +ChainID = 'mainnet' +Enabled = false +BalancePollPeriod = '1m0s' +ConfirmPollPeriod = '1s' +OCR2CachePollPeriod = '1m0s' +OCR2CacheTTL = '1h0m0s' +TxTimeout = '1h0m0s' +TxRetryTimeout = '1m0s' +TxConfirmTimeout = '1s' +SkipPreflight = true +Commitment = 'banana' +MaxRetries = 7 + +[[Solana.Nodes]] +Name = 'primary' +URL = 'http://solana.web' + +[[Solana.Nodes]] +Name = 'foo' +URL = 'http://solana.foo' + +[[Solana.Nodes]] +Name = 'bar' +URL = 'http://solana.bar' + +[[Starknet]] +ChainID = 'foobar' +Enabled = true +OCR2CachePollPeriod = '6h0m0s' +OCR2CacheTTL = '3m0s' +RequestTimeout = '1m3s' +TxTimeout = '13s' +TxSendFrequency = '42s' +TxMaxBatchSize = 17 + +[[Starknet.Nodes]] +Name = 'primary' +URL = 'http://stark.node' + +[[Terra]] +ChainID = 'Bombay-12' +Enabled = true +BlockRate = '1m0s' +BlocksUntilTxTimeout = 12 +ConfirmPollPeriod = '1s' +FallbackGasPriceULuna = '0.001' +FCDURL = 'http://terra.com' +GasLimitMultiplier = '1.2' +MaxMsgsPerBatch = 17 +OCR2CachePollPeriod = '1m0s' +OCR2CacheTTL = '1h0m0s' +TxMsgTimeout = '1s' + +[[Terra.Nodes]] +Name = 'primary' +TendermintURL = 'http://tender.mint' + +[[Terra.Nodes]] +Name = 'foo' +TendermintURL = 'http://foo.url' + +[[Terra.Nodes]] +Name = 'bar' +TendermintURL = 'http://bar.web' diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml new file mode 100644 index 00000000000..f7b249e3bac --- /dev/null +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -0,0 +1,507 @@ +ExplorerURL = '' +InsecureFastScrypt = false +RootDir = 'my/root/dir' +ShutdownGracePeriod = '5s' + +[Feature] +FeedsManager = false +LogPoller = false +UICSAKeys = false + +[Database] +DefaultIdleInTxSessionTimeout = '1h0m0s' +DefaultLockTimeout = '15s' +DefaultQueryTimeout = '10s' +LogQueries = false +MaxIdleConns = 10 +MaxOpenConns = 20 +MigrateOnStartup = true + +[Database.Backup] +Dir = '' +Frequency = '1h0m0s' +Mode = 'none' +OnVersionUpgrade = true + +[Database.Listener] +MaxReconnectDuration = '10m0s' +MinReconnectInterval = '1m0s' +FallbackPollInterval = '2m0s' + +[Database.Lock] +LeaseDuration = '10s' +LeaseRefreshInterval = '1s' + +[TelemetryIngress] +UniConn = true +Logging = false +ServerPubKey = '' +URL = '' +BufferSize = 100 +MaxBatchSize = 50 +SendInterval = '500ms' +SendTimeout = '10s' +UseBatchSend = true + +[AuditLogger] +Enabled = true +ForwardToUrl = 'http://localhost:9898' +JsonWrapperKey = 'event' +Headers = ['Authorization: token', 'X-SomeOther-Header: value with spaces | and a bar+*'] + +[Log] +Level = 'panic' +JSONConsole = true +UnixTS = false + +[Log.File] +Dir = '' +MaxSize = '5.12gb' +MaxAgeDays = 0 +MaxBackups = 1 + +[WebServer] +AllowOrigins = 'http://localhost:3000,http://localhost:6688' +BridgeResponseURL = '' +HTTPWriteTimeout = '10s' +HTTPPort = 6688 +SecureCookies = true +SessionTimeout = '15m0s' +SessionReaperExpiration = '240h0m0s' + +[WebServer.MFA] +RPID = '' +RPOrigin = '' + +[WebServer.RateLimit] +Authenticated = 1000 +AuthenticatedPeriod = '1m0s' +Unauthenticated = 5 +UnauthenticatedPeriod = '20s' + +[WebServer.TLS] +CertPath = '' +ForceRedirect = false +Host = '' +HTTPSPort = 6689 +KeyPath = '' + +[JobPipeline] +ExternalInitiatorsEnabled = false +MaxRunDuration = '10m0s' +ReaperInterval = '1h0m0s' +ReaperThreshold = '24h0m0s' +ResultWriteQueueDepth = 100 + +[JobPipeline.HTTPRequest] +DefaultTimeout = '30s' +MaxSize = '32.77kb' + +[FluxMonitor] +DefaultTransactionQueueDepth = 1 +SimulateTransactions = false + +[OCR2] +Enabled = true +ContractConfirmations = 3 +BlockchainTimeout = '20s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '20s' +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' + +[OCR] +Enabled = true +ObservationTimeout = '5s' +BlockchainTimeout = '5s' +ContractPollInterval = '1m0s' +ContractSubscribeInterval = '2m0s' +DefaultTransactionQueueDepth = 1 +KeyBundleID = '0000000000000000000000000000000000000000000000000000000000000000' +SimulateTransactions = false +TransmitterAddress = '' + +[P2P] +IncomingMessageBufferSize = 999 +OutgoingMessageBufferSize = 10 +PeerID = '' +TraceLogging = false + +[P2P.V1] +Enabled = true +AnnounceIP = '' +AnnouncePort = 0 +BootstrapCheckInterval = '20s' +DefaultBootstrapPeers = [] +DHTAnnouncementCounterUserPrefix = 0 +DHTLookupInterval = 10 +ListenIP = '0.0.0.0' +ListenPort = 0 +NewStreamTimeout = '10s' +PeerstoreWriteInterval = '5m0s' + +[P2P.V2] +Enabled = false +AnnounceAddresses = [] +DefaultBootstrappers = [] +DeltaDial = '15s' +DeltaReconcile = '1m0s' +ListenAddresses = [] + +[Keeper] +DefaultTransactionQueueDepth = 1 +GasPriceBufferPercent = 10 +GasTipCapBufferPercent = 20 +BaseFeeBufferPercent = 20 +MaxGracePeriod = 100 +TurnLookBack = 1000 +TurnFlagEnabled = false +UpkeepCheckGasPriceEnabled = false + +[Keeper.Registry] +CheckGasOverhead = 200000 +PerformGasOverhead = 300000 +MaxPerformDataSize = 5000 +SyncInterval = '30m0s' +SyncUpkeepQueueSize = 10 + +[AutoPprof] +Enabled = false +ProfileRoot = '' +PollInterval = '10s' +GatherDuration = '10s' +GatherTraceDuration = '5s' +MaxProfileSize = '100.00mb' +CPUProfileRate = 7 +MemProfileRate = 1 +BlockProfileRate = 1 +MutexProfileFraction = 1 +MemThreshold = '4.00gb' +GoroutineThreshold = 5000 + +[Pyroscope] +ServerAddress = '' +Environment = 'mainnet' + +[Sentry] +Debug = false +DSN = '' +Environment = '' +Release = '' + +[[EVM]] +ChainID = '1' +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 26 +LinkContractAddress = '0x514910771AF9Ca656af840dff83E8264EcF986CA' +LogBackfillBatchSize = 100 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +MinIncomingConfirmations = 3 +MinContractPayment = '0.1 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +OperatorFactoryAddress = '0x3E64Cd889482443324F91bFA9c84fE72A511f48A' +RPCDefaultBatchSize = 100 +RPCBlockQueryDelay = 1 + +[EVM.Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[EVM.BalanceMonitor] +Enabled = true + +[EVM.GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '20 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +BumpTxDepth = 10 +EIP1559DynamicFees = true +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[EVM.GasEstimator.BlockHistory] +BatchSize = 4 +BlockHistorySize = 4 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 50 + +[EVM.HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' + +[EVM.NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' + +[EVM.OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +ObservationGracePeriod = '1s' + +[EVM.OCR2] +[EVM.OCR2.Automation] +GasLimit = 5300000 + +[[EVM.Nodes]] +Name = 'primary' +WSURL = 'wss://web.socket/mainnet' + +[[EVM.Nodes]] +Name = 'secondary' +HTTPURL = 'http://broadcast.mirror' +SendOnly = true + +[[EVM]] +ChainID = '42' +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 50 +LinkContractAddress = '0xa36085F69e2889c224210F603D836748e7dC0088' +LogBackfillBatchSize = 100 +LogPollInterval = '15s' +LogKeepBlocksDepth = 100000 +MinIncomingConfirmations = 3 +MinContractPayment = '0.1 link' +NonceAutoSync = true +NoNewHeadsThreshold = '3m0s' +OperatorFactoryAddress = '0x8007e24251b1D2Fc518Eb843A701d9cD21fe0aA3' +RPCDefaultBatchSize = 100 +RPCBlockQueryDelay = 1 + +[EVM.Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 250 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[EVM.BalanceMonitor] +Enabled = true + +[EVM.GasEstimator] +Mode = 'BlockHistory' +PriceDefault = '9.223372036854775807 ether' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '1 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +BumpMin = '5 gwei' +BumpPercent = 20 +BumpThreshold = 3 +BumpTxDepth = 10 +EIP1559DynamicFees = false +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[EVM.GasEstimator.BlockHistory] +BatchSize = 4 +BlockHistorySize = 4 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 50 + +[EVM.HeadTracker] +HistoryDepth = 100 +MaxBufferSize = 3 +SamplingInterval = '1s' + +[EVM.NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' + +[EVM.OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +ObservationGracePeriod = '1s' + +[EVM.OCR2] +[EVM.OCR2.Automation] +GasLimit = 5300000 + +[[EVM.Nodes]] +Name = 'primary' +WSURL = 'wss://web.socket/test' + +[[EVM]] +ChainID = '137' +BlockBackfillDepth = 10 +BlockBackfillSkip = false +FinalityDepth = 500 +LinkContractAddress = '0xb0897686c545045aFc77CF20eC7A532E3120E0F1' +LogBackfillBatchSize = 100 +LogPollInterval = '1s' +LogKeepBlocksDepth = 100000 +MinIncomingConfirmations = 5 +MinContractPayment = '0.00001 link' +NonceAutoSync = true +NoNewHeadsThreshold = '30s' +RPCDefaultBatchSize = 100 +RPCBlockQueryDelay = 10 + +[EVM.Transactions] +ForwardersEnabled = false +MaxInFlight = 16 +MaxQueued = 5000 +ReaperInterval = '1h0m0s' +ReaperThreshold = '168h0m0s' +ResendAfterThreshold = '1m0s' + +[EVM.BalanceMonitor] +Enabled = true + +[EVM.GasEstimator] +Mode = 'FixedPrice' +PriceDefault = '30 gwei' +PriceMax = '115792089237316195423570985008687907853269984665.640564039457584007913129639935 tether' +PriceMin = '30 gwei' +LimitDefault = 500000 +LimitMax = 500000 +LimitMultiplier = '1' +LimitTransfer = 21000 +BumpMin = '20 gwei' +BumpPercent = 20 +BumpThreshold = 5 +BumpTxDepth = 10 +EIP1559DynamicFees = false +FeeCapDefault = '100 gwei' +TipCapDefault = '1 wei' +TipCapMin = '1 wei' + +[EVM.GasEstimator.BlockHistory] +BatchSize = 4 +BlockHistorySize = 24 +CheckInclusionBlocks = 12 +CheckInclusionPercentile = 90 +TransactionPercentile = 60 + +[EVM.HeadTracker] +HistoryDepth = 2000 +MaxBufferSize = 3 +SamplingInterval = '1s' + +[EVM.NodePool] +PollFailureThreshold = 5 +PollInterval = '10s' +SelectionMode = 'HighestHead' + +[EVM.OCR] +ContractConfirmations = 4 +ContractTransmitterTransmitTimeout = '10s' +DatabaseTimeout = '10s' +ObservationGracePeriod = '1s' + +[EVM.OCR2] +[EVM.OCR2.Automation] +GasLimit = 5300000 + +[[EVM.Nodes]] +Name = 'primary' +WSURL = 'wss://web.socket/test' + +[[Solana]] +ChainID = 'mainnet' +BalancePollPeriod = '5s' +ConfirmPollPeriod = '500ms' +OCR2CachePollPeriod = '1s' +OCR2CacheTTL = '1m0s' +TxTimeout = '1m0s' +TxRetryTimeout = '10s' +TxConfirmTimeout = '30s' +SkipPreflight = true +Commitment = 'confirmed' +MaxRetries = 12 + +[[Solana.Nodes]] +Name = 'primary' +URL = 'http://mainnet.solana.com' + +[[Solana]] +ChainID = 'testnet' +BalancePollPeriod = '5s' +ConfirmPollPeriod = '500ms' +OCR2CachePollPeriod = '1m0s' +OCR2CacheTTL = '1m0s' +TxTimeout = '1m0s' +TxRetryTimeout = '10s' +TxConfirmTimeout = '30s' +SkipPreflight = true +Commitment = 'confirmed' +MaxRetries = 0 + +[[Solana.Nodes]] +Name = 'primary' +URL = 'http://testnet.solana.com' + +[[Starknet]] +ChainID = 'foobar' +OCR2CachePollPeriod = '5s' +OCR2CacheTTL = '1m0s' +RequestTimeout = '10s' +TxTimeout = '1m0s' +TxSendFrequency = '1h0m0s' +TxMaxBatchSize = 100 + +[[Starknet.Nodes]] +Name = 'primary' +URL = 'http://stark.node' + +[[Terra]] +ChainID = 'Columbus-5' +BlockRate = '6s' +BlocksUntilTxTimeout = 30 +ConfirmPollPeriod = '1s' +FallbackGasPriceULuna = '0.015' +FCDURL = '' +GasLimitMultiplier = '1.5' +MaxMsgsPerBatch = 13 +OCR2CachePollPeriod = '4s' +OCR2CacheTTL = '1m0s' +TxMsgTimeout = '10m0s' + +[[Terra.Nodes]] +Name = 'primary' +TendermintURL = 'http://columbus.terra.com' + +[[Terra]] +ChainID = 'Bombay-12' +BlockRate = '6s' +BlocksUntilTxTimeout = 20 +ConfirmPollPeriod = '1s' +FallbackGasPriceULuna = '0.015' +FCDURL = '' +GasLimitMultiplier = '1.5' +MaxMsgsPerBatch = 100 +OCR2CachePollPeriod = '4s' +OCR2CacheTTL = '1m0s' +TxMsgTimeout = '10m0s' + +[[Terra.Nodes]] +Name = 'primary' +TendermintURL = 'http://bombay.terra.com' diff --git a/core/web/resolver/testdata/config-multi-chain.toml b/core/web/resolver/testdata/config-multi-chain.toml new file mode 100644 index 00000000000..05062b3d4ef --- /dev/null +++ b/core/web/resolver/testdata/config-multi-chain.toml @@ -0,0 +1,109 @@ +RootDir = 'my/root/dir' + +[Database] +[Database.Listener] +FallbackPollInterval = '2m0s' + +[AuditLogger] +Enabled = true +ForwardToUrl = 'http://localhost:9898' +JsonWrapperKey = 'event' +Headers = ['Authorization: token', 'X-SomeOther-Header: value with spaces | and a bar+*'] + +[Log] +Level = 'panic' +JSONConsole = true + +[JobPipeline] +[JobPipeline.HTTPRequest] +DefaultTimeout = '30s' + +[OCR2] +Enabled = true +DatabaseTimeout = '20s' + +[OCR] +Enabled = true +BlockchainTimeout = '5s' + +[P2P] +IncomingMessageBufferSize = 999 + +[Keeper] +GasPriceBufferPercent = 10 + +[AutoPprof] +CPUProfileRate = 7 + +[[EVM]] +ChainID = '1' +FinalityDepth = 26 + +[[EVM.Nodes]] +Name = 'primary' +WSURL = 'wss://web.socket/mainnet' + +[[EVM.Nodes]] +Name = 'secondary' +HTTPURL = 'http://broadcast.mirror' +SendOnly = true + +[[EVM]] +ChainID = '42' + +[EVM.GasEstimator] +PriceDefault = '9.223372036854775807 ether' + +[[EVM.Nodes]] +Name = 'primary' +WSURL = 'wss://web.socket/test' + +[[EVM]] +ChainID = '137' + +[EVM.GasEstimator] +Mode = 'FixedPrice' + +[[EVM.Nodes]] +Name = 'primary' +WSURL = 'wss://web.socket/test' + +[[Solana]] +ChainID = 'mainnet' +MaxRetries = 12 + +[[Solana.Nodes]] +Name = 'primary' +URL = 'http://mainnet.solana.com' + +[[Solana]] +ChainID = 'testnet' +OCR2CachePollPeriod = '1m0s' + +[[Solana.Nodes]] +Name = 'primary' +URL = 'http://testnet.solana.com' + +[[Starknet]] +ChainID = 'foobar' +TxSendFrequency = '1h0m0s' + +[[Starknet.Nodes]] +Name = 'primary' +URL = 'http://stark.node' + +[[Terra]] +ChainID = 'Columbus-5' +MaxMsgsPerBatch = 13 + +[[Terra.Nodes]] +Name = 'primary' +TendermintURL = 'http://columbus.terra.com' + +[[Terra]] +ChainID = 'Bombay-12' +BlocksUntilTxTimeout = 20 + +[[Terra.Nodes]] +Name = 'primary' +TendermintURL = 'http://bombay.terra.com'