Skip to content

feat!: drop legacy storage - #1117

Merged
benjlevesque merged 48 commits into
masterfrom
feat/drop-legacy-storage
Oct 25, 2023
Merged

feat!: drop legacy storage#1117
benjlevesque merged 48 commits into
masterfrom
feat/drop-legacy-storage

Conversation

@benjlevesque

@benjlevesquebenjlevesque commented Jun 20, 2023

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: Dropping legacy indexing mechanism.

Changes:

  • enforce usage of TheGraph as a backend for request-node
  • drop all custom indexing code (mostly DataAccess)
  • refactor DataAccess to rely on an Indexer
  • refactor mock to use in-memory indexer
  • reduce dependency to TheGraph by abstracting most of the code transformation. TheGraph dependency is now down to only the SubgraphClient.

@benjlevesque
benjlevesque changed the base branch from master to refactor/request-node/configJune 20, 2023 22:17
@benjlevesquebenjlevesque changed the title feat/drop legacy storagefeat!: drop legacy storageJun 20, 2023
Base automatically changed from refactor/request-node/config to masterJune 23, 2023 08:43
@benjlevesque
benjlevesqueforce-pushed the feat/drop-legacy-storage branch from 36b281d to e339f76CompareJune 23, 2023 09:10
@MantisClone

Copy link
Copy Markdown
Contributor

I recognize that the legacy indexing mechanism doesn't work on many chains, is difficult to maintain, and that no one wants to spend the time to fix it. For those reasons, I agree that removing it now is the right move.

Nonetheless, would it be possible to leave injection points such that someone could plug in their own custom indexer into the protocol?

@benjlevesque

Copy link
Copy Markdown
ContributorAuthor

I recognize that the legacy indexing mechanism doesn't work on many chains, is difficult to maintain, and that no one wants to spend the time to fix it. For those reasons, I agree that removing it now is the right move.

Nonetheless, would it be possible to leave injection points such that someone could plug in their own custom indexer into the protocol?

Yes @MantisClone; that would be best indeed! These injection points are still available, but not as the Node level (same as today). I've introduced a new layer called "indexer" that represents better the way things are (it would actually be possible to keep the old code with this indexer layer, but it's not efficient so better remove it).

This PR is still draft because I'm trying to reduce the surface of TheGraph in the code; it should be down to only the Subgraph Client, graphql queries and types. The rest could be generalised to work with any type of indexer.

@benjlevesque
benjlevesqueforce-pushed the feat/drop-legacy-storage branch from d34fb57 to 185f6b2CompareJune 26, 2023 08:02
@benjlevesque
benjlevesqueforce-pushed the feat/drop-legacy-storage branch from 185f6b2 to ca607aeCompareJuly 12, 2023 10:39
@benjlevesque
benjlevesqueforce-pushed the feat/drop-legacy-storage branch 2 times, most recently from f449cb1 to 70119e9CompareJuly 25, 2023 15:30
@@ -1,42 +1,29 @@
#!/usr/bin/env node

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

this file now only creates the server object, but doesn't start it. startNode is called from bin.ts

@@ -1,36 +1,182 @@
import { DataAccess, TransactionIndex } from '@requestnetwork/data-access';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

requestNodeBase.ts moved to requestNode.ts

@@ -0,0 +1,194 @@
import { DataAccessTypes, StorageTypes } from '@requestnetwork/types';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

moved from packages/thegraph-data-access/src/data-access.ts

@@ -0,0 +1,32 @@
import { DataAccessTypes } from '@requestnetwork/types';

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

moved from packages/thegraph-data-access/src/data-access.ts

Comment threadpackages/ethereum-storage/src/ethereum-utils.ts

@yomarionyomarion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Massive!

Comment threadpackages/usage-examples/src/request-client-js-erc20-request.ts Outdated
Comment threadpackages/request-client.js/src/http-metamask-data-access.ts Outdated
Comment threadpackages/request-node/test/getConfirmedTransaction.test.ts
Comment threadpackages/thegraph-data-access/src/subgraph-client.ts

@MantisCloneMantisClone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm about 1/4th of the way through the review.

Comment threadREADME.md

@MantisCloneMantisClone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Impressive refactor! Only a few minor comments.

Comment threadpackages/request-client.js/src/http-request-network.ts
Comment threadpackages/request-node/src/dataAccess.ts
Comment threadpackages/request-node/src/dataAccess.ts
Comment threadpackages/request-node/test/getChannelsByTopic.test.ts
Comment threadpackages/request-node/test/getChannelsByTopic.test.ts
Comment threadpackages/thegraph-data-access/src/types.ts

@alexandre-abriouxalexandre-abrioux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👏

@benjlevesque

benjlevesque commented Nov 14, 2023

Copy link
Copy Markdown
ContributorAuthor

NB: from now on, the IPFS_URL environment variable replaces IPFS_HOST, IPFS_PORT and IPFS_PROTOCOL

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants

@benjlevesque@MantisClone@coveralls@alexandre-abrioux@yomarion