Skip to content

l2geth: fix eth call evm context#632

Merged
gakonst merged 3 commits intomasterfrom
fix/eth-call-blocknumber
Apr 26, 2021
Merged

l2geth: fix eth call evm context#632
gakonst merged 3 commits intomasterfrom
fix/eth-call-blocknumber

Conversation

@tynes
Copy link
Contributor

@tynes tynes commented Apr 26, 2021

Description
Uses the correct block.number and block.timestamp for eth_call. It was previously using the block number and timestamp of the L2 block instead of the L1 based context.

Metadata
Fixes #530

@changeset-bot
Copy link

changeset-bot bot commented Apr 26, 2021

🦋 Changeset detected

Latest commit: 8497e65

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@eth-optimism/integration-tests Patch
@eth-optimism/l2geth Patch

Not sure what this means? Click here to learn what changesets are.

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

@tynes tynes force-pushed the fix/eth-call-blocknumber branch from c747b02 to 6cb103d Compare April 26, 2021 19:22
@tynes tynes marked this pull request as ready for review April 26, 2021 19:32
@@ -968,6 +981,8 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
gp := new(core.GasPool).AddGas(math.MaxUint64)
if vm.UsingOVM {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need a less error prone way of getting an EVM with the correct context set, otherwise we need to make sure to mutate the evm context externally in each codepath that it is used. Thinking about the correct place to slot in will be left to the berlin geth migration

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you open an issue describing the desired solution you have in mind?

@snario snario removed their request for review April 26, 2021 19:35
@@ -968,6 +981,8 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
gp := new(core.GasPool).AddGas(math.MaxUint64)
if vm.UsingOVM {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you open an issue describing the desired solution you have in mind?

@gakonst gakonst merged commit 5b9be2e into master Apr 26, 2021
@gakonst gakonst deleted the fix/eth-call-blocknumber branch April 26, 2021 19:44
InoMurko pushed a commit to omgnetwork/optimism that referenced this pull request May 25, 2021
* l2geth: correct timestamp + blocknumber in eth_call

* test: correct eth_call blocknumber + timestamp

* chore: add changeset
emhane added a commit that referenced this pull request Feb 4, 2026
#632)

Ref op-rs/op-reth#631

- Changes nested database tx type to owned type as has no need to be ref
- Uses `AsyncFnOnce`(new in Rust 1.85) instead of generic future return
type
emhane added a commit that referenced this pull request Feb 4, 2026
#632)

Ref op-rs/op-reth#631

- Changes nested database tx type to owned type as has no need to be ref
- Uses `AsyncFnOnce`(new in Rust 1.85) instead of generic future return
type
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.

Behaviour of block.number on eth_call is incorrect

2 participants