Skip to content

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

Merged
merged 2 commits into from
May 13, 2025

Conversation

ali-bahjati
Copy link
Collaborator

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?

  • Manually tested the code. I tested the readiness probe, made queries in the symbols endpoint, and made sure that other functionalities keep working fine.

@ali-bahjati ali-bahjati requested a review from cctdaniel May 1, 2025 08:30
Copy link

vercel bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 1:03pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 1:03pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 1:03pm
entropy-explorer ❌ Failed (Inspect) May 13, 2025 1:03pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 1:03pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 1:03pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 1:03pm

Copy link
Contributor

@tejasbadadare tejasbadadare left a 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

Comment on lines 252 to 254
while all_ids.is_empty() {
all_ids = Aggregates::get_price_feed_ids(state).await;
tracing::info!("Waiting for price feed ids...");
Copy link
Contributor

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?

Comment on lines 282 to 284
// Product account header: <magic:u32le:0xa1b2c3d4> <version:u32le:0x02> <account_type:u32le:0x02>
MemcmpEncodedBytes::Bytes(hex::decode("d4c3b2a10200000002000000").unwrap()),
))]),
Copy link
Contributor

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

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.

2 participants