Skip to content

indexer: fix metrics, reduce DB load#2272

Merged
mslipper merged 3 commits intoethereum-optimism:developfrom
mslipper:bugfix/metrics
Mar 7, 2022
Merged

indexer: fix metrics, reduce DB load#2272
mslipper merged 3 commits intoethereum-optimism:developfrom
mslipper:bugfix/metrics

Conversation

@mslipper
Copy link
Collaborator

@mslipper mslipper commented Mar 7, 2022

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Mar 7, 2022

⚠️ No Changeset found

Latest commit: f02b940

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

@mslipper mslipper changed the title indexer: fix metrics indexer: fix metrics, reduce DB load Mar 7, 2022
@mslipper mslipper requested a review from tuxcanfly March 7, 2022 17:20
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2022

Codecov Report

Merging #2272 (f02b940) into develop (51a527b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2272   +/-   ##
========================================
  Coverage    80.08%   80.08%           
========================================
  Files           77       77           
  Lines         2460     2460           
  Branches       450      450           
========================================
  Hits          1970     1970           
  Misses         490      490           
Flag Coverage Δ
contracts 99.29% <ø> (ø)
core-utils 86.77% <ø> (ø)
data-transport-layer 49.72% <ø> (ø)
sdk 55.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51a527b...f02b940. Read the comment docs.

Copy link
Contributor

@tuxcanfly tuxcanfly left a comment

Choose a reason for hiding this comment

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

OK. LGTM.

deposits := depositsByBlockHash[blockHash]
batches := stateBatches[blockHash]

if len(deposits) == 0 && len(batches) == 0 && i != len(headers)-1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, this saves a lot of unnecessary db call preps.

headerSelector *ConfirmedHeaderSelector

metrics *metrics.Metrics
metrics *metrics.Metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure where these came from, gofmt should have fixed them, thanks.

return &Metrics{
SyncHeight: promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "l1_sync_height",
Name: "sync_height",
Copy link
Contributor

Choose a reason for hiding this comment

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

I see we are using a single metric with l1/l2 labels. Should the Help comment below be updated to reflect the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah good catch. Fixing now.

@mslipper mslipper merged commit 7f42e18 into ethereum-optimism:develop Mar 7, 2022
theochap pushed a commit that referenced this pull request Dec 10, 2025
theochap pushed a commit that referenced this pull request Dec 10, 2025
theochap pushed a commit that referenced this pull request Dec 10, 2025
This PR
- adds the acceptance test for the preinterop which is being skipped as
of now due `op_contract_deployer_params ` issues
- fix the flaky existing test cases


Closes #2272
theochap pushed a commit that referenced this pull request Jan 14, 2026
theochap pushed a commit that referenced this pull request Jan 14, 2026
theochap pushed a commit that referenced this pull request Jan 14, 2026
This PR
- adds the acceptance test for the preinterop which is being skipped as
of now due `op_contract_deployer_params ` issues
- fix the flaky existing test cases


Closes #2272
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.

3 participants