Skip to content

Conversation

@kylesmartin
Copy link
Contributor

@kylesmartin kylesmartin commented Nov 19, 2025

https://smartcontract-it.atlassian.net/browse/CCIP-7559

Out of scope:

  • Changesets, separate ticket
  • TokenMessengerProxy, separate ticket

@kylesmartin kylesmartin marked this pull request as ready for review November 21, 2025 15:53
@kylesmartin kylesmartin requested a review from a team as a code owner November 21, 2025 15:53
@kylesmartin kylesmartin changed the title [CCIP-7559] Add CCTPV2Verifier Contract [CCIP-7559] Add CCTPVerifier Contract Nov 21, 2025
event FinalityConfigSet(FinalityConfig finalityConfig);

/// @notice The static configuration.
// solhint-disable-next-line gas-struct-packing
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you ignore this for every struct? They appear trivial to pack

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because these aren't ever stored, they are just used in memory. The comments note that we don't care about struct packing for those specific structs. I had seen it used in a similar way on other contracts. I can remove it though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/// @notice Configures finality handling for this chain.
struct FinalityConfig {
uint32 defaultCCTPFinalityThreshold; // ──╮ CCTP finality threshold applied when CCIP finality is 0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be a constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responded to most finality threshold comments elsewhere. If referring to the default (2000), then yea we could make it a constant because I doubt CCTP would ever change that (though this is never stated explicitly).

// The maximum fee, taken on destination, is a percentage of the total amount transferred.
// We use bps to calculate the smallest possible value that we can set as the max fee.
// The bps values configured for each finality threshold on this chain must mirror those used by CCTP.
// CCTP defines different bps values for each chain.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not exist as something we can check on their contracts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is added to the CCTP message by Iris. Field is called feeExecuted.

) private view returns (uint32 finalityThreshold, uint16 bps) {
if (finality != 0) {
// The length of the customCCIPFinalities array is guaranteed to be at least 1.
// Therefore, if finality is not 0, we will find a match here.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CCTP has two modes, right? This feels overly complex. Should we not simply use 2 hard coded values?

Copy link
Contributor Author

@kylesmartin kylesmartin Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now yes it has two modes. We can hard-code, just means we have to change this contract if they ever add new thresholds that we want to support. CCTP V2 white paper notes this as a possibility.

/// @notice Sets the finality configuration for this chain.
/// @dev This function validates that custom finality values are sorted in ascending order.
/// @param finalityConfig The finality configuration.
function _setFinalityConfig(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible we kill all this and use

if x == 0 
  return 1000
else 
  return 2000

Those are the only allowed speeds right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can hard-code, just means we have to change this contract if they ever add new thresholds that we want to support. CCTP V2 white paper notes this as a possibility.

@github-actions
Copy link

Metric CCIP-7559 develop
Coverage 69.4% 68.7%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants