Skip to content

fix: keep expected supplier endpoints aligned with overrides - #326

Merged
jorgecuesta merged 5 commits into
pokt-network:stagingfrom
tsulhc:fix/endpoint-overrides-upstream
Jul 30, 2026
Merged

fix: keep expected supplier endpoints aligned with overrides#326
jorgecuesta merged 5 commits into
pokt-network:stagingfrom
tsulhc:fix/endpoint-overrides-upstream

Conversation

@tsulhc

@tsulhc tsulhc commented Jul 16, 2026

Copy link
Copy Markdown

Summary

The provider can repeatedly trigger ServiceMismatch remediation even when the supplier is correctly configured on-chain. The expected-service calculator ignored address-group endpointOverrides, while BuildSupplierServiceConfigHandler applied them when constructing the remediation stake transaction.

This change:

  • Applies endpointOverrides when calculating expected supplier services.
  • Adds shared RPC type normalization for numeric values, numeric strings, and enum names such as REST and JSON_RPC.
  • Supports both legacy override keys such as "REST" and normalized numeric keys such as "4" in both validation and stake construction.
  • Preserves the original endpoint value during {protocol} interpolation, avoiding unintended hostname changes and automatic restakes.
  • Adds regression tests for both override-key formats and for the existing string-RPC interpolation behavior.

This keeps validation and remediation aligned without migrating existing endpoint hostnames or stored overrides.

Validation

GitHub Actions CI run #151 passed:

  • Branch gate
  • PR title validation
  • Format check
  • Lint
  • Build
  • Type check
  • Tests
  • No-console guard
  • Docker builds for provider, provider-workflows, middleman, and middleman-workflows

@jorgecuesta
jorgecuesta requested a review from miguel502 July 29, 2026 16:35
@jorgecuesta jorgecuesta added the bug Something isn't working label Jul 29, 2026
@jorgecuesta

Copy link
Copy Markdown
Contributor

Ey @tsulhc thanks for this contribution, can you change and point it to staging instead of main please.

@jorgecuesta jorgecuesta added release Trigger staging deploy on merge to staging release:patch Trigger patch version bump on merge to main and removed release:patch Trigger patch version bump on merge to main release Trigger staging deploy on merge to staging labels Jul 29, 2026
Comment thread packages/domain/src/provider/utils/suppliers.ts Outdated
Comment thread packages/domain/src/provider/utils/suppliers.ts Outdated
@tsulhc
tsulhc force-pushed the fix/endpoint-overrides-upstream branch from d049729 to ed96a69 Compare July 30, 2026 15:19
@tsulhc
tsulhc changed the base branch from main to staging July 30, 2026 15:21

tsulhc commented Jul 30, 2026

Copy link
Copy Markdown
Author

Retargeted the PR to staging and addressed both review points. Override lookup is now backward-compatible with legacy enum-name keys and normalized numeric keys, while {protocol} interpolation continues to use the original endpoint value to avoid unintended hostname changes or restakes. Both review threads are resolved, and CI run #151 completed successfully, including all quality checks and four Docker builds.

@miguel502
miguel502 self-requested a review July 30, 2026 16:39
@jorgecuesta jorgecuesta added the release Trigger staging deploy on merge to staging label Jul 30, 2026
@jorgecuesta
jorgecuesta merged commit aaf01d5 into pokt-network:staging Jul 30, 2026
7 checks passed
jorgecuesta added a commit that referenced this pull request Jul 30, 2026
* ci: run the test suite in the quality job

The quality job ran prettier, lint, build and check-types, but never
turbo test — so a green CI said nothing about the 23 test tasks in the
workspace. PR #326 was a behavioural fix backed entirely by tests that
CI never executed.

turbo test costs ~18s locally: its dependsOn is ^build (dependencies
only), so the apps' Next builds are not repeated.

* ci: use pull_request_target for the staging deploy

A pull_request event raised by a PR from a fork gets a read-only
GITHUB_TOKEN and no secrets, whatever the permissions block says. When
PR #326 (external contributor) was merged, all four build-push jobs
failed with 'denied: installation not allowed to Write organization
package' and post-deploy was skipped, leaving the release branch out of
sync until the deploy was re-run manually via workflow_dispatch.

pull_request_target runs in the base-repo context with a read/write
token, and keeps github.event.pull_request.labels so the existing
'release' label gate is unchanged.

The usual pull_request_target hazard does not apply: both checkouts pin
ref: staging, never the PR head, and the job only runs post-merge.

* chore(k8s): drop the orphaned middleman-workflows mainnet overlay

Real deployments come from pnf-ops (middleman side) and the
docker-compose example (operator side). This overlay was last written by
the release automation in v0.11.2 (2026-05-18) and has been frozen at
that image tag through six releases; deploy-production.yml no longer
references it.

Its only remaining effect was to read as authoritative production config
while declaring NODE_ENV=development and LOG_LEVEL=debug, both inherited
from base — which is wrong, and misleading to anyone auditing prod.

Tilt is unaffected: every k8s/apps/*/Tiltfile builds ./overlays/dev.

* ci: revert the duplicate test step

Reverts e0111e9. The quality job already ran `pnpm turbo test` (ci.yml
lines 79-80, right after Type check); that commit added a second,
identical step. Its premise — that CI never ran the tests — came from a
truncated read of the workflow, not from the file.

Squash-and-merge collapses this pair away.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working release Trigger staging deploy on merge to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants