Skip to content

Commit

Permalink
merge with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Sep 30, 2024
2 parents 15914b8 + 02472a6 commit d0ee053
Show file tree
Hide file tree
Showing 128 changed files with 2,263 additions and 494 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-pillows-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#added Add RMNRemote in the chain reader definition
5 changes: 5 additions & 0 deletions .changeset/fifty-pillows-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Added `EVM.HeadTracker.PersistenceEnabled` config option to disable persistence for HeadTracker. #added
5 changes: 5 additions & 0 deletions .changeset/fresh-falcons-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#added solana: compute unit limit configuration and transaction instruction
5 changes: 5 additions & 0 deletions .changeset/honest-cameras-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Implementing evm specific token data encoder for CCIP #internal
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/nervous-books-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#internal Updated QueryKey to be able to do advanced queries on contract event data words
5 changes: 5 additions & 0 deletions .changeset/ninety-feet-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#updated default config values for FinalityTagEnabled to match CCIP configs
5 changes: 5 additions & 0 deletions .changeset/tidy-apricots-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#added Pass the home chain selector to the commit plugin factory
2 changes: 1 addition & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
contents: read
# For golangci-lint-action's `only-new-issues` option.
pull-requests: read
runs-on: ubuntu22.04-8cores-32GB
runs-on: ubuntu-24.04-8cores-32GB-ARM
needs: [filter]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/crib-integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CRIB Integration Tests
on:
pull_request:
paths:
- ".github/workflows/crib-integration-test.yml"
schedule:
- cron: "0 1 * * *"
workflow_call:
Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
echo $GITHUB_WORKSPACE
- name: Deploy and validate CRIB Environment for Core
uses: smartcontractkit/.github/actions/crib-deploy-environment@4dd21a9d6e3f1383ffe8b9650b55f6e6031d3d0a # crib-deploy-environment@1.0.0
uses: smartcontractkit/.github/actions/crib-deploy-environment@fa63a0fb95039c4d89fec6a9a78b53c0cacf5457 # crib-deploy-environment@2.0.0
id: deploy-crib
with:
github-token: ${{ steps.token.outputs.access-token }}
Expand All @@ -83,7 +86,7 @@ jobs:
ecr-private-registry: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
ingress-base-domain: ${{ secrets.INGRESS_BASE_DOMAIN_STAGE }}
k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }}
devspace-profiles: "local-dev-simulated-core-ocr1"
command: "core-dev-simulated-core-ocr1"
crib-alert-slack-webhook: ${{ secrets.CRIB_ALERT_SLACK_WEBHOOK }}
product-image: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/chainlink
product-image-tag: develop
Expand All @@ -103,6 +106,8 @@ jobs:
SETH_LOG_LEVEL: info
# RESTY_DEBUG: true
TEST_PERSISTENCE: true
E2E_TEST_CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink
E2E_TEST_CHAINLINK_VERSION: latest
run: |-
go test -v -run TestCRIBChaos
- name: Destroy CRIB Environment
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:

lint-integration-tests:
name: Lint ${{ matrix.project.name }}
runs-on: ubuntu22.04-8cores-32GB
runs-on: ubuntu-24.04-8cores-32GB-ARM
# We don't directly merge dependabot PRs, so let's not waste the resources
if: github.actor != 'dependabot[bot]'
strategy:
Expand Down Expand Up @@ -665,11 +665,19 @@ jobs:
with:
repository: smartcontractkit/chainlink-solana
ref: ${{ needs.get_solana_sha.outputs.sha }}
- name: Download Artifacts
if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false'
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: artifacts
path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
- name: Build Test Image
if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false'
uses: smartcontractkit/.github/actions/ctf-build-test-image@a5e4f4c8fbb8e15ab2ad131552eca6ac83c4f4b3 # [email protected]
with:
repository: chainlink-solana-tests
tag: ${{ needs.get_solana_sha.outputs.sha }}
suites: smoke
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
Expand Down
3 changes: 3 additions & 0 deletions ccip/config/evm/Avalanche_ANZ_testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ PriceMin = '25 gwei'

[GasEstimator.BlockHistory]
BlockHistorySize = 24

[HeadTracker]
PersistenceEnabled = false
1 change: 1 addition & 0 deletions ccip/config/evm/Avalanche_Fuji.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ BlockHistorySize = 24

[HeadTracker]
FinalityTagBypass = false
PersistenceEnabled = false
3 changes: 3 additions & 0 deletions ccip/config/evm/Avalanche_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ PriceMin = '25 gwei'
[GasEstimator.BlockHistory]
# Average block time of 2s
BlockHistorySize = 24

[HeadTracker]
PersistenceEnabled = false
1 change: 1 addition & 0 deletions ccip/config/evm/BSC_Testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ BlockHistorySize = 24
HistoryDepth = 100
SamplingInterval = '1s'
FinalityTagBypass = false
PersistenceEnabled = false

[OCR]
DatabaseTimeout = '2s'
Expand Down
1 change: 1 addition & 0 deletions ccip/config/evm/Celo_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ BlockHistorySize = 12

[HeadTracker]
HistoryDepth = 50
PersistenceEnabled = false
1 change: 1 addition & 0 deletions ccip/config/evm/Celo_Testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ BlockHistorySize = 24

[HeadTracker]
HistoryDepth = 50
PersistenceEnabled = false
1 change: 1 addition & 0 deletions ccip/config/evm/Simulated.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PriceMax = '100 micro'
HistoryDepth = 10
MaxBufferSize = 100
SamplingInterval = '0s'
PersistenceEnabled = false

[OCR]
ContractConfirmations = 1
3 changes: 3 additions & 0 deletions ccip/config/evm/WeMix_Mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ ContractConfirmations = 1
[GasEstimator]
EIP1559DynamicFees = true
TipCapDefault = '100 gwei'

[HeadTracker]
PersistenceEnabled = false
1 change: 1 addition & 0 deletions ccip/config/evm/WeMix_Testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ TipCapDefault = '100 gwei'

[HeadTracker]
FinalityTagBypass = false
PersistenceEnabled = false
1 change: 1 addition & 0 deletions common/headtracker/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ type HeadTrackerConfig interface {
SamplingInterval() time.Duration
FinalityTagBypass() bool
MaxAllowedFinalityDepth() uint32
PersistenceEnabled() bool
}
10 changes: 10 additions & 0 deletions contracts/.changeset/tall-donkeys-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@chainlink/contracts': minor
---

#internal Updated ChainReaderTester to include dynamic and static nested structs in TestStruct


PR issue: BCFR-44

Solidity Review issue: BCFR-957
74 changes: 61 additions & 13 deletions contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,41 @@ struct TestStruct {
address Account;
address[] Accounts;
int192 BigField;
MidLevelTestStruct NestedStruct;
MidLevelDynamicTestStruct NestedDynamicStruct;
MidLevelStaticTestStruct NestedStaticStruct;
}

struct MidLevelTestStruct {
struct MidLevelDynamicTestStruct {
bytes2 FixedBytes;
InnerTestStruct Inner;
InnerDynamicTestStruct Inner;
}

struct InnerTestStruct {
struct InnerDynamicTestStruct {
int64 IntVal;
string S;
}

struct MidLevelStaticTestStruct {
bytes2 FixedBytes;
InnerStaticTestStruct Inner;
}

struct InnerStaticTestStruct {
int64 IntVal;
address A;
}

contract ChainReaderTester {
event Triggered(
int32 indexed field,
uint8 oracleId,
MidLevelDynamicTestStruct nestedDynamicStruct,
MidLevelStaticTestStruct nestedStaticStruct,
uint8[32] oracleIds,
address Account,
address[] Accounts,
string differentField,
int192 bigField,
MidLevelTestStruct nestedStruct
int192 bigField
);

event TriggeredEventWithDynamicTopic(string indexed fieldHash, string field);
Expand Down Expand Up @@ -61,9 +73,22 @@ contract ChainReaderTester {
address account,
address[] calldata accounts,
int192 bigField,
MidLevelTestStruct calldata nestedStruct
MidLevelDynamicTestStruct calldata nestedDynamicStruct,
MidLevelStaticTestStruct calldata nestedStaticStruct
) public {
s_seen.push(TestStruct(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct));
s_seen.push(
TestStruct(
field,
differentField,
oracleId,
oracleIds,
account,
accounts,
bigField,
nestedDynamicStruct,
nestedStaticStruct
)
);
}

function setAlterablePrimitiveValue(uint64 value) public {
Expand All @@ -78,9 +103,21 @@ contract ChainReaderTester {
address account,
address[] calldata accounts,
int192 bigField,
MidLevelTestStruct calldata nestedStruct
MidLevelDynamicTestStruct calldata nestedDynamicStruct,
MidLevelStaticTestStruct calldata nestedStaticStruct
) public pure returns (TestStruct memory) {
return TestStruct(field, differentField, oracleId, oracleIds, account, accounts, bigField, nestedStruct);
return
TestStruct(
field,
differentField,
oracleId,
oracleIds,
account,
accounts,
bigField,
nestedDynamicStruct,
nestedStaticStruct
);
}

function getElementAtIndex(uint256 i) public view returns (TestStruct memory) {
Expand Down Expand Up @@ -110,14 +147,25 @@ contract ChainReaderTester {
function triggerEvent(
int32 field,
uint8 oracleId,
MidLevelDynamicTestStruct calldata nestedDynamicStruct,
MidLevelStaticTestStruct calldata nestedStaticStruct,
uint8[32] calldata oracleIds,
address account,
address[] calldata accounts,
string calldata differentField,
int192 bigField,
MidLevelTestStruct calldata nestedStruct
int192 bigField
) public {
emit Triggered(field, oracleId, oracleIds, account, accounts, differentField, bigField, nestedStruct);
emit Triggered(
field,
oracleId,
nestedDynamicStruct,
nestedStaticStruct,
oracleIds,
account,
accounts,
differentField,
bigField
);
}

function triggerEventWithDynamicTopic(string calldata field) public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func Test_USDCReader_MessageHashes(t *testing.T) {
emitMessageSent(t, ts, ethereumDomainCCTP, polygonDomainCCTP, 31)
emitMessageSent(t, ts, ethereumDomainCCTP, polygonDomainCCTP, 41)

// Need to replay as sometimes the logs are not picked up by the log poller (?)
// Maybe another situation where chain reader doesn't register filters as expected.
require.NoError(t, ts.lp.Replay(ctx, 1))

tt := []struct {
name string
tokens map[exectypes.MessageTokenID]cciptypes.RampTokenAmount
Expand Down Expand Up @@ -198,7 +202,7 @@ func Test_USDCReader_MessageHashes(t *testing.T) {
}
}
return true
}, tests.WaitTimeout(t), 100*time.Millisecond)
}, tests.WaitTimeout(t), 50*time.Millisecond)
})
}
}
Expand Down Expand Up @@ -286,6 +290,7 @@ func testSetup(ctx context.Context, t *testing.T, readerChain cciptypes.ChainSel
auth: auth,
cl: cl,
reader: cr,
lp: lp,
}
}

Expand All @@ -296,4 +301,5 @@ type testSetupData struct {
auth *bind.TransactOpts
cl client.Client
reader types.ContractReader
lp logpoller.LogPoller
}
38 changes: 38 additions & 0 deletions core/capabilities/ccip/ccipevm/tokendata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package ccipevm

import (
"context"

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"

"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
)

type usdcAttestationPayload struct {
Message []byte
Attestation []byte
}

func (m usdcAttestationPayload) AbiString() string {
return `
[{
"components": [
{"name": "message", "type": "bytes"},
{"name": "attestation", "type": "bytes"}
],
"type": "tuple"
}]`
}

type EVMTokenDataEncoder struct{}

func NewEVMTokenDataEncoder() EVMTokenDataEncoder {
return EVMTokenDataEncoder{}
}

func (e EVMTokenDataEncoder) EncodeUSDC(_ context.Context, message cciptypes.Bytes, attestation cciptypes.Bytes) (cciptypes.Bytes, error) {
return abihelpers.EncodeAbiStruct(usdcAttestationPayload{
Message: message,
Attestation: attestation,
})
}
Loading

0 comments on commit d0ee053

Please sign in to comment.