blockworks-foundation / mango-feeds

GNU Affero General Public License v3.0
3 stars 3 forks source link

Port account_fetcher.rs to mango-feeds #5

Open grooviegermanikus opened 1 year ago

grooviegermanikus commented 1 year ago

A account/cain data retrieval utility has been implemented in Rust in the course of mango-v4 project.

Problem:

Maintaining and replicating account state is cumbersome to implement and imposes risk of high traffic on RPC-Nodes.

Proposed solution:

Take the Rust account_fetcher.rs and *chain_data_fetcher.rs' util and make it reusable as part of mango-feeds-connector.

Features:

note: chain_data_fetcher.rs is about account state - all other data (e.g. slot) is required to implement the replication

Architecture:

Milestones:

  1. Design a Rust ABI based on research of current users of account_fetcher.rs.
  2. Extract account store interface and refactor existing in-memory as a reference implementation.
grooviegermanikus commented 1 year ago

Donatello account_fetcher.rs is actual a copy of chain_data_fetcher.rs. Yet the name AccountFetcher clashes. The account_fetcher.rs in mango-v4 implements an account rpc client + cache.

grooviegermanikus commented 10 months ago

some mango services use sync rust code to fetch accounts; yet we do not want to maintain sync+async code for account_fetcher -> isolate the sync-code and refactor only the async code

current work on refactoring is mango and connector