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

Merged
merged 7 commits into from
Jun 10, 2025
Merged

Add pyth quorom server #2759

merged 7 commits into from
Jun 10, 2025

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 10, 2025 11:05am
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am
developer-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 11:05am

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-behjati ali-behjati 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.

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

got 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.

When we receive a Ctrl-c signal, the WS connection is being dropped immediately, so I just removed the task tracker for simplicity.

I also tested graceful shutdown and it's working fine.

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.

3 participants