Skip to content

add 'region' field support#77

Merged
metachris merged 1 commit intomainfrom
region
Apr 30, 2026
Merged

add 'region' field support#77
metachris merged 1 commit intomainfrom
region

Conversation

@metachris
Copy link
Copy Markdown
Contributor

@metachris metachris commented Apr 30, 2026

📝 Summary

Builder instances can register a region field, which is returned to other builders as part of the peers info.

The region field can be registered as part of any service.


Here's the e2e test snippet:

# [Builder API] Register credentials for 'orderflow_proxy' service
POST http://localhost:8888/api/l1-builder/v1/register_credentials/orderflow_proxy
{
  "ecdsa_pubkey_address": "0x321f3426eEc20DE1910af1CD595c4DD83BEA0BA5",
  "tls_cert": "abcdefghijklmnopqrstuvwxyz",
  "region": "europe"
}
HTTP 200

# [Builder API] Get the list of peers
GET http://localhost:8888/api/l1-builder/v1/builders
HTTP 200
[Asserts]
jsonpath "$.[0].orderflow_proxy.ecdsa_pubkey_address" == "0x321f3426eec20de1910af1cd595c4dd83bea0ba5"
jsonpath "$.[0].orderflow_proxy.tls_cert" == "abcdefghijklmnopqrstuvwxyz"
jsonpath "$.[0].orderflow_proxy.region" == "europe"

Copilot AI review requested due to automatic review settings April 30, 2026 07:56
Copy link
Copy Markdown
Contributor

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

Adds end-to-end support for an optional region attribute on service credential registrations so it can be stored in Postgres and returned in peers/builder listings.

Changes:

  • Extend domain + ports types to include region in service credentials and peer info payloads.
  • Persist region in service_credential_registrations (schema migration + insert/select updates).
  • Update E2E coverage (Go DB-backed test + Hurl script) to assert region round-trips.

Reviewed changes

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

Show a summary per file
File Description
scripts/ci/e2e-test.hurl Registers region and asserts it appears in peers output
schema/004_region.sql Adds region column to service_credential_registrations
ports/types_test.go Adds JSON unmarshal test coverage for region
ports/types.go Adds Region to ServiceCred and maps domain -> ports
ports/http_handler.go Passes region through the register-credentials handler/service interface
httpserver/e2e_test.go DB E2E asserts region persists and is returned
domain/types.go Adds Region to domain.BuilderServices
application/service.go Threads region through application interfaces
adapters/database/types.go Maps DB credential -> domain including region
adapters/database/service.go Writes/reads region to/from Postgres

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ports/http_handler.go
Comment thread ports/types_test.go Outdated
@metachris metachris merged commit 9637575 into main Apr 30, 2026
7 checks passed
@metachris metachris deleted the region branch April 30, 2026 15:47
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