Skip to content

[RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type#1633

Merged
commoddity merged 31 commits intomainfrom
rpc-type-backend-selection
Jul 14, 2025
Merged

[RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type#1633
commoddity merged 31 commits intomainfrom
rpc-type-backend-selection

Conversation

@commoddity
Copy link
Copy Markdown
Contributor

@commoddity commoddity commented Jul 3, 2025

🌿 Summary

Enhances the Relay Miner to dynamically route incoming requests to different backend URLs based on the RPC type specified in the request header, enabling greater flexibility in handling protocol-specific relays.

NOTE: This PR specifically intends to be backward-compatible by introducing RPC-type specific service configs in addition to the default service config.

This means the YAML structure of the Relay Miner config is unchanged so the new functionality may be added in addition to existing configs but does not require NRs to change their config structure.

🌱 Primary Changes:

  • Introduced support for multiple service configurations within a single supplier via new rpc_type_service_configs YAML field.
  • Modified proxy request handling logic to route requests by inspecting the RPC-Type header and selecting the corresponding service configuration.
  • Added RPCType enum with validation logic to support known RPC types (e.g., json_rpc, rest).

🍃 Secondary changes:

  • Refactored config structures to distinguish between ServiceConfig and RPCTypeServiceConfigs.
  • Updated tests to validate new config parsing and proxy behavior under varied RPC-type scenarios.
  • Renamed usages of ServiceConfig to ServiceConfig across the codebase for alignment.

🛠️ Type of change

Select one or more from the following:

  • New feature, functionality or library

🤯 Sanity Checklist

  • I have updated the GitHub Issue 'assignees', 'reviewers', 'labels', 'project', 'iteration' and 'milestone'
  • For code, I have run 'make test_all'
  • I added TODOs where applicable

@commoddity commoddity self-assigned this Jul 3, 2025
@commoddity commoddity added the relayminer Changes related to the Relayminer label Jul 3, 2025
@github-project-automation github-project-automation Bot moved this to 📋 Backlog in Shannon Jul 3, 2025
@Olshansk Olshansk moved this from 📋 Backlog to 🏗 In progress in Shannon Jul 6, 2025
Copy link
Copy Markdown
Contributor

@red-0ne red-0ne left a comment

Choose a reason for hiding this comment

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

Great addition!

Thanks for keeping the config backward compatible.

Uniqueness of the RPC configs is guaranteed 👍

Left a few comments but no major blockers.

Comment thread pkg/relayer/proxy/http_server.go Outdated
Comment thread pkg/relayer/proxy/sync.go Outdated
Comment thread pkg/relayer/proxy/sync.go Outdated
Comment thread pkg/relayer/proxy/async.go Outdated
Comment thread pkg/relayer/config/types.go Outdated
Comment thread pkg/relayer/config/types.go Outdated
Comment thread pkg/relayer/config/types.go Outdated
Comment thread pkg/relayer/config/relayminer_configs_reader_test.go
@commoddity commoddity marked this pull request as ready for review July 8, 2025 19:46
@commoddity commoddity requested review from red-0ne July 8, 2025 19:47
@commoddity commoddity changed the title [WIP][RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type Jul 8, 2025
Copy link
Copy Markdown
Collaborator

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

Biggest issue I see right now is the fact that we're changing configs, not updating docs, and some naming discrepencies.

Comment thread pkg/relayer/proxy/sync.go Outdated
Comment thread pkg/relayer/proxy/sync.go Outdated
Comment thread pkg/relayer/config/types.go Outdated
Comment thread pkg/relayer/config/types.go Outdated
Comment thread pkg/relayer/config/types.go
Comment thread pkg/relayer/proxy/async.go Outdated
Comment thread pkg/relayer/config/supplier_hydrator.go
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to 👀 In review in Shannon Jul 9, 2025
@github-actions github-actions Bot added the consensus-breaking IMPORTANT! If the PR with this tag is merged, next release WILL HAVE TO BE an upgrade. label Jul 10, 2025
Copy link
Copy Markdown
Collaborator

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

Posted a fair number of changes, but we're close!

Should be g2g after this round.

Comment thread proto/pocket/shared/service.proto Outdated
Comment thread pkg/relayer/proxy/sync.go Outdated
Comment thread pkg/relayer/proxy/sync.go
Comment thread pkg/relayer/config/types.go
Comment thread pkg/relayer/config/types.go
Comment thread pkg/relayer/proxy/http_server.go Outdated
Comment thread pkg/relayer/config/supplier_hydrator.go Outdated
Comment thread pkg/relayer/config/supplier_hydrator.go Outdated
Comment thread pkg/relayer/config/supplier_hydrator.go
Comment thread pkg/relayer/config/supplier_hydrator.go Outdated
@commoddity commoddity requested a review from Olshansk July 11, 2025 15:22
Copy link
Copy Markdown
Collaborator

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

@commoddity I'm publishing a partial (early) review to make sure one of the comments gets out early.

Will keep reviewing.

Comment thread docusaurus/docs/1_operate/3_configs/4_relayminer_config.md Outdated
Comment thread docusaurus/docs/1_operate/3_configs/4_relayminer_config.md Outdated
Comment thread docusaurus/docs/1_operate/3_configs/4_relayminer_config.md Outdated
Comment thread docusaurus/docs/1_operate/3_configs/4_relayminer_config.md
Comment thread docusaurus/docs/1_operate/3_configs/4_relayminer_config.md Outdated
Comment thread proto/pocket/shared/service.proto
@Olshansk Olshansk self-requested a review July 13, 2025 22:36
Copy link
Copy Markdown
Collaborator

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

@commoddity I squashed and merged my review here: #1669

LGTM otherwise. Let's merge it in!

@commoddity commoddity merged commit fab8a5d into main Jul 14, 2025
11 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Shannon Jul 14, 2025
bryanchriswhite added a commit that referenced this pull request Jul 14, 2025
* pokt/main: (34 commits)
  [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type (#1633)
  [Morse Recovery] Added new addresses for recovery (#1667)
  [DOCS][SERVICE] Adding danger for Grove employees on mainnet service creation (#1666)
  [Foundation] Remove `pulsar` (#1661)
  [RelayMiner] Add timeout support and improved logging to query clients (#1657)
  [RelayMiner] Replace buffer copying with explicit cleanup pattern in SafeReadBody (#1658)
  [Testing] Fixing flaky unit tests to make CI more reliable (#1662)
  [Scripts] Notes, events and queries to query `block` events and `tx` events (#1660)
  [Morse Recovery] Add recovery addresses for issue #1654 (#1656)
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  [RelayMiner] Improve SafeReadBody concurrency safety by copying buffer data (#1650)
  Add a configurable max body size parameter to RelayMiner configuration. (#1566)
  Update upgrade_tx_v0.1.25_alpha.json
  feat: Improve relay request unmarshaling error handling and logging (#1649)
  [Docs] v0.1.25/26 upgrage artifacts (#1648)
  Remove settlement result from `EventClaimSettled` in `v0.127` release. (#1647)
  Revert "feat: Remove settlement result from EventClaimSettled" (#1643)
  [Code Health] Fix linter issues & attempt to fix flaky tests (#1646)
  Updating config-path-x.yaml with: schema header, owned app for config-path-1
  ...
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* pokt/chore/ibc:
  fix: TODOs
  fix: onchain upgrade
  [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type (#1633)
  [Morse Recovery] Added new addresses for recovery (#1667)
  [DOCS][SERVICE] Adding danger for Grove employees on mainnet service creation (#1666)
  [Foundation] Remove `pulsar` (#1661)
  [RelayMiner] Add timeout support and improved logging to query clients (#1657)
  [RelayMiner] Replace buffer copying with explicit cleanup pattern in SafeReadBody (#1658)
  [Testing] Fixing flaky unit tests to make CI more reliable (#1662)
  [Scripts] Notes, events and queries to query `block` events and `tx` events (#1660)
  [Morse Recovery] Add recovery addresses for issue #1654 (#1656)
  First review
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* chore/localnet/tilt: (88 commits)
  [Disk Utilization] refactor: remove unnecessary Msg.*Response fields (#1670)
  [RelayMiner] Bump SMT version (#1675)
  [IBC] Prepare pocket for IBC connectivity (#1262)
  fix: TODOs
  fix: onchain upgrade
  [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type (#1633)
  [Morse Recovery] Added new addresses for recovery (#1667)
  [DOCS][SERVICE] Adding danger for Grove employees on mainnet service creation (#1666)
  [Foundation] Remove `pulsar` (#1661)
  [RelayMiner] Add timeout support and improved logging to query clients (#1657)
  [RelayMiner] Replace buffer copying with explicit cleanup pattern in SafeReadBody (#1658)
  [Testing] Fixing flaky unit tests to make CI more reliable (#1662)
  [Scripts] Notes, events and queries to query `block` events and `tx` events (#1660)
  [Morse Recovery] Add recovery addresses for issue #1654 (#1656)
  fixup! upgrade
  fixup! upgrade
  revertme: testing
  fixup! upgrade
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  ...
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* chore/ibc-axelar: (92 commits)
  [Disk Utilization] refactor: remove unnecessary Msg.*Response fields (#1670)
  [RelayMiner] Bump SMT version (#1675)
  [IBC] Prepare pocket for IBC connectivity (#1262)
  fix: TODOs
  fix: onchain upgrade
  [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type (#1633)
  [Morse Recovery] Added new addresses for recovery (#1667)
  [DOCS][SERVICE] Adding danger for Grove employees on mainnet service creation (#1666)
  [Foundation] Remove `pulsar` (#1661)
  [RelayMiner] Add timeout support and improved logging to query clients (#1657)
  [RelayMiner] Replace buffer copying with explicit cleanup pattern in SafeReadBody (#1658)
  [Testing] Fixing flaky unit tests to make CI more reliable (#1662)
  [Scripts] Notes, events and queries to query `block` events and `tx` events (#1660)
  [Morse Recovery] Add recovery addresses for issue #1654 (#1656)
  fixup! upgrade
  fixup! upgrade
  revertme: testing
  fixup! upgrade
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  ...
bryanchriswhite added a commit that referenced this pull request Jul 16, 2025
* chore/ibc-axelar: (88 commits)
  [Disk Utilization] refactor: remove unnecessary Msg.*Response fields (#1670)
  [RelayMiner] Bump SMT version (#1675)
  [IBC] Prepare pocket for IBC connectivity (#1262)
  fix: TODOs
  fix: onchain upgrade
  [RelayMiner] feat: relay miner routes to multiple backend URLs based on RPC Type (#1633)
  [Morse Recovery] Added new addresses for recovery (#1667)
  [DOCS][SERVICE] Adding danger for Grove employees on mainnet service creation (#1666)
  [Foundation] Remove `pulsar` (#1661)
  [RelayMiner] Add timeout support and improved logging to query clients (#1657)
  [RelayMiner] Replace buffer copying with explicit cleanup pattern in SafeReadBody (#1658)
  [Testing] Fixing flaky unit tests to make CI more reliable (#1662)
  [Scripts] Notes, events and queries to query `block` events and `tx` events (#1660)
  [Morse Recovery] Add recovery addresses for issue #1654 (#1656)
  fixup! upgrade
  fixup! upgrade
  revertme: testing
  fixup! upgrade
  Refactor Tiltfile structure and enhance Pocketdex support. (#1640)
  [Morse Recovery] Updated Recovery Allowlist (#1651)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consensus-breaking IMPORTANT! If the PR with this tag is merged, next release WILL HAVE TO BE an upgrade. relayminer Changes related to the Relayminer

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants