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

Replay for Byzantium data #436

Draft
wants to merge 6 commits into
base: jsign-replay-kaustinen6
Choose a base branch
from

Conversation

jsign
Copy link
Collaborator

@jsign jsign commented May 7, 2024

This PR is basically the branch from #431 but with further adjustments to allow trying to replay the old (smaller) replay data.

This PR isn't intended to be merged, but was to be able to fix anything that was a bug for replay to work in general. #431 configuration reg precompiles/instructions shouldn't be changed. At some point we need to decide to merge bug-related/adjustements to that branch, see comments.

@jsign jsign changed the title Jsign replay kaustinen6 for old Replay for Byzantium data May 7, 2024
core/vm/contracts.go Show resolved Hide resolved
core/vm/evm.go Show resolved Hide resolved
core/vm/evm.go Show resolved Hide resolved
Comment on lines -394 to +396
if transfersValue && !evm.chainRules.IsEIP4762 {
if transfersValue && (!evm.chainRules.IsEIP4762 || replayMode) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other case that we should disable the effects.

Copy link
Owner

Choose a reason for hiding this comment

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

but isn't just deactivating eip 4762 enough?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

note to self: no it isn't, because if you do then eip2929 is still active and we don't want to handle that case. I guess eip2929 becomes the new final boss.

core/vm/gas_table.go Show resolved Hide resolved
Comment on lines -325 to +326
bc.stateCache.InitTransitionStatus(true, true)
bc.stateCache.EndVerkleTransition()
bc.stateCache.InitTransitionStatus(false, false)
// bc.stateCache.EndVerkleTransition()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a required change to avoid an error when processing the second block.
Before merging we have to figure out a coherent way to do this for both replay and non-replay setups to work correctly.

Copy link
Owner

Choose a reason for hiding this comment

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

indeed. but if it's the only change that we have to keep in a separate branch, that's ok too.

core/state/database.go Show resolved Hide resolved
for i := prevNumber; i > 0 && i >= prevNumber-params.Eip2935BlockHashHistorySize; i-- {
for i := prevNumber; i > 0 && i > prevNumber-params.Eip2935BlockHashHistorySize; i-- {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can be removed when #438 is merged and the base branch change bubbles up when we rebase branches. For now leaving the fix since it's needed.

@jsign jsign requested a review from gballet May 8, 2024 17:35
Copy link
Owner

Choose a reason for hiding this comment

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

note to self: these changes are why this can't be merged, it's only to replay very old stuff.

jsign added 5 commits June 7, 2024 11:21
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign jsign force-pushed the jsign-replay-kaustinen6-for-old branch from b524731 to cd92db3 Compare June 7, 2024 14:23
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
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