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

Revert historical rpc #247

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Revert historical rpc #247

merged 2 commits into from
Oct 3, 2024

Conversation

piersy
Copy link

@piersy piersy commented Oct 2, 2024

This reverts the changes made to trigger the historical RPC based on the cel2 block time.

The reason for this is that there are [tests] in optimism (https://github.com/celo-org/optimism/blob/78d41a3be3c1759e32965a9eb2e69c146eda02b6/op-e2e/op_geth_test.go#L232) that test pre and post time based forks. These test were failing on this PR:

The function used to construct the genesis assumes that the time based forks take the time of the L1 start block and sets all time based forks to the L1 start block time. If we set the Cel2Time to the L1 start block time and then try to test some pre fork execution behaviour, the op-geth RPC api will interpret that request as a request that needs to be proxied but in these tests no proxy is set so the tests fail.

Previously the test relied on the fact that the bedrock block defaults to zero, and since the old RPC implementation only proxies requests older than bedrock it ensures that no requests need proxying.

It turns out that we can use the bedrock block as well, since we always set the bedrock block to be the same block as the migration block. So simply removing the changes made for historical RPC actually works well, and fixes the tests in the aforementioned PR.

@alecps
Copy link

alecps commented Oct 3, 2024

@piersy do we not want to add HistoricalRPCService to debug_traceCall?

@piersy
Copy link
Author

piersy commented Oct 3, 2024

@piersy do we not want to add HistoricalRPCService to debug_traceCall?

Oh no, we do! Updated thanks @alecps !

Copy link

@alecps alecps left a comment

Choose a reason for hiding this comment

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

Makes sense! We may want to add a comment somewhere (maybe where IsOptimismPreBedrock is declared) explaining why this is used as the HistoricalRPCService pivot point rather than the Cel2Time

@piersy piersy merged commit fd593f2 into celo8 Oct 3, 2024
7 checks passed
@piersy piersy deleted the piersy/revert-historical-rpc branch October 3, 2024 17:36
@piersy
Copy link
Author

piersy commented Oct 3, 2024

s sense! We may want to add a comment somewhere (maybe where IsOptimismPreBedrock is declared) explaining why this is used as the HistoricalRPCService pivot point rather than the Cel2Time

Ok merged before I added that, will add it in another PR

karlb pushed a commit that referenced this pull request Oct 11, 2024
This reverts the changes made to trigger the historical RPC based on the cel2
block time. (although we retain support for historical execution for
debug_traceCall)

The reason for this is that there are [tests] in optimism
(https://github.com/celo-org/optimism/blob/78d41a3be3c1759e32965a9eb2e69c146eda02b6/op-e2e/op_geth_test.go#L232)
that test pre and post time based forks. These test were failing on this PR:

* celo-org/optimism#243

The function used to [construct the
genesis](https://github.com/celo-org/optimism/blob/78d41a3be3c1759e32965a9eb2e69c146eda02b6/op-chain-ops/genesis/genesis.go#L25)
assumes that the time based forks take the time of the L1 start block and sets
all time based forks to the L1 start block time. If we set the Cel2Time to the
L1 start block time and then try to test some pre fork execution behaviour, the
op-geth RPC api will interpret that request as a request that needs to be
proxied but in these tests no proxy is set so the tests fail.

Previously the test relied on the fact that the bedrock block defaults to zero,
and since the old RPC implementation only proxies requests older than bedrock
it ensures that no requests need proxying.

It turns out that we can use the bedrock block as well, since we always set the
bedrock block to be the same block as the migration block. So simply removing
the changes made for historical RPC actually works well, and fixes the tests in
the aforementioned PR.
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.

2 participants