Skip to content

op-program: Implement oracle backed database#5349

Merged
OptimismBot merged 2 commits intodevelopfrom
aj/fpp-oracle-db
Apr 6, 2023
Merged

op-program: Implement oracle backed database#5349
OptimismBot merged 2 commits intodevelopfrom
aj/fpp-oracle-db

Conversation

@ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Apr 5, 2023

Description

Adds an implementation of ethdb.KeyValueStore sufficient to be used for block processing.

Also adds separate oracle method to access code by hash to support the way Geth now adds a prefix to the hash when storing new code values in the database.

Removed the context from oracle methods and stored one as a property in the fetcher implementation. This isn't the typical golang pattern but it fits better here as we'll need to support a fully synchronous, local execution mode where having a context doesn't make sense and a context isn't passed into the ethdb.KeyValueStore methods.

Tests

Tested the database adapter methods directly for low lever behaviour, as well as a backing for an op-geth statedb to ensure the database behaviour is compatible with the real code using it.

Metadata

@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2023

⚠️ No Changeset found

Latest commit: 8fe0096

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 Apr 5, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 8fe0096
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/642e13ff89fbfb00082833b9

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #5349 (8fe0096) into develop (1ee6896) will decrease coverage by 3.56%.
The diff coverage is 62.29%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5349      +/-   ##
===========================================
- Coverage    38.84%   35.28%   -3.56%     
===========================================
  Files          394      240     -154     
  Lines        26345    21890    -4455     
  Branches       838        0     -838     
===========================================
- Hits         10233     7724    -2509     
+ Misses       15331    13421    -1910     
+ Partials       781      745      -36     
Flag Coverage Δ
bedrock-go-tests 35.28% <62.29%> (+0.05%) ⬆️
common-ts-tests ?
contracts-bedrock-tests ?
contracts-tests ?
core-utils-tests ?
dtl-tests ?
fault-detector-tests ?
sdk-tests ?

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

Impacted Files Coverage Δ
op-program/cmd/main.go 68.85% <0.00%> (-1.15%) ⬇️
op-program/l2/db.go 53.65% <53.65%> (ø)
op-program/l2/fetcher.go 66.66% <88.88%> (+12.49%) ⬆️

... and 157 files with indirect coverage changes

@ajsutton ajsutton marked this pull request as ready for review April 5, 2023 03:16
@ajsutton ajsutton requested a review from a team as a code owner April 5, 2023 03:16
@ajsutton ajsutton requested review from mslipper and protolambda and removed request for mslipper April 5, 2023 03:16
@ajsutton ajsutton force-pushed the aj/fpp-oracle-db branch 2 times, most recently from 3640864 to c09dd88 Compare April 5, 2023 03:27
Copy link
Contributor

@protolambda protolambda left a comment

Choose a reason for hiding this comment

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

LGTM, but the prefix check looks unsafe, so I'll mark this as request-changes for now. If it's actually safe this way then a comment would help for later readers.

Adds separate oracle method to access code by hash to support the way Geth now adds a prefix to the hash when storing new code values in the database.
@mergify
Copy link
Contributor

mergify bot commented Apr 5, 2023

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

@mergify
Copy link
Contributor

mergify bot commented Apr 6, 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 Apr 6, 2023

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

@OptimismBot OptimismBot merged commit 5eae816 into develop Apr 6, 2023
@OptimismBot OptimismBot deleted the aj/fpp-oracle-db branch April 6, 2023 00:52
@mergify mergify bot removed the on-merge-train label Apr 6, 2023
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