Skip to content

Conversation

@lynnagara
Copy link
Member

@lynnagara lynnagara commented Jan 8, 2026

this endpoint implements a fanout and merge strategy.

unlike project configs, partial responses are not really valid, so we only return a successful merged response under two conditions:

  • all upstreams return a successful response (no timeout, deserialization errors, error status codes)
  • we have received is a non-null public key value for every requested Relay ID from one of the successful upstreams

@lynnagara lynnagara marked this pull request as ready for review January 9, 2026 01:02
@lynnagara lynnagara requested a review from a team as a code owner January 9, 2026 01:02
Comment on lines +89 to +105
// Extract requested relay_ids from the request
let request_data: PublicKeysRequest = deserialize_body(body.clone())?;
let requested_relay_ids: HashSet<String> = request_data.relay_ids.into_iter().collect();

// Send the request to all cells
let cell_requests = cells
.cell_list()
.iter()
.map(|cell_id| {
let req = Request::from_parts(parts.clone(), body.clone());
(cell_id.clone(), req)
})
.collect();

let metadata = Box::new(PublicKeysMetadata {
requested_relay_ids,
});
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to do a fanout here. We could fetch from any cell instead. We'll be replicating the data that this endpoint reads into all cells as part of relay's registration flows.

Copy link
Member Author

Choose a reason for hiding this comment

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

alright. that makes things easier

did it that way in #109

lynnagara added a commit that referenced this pull request Jan 9, 2026
alternative to #107
with this option, sentry replicates the data so AnyCellHandler
is fine as each cell returns a complete result
lynnagara added a commit that referenced this pull request Jan 9, 2026
alternative to #107

with this option, sentry replicates the data so AnyCellHandler is fine
as each cell returns a complete result
@lynnagara lynnagara closed this Jan 9, 2026
@lynnagara lynnagara deleted the publickeys branch January 9, 2026 20:29
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