Skip to content

Add pyth quorom server #2759

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
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add pyth quorom server #2759

wants to merge 5 commits into from

Conversation

danimhr
Copy link
Contributor

@danimhr danimhr commented Jun 5, 2025

This PR aims to add pyth quorom server

Copy link

vercel bot commented Jun 5, 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 Jun 6, 2025 6:24pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm
developer-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 6:24pm

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a new Pyth server (named "quorom") that includes a websocket endpoint, REST API endpoints to handle observations, and integration with Pythnet for fetching guardian set information.

  • Implements a websocket actor (Subscriber) to manage long-lived connections and deliver update events.
  • Adds API endpoints for health checks and handling observation submissions that result in broadcasting VAAs.
  • Introduces a Pythnet client to fetch guardian set data and integrates server shutdown via a global exit flag.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/quorom/src/ws.rs Implements websocket handling and subscriber actor for update events.
apps/quorom/src/server.rs Sets up server state, command-line options, and graceful shutdown.
apps/quorom/src/pythnet.rs Implements Pythnet client functionality to fetch guardian set info.
apps/quorom/src/main.rs Configures tracing and starts the server.
apps/quorom/src/api.rs Provides API endpoints to handle observations and broadcast VAAs.
apps/quorom/rust-toolchain Specifies the Rust toolchain version.
apps/quorom/Cargo.toml Declares the project metadata and dependencies.
apps/quorom/.gitignore Configures ignore rules for Rust build artifacts.

Copy link
Collaborator

@ali-bahjati ali-bahjati left a comment

Choose a reason for hiding this comment

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

LGTM. My comments are mostly minor but please address them before merging.

signatures,
}, params.body.clone()).into();
if let Err(e) = state.ws.broadcast_sender.send(UpdateEvent::NewVaa(vaa)) {
tracing::error!(error = ?e, "Failed to broadcast new VAA");
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think you only get error here when there is no receiver and we should ignore it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isnt it good to shout when there is no receiver?

if let Err(e) = state.ws.broadcast_sender.send(UpdateEvent::NewVaa(vaa)) {
tracing::error!(error = ?e, "Failed to broadcast new VAA");
}
verification_writer.remove(&params.body);
Copy link
Collaborator

Choose a reason for hiding this comment

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

something that can happen here is that we wait for all these to finish when we shut down. i am somewhat surprised that axum graceful shutdown is not doing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used task tracker to make sure that we handle all observation before shutting down. Do you think it's not necessary to handle all observations before shutting down?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This means we are not going to accept new requests, but we will wait until we handle all prv requests that we received

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