Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 8, 2026

Summary

This PR removes the limitation that prevented the Sui SDK from handling multiple accumulator messages in a single transaction. Previously, calling updatePriceFeeds, updatePriceFeedsWithCoins, or createPriceFeed with multiple updates would throw an error: "SDK does not support sending multiple accumulator messages in a single transaction".

The fix processes each accumulator message independently within the same transaction by:

  • Extracting and verifying the VAA from each accumulator message
  • Creating a hot potato for each accumulator message
  • Parsing each accumulator message to extract the price feed IDs it contains
  • Mapping each requested feed ID to its corresponding hot potato
  • Updating each price feed using the correct hot potato
  • Destroying all hot potatoes at the end of the transaction

Package version bumped from 2.4.0 to 2.5.0 (minor version for new feature).

Updates since last revision

  • Refactored to build the feedIdToHotPotatoIndex mapping directly in verifyVaasAndGetHotPotatoes instead of returning feedIdsPerUpdate and building the mapping separately (per reviewer feedback)
  • Rebased on current main and removed developer-hub docs changes (per reviewer request)
  • Regenerated pnpm-lock.yaml to fix broken lockfile after rebase

Rationale

Users were encountering this error in production when Hermes returned multiple accumulator messages (which happens when price updates span different VAAs). This is a valid use case that the SDK should support.

Forum issue: https://dev-forum.pyth.network/t/505

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

The existing tests should continue to pass. The changes maintain backward compatibility - single accumulator message updates work exactly as before.

Human Review Checklist

  • Verify the binary parsing logic in extractPriceFeedIdsFromAccumulatorMessage correctly parses the accumulator message format (header, VAA, price updates with Merkle proofs)
  • Verify the Merkle proof size calculation assumes 20 bytes per proof element - confirm this matches the actual format
  • Verify the hot potato state management is correct - each hot potato must be updated and destroyed exactly once
  • Verify the feed ID to hot potato mapping handles the case where a feed ID might not be found in any accumulator message (currently throws an error)
  • Verify feed ID normalization (removing "0x" prefix) is consistent with how feed IDs are stored/returned elsewhere

Link to Devin run: https://app.devin.ai/sessions/aea3dc2103ad4f0ab8ba91806e1638ac
Requested by: Ali ([email protected])

@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner January 8, 2026 09:03
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
proposals Error Error Jan 15, 2026 3:23pm
staking Ready Ready Preview, Comment Jan 15, 2026 3:23pm
5 Skipped Deployments
Project Deployment Review Updated (UTC)
api-reference Skipped Skipped Jan 15, 2026 3:23pm
component-library Skipped Skipped Jan 15, 2026 3:23pm
developer-hub Skipped Skipped Jan 15, 2026 3:23pm
entropy-explorer Skipped Skipped Jan 15, 2026 3:23pm
insights Skipped Skipped Jan 15, 2026 3:23pm

@vercel vercel bot temporarily deployed to Preview – entropy-explorer January 8, 2026 09:08 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals January 8, 2026 09:08 Inactive
@vercel vercel bot temporarily deployed to Preview – insights January 8, 2026 09:08 Inactive
@vercel vercel bot temporarily deployed to Preview – staking January 8, 2026 09:08 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals January 8, 2026 09:14 Inactive
@vercel vercel bot temporarily deployed to Preview – staking January 8, 2026 09:14 Inactive
@vercel vercel bot temporarily deployed to Preview – insights January 8, 2026 09:14 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer January 8, 2026 09:14 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals January 8, 2026 09:20 Inactive
@vercel vercel bot temporarily deployed to Preview – insights January 8, 2026 09:20 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer January 8, 2026 09:20 Inactive
@vercel vercel bot temporarily deployed to Preview – staking January 8, 2026 09:20 Inactive
@vercel vercel bot temporarily deployed to Preview – insights January 8, 2026 14:39 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer January 8, 2026 14:39 Inactive
@vercel vercel bot temporarily deployed to Preview – staking January 8, 2026 14:39 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals January 8, 2026 14:39 Inactive
devin-ai-integration bot and others added 5 commits January 15, 2026 15:16
…ction

This change removes the error that was thrown when multiple accumulator
messages were passed to updatePriceFeeds, updatePriceFeedsWithCoins, and
createPriceFeed methods.

The fix processes each accumulator message independently within the same
transaction by:
- Extracting the VAA from each accumulator message and verifying it
- Creating a hot potato for each accumulator message
- Parsing each accumulator message to extract the price feed IDs it contains
- Mapping each requested feed ID to its corresponding hot potato
- Updating each price feed using the correct hot potato
- Destroying all hot potatoes at the end of the transaction

This allows users to update price feeds that span different VAAs in a
single transaction, which was previously not supported.

Co-Authored-By: Ali <[email protected]>
@vercel vercel bot temporarily deployed to Preview – component-library January 15, 2026 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub January 15, 2026 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – insights January 15, 2026 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer January 15, 2026 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference January 15, 2026 15:20 Inactive
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.

1 participant