-
Notifications
You must be signed in to change notification settings - Fork 255
refactor(hermes/server): use program accounts instead of mapping acct #2643
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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! left a couple comments
while all_ids.is_empty() { | ||
all_ids = Aggregates::get_price_feed_ids(state).await; | ||
tracing::info!("Waiting for price feed ids..."); |
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.
the ordering of these ops means that we'll always have to wait at least 1 second right? should we check all_ids.is_empty() before sleeping?
// Product account header: <magic:u32le:0xa1b2c3d4> <version:u32le:0x02> <account_type:u32le:0x02> | ||
MemcmpEncodedBytes::Bytes(hex::decode("d4c3b2a10200000002000000").unwrap()), | ||
))]), |
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.
does the string literal not match the comment because its BE vs LE? maybe worth mentioning that in the comment
Rationale
We used mapping account to get the product metadata but it involves many calls and many node providers have been facing issues with it. This change removes mapping account and uses
getProgramAccounts
to fetch all accounts in one go.How has this been tested?