-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use GetSourceChainConfig instead of OffRampGetAllSourceChainConfigs #527
Conversation
47b91ad
to
f85fc49
Compare
70b1616
to
7aed7b5
Compare
7aed7b5
to
3113af7
Compare
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.
Looks good to me, but I don't have too much context on this codebase.
So please get some approvals from others too, who know this code.
results, _, err := r.contractReaders[r.destChain].ExtendedBatchGetLatestValues( | ||
ctx, contractreader.ExtendedBatchGetLatestValuesRequest{consts.ContractNameOffRamp: contractBatch}, | ||
false, |
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.
Previously this was using an Unconfirmed
confidence level. What level is used with batch get?
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.
It's ignored anyway on Solana. Looks like it does default to Unconfirmed
on EVM, and the possibility of overriding the default looks mostly implemented. Not sure why they didn't expose that feature in the API:
https://github.com/smartcontractkit/chainlink/blob/develop/core/services/relay/evm/read/batch.go#L132-L140
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.
LGTM, nice!
|
There isn't any efficient way to implement OffRampGetAllSourceChainConfigs on Solana, due to the information being spread across many different Accounts while not having the seeds passed as input params to determine the PDA's for those accounts. GetSourceChainConfig works on both evm & solana
Note:
We could do it using getProgramAccounts, but this requires account indexing to be enabled on the rpc server, doubling memory requirements to run it. We could also get around it by storing a list of the PDA's in an account with a fixed prefix, but this would require us to have a maximum limit on the number of chains we support. If the maximum limit was too high, it would waste costly on-chain storage space without actually using it. Too low, and we'd have to update the smart contracts when we hit the limit.