Skip to content

Solana CCTP token pool extra-data improved ABI decoding #1099

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

Merged
merged 3 commits into from
Jul 29, 2025

Conversation

toblich
Copy link
Contributor

@toblich toblich commented Jul 23, 2025

No description provided.

@toblich toblich requested a review from PabloMansanet July 23, 2025 14:13
@toblich toblich requested a review from a team as a code owner July 23, 2025 14:13
Copy link

👋 toblich, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@@ -14,6 +14,8 @@ impl TokenPoolExtraData {
const NONCE_INDEXES: (usize, usize) = (24, 32);
// The source domain is in bytes 60..64 in the serialized data (u32 is 4 bytes)
const SOURCE_DOMAIN_INDEXES: (usize, usize) = (60, 64);
// Total size of the serialized data (2 fields of 32 bytes each)
const TOTAL_SIZE: usize = 64;

pub fn abi_encode(&self) -> [u8; 64] {
let mut bytes = [0u8; 64];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit: This method could also use TOTAL_SIZE instead of the 64 magic number, if nothing else to signal that they're the same constant (ditto return value)

Copy link
Contributor

@PabloMansanet PabloMansanet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one minor comment.

@toblich toblich enabled auto-merge July 27, 2025 17:10
@toblich toblich added this pull request to the merge queue Jul 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 28, 2025
@toblich toblich enabled auto-merge July 29, 2025 14:43
Copy link

Metric fix/pool-token-data-decoding main
Coverage 70.1% 69.7%

@toblich toblich added this pull request to the merge queue Jul 29, 2025
Merged via the queue into main with commit bca9673 Jul 29, 2025
48 checks passed
@toblich toblich deleted the fix/pool-token-data-decoding branch July 29, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants