Skip to content
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

[RelayMiner]: add proxy.Ping(...) capability to test connectivity between relay servers and backend URLs #1037

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

eddyzags
Copy link

Summary

This PR adds the capability to test the connectivity between the Relay Servers and the Backend URLs in two ways.

  1. Safeguard at Startup:
    For every suppliers.[].service_config.backend_url referenced as input inside the Relay Miner Configuration file, the Relay Proxy will verify wether the network connection between the targeted backend_url and the relayerminer process is functioning properly. If one or more connections aren't possible, the relay miner won't be able to start.

  2. Configurable Ping HTTP server:
    The Relay Miner process will listen for incoming request to synchronously test the connectivity of every referenced suppliers.[].service_config.backend_url. If one or more backend URLs aren't reachable, the incoming request will fail.

Based on the serverConfig.ServerType (Example: HTTP), each Server Type will implement their own logic to implement to test the connectivity.

Issue

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Testing

Documentation changes (only if making doc changes)

  • make docusaurus_start; only needed if you make doc changes

Local Testing (only if making code changes)

  • Unit Tests: make go_develop_and_test
  • LocalNet E2E Tests: make test_e2e
  • See quickstart guide for instructions

PR Testing (only if making code changes)

  • DevNet E2E Tests: Add the devnet-test-e2e label to the PR.
    • THIS IS VERY EXPENSIVE, so only do it after all the reviews are complete.
    • Optionally run make trigger_ci if you want to re-trigger tests without any code changes
    • If tests fail, try re-running failed tests only using the GitHub UI as shown here

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new configuration section for the ping functionality, allowing users to test backend connectivity within the relay miner's setup.
    • Added methods to handle ping requests, enhancing health check capabilities for relay servers.
  • Bug Fixes

    • Improved error handling during the server startup process if any relay server is unreachable.
  • Tests

    • Added tests for the new ping functionality to ensure operational integrity and reliability of the relay miner.

…ty between relay servers and backend URLs (#1)

* relayer: add RelayServers() method to RelayProxy interface; Add Ping(), ServiceIDs(), Forward() method to RelayServer interface; add RelayServers slice with helper method byServiceID

* relayer: add forward config entry

* relayer: implement ServiceIDs, Forward, and Ping method for synchrounous RPC server

* relayer: add RelayServers implementation for RelayProxy

* relayer: add Ping and Forward options

* relayer: integrate ping option

* relayer: add ServePing and ServeForward method to RelayMiner

* test proxy.Ping() in test + remove forward feature

* add serve ping test

* add doc
@Olshansk Olshansk added tooling Tooling - CLI, scripts, helpers, off-chain, etc... community A ticket intended to potentially be picked up by a community member nice-to-have Not-important and not-urgent labels Jan 22, 2025
@Olshansk Olshansk added this to the Beta TestNet Iteration milestone Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community A ticket intended to potentially be picked up by a community member nice-to-have Not-important and not-urgent tooling Tooling - CLI, scripts, helpers, off-chain, etc...
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants