Skip to content

refactor: split rpc into actor/core/common layers#87

Merged
afterburn merged 7 commits intov7from
refactor/arch
Feb 24, 2026
Merged

refactor: split rpc into actor/core/common layers#87
afterburn merged 7 commits intov7from
refactor/arch

Conversation

@afterburn
Copy link
Contributor

This PR splits the monolithic rpc module into three layers:

  • actor/ - I/O orchestration (socket, tick loop, message dispatch)
  • core/ - core logic (iterative queries, put queries, server, routing maintenance, DHT statistics)
  • common/closest_nodes - moved shared data structure out of rpc

Extracted RoutingMaintenance and DhtStatistics from inline logic in the rpc tick loop into their own modules.
There are no public API changes and no performance regressions (benchmarked it using benchmarks in this repo and against pubky-homeserver). Added 4 benchmarks for ongoing regression tracking.

@afterburn afterburn force-pushed the refactor/arch branch 4 times, most recently from 7c12f32 to b1985d3 Compare February 6, 2026 14:58
@afterburn afterburn marked this pull request as ready for review February 6, 2026 15:40
@afterburn afterburn requested a review from 86667 February 11, 2026 10:17
@afterburn afterburn changed the base branch from main to v7 February 18, 2026 12:10
Copy link

@86667 86667 left a comment

Choose a reason for hiding this comment

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

Nice refactor - much cleaner. A few small comments

@86667
Copy link

86667 commented Feb 19, 2026

Also some docs on running benchmarks in the README and in the /benchmarks folder itself describing what each one does, what it is testing exactly and how this data can be used to mitigate regressions

@afterburn afterburn requested a review from 86667 February 19, 2026 14:49
Copy link
Contributor

@SeverinAlexB SeverinAlexB left a comment

Choose a reason for hiding this comment

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

I did not fully review the PR but I assume @86667 already did a good job in reviewing the main code changes.

About the benchmarks: @afterburn you are responsible to double check any AI generated code before anybody reviews so it holds up to its promises. The benchmarks are clearly not up to this standard and need to be fully rewritten.

I do like the initiative though and we do need better tests in mainline. Benchmarks like this are very important to provide feedback for humans and AIs. Especially for this reason, merging such sloppy benchmarks would be a disaster.

I suggest you create a separate PR for these benchmarks.

@afterburn
Copy link
Contributor Author

@SeverinAlexB removed benches from this PR, will address all the feedback you had for the benches in separate PR.

@afterburn afterburn merged commit e5ca746 into v7 Feb 24, 2026
9 checks passed
@afterburn afterburn deleted the refactor/arch branch February 24, 2026 11:15
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