-
Notifications
You must be signed in to change notification settings - Fork 2
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
Discover Router and FeeQuoters #171
Conversation
23a6f5e
to
790ba82
Compare
) (ContractAddresses, error) { | ||
if err := validateExtendedReaderExistence(r.contractReaders, destChain); err != nil { | ||
return nil, err | ||
// Exit without an error if we cannot read the destination. |
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.
We check for ErrContractReaderNotFound in the processor already - is that check still useful?
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.
Moved this to DiscoverContracts
along with a comment. The handling is a little different than elsewhere because it's important to continue after this error in order to handle cases where a node is configured such that they can read from a source chain but not the dest chain.
FChain map[cciptypes.ChainSelector]int | ||
Addresses map[string]map[cciptypes.ChainSelector][]byte | ||
|
||
// TODO: fix circular dependency /w token reader |
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.
Maybe we can move ContractAddresses
to a new package reader/readertypes
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.
I think TokenReader should probably not be depending on something in the plugin packages
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.
Oh nvm I read token reader wrong. How does token reader get affected by all this? 🫨
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.
The token reader types are defined in the exectypes
package and used by the pkg/reader/usdc_reader.go
. They should probably be moved into the reader package, or the reader moved to exec.
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.
07c69f2
to
b0f18e9
Compare
@@ -41,20 +43,31 @@ func TestContractDiscoveryProcessor_Observation_SupportsDest_HappyPath(t *testin | |||
expectedOnRamp := map[cciptypes.ChainSelector][]byte{ | |||
source: []byte("onRamp"), | |||
} | |||
expectedFeeQuoter := map[cciptypes.ChainSelector][]byte{ | |||
source: []byte("onRamp"), |
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.
Why are we adding source as onRamp here?
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.
This is the fee quoter from the onramp, the other entry here is a fee quoter from the destination. I updated the names for clarity.
// OnRamps are in the offramp SourceChainConfig. | ||
sourceConfigs, err := r.getSourceChainsConfig(ctx, chains) | ||
// OnRamps are in the offRamp SourceChainConfig. | ||
sourceConfigs, err := r.getOffRampSourceChainsConfig(ctx, allChains) |
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.
took me some time to get why we need the allChains
here. Maybe add a doc to the function.
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.
Updated comment on DiscoverContract. But also, this should hopefully go away soon.
9a3b386
to
68f5a76
Compare
// Deprecated: TODO: remove after chainlink is updated. | ||
MethodNameOfframpGetDynamicConfig = "OfframpGetDynamicConfig" | ||
// Deprecated: TODO: remove after chainlink is updated. | ||
MethodNameOfframpGetStaticConfig = "OfframpGetStaticConfig" | ||
// Deprecated: TODO: remove after chainlink is updated. | ||
MethodNameOnrampGetDynamicConfig = "OnrampGetDynamicConfig" | ||
// Deprecated: TODO: remove after chainlink is updated. | ||
MethodNameOnrampGetStaticConfig = "OnrampGetStaticConfig" |
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.
Fixing the casing on these, it will take a couple PRs.
Add a test for the ignored source fee quoter calls. Make contract observation more generic. Update another test. fix cyclo lint warning. Minor cleanup. Add missing const, disable router discovery. Disable router tests. Add deprecated types back in. lint
6cf9ffa
to
f49d689
Compare
|
Extend the DiscoverContract function: