-
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
Solana plugin codec implementation #15816
base: solana-offchain-plugin
Are you sure you want to change the base?
Solana plugin codec implementation #15816
Conversation
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
…NONEVM-935/implement-ccip-solana-plugin-codec
…NONEVM-935/implement-ccip-solana-plugin-codec
…solana-plugin-codec
DestTokenAddress: DestTokenAddress, | ||
ExtraData: tokenAmount.ExtraData, | ||
Amount: bigIntToBytes32(tokenAmount.Amount), | ||
DestGasAmount: bytesToUint32(tokenAmount.DestExecData), |
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'm not fully sure what format this field will be encoded to []byte as.
We should review this specific field with a CCIP team member.
I suspect if source chain is EVM, this may be encoded using abi.
|
||
var extraArgs ccip_router.SolanaExtraArgs | ||
decoder := agbinary.NewBorshDecoder(msg.ExtraArgs) | ||
err := extraArgs.UnmarshalWithDecoder(decoder) |
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 started a thread around SolanaExtraArgs encoding scheme.
As of today, I think if EVM is the source chain, this would be encoded as abi.
We need to discuss in that thread what this should be like.
tokenAmounts := make([]cciptypes.RampTokenAmount, 0, len(executeReport.Message.TokenAmounts)) | ||
for _, tokenAmount := range executeReport.Message.TokenAmounts { | ||
destData := make([]byte, 4) | ||
binary.BigEndian.PutUint32(destData, tokenAmount.DestGasAmount) |
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.
Again, I'm a little lost on what this encoding should be like.
Need someone from CCIP to explain to us.
// CommitPluginCodecV1 is a codec for encoding and decoding commit plugin reports. | ||
// Compatible with: | ||
// - "OffRamp 1.6.0-dev" | ||
type CommitPluginCodecV1 struct{} |
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 can't we use the Solana Codec for this? Just define the IDL for these types, I haven't looked closely into the types being encodec, so I may be missing something
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.
Quality Gate passedIssues Measures |
Jira reference:
https://smartcontract-it.atlassian.net/browse/NONEVM-935
The codec is implemented using chainlink-ccip gobinding tool.
The onchain sdk will provide a calculation for the token pool accounts, right now it's a fixed account length based on https://github.com/smartcontractkit/chainlink-ccip/blob/main/chains/solana/contracts/tests/ccip/ccip_router_test.go#L4839