Skip to content

feat(indexer) consolidate retrieval of finalized headers#5840

Merged
OptimismBot merged 6 commits intodevelopfrom
indexer.fetcher
Jun 5, 2023
Merged

feat(indexer) consolidate retrieval of finalized headers#5840
OptimismBot merged 6 commits intodevelopfrom
indexer.fetcher

Conversation

@hamdiallam
Copy link
Contributor

@hamdiallam hamdiallam commented May 31, 2023

The Fetcher will be used to drive new batches of headers to check. This can be used against both the L1 and L2 instances. Not super clear why the indexer currently duplicates this logic in both L1/L2

Follow up

  1. Implement the processor which will poll the Fetcher
  2. Investigate if we can utilize a subscription for new headers instead of polling
  3. More robust implementation for the EthClient interface. See some of the comments on this PR

@hamdiallam hamdiallam requested a review from roninjin10 May 31, 2023 16:04
@hamdiallam hamdiallam requested a review from a team as a code owner May 31, 2023 16:04
@changeset-bot
Copy link

changeset-bot bot commented May 31, 2023

⚠️ No Changeset found

Latest commit: 97de2f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented May 31, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 97de2f2
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/647e25a4bce82d0008755176

@mergify mergify bot added the A-indexer Area: indexer label May 31, 2023
@tynes
Copy link
Contributor

tynes commented May 31, 2023

Could reuse this tooling for the batch calling:

func (b *BaseRPCClient) BatchCallContext(ctx context.Context, batch []rpc.BatchElem) error {

I think this is what you'd want to use:

func NewInstrumentedRPC(c RPC, m *metrics.Metrics) *InstrumentedRPCClient {

@hamdiallam
Copy link
Contributor Author

Could reuse this tooling for the batch calling:

func (b *BaseRPCClient) BatchCallContext(ctx context.Context, batch []rpc.BatchElem) error {

I think this is what you'd want to use:

func NewInstrumentedRPC(c RPC, m *metrics.Metrics) *InstrumentedRPCClient {

ooh nice this is helpful thanks! I'll revisit a lot of the EthClient implementation when we incorporating retries/backoff

@roninjin10
Copy link
Contributor

@roninjin10
Copy link
Contributor

DX-50

@roninjin10
Copy link
Contributor

FE-1197 does it work for ecosystem team?

@hamdiallam
Copy link
Contributor Author

Updated so that the fetcher holds reference to the last header. Useful so that the fetcher can ensure the next batch is chained correctly on the last header

@hamdiallam
Copy link
Contributor Author

Copying @roninjin10 comment about batch sizes

Just sharing context on how others do this:

Ponder fetches an extremely aggressive amount at once and then if it fails backs off to more conservative amounts.

The graph does the opposite where it tries to get more aggressive as it goes

@mergify
Copy link
Contributor

mergify bot commented Jun 5, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Jun 5, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Jun 5, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@OptimismBot OptimismBot merged commit c3e5465 into develop Jun 5, 2023
@OptimismBot OptimismBot deleted the indexer.fetcher branch June 5, 2023 18:17
@mergify mergify bot removed the on-merge-train label Jun 5, 2023
@hamdiallam hamdiallam changed the title [indexer] consolidate retrieval of finalized headers feat(indexer) consolidate retrieval of finalized headers Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-indexer Area: indexer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants