-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
follow up the chain selector refactor for CCIP plugin, fix potential bug in CR/CW config #15482
follow up the chain selector refactor for CCIP plugin, fix potential bug in CR/CW config #15482
Conversation
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
…NONEVM-826/update-chain-family-logic-plugin
@@ -344,7 +344,7 @@ func (i *pluginOracleCreator) createReadersAndWriters( | |||
return nil, nil, err1 | |||
} | |||
|
|||
if chainID == destChainID { | |||
if chainID == destChainID && destChainFamily == relayChainFamily { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the difference between a chainID and a chain selector?
Is it true that this extra check is to ensure we don't mis-match in case the same chainID is used in different chain families?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, chain selector is a randomly generated uint64 and used by CCIP, and it is unique across all chains/families.
The chain id is specific to a chain family, so it doesn't provide this guarantee. For example chainid
: 1
can either beethereum-mainnet
or aptos-mainnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I was mixing up chainID and chainSelector. They're both differen't ways to ID a chain so it's hard to reason about, some kind of (chainID, chainFamily) tuple type and/or converting to one or the other rather than passing them around is needed. Having an ID with type string doesn't help.
I believe getChainReaderConfig
has this same bug.
https://smartcontract-it.atlassian.net/browse/NONEVM-826
Follow up PR for PR for chain selector refactor work in CCIP plugin change, there's a mistake that potentially causes mis-configuration in CR/CW config