Skip to content

[STALE] - CCIP - add ExtraDataCodecRegistry to sync SourceChainExtraDataCodecs across LOOPed relayers#19374

Closed
ogtownsend wants to merge 3 commits intodevelopfrom
ogt/ccip-add-extradatacodec-registry-oracle-creator-v2
Closed

[STALE] - CCIP - add ExtraDataCodecRegistry to sync SourceChainExtraDataCodecs across LOOPed relayers#19374
ogtownsend wants to merge 3 commits intodevelopfrom
ogt/ccip-add-extradatacodec-registry-oracle-creator-v2

Conversation

@ogtownsend
Copy link
Collaborator

@ogtownsend ogtownsend commented Sep 15, 2025

The CCIP codec implementation faces a "chicken and egg" problem:

  • The Codec() within CCIPProvider requires the extraDataCodec map (map[chainFamily]SourceChainExtraDataCodec).
  • However, creating the extraDataCodec map requires the prior creation of all other codecs.
  • This PR creates an ExtraDataCodecRegistry singleton where chain families can be registered with no-op SourceChainExtraDataCodec implementations until their actual source chain codecs are provided by CCIPProvider
  • The singleton maintains the underlying ExtraDataCodecMap and can serve the ExtraDataCodecBundle interface over gRPC

Related PRs:

  1. Bump cl-common import and update GetFeeQuoterTokenUpdates chainlink-ton#190
  2. CCIP - add ExtraDataCodecBundle protobuf and client/server support chainlink-common#1548
  3. Update DefaultAccessor GetFeeQuoterTokenUpdates and add SolanaUSDCReaderAccessor impl chainlink-ccip#1206

Comment on lines +21 to +24
type ExtraDataCodecRegistry struct {
extraDataCodec cciptypes.ExtraDataCodecMap
mu sync.RWMutex
}
Copy link
Collaborator Author

@ogtownsend ogtownsend Sep 15, 2025

Choose a reason for hiding this comment

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

Right now I don't have this implementing services.StateMachine to indicate when all codecs have been initialized, but I'd be open to the idea

@ogtownsend ogtownsend force-pushed the ogt/ccip-add-extradatacodec-registry-oracle-creator-v2 branch 2 times, most recently from 1ecda28 to 8e6ee44 Compare September 15, 2025 20:21
@github-actions
Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@ogtownsend ogtownsend force-pushed the ogt/ccip-add-extradatacodec-registry-oracle-creator-v2 branch 4 times, most recently from aa59466 to 726bada Compare September 15, 2025 22:02
@ogtownsend ogtownsend force-pushed the ogt/ccip-add-extradatacodec-registry-oracle-creator-v2 branch 6 times, most recently from 50c6b4b to d8a3881 Compare September 19, 2025 02:24
@ogtownsend ogtownsend force-pushed the ogt/ccip-add-extradatacodec-registry-oracle-creator-v2 branch from d8a3881 to c165c40 Compare September 19, 2025 18:15
@ogtownsend ogtownsend marked this pull request as ready for review September 19, 2025 20:03
@ogtownsend ogtownsend requested review from a team as code owners September 19, 2025 20:03
@ogtownsend ogtownsend force-pushed the ogt/ccip-add-extradatacodec-registry-oracle-creator-v2 branch from c165c40 to 2ab89e9 Compare September 19, 2025 20:05
@cl-sonarqube-production
Copy link


return codec.OracleIDAsAddressBytes(oracleID)
}
type AddressCodec = cciptypes.AddressCodecMap
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason that we keep this instead of just using common ccipocr3 ?

// RegisterFamily registers a chain family with a no-op SourceChainExtraDataCodec if not already registered.
// This is used when we know which chain families we want to support but don't have a specific codec
// implementation initialized for it yet. This should only be called from core node, not over gRPC.
func (r *ExtraDataCodecRegistry) RegisterFamily(chainFamily string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

wonder if it would be more accurate to use RegisterNoop(), and call it when codec is missing from config

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

might do a combination of the two: RegisterFamilyNoop() 🤔


// Add all families to the registries. If the codecs are provided by the config, set them here, otherwise
// ccipProvider will set them later in the oracle creator.
extraDataCodecRegistry.RegisterFamily(family)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can call this when config.ExtraDataCodec is nil ?

@huangzhen1997
Copy link
Contributor

huangzhen1997 commented Sep 22, 2025

For the failed core test, you can try with my fix here and here

@ogtownsend ogtownsend marked this pull request as draft September 23, 2025 21:12
@ogtownsend ogtownsend changed the title CCIP - add ExtraDataCodecRegistry to sync SourceChainExtraDataCodecs across LOOPed relayers [STALE] - CCIP - add ExtraDataCodecRegistry to sync SourceChainExtraDataCodecs across LOOPed relayers Sep 24, 2025
@ogtownsend ogtownsend closed this Sep 30, 2025
@ogtownsend ogtownsend deleted the ogt/ccip-add-extradatacodec-registry-oracle-creator-v2 branch September 30, 2025 00:57
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.

3 participants