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

Integrate Epoch Block Oracle #479

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Integrate Epoch Block Oracle #479

merged 1 commit into from
Sep 27, 2022

Conversation

hopeyen
Copy link
Contributor

@hopeyen hopeyen commented Sep 7, 2022

In preparation for the Epoch Block Oracle (EBO) to be the source of true latest valid epochs and latest valid epoch start blocks in the multi-chain world, This PR integrates the EBO subgraph such that indexer-agent,common,service can resolve POIs for subgraph deployments on different networks.

Usage

  • Supply indexer-agent startup param endpoint --block-oracle-endpoint
  • Make sure your graph node has correct ethereum connections (mainnet, goerli, gnosis, etc)

Updates/Notes

  • Hardcoded constant variable of supported network aliasing NetworkAliases for Ethereum mainnet, goerli, and gnosis chain. (Remove once aliasing happens on the EBO subgraph or the graph node.
  • When resolving POI for an allocation, query the EBO subgraph for start block number, and then query graph node for the corresponding block hash.
    -- This replaces the previous process: query the network epochManager contract for the current epoch start block, then query the indexer agent's eth client for the block hash.
  • We can replace currentEpochs and other getBlock(...).hash calls later on

@hopeyen hopeyen force-pushed the hope/integrate-block-oracle branch 3 times, most recently from 5f9af3f to 61f0148 Compare September 8, 2022 17:10
@hopeyen hopeyen force-pushed the hope/integrate-block-oracle branch 3 times, most recently from c2a45eb to 728d4a0 Compare September 16, 2022 20:27
@hopeyen hopeyen marked this pull request as ready for review September 16, 2022 20:41
@hopeyen hopeyen requested a review from fordN September 16, 2022 20:46
@fordN fordN requested a review from tilacog September 21, 2022 17:37
packages/indexer-common/src/indexer-management/monitor.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/indexer-management/monitor.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
packages/indexer-agent/src/agent.ts Show resolved Hide resolved
packages/indexer-service/src/commands/start.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/errors.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/indexer-management/monitor.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/indexer-management/monitor.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@tilacog tilacog left a comment

Choose a reason for hiding this comment

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

LGTM, considering the Epoch Subgraph scope.
I would say that removing rinkeby as an indexed chaing is the only required change on that matter.

@hopeyen hopeyen force-pushed the hope/integrate-block-oracle branch 4 times, most recently from fd5b3a9 to 212ab95 Compare September 26, 2022 23:12
Copy link
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

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

Getting close!

packages/indexer-common/src/indexer-management/monitor.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/indexing-status.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/index.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/allocations/types.ts Outdated Show resolved Hide resolved
packages/indexer-common/src/allocations/types.ts Outdated Show resolved Hide resolved
@hopeyen hopeyen force-pushed the hope/integrate-block-oracle branch 3 times, most recently from f01a133 to 5994add Compare September 27, 2022 20:31
Copy link
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@hopeyen hopeyen merged commit 5311ec0 into main Sep 27, 2022
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.

None yet

3 participants