testinprod-io / op-erigon

Optimism implementation on the efficiency frontier
https://op-erigon.testinprod.io
GNU Lesser General Public License v3.0
87 stars 15 forks source link

Arbitrary depth rewinding in Optimism forkchoice #153

Closed jyellick closed 7 months ago

jyellick commented 7 months ago

The current forkchoice code will not allow re-orgs to canonical blocks. This is consistent with the Ethereum specification, but is incorrect for Optimism. This change adds the ability to re-org a chain via a forkchoice to a canonical block.

ImTei commented 7 months ago

@jyellick Can you provide more details about the change, such as optimism specs or corresponding op-geth impl? I think this issue was handled in the past(https://github.com/testinprod-io/op-erigon/pull/8, https://github.com/testinprod-io/op-erigon/pull/16), but it appears to have become an issue again due to a change in upstream code. I wanna get confirm if this PR is the same issue.

jyellick commented 7 months ago

I think this issue was handled in the past(https://github.com/testinprod-io/op-erigon/pull/8, https://github.com/testinprod-io/op-erigon/pull/16), but it appears to have become an issue again due to a change in upstream code. I wanna get confirm if this PR is the same issue.

Correct, this is that same issue referenced in those others. When Erigon refactored the code to better support their internal consensus layer, it broke the re-org path for op-erigon.

Adding this change fixes dozens of broken tests in the op-e2e.