Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d572faa
Create FinalityCodec.sol
RensR Mar 23, 2026
d5dabce
change data types
RensR Mar 24, 2026
be8c0e8
add clear bit layout
RensR Mar 24, 2026
e10eb67
implement finality config in BaseVerifier
RensR Mar 24, 2026
c80ea01
tests
RensR Mar 24, 2026
310e250
rename token pool block confs & impl pool ftf
RensR Mar 24, 2026
96e7860
exec
RensR Mar 24, 2026
ed0d055
receiver/offramp
RensR Mar 24, 2026
a50ca2a
fix lint & comments
RensR Mar 24, 2026
9b2adcb
Fix comments & clarity
RensR Mar 24, 2026
a0c09fa
fix naming, comments, errors
RensR Mar 25, 2026
7576132
fix tests
RensR Mar 25, 2026
a0ca997
upgrade the example receivers
RensR Mar 25, 2026
4a058fb
use finality tag instead of bytes(0)
RensR Mar 25, 2026
06e4da5
fix compilation settings
RensR Mar 26, 2026
5feebd0
4 bytes
RensR Mar 26, 2026
aa11f13
add parens for extra clarity
RensR Mar 27, 2026
501e9b4
consistent naming
RensR Mar 27, 2026
47de311
fix comment
RensR Mar 27, 2026
687ec4b
rm dup const
RensR Mar 27, 2026
0a6e35c
consistent `requestedFinality`
RensR Mar 27, 2026
c8de953
fix comment outline
RensR Mar 27, 2026
408cff3
improve cctp finality parsing
RensR Apr 2, 2026
1d0e96e
minor cleanup
RensR Apr 2, 2026
e67e8f0
add helpers to extraArgs lib
RensR Apr 6, 2026
d0adf78
fix cov
0xsuryansh Apr 6, 2026
f4dd64f
Merge branch 'main' into finality
0xsuryansh Apr 6, 2026
b233a70
snapshot update
0xsuryansh Apr 6, 2026
69323f4
extract verifier finality config
RensR Apr 7, 2026
bff6b3a
expose helpers + add test
RensR Apr 7, 2026
1665215
Finality Codec support in CLD (#1911)
RensR Apr 8, 2026
c3dedc5
Merge branch 'main' into finality
RensR Apr 8, 2026
6c65759
fix merge
RensR Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions ccv/chains/evm/deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ require (
github.com/Masterminds/semver/v3 v3.4.0
github.com/ethereum/go-ethereum v1.17.1
github.com/smartcontractkit/chain-selectors v1.0.97
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260319162701-d96a00a71caf
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260319162701-d96a00a71caf
github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-20260319162701-d96a00a71caf
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260319162701-d96a00a71caf
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260407160429-e6e3a1570ff1
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260407160429-e6e3a1570ff1
github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-20260407160429-e6e3a1570ff1
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260407160429-e6e3a1570ff1
github.com/smartcontractkit/chainlink-common v0.10.1-0.20260310151336-c98a9c147ac0
github.com/smartcontractkit/chainlink-deployments-framework v0.93.0
github.com/smartcontractkit/chainlink-evm v0.3.3
Expand Down
20 changes: 15 additions & 5 deletions ccv/chains/evm/deployment/operations_gen_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ contracts:
- contract_name: MockReceiverV2
version: "2.0.0"
functions:
- name: getCCVsAndMinBlockConfirmations
- name: getCCVsAndFinalityConfig
access: public
- name: setMinBlockConfirmations
- name: setAllowedFinalityConfig
access: public # Only used in testing, not critical

# Token Pool contracts (latest / v2.0.0)
Expand All @@ -122,7 +122,7 @@ contracts:
abi_file: burn_mint_token_pool.json
no_deployment: true
functions:
- name: setMinBlockConfirmations
- name: setAllowedFinalityConfig
access: owner
- name: addRemotePool
access: owner
Expand All @@ -146,7 +146,7 @@ contracts:
access: public
- name: getCurrentRateLimiterState
access: public
- name: getMinBlockConfirmations
- name: getAllowedFinalityConfig
access: public
- name: getSupportedChains
access: public
Expand Down Expand Up @@ -280,7 +280,7 @@ contracts:
access: public
- name: getMaxCCVsPerMessage
access: public
- name: getMinBlockConfirmations
- name: getAllowedFinalityConfig
access: public

- contract_name: Proxy
Expand Down Expand Up @@ -308,6 +308,8 @@ contracts:
access: owner
- name: setRemoteAdapters
access: owner
- name: setAllowedFinalityConfig
access: owner
- name: setDynamicConfig
access: owner
- name: applyAllowlistUpdates
Expand Down Expand Up @@ -350,6 +352,8 @@ contracts:
access: owner
- name: updateStorageLocations
access: owner
- name: setAllowedFinalityConfig
access: owner
- name: withdrawFeeTokens
access: owner
- name: versionTag
Expand All @@ -364,6 +368,8 @@ contracts:
access: public
- name: getStorageLocations
access: public
- name: getAllowedFinalityConfig
access: public
- name: getFee
access: public

Expand All @@ -374,6 +380,8 @@ contracts:
access: owner
- name: applyRemoteChainConfigUpdates
access: owner
- name: setAllowedFinalityConfig
access: owner
- name: applyAllowlistUpdates
access: owner
- name: withdrawFeeTokens
Expand All @@ -386,6 +394,8 @@ contracts:
access: public
- name: getSignatureConfig
access: public
- name: getAllowedFinalityConfig
access: public
- name: getFee
access: public
- name: versionTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/stretchr/testify/require"

chain_selectors "github.com/smartcontractkit/chain-selectors"

evm_adapters "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/adapters"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/cctp_through_ccv_token_pool"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/usdc_token_pool_proxy"
Expand All @@ -30,6 +31,7 @@ import (
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_5/operations/usdc_token_pool_cctp_v2"
v1_6_1_burn_mint_token_pool "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_1/burn_mint_token_pool"
burn_mint_with_lock_release_flag_token_pool_bindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_1/burn_mint_with_lock_release_flag_token_pool"
"github.com/smartcontractkit/chainlink-ccip/deployment/finality"
"github.com/smartcontractkit/chainlink-ccip/deployment/tokens"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets"
"github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/adapters"
Expand Down Expand Up @@ -621,7 +623,7 @@ func TestCCTPChainAdapter_HomeToNonHomeChain(t *testing.T) {
require.Contains(t, homeCCTPV2AuthorizedCallers, homeUSDCTokenPoolProxyAddr, "USDCTokenPoolProxy should be an authorized caller on CCTP V2 token pool on home chain")

// Check USDCTokenPoolProxy required CCVs on home chain
homeRequiredCCVs, err := homeUSDCTokenPoolProxy.GetRequiredCCVs(nil, homeSetup.USDCToken, nonHomeChainSelector, big.NewInt(1e18), 1, []byte{}, 0)
homeRequiredCCVs, err := homeUSDCTokenPoolProxy.GetRequiredCCVs(nil, homeSetup.USDCToken, nonHomeChainSelector, big.NewInt(1e18), finality.Config{BlockDepth: 1}.Raw(), []byte{}, 0)
require.NoError(t, err, "Failed to get required CCVs from USDCTokenPoolProxy on home chain")
require.Equal(t, []common.Address{homeCCTPVerifierResolverAddr}, homeRequiredCCVs, "Required CCVs should match on home chain")

Expand All @@ -646,7 +648,7 @@ func TestCCTPChainAdapter_HomeToNonHomeChain(t *testing.T) {
// Check CCTPVerifier remote chain config on home chain
homeVerifierRemoteChainConfig, err := homeCCTPVerifier.GetRemoteChainConfig(nil, nonHomeChainSelector)
require.NoError(t, err, "Failed to get remote chain config from CCTPVerifier on home chain")
require.Equal(t, homeSetup.Router, homeVerifierRemoteChainConfig.Router, "CCTPVerifier remote chain config Router should match on home chain")
require.Equal(t, homeSetup.Router, homeVerifierRemoteChainConfig.RemoteChainConfig.Router, "CCTPVerifier remote chain config Router should match on home chain")

// Check CCTP V2 token pool domain on home chain
homeCCTPV2Domain, err := homeCCTPV2TokenPool.GetDomain(nil, nonHomeChainSelector)
Expand Down Expand Up @@ -754,7 +756,7 @@ func TestCCTPChainAdapter_HomeToNonHomeChain(t *testing.T) {
// Check CCTPVerifier remote chain config on non-home chain
nonHomeVerifierRemoteChainConfig, err := nonHomeCCTPVerifier.GetRemoteChainConfig(nil, homeChainSelector)
require.NoError(t, err, "Failed to get remote chain config from CCTPVerifier on non-home chain")
require.Equal(t, nonHomeSetup.Router, nonHomeVerifierRemoteChainConfig.Router, "CCTPVerifier remote chain config Router should match on non-home chain")
require.Equal(t, nonHomeSetup.Router, nonHomeVerifierRemoteChainConfig.RemoteChainConfig.Router, "CCTPVerifier remote chain config Router should match on non-home chain")

// Check CCTP V2 token pool domain on non-home chain
nonHomeCCTPV2TokenPool, err := usdc_token_pool_cctp_v2.NewUSDCTokenPoolCCTPV2Contract(nonHomeCCTPV2TokenPoolAddr, nonHomeChain.Client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func convertExecutors(params []ccvadapters.ExecutorDeployParams) ([]sequences.Ex
MaxCCVsPerMsg: ep.MaxCCVsPerMsg,
DynamicConfig: executor.DynamicConfig{
FeeAggregator: feeAgg,
MinBlockConfirmations: ep.DynamicConfig.MinBlockConfirmations,
AllowedFinalityConfig: ep.DynamicConfig.AllowedFinalityConfig.Raw(),
CcvAllowlistEnabled: ep.DynamicConfig.CcvAllowlistEnabled,
},
Qualifier: ep.Qualifier,
Expand All @@ -301,12 +301,12 @@ func convertMockReceivers(params []ccvadapters.MockReceiverDeployParams) []seque
result := make([]sequences.MockReceiverParams, 0, len(params))
for _, mr := range params {
result = append(result, sequences.MockReceiverParams{
Version: mr.Version,
RequiredVerifiers: mr.RequiredVerifiers,
OptionalVerifiers: mr.OptionalVerifiers,
OptionalThreshold: mr.OptionalThreshold,
MinimumBlockConfirmations: mr.MinimumBlockConfirmations,
Qualifier: mr.Qualifier,
Version: mr.Version,
RequiredVerifiers: mr.RequiredVerifiers,
OptionalVerifiers: mr.OptionalVerifiers,
OptionalThreshold: mr.OptionalThreshold,
AllowedFinalityConfig: mr.AllowedFinalityConfig.Raw(),
Qualifier: mr.Qualifier,
})
}
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
onrampops_v160 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/operations/onramp"
seq1_6 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_0/sequences"

"github.com/smartcontractkit/chainlink-ccip/deployment/finality"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
ccvadapters "github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/adapters"

Expand Down Expand Up @@ -96,7 +97,7 @@ func dummyDeployContractParams() ccvadapters.DeployContractParams {
MaxCCVsPerMsg: 3,
DynamicConfig: ccvadapters.ExecutorDynamicDeployConfig{
FeeAggregator: "0xDummyExecutorFeeAgg",
MinBlockConfirmations: 5,
AllowedFinalityConfig: finality.Config{BlockDepth: 5},
CcvAllowlistEnabled: true,
},
Qualifier: "dummy-exec",
Expand Down
16 changes: 8 additions & 8 deletions ccv/chains/evm/deployment/v1_7_0/adapters/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (t *TokenAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokens.TPRLRe
args := []token_pool.RateLimitConfigArgs{
{
RemoteChainSelector: input.RemoteChainSelector,
CustomBlockConfirmations: false,
FastFinality: false,
OutboundRateLimiterConfig: token_pool.Config{
IsEnabled: input.DefaultFinalityOutboundRateLimiterConfig.IsEnabled,
Capacity: input.DefaultFinalityOutboundRateLimiterConfig.Capacity,
Expand All @@ -316,7 +316,7 @@ func (t *TokenAdapter) SetTokenPoolRateLimits() *cldf_ops.Sequence[tokens.TPRLRe
},
{
RemoteChainSelector: input.RemoteChainSelector,
CustomBlockConfirmations: true,
FastFinality: true,
OutboundRateLimiterConfig: token_pool.Config{
IsEnabled: input.CustomFinalityOutboundRateLimiterConfig.IsEnabled,
Capacity: input.CustomFinalityOutboundRateLimiterConfig.Capacity,
Expand Down Expand Up @@ -351,8 +351,8 @@ func (t *TokenAdapter) MigrateLockReleasePoolLiquiditySequence() *cldf_ops.Seque
return evm_tokens.MigrateLockReleasePoolLiquidity
}

func (t *TokenAdapter) SetMinBlockConfirmations(e *deployment.Environment) *cldf_ops.Sequence[tokens.SetMinBlockConfirmationsSequenceInput, sequences.OnChainOutput, chain.BlockChains] {
return evm_tokens.SetMinBlockConfirmationsForTokenPools
func (t *TokenAdapter) SetAllowedFinalityConfig(e *deployment.Environment) *cldf_ops.Sequence[tokens.SetAllowedFinalityConfigSequenceInput, sequences.OnChainOutput, chain.BlockChains] {
return evm_tokens.SetAllowedFinalityConfigForTokenPools
}

func (t *TokenAdapter) SetTokenTransferFee(e *deployment.Environment) *cldf_ops.Sequence[tokens.SetTokenTransferFeeSequenceInput, sequences.OnChainOutput, chain.BlockChains] {
Expand Down Expand Up @@ -394,10 +394,10 @@ func (t *TokenAdapter) GetOnchainTokenTransferFeeConfig(e deployment.Environment
}

return tokens.TokenTransferFeeConfig{
DefaultFinalityTransferFeeBps: report.Output.DefaultBlockConfirmationsTransferFeeBps,
CustomFinalityTransferFeeBps: report.Output.CustomBlockConfirmationsTransferFeeBps,
DefaultFinalityFeeUSDCents: report.Output.DefaultBlockConfirmationsFeeUSDCents,
CustomFinalityFeeUSDCents: report.Output.CustomBlockConfirmationsFeeUSDCents,
DefaultFinalityTransferFeeBps: report.Output.FinalityTransferFeeBps,
CustomFinalityTransferFeeBps: report.Output.FastFinalityTransferFeeBps,
DefaultFinalityFeeUSDCents: report.Output.FinalityFeeUSDCents,
CustomFinalityFeeUSDCents: report.Output.FastFinalityFeeUSDCents,
DestBytesOverhead: report.Output.DestBytesOverhead,
DestGasOverhead: report.Output.DestGasOverhead,
IsEnabled: report.Output.IsEnabled,
Expand Down
5 changes: 3 additions & 2 deletions ccv/chains/evm/deployment/v1_7_0/adapters/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
_ "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/adapters"
v1_6_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/changesets"
burn_mint_token_pool_v1_6_1 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/operations/burn_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/deployment/finality"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
"github.com/smartcontractkit/chainlink-deployments-framework/deployment"
"github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment"
Expand Down Expand Up @@ -365,12 +366,12 @@ func TestTokenAdapter(t *testing.T) {
if chainSel == chainA {
boundTokenPool, err := tp_bindings.NewTokenPool(tokenPoolAddr, evmChain.Client)
require.NoError(t, err, "Failed to instantiate token pool contract")
inboundCCVs, err := boundTokenPool.GetRequiredCCVs(nil, common.Address{}, remoteChainSel, big.NewInt(0), 0, []byte{}, inbound)
inboundCCVs, err := boundTokenPool.GetRequiredCCVs(nil, common.Address{}, remoteChainSel, big.NewInt(0), finality.RawWaitForFinality, []byte{}, inbound)
require.NoError(t, err, "Failed to get inbound CCVs from token pool")
require.Len(t, inboundCCVs, 1, "Number of inbound CCVs should match")
require.Equal(t, verifierAddr, inboundCCVs[0], "Inbound CCV address should match")

outboundCCVs, err := boundTokenPool.GetRequiredCCVs(nil, common.Address{}, remoteChainSel, big.NewInt(0), 0, []byte{}, outbound)
outboundCCVs, err := boundTokenPool.GetRequiredCCVs(nil, common.Address{}, remoteChainSel, big.NewInt(0), finality.RawWaitForFinality, []byte{}, outbound)
require.NoError(t, err, "Failed to get outbound CCVs from token pool")
require.Len(t, outboundCCVs, 1, "Number of outbound CCVs should match")
require.Equal(t, verifierAddr, outboundCCVs[0], "Outbound CCV address should match")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
v1_6_1_tokens "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/sequences"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_5/operations/usdc_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_5/operations/usdc_token_pool_cctp_v2"
"github.com/smartcontractkit/chainlink-ccip/deployment/finality"
tokens_core "github.com/smartcontractkit/chainlink-ccip/deployment/tokens"
datastore_utils "github.com/smartcontractkit/chainlink-ccip/deployment/utils/datastore"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
Expand Down Expand Up @@ -244,7 +245,7 @@ var ConfigureCCTPChainForLanes = cldf_ops.NewSequence(
TokenPoolAddress: refs.CCTPV2WithCCVsPool.Address,
RegistryTokenPoolAddress: refs.RegisteredPool.Address,
RegistryAddress: refs.TokenAdminRegistry.Address,
MinFinalityValue: 1,
AllowedFinalityConfig: finality.Config{BlockDepth: 1},
RemoteChains: cctpThroughCCVRemoteChainConfigs,
})
if err != nil {
Expand Down Expand Up @@ -573,6 +574,27 @@ func applyCCTPVerifierWrites(b cldf_ops.Bundle, chain evm.Chain, verifierAddress
return nil, fmt.Errorf("failed to set domains on CCTPVerifier: %w", err)
}
writes = append(writes, domainsReport.Output)

desiredFinality := finality.Config{BlockDepth: 1}.Raw()
currentFinalityReport, err := cldf_ops.ExecuteOperation(b, cctp_verifier.GetAllowedFinalityConfig, chain, contract_utils.FunctionInput[struct{}]{
ChainSelector: chain.Selector,
Address: verifierAddress,
})
if err != nil {
return nil, fmt.Errorf("failed to get allowed finality config from CCTPVerifier: %w", err)
}
if currentFinalityReport.Output != desiredFinality {
setFinalityReport, err := cldf_ops.ExecuteOperation(b, cctp_verifier.SetAllowedFinalityConfig, chain, contract_utils.FunctionInput[[4]byte]{
ChainSelector: chain.Selector,
Address: verifierAddress,
Args: desiredFinality,
})
if err != nil {
return nil, fmt.Errorf("failed to set allowed finality config on CCTPVerifier: %w", err)
}
writes = append(writes, setFinalityReport.Output)
}

return writes, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"

mcms_types "github.com/smartcontractkit/mcms/types"

cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain"
"github.com/smartcontractkit/chainlink-deployments-framework/chain/evm"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations"
mcms_types "github.com/smartcontractkit/mcms/types"

"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
Expand Down Expand Up @@ -605,7 +606,7 @@ func configureCommitteeVerifierAsSource(
}
cur := currentRemoteReport.Output

if cur.Router != desired.Router || cur.AllowlistEnabled != desired.AllowlistEnabled {
if cur.RemoteChainConfig.Router != desired.Router || cur.RemoteChainConfig.AllowlistEnabled != desired.AllowlistEnabled {
remoteChainConfigArgs = append(remoteChainConfigArgs, desired)
} else {
getFeeReport, err := cldf_ops.ExecuteOperation(b, committee_verifier.GetFee, chain, contract.FunctionInput[committee_verifier.GetFeeArgs]{
Expand All @@ -621,7 +622,7 @@ func configureCommitteeVerifierAsSource(
curFee := getFeeReport.Output
if curFee.FeeUSDCents != desired.FeeUSDCents ||
curFee.GasForVerification != desired.GasForVerification ||
curFee.PayloadSizeBytes != desired.PayloadSizeBytes {
curFee.PayloadSizeBytes != uint32(desired.PayloadSizeBytes) {
remoteChainConfigArgs = append(remoteChainConfigArgs, desired)
}
}
Expand Down
Loading
Loading