[STALE] - CCIP - add ExtraDataCodecRegistry to sync SourceChainExtraDataCodecs across LOOPed relayers#19374
Conversation
| type ExtraDataCodecRegistry struct { | ||
| extraDataCodec cciptypes.ExtraDataCodecMap | ||
| mu sync.RWMutex | ||
| } |
There was a problem hiding this comment.
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
1ecda28 to
8e6ee44
Compare
|
I see you updated files related to
|
aa59466 to
726bada
Compare
50c6b4b to
d8a3881
Compare
d8a3881 to
c165c40
Compare
c165c40 to
2ab89e9
Compare
|
|
|
||
| return codec.OracleIDAsAddressBytes(oracleID) | ||
| } | ||
| type AddressCodec = cciptypes.AddressCodecMap |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
wonder if it would be more accurate to use RegisterNoop(), and call it when codec is missing from config
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
maybe we can call this when config.ExtraDataCodec is nil ?




The CCIP codec implementation faces a "chicken and egg" problem:
Codec()withinCCIPProviderrequires theextraDataCodec map (map[chainFamily]SourceChainExtraDataCodec).extraDataCodecmap requires the prior creation of all other codecs.ExtraDataCodecRegistrysingleton where chain families can be registered with no-opSourceChainExtraDataCodecimplementations until their actual source chain codecs are provided byCCIPProviderExtraDataCodecMapand can serve theExtraDataCodecBundleinterface over gRPCRelated PRs: