Skip to content

Commit

Permalink
Merge branch 'develop' into SHIP-1754-Consolidate-all-FinalityDepth-s…
Browse files Browse the repository at this point in the history
…ettings
  • Loading branch information
Madalosso authored Nov 8, 2024
2 parents 9132246 + 12986aa commit 660f3ce
Show file tree
Hide file tree
Showing 98 changed files with 2,371 additions and 1,293 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-gifts-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#updated Operator UI to support StreamSpec job definition
5 changes: 5 additions & 0 deletions .changeset/thick-chefs-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Enable AutoPurge feature on all affected chains #nops
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
/core/services/ccip @smartcontractkit/ccip
/core/services/ocr2/plugins/ccip @smartcontractkit/ccip

# CCIP
/core/services/ccip @smartcontractkit/ccip
/core/services/ocr2/plugins/ccip @smartcontractkit/ccip

# VRF-related services
/core/services/vrf @smartcontractkit/dev-services @smartcontractkit/core
/core/services/blockhashstore @smartcontractkit/dev-services @smartcontractkit/core
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/delete-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Cleanup Caches

# See:
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries

on:
pull_request:
types:
- closed

jobs:
cleanup-branch-caches:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Check out code
uses: actions/[email protected]

- name: Cleanup Branch Caches
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
contents: read
needs: [build-chainlink, changes]
if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@ca50645120f0f07ed8c0df08175a5d6b3e4ac454 #ctf-run-tests@0.1.2
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 #ctf-run-tests@0.2.0
with:
workflow_name: Run Core E2E Tests For PR
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog Chainlink Core

## 2.18.0 - UNRELEASED
## 2.18.0 - 2024-11-01

### Minor Changes

Expand Down Expand Up @@ -90,12 +90,10 @@
- [#14693](https://github.com/smartcontractkit/chainlink/pull/14693) [`03df8989e8`](https://github.com/smartcontractkit/chainlink/commit/03df8989e8e7549afb05bb49c765c0c07db8669e) Thanks [@ChrisAmora](https://github.com/ChrisAmora)! - #updated Consume Feeds Manager WSRPC protos from Chainlink Protos Repository.
- [#14694](https://github.com/smartcontractkit/chainlink/pull/14694) [`e9b3397f46`](https://github.com/smartcontractkit/chainlink/commit/e9b3397f465e26209c8c8ccfed66aa9595f8246b) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Adjustments for usdc reader tests #internal
- [#14624](https://github.com/smartcontractkit/chainlink/pull/14624) [`be774f00a9`](https://github.com/smartcontractkit/chainlink/commit/be774f00a961d9a7361d9ae5b10c97996f7ab164) Thanks [@mateusz-sekara](https://github.com/mateusz-sekara)! - Registering USDC/CCTP events in the ChainReader during oracle creation #internal
- [#14534](https://github.com/smartcontractkit/chainlink/pull/14534) [`de268e98b8`](https://github.com/smartcontractkit/chainlink/commit/de268e98b8d68a284e1260297925b91c5d2411bc) Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - - register polling subscription to avoid subscription leaking when rpc client gets closed.

- [#14534](https://github.com/smartcontractkit/chainlink/pull/14534) [`de268e98b8`](https://github.com/smartcontractkit/chainlink/commit/de268e98b8d68a284e1260297925b91c5d2411bc) Thanks [@huangzhen1997](https://github.com/huangzhen1997)!
- 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

- fix a deadlock in poller, by using a new lock for subs slice in rpc client. #bugfix
- [#14656](https://github.com/smartcontractkit/chainlink/pull/14656) [`004a0de233`](https://github.com/smartcontractkit/chainlink/commit/004a0de2337b0312558ae7c045e7fc2fb4a05916) Thanks [@dimkouv](https://github.com/dimkouv)! - #added graceful shutdown for ccip oracles
- [#14720](https://github.com/smartcontractkit/chainlink/pull/14720) [`4f8c55eb01`](https://github.com/smartcontractkit/chainlink/commit/4f8c55eb01b5823f43f49761344e92dc37ec0114) Thanks [@vyzaldysanchez](https://github.com/vyzaldysanchez)! - #updated Refactors store_db
- [#14530](https://github.com/smartcontractkit/chainlink/pull/14530) [`2c16f46311`](https://github.com/smartcontractkit/chainlink/commit/2c16f4631184a6e3da7f2f3957173500e2c4837b) Thanks [@Madalosso](https://github.com/Madalosso)! - #updated default config values for FinalityTagEnabled to match CCIP configs
Expand All @@ -108,6 +106,7 @@
- [#14668](https://github.com/smartcontractkit/chainlink/pull/14668) [`dacb6a8c70`](https://github.com/smartcontractkit/chainlink/commit/dacb6a8c708e8d7cb94aa63ae7463f58a38d0e59) Thanks [@winder](https://github.com/winder)! - #internal ccip contract reader config.
- [#14814](https://github.com/smartcontractkit/chainlink/pull/14814) [`f708ebb094`](https://github.com/smartcontractkit/chainlink/commit/f708ebb094ecd6f4f77e9c480ceacd250fc1fadc) Thanks [@DylanTinianov](https://github.com/DylanTinianov)! - Fix testWSServer issue causing panic in testing #internal
- [#14635](https://github.com/smartcontractkit/chainlink/pull/14635) [`ee1d6e3b1a`](https://github.com/smartcontractkit/chainlink/commit/ee1d6e3b1a60dc657a5cab869aac0897e33dc76d) Thanks [@dhaidashenko](https://github.com/dhaidashenko)! - Hedera chain type: broadcast transactions only to a single healthy RPC instead of all healthy RPCs to avoid redundant relay fees. #changed
- [#15031](https://github.com/smartcontractkit/chainlink/pull/15031) [`6951f9e74a`](https://github.com/smartcontractkit/chainlink/commit/6951f9e74ae016fab1548b682d4fd8ed5b818d3c) Thanks [@ogtownsend](https://github.com/ogtownsend)! - #bugfix Update DA oracle config struct members to pointers

## 2.17.0 - 2024-10-10

Expand Down
1 change: 1 addition & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ golangci-lint: ## Run golangci-lint for all issues.

.PHONY: modgraph
modgraph:
go install github.com/jmank88/[email protected]
./tools/bin/modgraph > go.md

.PHONY: test-short
Expand Down
5 changes: 5 additions & 0 deletions ccip/config/evm/Linea_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ HistoryDepth = 350
# FinalityDepth > 1k => FinalityTagBypass = false
# https://chainlink-core.slack.com/archives/C07RA1B58CC/p1730983397689179?thread_ts=1730908333.814809&cid=C07RA1B58CC
FinalityTagBypass = false

[Transactions.AutoPurge]
Enabled = true
Threshold = 50 # 50 blocks at 3s block time ~2.5 minutes
MinAttempts = 3
5 changes: 5 additions & 0 deletions ccip/config/evm/Linea_Sepolia.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ HistoryDepth = 1000
# FinalityDepth > 1k => FinalityTagBypass = false
# https://chainlink-core.slack.com/archives/C07RA1B58CC/p1730983397689179?thread_ts=1730908333.814809&cid=C07RA1B58CC
FinalityTagBypass = false

[Transactions.AutoPurge]
Enabled = true
Threshold = 50 # 50 blocks at 3s block time ~2.5 minutes
MinAttempts = 3
4 changes: 4 additions & 0 deletions ccip/config/evm/Polygon_Zkevm_Cardona.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ HistoryDepth = 2000
# FinalityDepth > 1k => FinalityTagBypass = false
# https://chainlink-core.slack.com/archives/C07RA1B58CC/p1730983397689179?thread_ts=1730908333.814809&cid=C07RA1B58CC
FinalityTagBypass = false

[Transactions.AutoPurge]
Enabled = true
MinAttempts = 3
4 changes: 4 additions & 0 deletions ccip/config/evm/Polygon_Zkevm_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ BlockHistorySize = 12
[HeadTracker]
# Polygon suffers from a tremendous number of re-orgs, we need to set this to something very large to be conservative enough
HistoryDepth = 2000

[Transactions.AutoPurge]
Enabled = true
MinAttempts = 3
4 changes: 4 additions & 0 deletions ccip/config/evm/Scroll_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ FinalityTagBypass = false

[OCR]
ContractConfirmations = 1

[Transactions.AutoPurge]
Enabled = true
DetectionApiUrl = 'https://venus.scroll.io'
4 changes: 4 additions & 0 deletions ccip/config/evm/Scroll_Sepolia.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ FinalityTagBypass = false

[OCR]
ContractConfirmations = 1

[Transactions.AutoPurge]
Enabled = true
DetectionApiUrl = 'https://sepolia-venus.scroll.io'
4 changes: 4 additions & 0 deletions ccip/config/evm/XLayer_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ BlockHistorySize = 12

[HeadTracker]
HistoryDepth = 2000

[Transactions.AutoPurge]
Enabled = true
MinAttempts = 3
4 changes: 4 additions & 0 deletions ccip/config/evm/XLayer_Sepolia.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ HistoryDepth = 2000
# FinalityDepth > 1k => FinalityTagBypass = false
# https://chainlink-core.slack.com/archives/C07RA1B58CC/p1730983397689179?thread_ts=1730908333.814809&cid=C07RA1B58CC
FinalityTagBypass = false

[Transactions.AutoPurge]
Enabled = true
MinAttempts = 3
36 changes: 36 additions & 0 deletions ccip/config/evm/Zircuit_Mainnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ChainID = '48900'
ChainType = 'optimismBedrock'
FinalityTagEnabled = true
FinalityDepth = 1000
LinkContractAddress = '0x5D6d033B4FbD2190D99D930719fAbAcB64d2439a'
LogPollInterval = "2s"
NoNewHeadsThreshold = "40s"
NoNewFinalizedHeadsThreshold = "15m"

[GasEstimator]
EIP1559DynamicFees = true
PriceMin = '1 wei'
BumpMin = '100 wei'

[GasEstimator.BlockHistory]
BlockHistorySize = 24

[Transactions]
ResendAfterThreshold = '30s'

[HeadTracker]
HistoryDepth = 2000

[NodePool]
SyncThreshold = 10

[OCR]
ContractConfirmations = 1

[OCR2.Automation]
GasLimit = 6500000

[Transactions.AutoPurge]
Enabled = true
Threshold = 90 # 90 blocks at 2s block time ~3 minutes
MinAttempts = 3
36 changes: 36 additions & 0 deletions ccip/config/evm/Zircuit_Sepolia.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ChainID = '48899'
ChainType = 'optimismBedrock'
FinalityTagEnabled = true
FinalityDepth = 1000
LinkContractAddress = '0xDEE94506570cA186BC1e3516fCf4fd719C312cCD'
LogPollInterval = "2s"
NoNewHeadsThreshold = "40s"
NoNewFinalizedHeadsThreshold = "15m"

[GasEstimator]
EIP1559DynamicFees = true
PriceMin = '1 wei'
BumpMin = '100 wei'

[GasEstimator.BlockHistory]
BlockHistorySize = 60

[Transactions]
ResendAfterThreshold = '30s'

[HeadTracker]
HistoryDepth = 2000

[NodePool]
SyncThreshold = 10

[OCR]
ContractConfirmations = 1

[OCR2.Automation]
GasLimit = 6500000

[Transactions.AutoPurge]
Enabled = true
Threshold = 90 # 90 blocks at 2s block time ~3 minutes
MinAttempts = 3
12 changes: 6 additions & 6 deletions common/txmgr/confirmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,12 +1078,12 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Ens
}

// Here, we rely on the finalized block provided in the chain instead of the one
//provided via a dedicated method to avoid the false warning of the chain being
//too short. When `FinalityTagBypass = true,` HeadTracker tracks `finality depth
//+ history depth` to prevent excessive CPU usage. Thus, the provided chain may
//be shorter than the chain from the latest to the latest finalized, marked with
//a tag. A proper fix of this issue and complete switch to finality tag support
//will be introduced in BCFR-620
// provided via a dedicated method to avoid the false warning of the chain being
// too short. When `FinalityTagBypass = true,` HeadTracker tracks `finality depth
// + history depth` to prevent excessive CPU usage. Thus, the provided chain may
// be shorter than the chain from the latest to the latest finalized, marked with
// a tag. A proper fix of this issue and complete switch to finality tag support
// will be introduced in BCFR-620
latestFinalized := head.LatestFinalizedHead()
if latestFinalized == nil || !latestFinalized.IsValid() {
if ec.nConsecutiveBlocksChainTooShort > logAfterNConsecutiveBlocksChainTooShort {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ func makeTestEvmTxm(
keyStore keystore.Eth) (txmgr.TxManager, gas.EvmFeeEstimator) {
config, dbConfig, evmConfig := MakeTestConfigs(t)

estimator, err := gas.NewEstimator(logger.TestLogger(t), ethClient, config.ChainType(), evmConfig.GasEstimator(), nil)
estimator, err := gas.NewEstimator(logger.TestLogger(t), ethClient, config.ChainType(), ethClient.ConfiguredChainID(), evmConfig.GasEstimator(), nil)
require.NoError(t, err, "failed to create gas estimator")

lggr := logger.TestLogger(t)
Expand Down
3 changes: 2 additions & 1 deletion core/capabilities/integration_tests/keystone/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ consensus:
observations:
- "$(trigger.outputs)"
config:
report_id: "0001"
report_id: "0001"
key_id: "evm"
aggregation_method: "data_feeds"
aggregation_config:
feeds:
Expand Down
1 change: 1 addition & 0 deletions core/capabilities/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (w *launcher) addRemoteCapabilities(ctx context.Context, myDON registrysync
codec,
signers,
int(remoteDON.F+1),
info.ID,
w.lggr,
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/capabilities/streams/trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestStreamsTrigger(t *testing.T) {
lggr := logger.TestLogger(t)
ctx := testutils.Context(t)
codec := streams.NewCodec(lggr)
agg := triggers.NewMercuryRemoteAggregator(codec, allowedSigners, F, lggr)
agg := triggers.NewMercuryRemoteAggregator(codec, allowedSigners, F, "[email protected]", lggr)

capInfo := capabilities.CapabilityInfo{
ID: triggerID,
Expand Down
6 changes: 3 additions & 3 deletions core/chains/evm/client/chain_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type Client interface {
SuggestGasPrice(ctx context.Context) (*big.Int, error)
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
LatestBlockHeight(ctx context.Context) (*big.Int, error)
FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error)
FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error)

HeaderByNumber(ctx context.Context, n *big.Int) (*types.Header, error)
HeaderByHash(ctx context.Context, h common.Hash) (*types.Header, error)
Expand Down Expand Up @@ -473,12 +473,12 @@ func (c *chainClient) LatestFinalizedBlock(ctx context.Context) (*evmtypes.Head,
return r.LatestFinalizedBlock(ctx)
}

func (c *chainClient) FeeHistory(ctx context.Context, blockCount uint64, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) {
func (c *chainClient) FeeHistory(ctx context.Context, blockCount uint64, lastBlock *big.Int, rewardPercentiles []float64) (feeHistory *ethereum.FeeHistory, err error) {
r, err := c.multiNode.SelectRPC()
if err != nil {
return feeHistory, err
}
return r.FeeHistory(ctx, blockCount, rewardPercentiles)
return r.FeeHistory(ctx, blockCount, lastBlock, rewardPercentiles)
}

func (c *chainClient) CheckTxValidity(ctx context.Context, from common.Address, to common.Address, data []byte) *SendError {
Expand Down
Loading

0 comments on commit 660f3ce

Please sign in to comment.