Skip to content

feat: refactor store api into separate services#932

Merged
bobbinth merged 6 commits intonextfrom
tomasarrachea-separate-store-api
Jun 11, 2025
Merged

feat: refactor store api into separate services#932
bobbinth merged 6 commits intonextfrom
tomasarrachea-separate-store-api

Conversation

@TomasArrachea
Copy link
Collaborator

@TomasArrachea TomasArrachea commented Jun 6, 2025

Addresses part of #918

This PR refactors the Store API to separate it into three APIs: RPC, BlockProducer, NtxBuilder.

For follow up PR:
The three services are being hosted on one single tonic server, it's probably better to serve them separately on 3 different addresses. This would need to update the store config.

Comment on lines +57 to +60
// CLIENT ENDPOINTS
// --------------------------------------------------------------------------------------------
#[tonic::async_trait]
impl api_server::Api for StoreApi {
// CLIENT ENDPOINTS
// --------------------------------------------------------------------------------------------

impl rpc_server::Rpc for StoreApi {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move this (and the other two similar impls) into separate files? For example, instead of a single api.rs file, we'd have something like:

  • src/server/rpc_api.rs
  • src/server/ntx_builder.rs
  • src/server/block_producer.rs

@bobbinth
Copy link
Contributor

bobbinth commented Jun 7, 2025

The three services are being hosted on one single tonic server, maybe it's better to serve them separately on 3 different addresses. This would need to update the store config to take 3 addresses.

Maybe we should do this in stages? First logically separate the services and then in the next PR make them work on different addresses?

@TomasArrachea
Copy link
Collaborator Author

Maybe we should do this in stages? First logically separate the services and then in the next PR make them work on different addresses?

Agree, we can do the different addresses in a follow-up PR

@TomasArrachea TomasArrachea marked this pull request as ready for review June 9, 2025 15:17
Copy link
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Just some really minor nits; I didn't do a deep review of the method impls - I assume they're just copies of the original impls.

@TomasArrachea TomasArrachea requested a review from bobbinth June 10, 2025 21:19
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@bobbinth bobbinth merged commit 5233116 into next Jun 11, 2025
8 checks passed
@bobbinth bobbinth deleted the tomasarrachea-separate-store-api branch June 11, 2025 23:02
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