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

Feature/optional ws url #1534

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7c1c746
cherry-pick - feat: Add support for parsing deployed 1.0 contracts wh…
AnieeG Aug 27, 2024
5c71121
Bump chain-selectors => v1.0.23 (#1395)
friedemannf Aug 30, 2024
a44b9c2
Fix RPCClient Deadlock on Unsubscribe and NewHead (#14236) (#1426)
0xnogo Sep 11, 2024
22d3d18
Bump version for CCIP 2.14.0-ccip1.5.2
0xnogo Sep 12, 2024
16dda4c
Gas limit estimation feature (#14041)
amit-momin Aug 22, 2024
3290ed3
Set From address for gas limit estimation feature (#14246)
amit-momin Aug 27, 2024
ee84efc
Update EstimateGasLimit config name to EstimateLimit (#14297)
amit-momin Sep 3, 2024
d2cd08f
Add Mantle errors (#14053)
DylanTinianov Aug 8, 2024
1493add
Changed Optimism L1 Oracle to support Mantle (#14160)
ma33r Aug 22, 2024
57e10f6
Mantle use vanilla l1 oracle (#14471)
matYang Sep 18, 2024
74ed3a2
FeeHistory estimator (#13833)
dimriou Sep 4, 2024
11bdcc3
Add node level OOC error (#14315)
friedemannf Sep 5, 2024
7725c8c
Change Polygon zkEVM to use FeeHistory estimator (#14161)
friedemannf Sep 23, 2024
00c81f8
Add Zircuit Configs (#14541)
friedemannf Sep 24, 2024
2f7705c
Use Astar Chain Type (#1465)
flodesi Sep 25, 2024
e8e20f1
Zp/update mockrouter (#1427)
zeuslawyer Sep 12, 2024
da80ec5
Bump version for CCIP 2.14.0-ccip1.5.3
valerii-kabisov-cll Oct 3, 2024
ad546bd
[CCIP-2590] Transfer Data Availability costs to the DAGasEstimator (#…
valerii-kabisov-cll Aug 29, 2024
b84dc2c
[CCIP-3376] Add component into CCIP price estimators to account for c…
valerii-kabisov-cll Sep 24, 2024
b664c36
Revert "Bump version for CCIP 2.14.0-ccip1.5.3"
valerii-kabisov-cll Oct 3, 2024
0d172d1
Bump version for CCIP 2.14.0-ccip1.5.4
valerii-kabisov-cll Oct 3, 2024
943e011
Chore: Change metis config (#1345)
stackman27 Aug 26, 2024
28e5fec
Chore: Metis change (#1485)
stackman27 Oct 4, 2024
047109f
Do not return the error in case if onRamp not initialized (#1487)
valerii-kabisov-cll Oct 4, 2024
890450d
use chain Id as opposed to chain type to identify Mantle (#1489)
matYang Oct 6, 2024
dbe6589
Bump chainselectors cherrypicked (#1493)
fernandezlautaro Oct 8, 2024
5b3e0c2
bump package version
matYang Oct 10, 2024
7711683
updated chain-selectors to 1.0.27 (#1500) (#1502)
simsonraj Oct 15, 2024
a917e9a
Fix Nil pointer error in TXM stuck tx detector (CCIP 1.5) (#1499)
amit-momin Oct 15, 2024
909ecdf
Add Mantle NonceTooLow Error (#14859) (#1505)
matYang Oct 21, 2024
463d5e3
Bump version for CCIP 2.14.0-ccip1.5.6
bukata-sa Oct 23, 2024
d507af3
[CCIP-2611] Report new heads to atlas' OTI (#13647) (#1508)
bukata-sa Oct 23, 2024
4cc3609
Adding TOML configs for B^2, BoB, Berachain, Unichain, Worldchain (#1…
fernandezlautaro Nov 8, 2024
694518d
LogBroadcaster feature flag (#14354)
huangzhen1997 Sep 9, 2024
0a3cb23
support new heads polling over http rpc client (#14373)
huangzhen1997 Sep 23, 2024
7c91b65
tmp fix broken dep
dhaidashenko Nov 9, 2024
8028b5e
fixing multinode state transition logic by register polling subscript…
huangzhen1997 Sep 30, 2024
b5ee3df
WS URL can be optional when LogBroadcaster is disabled (#14364)
huangzhen1997 Oct 3, 2024
9dfa696
Config validation requires ws url when http polling disabled (#14929)
huangzhen1997 Oct 24, 2024
2d049bc
Revert "tmp fix broken dep"
dhaidashenko Nov 9, 2024
b66b04b
remove defaults-override as it was introduced by PR that is not inclu…
dhaidashenko Nov 9, 2024
36815f4
fix lint issue
dhaidashenko Nov 9, 2024
9093754
disable integration-tests linter to unblock run of the tests (linter …
dhaidashenko Nov 12, 2024
494fc05
better way to force run integration tests on linter error
dhaidashenko Nov 12, 2024
acae0ac
Revert "better way to force run integration tests on linter error"
dhaidashenko Nov 12, 2024
9eaef36
Revert "disable integration-tests linter to unblock run of the tests …
dhaidashenko Nov 12, 2024
61f5878
force run integration tests on linter error
dhaidashenko Nov 12, 2024
9ba1ed8
hotfix integration tests failure caused by loki issue
dhaidashenko Nov 12, 2024
9328fed
fix integration tests config validation for loki
dhaidashenko Nov 12, 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/curly-birds-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Fixed deadlock in RPCClient causing CL Node to stop performing RPC requests for the affected chain #bugfix
5 changes: 5 additions & 0 deletions .changeset/curly-onions-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#changed Make Mantle use default OP stack l1 gas oracle in core
5 changes: 5 additions & 0 deletions .changeset/eight-bees-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#bugfix head reporter non-zero reporting period
5 changes: 5 additions & 0 deletions .changeset/four-kangaroos-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Add config validation so it requires ws url when http polling disabled #bugfix
5 changes: 5 additions & 0 deletions .changeset/great-timers-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Updated gas limit estimation feature to set From address #internal
5 changes: 5 additions & 0 deletions .changeset/green-eagles-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Handle zkEVM node level OOC error as TerminallyStuck #internal
11 changes: 11 additions & 0 deletions .changeset/happy-feet-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"chainlink": minor
---

This PR introduce few changes:
- Add a new config option `EVM.NodePool.NewHeadsPollInterval` (0 by default indicate disabled), which is an interval for polling new block periodically using http client rather than subscribe to ws feed.
- Updated new head handler for polling new head over http, and register the subscription in node lifecycle logic.
- If the polling new heads is enabled, WS new heads subscription will be replaced with the new http based polling.

Note: There will be another PR for making WS URL optional with some extra condition.
#added
5 changes: 5 additions & 0 deletions .changeset/hot-laws-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal log info on missed finalized head instead of returning an error
5 changes: 5 additions & 0 deletions .changeset/khaki-tigers-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#added #nops Add Zircuit Configs
13 changes: 13 additions & 0 deletions .changeset/kind-numbers-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"chainlink": minor
---

Adding feature flag for `LogBroadcaster` called `LogBroadcasterEnabled`, which is `true` by default to support backwards compatibility.
Adding `LogBroadcasterEnabled` allows certain chains to completely disable the `LogBroadcaster` feature, which is an old feature (getting replaced by logPoller) that only few products are using it:
* OCR1 Median
* *OCR2 Median when ChainReader is disabled
* *pre-OCR2 Keeper
* Flux Monitor
* Direct RequestOCR1 Median

#added
5 changes: 5 additions & 0 deletions .changeset/loud-windows-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Added gas limit estimation feature to EVM gas estimators. Introduced a new config `EVM.GasEstimator.EstimateLimit` to toggle this feature. #added
8 changes: 8 additions & 0 deletions .changeset/moody-rules-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"chainlink": patch
---

- register polling subscription to avoid subscription leaking when rpc client gets closed.
- add a temporary special treatment for SubscribeNewHead before we replace it with SubscribeToHeads. Add a goroutine that forwards new head from poller to caller channel.
- fix a deadlock in poller, by using a new lock for subs slice in rpc client.
#bugfix
5 changes: 5 additions & 0 deletions .changeset/pretty-worms-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Added a custom client error message for Mantle to capture NonceTooLow error. #added
5 changes: 5 additions & 0 deletions .changeset/proud-jokes-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#added Report new heads as a telemetry to OTI
5 changes: 5 additions & 0 deletions .changeset/seven-kiwis-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Added custom client error messages for Mantle to capture InsufficientEth and Fatal errors. #added
5 changes: 5 additions & 0 deletions .changeset/shiny-hornets-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Introduce new gas estimator #internal
8 changes: 8 additions & 0 deletions .changeset/silly-lies-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"chainlink": minor
---

Make websocket URL `WSURL` for `EVM.Nodes` optional, and apply logic so that:
* If WS URL was not provided, SubscribeFilterLogs should fail with an explicit error
* If WS URL was not provided LogBroadcaster should be disabled
#nops
5 changes: 5 additions & 0 deletions .changeset/swift-pumas-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal add head report chain_id
5 changes: 5 additions & 0 deletions .changeset/tender-lemons-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Enable FeeHistory estimator for Polygon zkEVM #nops
5 changes: 5 additions & 0 deletions .changeset/two-mugs-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Edited the Optimism Stack L1 Oracle to add support for Mantle #added
5 changes: 3 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:
only-new-issues: false # disabled for PRs due to unreliability
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
working-directory: ${{ matrix.project.path }}
continue-on-error: true

build-chainlink:
environment: integration
Expand Down Expand Up @@ -584,7 +585,7 @@ jobs:
test_config_chainlink_version: ${{ inputs.evm-ref || github.sha }}
test_config_selected_networks: ${{ env.SELECTED_NETWORKS }}
test_config_logging_run_id: ${{ github.run_id }}
test_config_logstream_log_targets: ${{ vars.LOGSTREAM_LOG_TARGETS }}
test_config_logstream_log_targets: "file"
test_config_test_log_collect: ${{ vars.TEST_LOG_COLLECT }}
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ inputs.evm-ref || github.sha }}${{ matrix.product.tag_suffix }}
Expand All @@ -606,7 +607,7 @@ jobs:
go_coverage_src_dir: /var/tmp/go-coverage
go_coverage_dest_dir: ${{ github.workspace }}/.covdata
DEFAULT_CHAINLINK_IMAGE: ${{ env.CHAINLINK_IMAGE }}
DEFAULT_LOKI_TENANT_ID: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
DEFAULT_LOKI_TENANT_ID: "promtail"
DEFAULT_LOKI_ENDPOINT: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
DEFAULT_LOKI_BASIC_AUTH: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
DEFAULT_GRAFANA_BASE_URL: "http://localhost:8080/primary"
Expand Down
35 changes: 32 additions & 3 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ packages:
feeEstimatorClient:
config:
mockname: FeeEstimatorClient
feeHistoryEstimatorClient:
config:
mockname: FeeHistoryEstimatorClient
EvmEstimator:
github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas/rollups:
interfaces:
Expand Down Expand Up @@ -258,11 +261,20 @@ packages:
ORM:
Runner:
PipelineParamUnmarshaler:
github.com/smartcontractkit/chainlink/v2/core/services/promreporter:
github.com/smartcontractkit/chainlink/v2/core/services/headreporter:
config:
dir: core/internal/mocks
dir: "{{ .InterfaceDir }}"
filename: "{{ .InterfaceName | snakecase }}_mock.go"
inpackage: true
mockname: "Mock{{ .InterfaceName | camelcase }}"
interfaces:
HeadReporter:
PrometheusBackend:
github.com/smartcontractkit/libocr/commontypes:
config:
dir: "common/types/mocks"
interfaces:
MonitoringEndpoint:
github.com/smartcontractkit/chainlink/v2/core/services/relay/evm:
interfaces:
BatchCaller:
Expand Down Expand Up @@ -297,6 +309,15 @@ packages:
interfaces:
Config:
FeeConfig:
github.com/smartcontractkit/chainlink/v2/core/services/telemetry:
config:
dir: "{{ .InterfaceDir }}"
filename: "{{ .InterfaceName | snakecase }}_mock.go"
inpackage: true
mockname: "Mock{{ .InterfaceName | camelcase }}"
interfaces:
MonitoringEndpointGenerator:
IngressAgent:
github.com/smartcontractkit/chainlink/v2/core/services/webhook:
interfaces:
ExternalInitiatorManager:
Expand Down Expand Up @@ -450,7 +471,7 @@ packages:
filename: optimism_portal2_interface.go
outpkg: mock_optimism_portal_2
interfaces:
OptimismPortal2Interface:
OptimismPortal2Interface:
github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_dispute_game_factory:
config:
dir: core/gethwrappers/liquiditymanager/mocks/mock_optimism_dispute_game_factory/
Expand Down Expand Up @@ -481,12 +502,20 @@ packages:
PriceRegistryReader:
config:
filename: price_registry_reader_mock.go
FeeEstimatorConfigReader:
config:
filename: fee_estimator_config_mock.go
TokenPoolReader:
config:
filename: token_pool_reader_mock.go
USDCReader:
config:
filename: usdc_reader_mock.go
github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/estimatorconfig:
interfaces:
GasPriceInterceptor:
config:
filename: gas_price_interceptor_mock.go
github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata/batchreader:
config:
filename: token_pool_batched_reader_mock.go
Expand Down
18 changes: 12 additions & 6 deletions common/client/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type NodeConfig interface {
FinalizedBlockPollInterval() time.Duration
EnforceRepeatableRead() bool
DeathDeclarationDelay() time.Duration
NewHeadsPollInterval() time.Duration
}

type ChainConfig interface {
Expand Down Expand Up @@ -90,14 +91,14 @@ type node[
services.StateMachine
lfcLog logger.Logger
name string
id int32
id int
chainID CHAIN_ID
nodePoolCfg NodeConfig
chainCfg ChainConfig
order int32
chainFamily string

ws url.URL
ws *url.URL
http *url.URL

rpc RPC
Expand All @@ -120,10 +121,10 @@ func NewNode[
nodeCfg NodeConfig,
chainCfg ChainConfig,
lggr logger.Logger,
wsuri url.URL,
wsuri *url.URL,
httpuri *url.URL,
name string,
id int32,
id int,
chainID CHAIN_ID,
nodeOrder int32,
rpc RPC,
Expand All @@ -135,8 +136,10 @@ func NewNode[
n.chainID = chainID
n.nodePoolCfg = nodeCfg
n.chainCfg = chainCfg
n.ws = wsuri
n.order = nodeOrder
if wsuri != nil {
n.ws = wsuri
}
if httpuri != nil {
n.http = httpuri
}
Expand All @@ -156,7 +159,10 @@ func NewNode[
}

func (n *node[CHAIN_ID, HEAD, RPC]) String() string {
s := fmt.Sprintf("(%s)%s:%s", Primary.String(), n.name, n.ws.String())
s := fmt.Sprintf("(%s)%s", Primary.String(), n.name)
if n.ws != nil {
s = s + fmt.Sprintf(":%s", n.ws.String())
}
if n.http != nil {
s = s + fmt.Sprintf(":%s", n.http.String())
}
Expand Down
9 changes: 7 additions & 2 deletions common/client/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ type testNodeConfig struct {
enforceRepeatableRead bool
finalizedBlockPollInterval time.Duration
deathDeclarationDelay time.Duration
newHeadsPollInterval time.Duration
}

func (n testNodeConfig) NewHeadsPollInterval() time.Duration {
return n.newHeadsPollInterval
}

func (n testNodeConfig) PollFailureThreshold() uint32 {
Expand Down Expand Up @@ -62,10 +67,10 @@ type testNodeOpts struct {
config testNodeConfig
chainConfig clientMocks.ChainConfig
lggr logger.Logger
wsuri url.URL
wsuri *url.URL
httpuri *url.URL
name string
id int32
id int
chainID types.ID
nodeOrder int32
rpc *mockNodeClient[types.ID, Head]
Expand Down
3 changes: 2 additions & 1 deletion common/fee/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var (
ErrBumpFeeExceedsLimit = errors.New("fee bump exceeds limit")
ErrBump = errors.New("fee bump failed")
ErrConnectivity = errors.New("transaction propagation issue: transactions are not being mined")
ErrFeeLimitTooLow = errors.New("provided fee limit too low")
)

func IsBumpErr(err error) bool {
Expand Down Expand Up @@ -63,7 +64,7 @@ func CalculateBumpedFee(
// Returns highest bumped fee price of originalFeePrice bumped by fixed units or percentage.
func MaxBumpedFee(originalFeePrice *big.Int, feeBumpPercent uint16, feeBumpUnits *big.Int) *big.Int {
return bigmath.Max(
addPercentage(originalFeePrice, feeBumpPercent),
AddPercentage(originalFeePrice, feeBumpPercent),
new(big.Int).Add(originalFeePrice, feeBumpUnits),
)
}
Expand Down
2 changes: 1 addition & 1 deletion common/fee/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func ApplyMultiplier(feeLimit uint64, multiplier float32) (uint64, error) {
}

// Returns the input value increased by the given percentage.
func addPercentage(value *big.Int, percentage uint16) *big.Int {
func AddPercentage(value *big.Int, percentage uint16) *big.Int {
bumped := new(big.Int)
bumped.Mul(value, big.NewInt(int64(100+percentage)))
bumped.Div(bumped, big.NewInt(100))
Expand Down
7 changes: 6 additions & 1 deletion common/txmgr/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/utils"

"github.com/smartcontractkit/chainlink/v2/common/client"
commonfee "github.com/smartcontractkit/chainlink/v2/common/fee"
feetypes "github.com/smartcontractkit/chainlink/v2/common/fee/types"
txmgrtypes "github.com/smartcontractkit/chainlink/v2/common/txmgr/types"
"github.com/smartcontractkit/chainlink/v2/common/types"
Expand Down Expand Up @@ -434,7 +435,11 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) hand
}

attempt, _, _, retryable, err := eb.NewTxAttempt(ctx, *etx, eb.lggr)
if err != nil {
// Mark transaction as fatal if provided gas limit is set too low
if errors.Is(err, commonfee.ErrFeeLimitTooLow) {
etx.Error = null.StringFrom(commonfee.ErrFeeLimitTooLow.Error())
return eb.saveFatallyErroredTransaction(eb.lggr, etx), false
} else if err != nil {
return fmt.Errorf("processUnstartedTxs failed on NewAttempt: %w", err), retryable
}

Expand Down
Loading
Loading