Commit 4f228fe9 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #5751 from ethereum-optimism/bugfix/wheel-header-copy

op-wheel: Copy the header safely
parents fc56ded1 dfdbf721
...@@ -10,6 +10,8 @@ import ( ...@@ -10,6 +10,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/beacon" "github.com/ethereum/go-ethereum/consensus/beacon"
...@@ -104,7 +106,7 @@ func (ch *Cheater) RunAndClose(fn HeadFn) error { ...@@ -104,7 +106,7 @@ func (ch *Cheater) RunAndClose(fn HeadFn) error {
_ = ch.Close() _ = ch.Close()
return fmt.Errorf("failed to commit state change: %w", err) return fmt.Errorf("failed to commit state change: %w", err)
} }
header := preHeader // copy the header header := types.CopyHeader(preHeader) // copy the header
header.Root = stateRoot header.Root = stateRoot
blockHash := header.Hash() blockHash := header.Hash()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment