-
Notifications
You must be signed in to change notification settings - Fork 323
feat(sui-sdk): support multiple accumulator messages in single transaction #3349
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
Open
devin-ai-integration
wants to merge
6
commits into
main
Choose a base branch
from
devin/1767862637-sui-sdk-multiple-accumulator-messages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(sui-sdk): support multiple accumulator messages in single transaction #3349
devin-ai-integration
wants to merge
6
commits into
main
from
devin/1767862637-sui-sdk-multiple-accumulator-messages
+204
−171
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
…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]>
Co-Authored-By: Ali <[email protected]>
Co-Authored-By: Ali <[email protected]>
Co-Authored-By: Ali <[email protected]>
…rifyVaasAndGetHotPotatoes Co-Authored-By: Ali <[email protected]>
828c417 to
d6ae4af
Compare
Co-Authored-By: Ali <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes the limitation that prevented the Sui SDK from handling multiple accumulator messages in a single transaction. Previously, calling
updatePriceFeeds,updatePriceFeedsWithCoins, orcreatePriceFeedwith 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:
Package version bumped from 2.4.0 to 2.5.0 (minor version for new feature).
Updates since last revision
feedIdToHotPotatoIndexmapping directly inverifyVaasAndGetHotPotatoesinstead of returningfeedIdsPerUpdateand building the mapping separately (per reviewer feedback)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?
The existing tests should continue to pass. The changes maintain backward compatibility - single accumulator message updates work exactly as before.
Human Review Checklist
extractPriceFeedIdsFromAccumulatorMessagecorrectly parses the accumulator message format (header, VAA, price updates with Merkle proofs)Link to Devin run: https://app.devin.ai/sessions/aea3dc2103ad4f0ab8ba91806e1638ac
Requested by: Ali ([email protected])