Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore_: initial steps to decouple rpc chain modules #5856

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dlipicar
Copy link
Contributor

@dlipicar dlipicar commented Sep 19, 2024

The way RPC chain modules were written, it is an extreme pain in the ass to work with them and write tests for them.
This PR doesn't solve that problem, it's just the initial steps of an attempt to bring some order into them, which I needed for activity-related tasks.

There should be 0 functional changes here, I just defined some new interfaces, split packages to avoid circular dependencies in mock files and split some pieces of code to separate classes.

  • Tagger and RPCLimiter moved to separate packages
  • EthClientInterface defined, representing a high-level wrapper around an rpc.Client (extension of go-ethereum's ethclient.Client) . EthClient defined as its implementation.
  • RPSLimitedEthClientInterface defined, extending EthClientInterface with some random dependencies needed by a bunch of places in the status-go. This shouldn't really exist, ideally we would only use EthClientInterface everywhere and users wouldn't know if there's RPS limiting, fallbacks or caching involved. Anyway, solving this properly requires much more work, we can think about it later.
  • ChainInterface removed, it wasn't used anywhere and was replaced by EthClientInterface.
  • ClientWithFallback now takes RPSLimitedEthClientInterface instead of the objects themselves.

@status-im-auto
Copy link
Member

status-im-auto commented Sep 19, 2024

Jenkins Builds

Click to see older builds (10)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 46b0119 #1 2024-09-19 19:20:35 ~1 min tests 📄log
✖️ 46b0119 #1 2024-09-19 19:20:42 ~1 min tests-rpc 📄log
46b0119 #1 2024-09-19 19:20:56 ~1 min linux 📄log
46b0119 #1 2024-09-19 19:20:56 ~1 min android 📄log
46b0119 #1 2024-09-19 19:21:01 ~1 min ios 📄log
✖️ 91121fa #2 2024-09-19 19:21:11 ~10 sec tests-rpc 📄log
91121fa #2 2024-09-19 19:21:42 ~33 sec linux 📄log
91121fa #2 2024-09-19 19:21:42 ~28 sec android 📄log
91121fa #2 2024-09-19 19:22:24 ~1 min ios 📄log
✖️ 91121fa #2 2024-09-19 19:22:55 ~1 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5eacecf #3 2024-09-19 19:27:51 ~2 min tests-rpc 📄log
✖️ 5eacecf #3 2024-09-19 19:27:56 ~2 min tests 📄log
✔️ 5eacecf #3 2024-09-19 19:28:56 ~3 min linux 📦zip
✔️ 5eacecf #3 2024-09-19 19:29:11 ~4 min ios 📦zip
✔️ 5eacecf #3 2024-09-19 19:29:51 ~4 min android 📦aar
✖️ 44da971 #4 2024-09-19 19:29:46 ~1 min tests 📄log
✔️ 44da971 #4 2024-09-19 19:30:29 ~2 min tests-rpc 📄log
✔️ 44da971 #4 2024-09-19 19:31:22 ~2 min linux 📦zip
✔️ 44da971 #4 2024-09-19 19:32:23 ~2 min android 📦aar
✔️ 44da971 #4 2024-09-19 19:33:41 ~4 min ios 📦zip

@dlipicar dlipicar force-pushed the chore/initial-rpc-chain-modules-decoupling branch from 46b0119 to 91121fa Compare September 19, 2024 19:20
@dlipicar dlipicar changed the title chore: initial steps to decouple rpc chain modules chore_: initial steps to decouple rpc chain modules Sep 19, 2024
@dlipicar dlipicar force-pushed the chore/initial-rpc-chain-modules-decoupling branch from 91121fa to 5eacecf Compare September 19, 2024 19:24
@dlipicar dlipicar force-pushed the chore/initial-rpc-chain-modules-decoupling branch from 5eacecf to 44da971 Compare September 19, 2024 19:27
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.

2 participants