Skip to content

Commit 4cfccea

Browse files
authored
Update PostDeploymentValidation script (#21630)
* Update PostValidation script * Lint fixes * Updates perf fix & v2 FQ * fixes * refactor * Fixes * Lint fixes & others * run go modtidy * refactor * Addressed comments & fixes * formatting * Add GasPriceStalenessThreshold back * FQ test fixes
1 parent 3e606d0 commit 4cfccea

14 files changed

Lines changed: 1977 additions & 221 deletions

File tree

core/scripts/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ require (
488488
github.com/smartcontractkit/chain-selectors v1.0.97 // indirect
489489
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260318173523-755cafb24200 // indirect
490490
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260323224438-d819cb3228e1 // indirect
491+
github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-20260317185256-d5f7db87ae70 // indirect
491492
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260310183131-8d0f0e383288 // indirect
492493
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260310183131-8d0f0e383288 // indirect
493494
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260317185256-d5f7db87ae70 // indirect

deployment/ccip/changeset/testhelpers/test_environment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,8 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tEnv TestEnvironment) Depl
848848
state, err := stateview.LoadOnchainState(e.Env, stateview.WithLoadLegacyContracts(true))
849849
require.NoError(t, err)
850850

851-
err = state.ValidatePostDeploymentState(e.Env, !tEnv.TestConfigs().SkipDONConfiguration)
852-
require.NoError(t, err)
851+
chainErrs := state.ValidatePostDeploymentStateWithoutMCMSOwnership(e.Env, !tEnv.TestConfigs().SkipDONConfiguration)
852+
require.Empty(t, chainErrs)
853853

854854
return e
855855
}

deployment/ccip/changeset/v1_6/cs_chain_contracts.go

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import (
4949
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal"
5050
commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset"
5151
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
52-
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
5352
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
5453
)
5554

@@ -1738,40 +1737,13 @@ func isOCR3ConfigSetOnOffRamp(
17381737

17391738
// DefaultFeeQuoterDestChainConfig returns the default FeeQuoterDestChainConfig
17401739
// with the config enabled/disabled based on the configEnabled flag.
1740+
// Fee values are set based on the destination chain type:
1741+
// - Any → Ethereum: NetworkFee=50, TokenFee=150
1742+
// - Any → Solana: NetworkFee=10, TokenFee=35
1743+
// - Any → other: NetworkFee=10, TokenFee=25
1744+
// - Ethereum -> any: NetworkFee=50, TokenFee=50 ( Source-chain-dependent override that must be applied by the caller)
17411745
func DefaultFeeQuoterDestChainConfig(configEnabled bool, destChainSelector ...uint64) fee_quoter.FeeQuoterDestChainConfig {
1742-
familySelector, _ := hex.DecodeString(EVMFamilySelector) // evm
1743-
if len(destChainSelector) > 0 {
1744-
destFamily, _ := chain_selectors.GetSelectorFamily(destChainSelector[0])
1745-
switch destFamily {
1746-
case chain_selectors.FamilySolana:
1747-
familySelector, _ = hex.DecodeString(SVMFamilySelector) // solana
1748-
case chain_selectors.FamilyAptos:
1749-
familySelector, _ = hex.DecodeString(AptosFamilySelector) // aptos
1750-
case chain_selectors.FamilyTon:
1751-
familySelector, _ = hex.DecodeString(TVMFamilySelector) // ton
1752-
case chain_selectors.FamilySui:
1753-
familySelector, _ = hex.DecodeString(SuiFamilySelector) // Sui
1754-
}
1755-
}
1756-
return fee_quoter.FeeQuoterDestChainConfig{
1757-
IsEnabled: configEnabled,
1758-
MaxNumberOfTokensPerMsg: 10,
1759-
MaxDataBytes: 30_000,
1760-
MaxPerMsgGasLimit: 3_000_000,
1761-
DestGasOverhead: ccipevm.DestGasOverhead,
1762-
DefaultTokenFeeUSDCents: 25,
1763-
DestGasPerPayloadByteBase: ccipevm.CalldataGasPerByteBase,
1764-
DestGasPerPayloadByteHigh: ccipevm.CalldataGasPerByteHigh,
1765-
DestGasPerPayloadByteThreshold: ccipevm.CalldataGasPerByteThreshold,
1766-
DestDataAvailabilityOverheadGas: 100,
1767-
DestGasPerDataAvailabilityByte: 16,
1768-
DestDataAvailabilityMultiplierBps: 1,
1769-
DefaultTokenDestGasOverhead: 90_000,
1770-
DefaultTxGasLimit: 200_000,
1771-
GasMultiplierWeiPerEth: 11e17, // Gas multiplier in wei per eth is scaled by 1e18, so 11e17 is 1.1 = 110%
1772-
NetworkFeeUSDCents: 10,
1773-
ChainFamilySelector: [4]byte(familySelector),
1774-
}
1746+
return ccipops.DefaultFeeQuoterDestChainConfig(configEnabled, destChainSelector...)
17751747
}
17761748

17771749
type ApplyFeeTokensUpdatesConfig struct {

deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes.go

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -446,33 +446,5 @@ func resolveUpdateLanesFeeQuoterAddressAndVersion(
446446
addresses []datastore.AddressRef,
447447
chainSel uint64,
448448
) (common.Address, semver.Version, error) {
449-
// Find the FeeQuoter with the highest version for this chain
450-
var bestRef datastore.AddressRef
451-
var bestVersion *semver.Version
452-
453-
for _, ref := range addresses {
454-
if ref.ChainSelector != chainSel {
455-
continue
456-
}
457-
if ref.Type != datastore.ContractType(fqv2ops.ContractType) {
458-
continue
459-
}
460-
if ref.Version == nil {
461-
continue
462-
}
463-
if bestVersion == nil || ref.Version.GreaterThan(bestVersion) {
464-
bestVersion = ref.Version
465-
bestRef = ref
466-
}
467-
}
468-
469-
if bestVersion == nil {
470-
return common.Address{}, semver.Version{}, fmt.Errorf("no fee quoter address found for chain %d", chainSel)
471-
}
472-
473-
if !common.IsHexAddress(bestRef.Address) {
474-
return common.Address{}, semver.Version{}, fmt.Errorf("invalid fee quoter address %q for chain %d", bestRef.Address, chainSel)
475-
}
476-
477-
return common.HexToAddress(bestRef.Address), *bestVersion, nil
449+
return shared.ResolveFeeQuoterAddressAndVersion(addresses, chainSel)
478450
}

deployment/ccip/operation/evm/v1_6/ops_fee_quoter.go

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,26 +199,43 @@ const (
199199
EVMFamilySelector = "2812d52c"
200200
SVMFamilySelector = "1e10bdc4"
201201
AptosFamilySelector = "ac77ffec"
202+
TVMFamilySelector = "647e2ba9"
203+
SuiFamilySelector = "c4e05953"
202204
)
203205

206+
// DefaultFeeQuoterDestChainConfig returns the default FeeQuoter dest chain config.
207+
// If destChainSelector is provided, family-specific values (ChainFamilySelector,
208+
// NetworkFeeUSDCents, DefaultTokenFeeUSDCents) are set accordingly.
204209
func DefaultFeeQuoterDestChainConfig(configEnabled bool, destChainSelector ...uint64) fee_quoter.FeeQuoterDestChainConfig {
205-
familySelector, _ := hex.DecodeString(EVMFamilySelector) // evm
210+
familySelector, _ := hex.DecodeString(EVMFamilySelector)
211+
networkFeeUSDCents := uint32(10)
212+
defaultTokenFeeUSDCents := uint16(25)
206213
if len(destChainSelector) > 0 {
207214
destFamily, _ := chain_selectors.GetSelectorFamily(destChainSelector[0])
208215
switch destFamily {
209216
case chain_selectors.FamilySolana:
210-
familySelector, _ = hex.DecodeString(SVMFamilySelector) // solana
217+
familySelector, _ = hex.DecodeString(SVMFamilySelector)
218+
defaultTokenFeeUSDCents = 35
211219
case chain_selectors.FamilyAptos:
212-
familySelector, _ = hex.DecodeString(AptosFamilySelector) // aptos
220+
familySelector, _ = hex.DecodeString(AptosFamilySelector)
221+
case chain_selectors.FamilyTon:
222+
familySelector, _ = hex.DecodeString(TVMFamilySelector)
223+
case chain_selectors.FamilySui:
224+
familySelector, _ = hex.DecodeString(SuiFamilySelector)
225+
case chain_selectors.FamilyEVM:
226+
if isEthereumChain(destChainSelector[0]) {
227+
networkFeeUSDCents = 50
228+
defaultTokenFeeUSDCents = 150
229+
}
213230
}
214231
}
215232
return fee_quoter.FeeQuoterDestChainConfig{
216233
IsEnabled: configEnabled,
217234
MaxNumberOfTokensPerMsg: 10,
218235
MaxDataBytes: 30_000,
219-
MaxPerMsgGasLimit: 3_000_000, // TODO: this needs to be updated based on RMN sig verification per chain?! 220/250K
236+
MaxPerMsgGasLimit: 3_000_000,
220237
DestGasOverhead: ccipevm.DestGasOverhead,
221-
DefaultTokenFeeUSDCents: 25,
238+
DefaultTokenFeeUSDCents: defaultTokenFeeUSDCents,
222239
DestGasPerPayloadByteBase: ccipevm.CalldataGasPerByteBase,
223240
DestGasPerPayloadByteHigh: ccipevm.CalldataGasPerByteHigh,
224241
DestGasPerPayloadByteThreshold: ccipevm.CalldataGasPerByteThreshold,
@@ -227,9 +244,15 @@ func DefaultFeeQuoterDestChainConfig(configEnabled bool, destChainSelector ...ui
227244
DestDataAvailabilityMultiplierBps: 1,
228245
DefaultTokenDestGasOverhead: 90_000,
229246
DefaultTxGasLimit: 200_000,
230-
GasMultiplierWeiPerEth: 11e17, // Gas multiplier in wei per eth is scaled by 1e18, so 11e17 is 1.1 = 110%
231-
NetworkFeeUSDCents: 10,
247+
GasMultiplierWeiPerEth: 11e17,
248+
NetworkFeeUSDCents: networkFeeUSDCents,
232249
ChainFamilySelector: [4]byte(familySelector),
233250
GasPriceStalenessThreshold: 90000,
234251
}
235252
}
253+
254+
func isEthereumChain(selector uint64) bool {
255+
return selector == chain_selectors.ETHEREUM_MAINNET.Selector ||
256+
selector == chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector ||
257+
selector == chain_selectors.ETHEREUM_TESTNET_HOODI.Selector
258+
}

deployment/ccip/shared/helpers.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import (
44
"context"
55
"fmt"
66

7+
"github.com/Masterminds/semver/v3"
78
"github.com/ethereum/go-ethereum/accounts/abi/bind"
89
"github.com/ethereum/go-ethereum/common"
910

11+
fqv2ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter"
1012
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
1113
"github.com/smartcontractkit/chainlink-deployments-framework/deployment"
1214
capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0"
@@ -115,3 +117,38 @@ func PopulateDataStore(addressBook deployment.AddressBook) (*datastore.MemoryDat
115117

116118
return ds, nil
117119
}
120+
121+
// ResolveFeeQuoterAddressAndVersion returns the FeeQuoter with the highest semver for a chain.
122+
func ResolveFeeQuoterAddressAndVersion(
123+
addresses []datastore.AddressRef,
124+
chainSel uint64,
125+
) (common.Address, semver.Version, error) {
126+
var bestRef datastore.AddressRef
127+
var bestVersion *semver.Version
128+
129+
for _, ref := range addresses {
130+
if ref.ChainSelector != chainSel {
131+
continue
132+
}
133+
if ref.Type != datastore.ContractType(fqv2ops.ContractType) {
134+
continue
135+
}
136+
if ref.Version == nil {
137+
continue
138+
}
139+
if bestVersion == nil || ref.Version.GreaterThan(bestVersion) {
140+
bestVersion = ref.Version
141+
bestRef = ref
142+
}
143+
}
144+
145+
if bestVersion == nil {
146+
return common.Address{}, semver.Version{}, fmt.Errorf("no fee quoter address found for chain %d", chainSel)
147+
}
148+
149+
if !common.IsHexAddress(bestRef.Address) {
150+
return common.Address{}, semver.Version{}, fmt.Errorf("invalid fee quoter address %q for chain %d", bestRef.Address, chainSel)
151+
}
152+
153+
return common.HexToAddress(bestRef.Address), *bestVersion, nil
154+
}

0 commit comments

Comments
 (0)