Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e9045720
Unverified
Commit
e9045720
authored
Feb 22, 2023
by
Matthew Slipper
Committed by
GitHub
Feb 22, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4898 from ethereum-optimism/update-op-geth
bedrock: update op-geth to v1.11.2
parents
6da12c7c
37fc57c1
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
333 additions
and
115 deletions
+333
-115
go.mod
go.mod
+19
-10
go.sum
go.sum
+161
-27
txmgr.go
op-batcher/batcher/txmgr.go
+1
-1
util.go
op-chain-ops/db/util.go
+9
-1
deployer.go
op-chain-ops/deployer/deployer.go
+0
-2
db.go
op-chain-ops/ether/db.go
+9
-8
check.go
op-chain-ops/genesis/check.go
+28
-12
db_migration.go
op-chain-ops/genesis/db_migration.go
+1
-1
genesis.go
op-chain-ops/genesis/genesis.go
+0
-4
layer_one.go
op-chain-ops/genesis/layer_one.go
+7
-1
action.go
op-chain-ops/genesis/migration_action/action.go
+10
-1
memory_db.go
op-chain-ops/state/memory_db.go
+13
-0
l1_miner.go
op-e2e/actions/l1_miner.go
+2
-2
l2_batcher.go
op-e2e/actions/l2_batcher.go
+2
-2
l2_engine.go
op-e2e/actions/l2_engine.go
+4
-4
l2_engine_api.go
op-e2e/actions/l2_engine_api.go
+17
-18
geth.go
op-e2e/geth.go
+1
-0
types.go
op-node/eth/types.go
+2
-2
types_test.go
op-node/rollup/types_test.go
+3
-2
cheat.go
op-wheel/cheat/cheat.go
+31
-5
engine.go
op-wheel/engine/engine.go
+13
-12
No files found.
go.mod
View file @
e9045720
...
@@ -9,7 +9,7 @@ require (
...
@@ -9,7 +9,7 @@ require (
github.com/docker/docker v20.10.21+incompatible
github.com/docker/docker v20.10.21+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/go-connections v0.4.0
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum/go-ethereum v1.1
0.26
github.com/ethereum/go-ethereum v1.1
1.2
github.com/fsnotify/fsnotify v1.6.0
github.com/fsnotify/fsnotify v1.6.0
github.com/golang/snappy v0.0.4
github.com/golang/snappy v0.0.4
github.com/google/go-cmp v0.5.9
github.com/google/go-cmp v0.5.9
...
@@ -31,11 +31,12 @@ require (
...
@@ -31,11 +31,12 @@ require (
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.1
github.com/urfave/cli v1.22.9
github.com/urfave/cli v1.22.9
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa
golang.org/x/crypto v0.
4
.0
golang.org/x/crypto v0.
6
.0
golang.org/x/term v0.5.0
golang.org/x/term v0.5.0
)
)
require (
require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/allegro/bigcache v1.2.1 // indirect
github.com/allegro/bigcache v1.2.1 // indirect
...
@@ -45,12 +46,16 @@ require (
...
@@ -45,12 +46,16 @@ require (
github.com/btcsuite/btcd/btcutil v1.1.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.0 // indirect
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/cgroups v1.0.4 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set
v1.8
.0 // indirect
github.com/deckarep/golang-set
/v2 v2.1
.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/deepmap/oapi-codegen v1.8.2 // indirect
github.com/deepmap/oapi-codegen v1.8.2 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
...
@@ -62,6 +67,7 @@ require (
...
@@ -62,6 +67,7 @@ require (
github.com/flynn/noise v1.0.0 // indirect
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-kit/kit v0.10.0 // indirect
github.com/go-kit/kit v0.10.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
...
@@ -72,7 +78,7 @@ require (
...
@@ -72,7 +78,7 @@ require (
github.com/golang/mock v1.6.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-202
21203041831-ce31453925ec
// indirect
github.com/google/pprof v0.0.0-202
30207041349-798e818bf904
// indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/graph-gophers/graphql-go v1.3.0 // indirect
github.com/graph-gophers/graphql-go v1.3.0 // indirect
...
@@ -81,7 +87,7 @@ require (
...
@@ -81,7 +87,7 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/huin/goupnp v1.
0.3
// indirect
github.com/huin/goupnp v1.
1.0
// indirect
github.com/influxdata/influxdb v1.8.3 // indirect
github.com/influxdata/influxdb v1.8.3 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect
github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect
...
@@ -95,6 +101,7 @@ require (
...
@@ -95,6 +101,7 @@ require (
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect
github.com/koron/go-ssdp v0.0.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
...
@@ -106,7 +113,7 @@ require (
...
@@ -106,7 +113,7 @@ require (
github.com/libp2p/go-reuseport v0.2.0 // indirect
github.com/libp2p/go-reuseport v0.2.0 // indirect
github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-colorable v0.1.1
2
// indirect
github.com/mattn/go-colorable v0.1.1
3
// indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/miekg/dns v1.1.50 // indirect
...
@@ -148,13 +155,13 @@ require (
...
@@ -148,13 +155,13 @@ require (
github.com/quic-go/webtransport-go v0.5.1 // indirect
github.com/quic-go/webtransport-go v0.5.1 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/r
jeczalik/notify v0.9.2
// indirect
github.com/r
ogpeppe/go-internal v1.9.0
// indirect
github.com/rs/cors v1.8.2 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/status-im/keycard-go v0.
0.0-20211109104530-b0e0482ba91d
// indirect
github.com/status-im/keycard-go v0.
2.0
// indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
...
@@ -184,4 +191,6 @@ require (
...
@@ -184,4 +191,6 @@ require (
nhooyr.io/websocket v1.8.7 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20230214215134-401b7fd3309b
replace github.com/ethereum/go-ethereum v1.11.2 => github.com/ethereum-optimism/op-geth v0.0.0-20230222154945-12d211246519
//replace github.com/ethereum/go-ethereum v1.11.2 => ../go-ethereum
go.sum
View file @
e9045720
This diff is collapsed.
Click to expand it.
op-batcher/batcher/txmgr.go
View file @
e9045720
...
@@ -120,7 +120,7 @@ func (t *TransactionManager) CraftTx(ctx context.Context, data []byte) (*types.T
...
@@ -120,7 +120,7 @@ func (t *TransactionManager) CraftTx(ctx context.Context, data []byte) (*types.T
}
}
t
.
log
.
Info
(
"creating tx"
,
"to"
,
rawTx
.
To
,
"from"
,
t
.
senderAddress
)
t
.
log
.
Info
(
"creating tx"
,
"to"
,
rawTx
.
To
,
"from"
,
t
.
senderAddress
)
gas
,
err
:=
core
.
IntrinsicGas
(
rawTx
.
Data
,
nil
,
false
,
true
,
true
)
gas
,
err
:=
core
.
IntrinsicGas
(
rawTx
.
Data
,
nil
,
false
,
true
,
true
,
false
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to calculate intrinsic gas: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to calculate intrinsic gas: %w"
,
err
)
}
}
...
...
op-chain-ops/db/util.go
View file @
e9045720
...
@@ -10,7 +10,15 @@ import (
...
@@ -10,7 +10,15 @@ import (
func
Open
(
path
string
,
cache
int
,
handles
int
)
(
ethdb
.
Database
,
error
)
{
func
Open
(
path
string
,
cache
int
,
handles
int
)
(
ethdb
.
Database
,
error
)
{
chaindataPath
:=
filepath
.
Join
(
path
,
"geth"
,
"chaindata"
)
chaindataPath
:=
filepath
.
Join
(
path
,
"geth"
,
"chaindata"
)
ancientPath
:=
filepath
.
Join
(
chaindataPath
,
"ancient"
)
ancientPath
:=
filepath
.
Join
(
chaindataPath
,
"ancient"
)
ldb
,
err
:=
rawdb
.
NewLevelDBDatabaseWithFreezer
(
chaindataPath
,
cache
,
handles
,
ancientPath
,
""
,
false
)
ldb
,
err
:=
rawdb
.
Open
(
rawdb
.
OpenOptions
{
Type
:
"leveldb"
,
Directory
:
chaindataPath
,
AncientsDirectory
:
ancientPath
,
Namespace
:
""
,
Cache
:
cache
,
Handles
:
handles
,
ReadOnly
:
false
,
})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
op-chain-ops/deployer/deployer.go
View file @
e9045720
...
@@ -63,8 +63,6 @@ func NewBackendWithGenesisTimestamp(ts uint64) *backends.SimulatedBackend {
...
@@ -63,8 +63,6 @@ func NewBackendWithGenesisTimestamp(ts uint64) *backends.SimulatedBackend {
LondonBlock
:
big
.
NewInt
(
0
),
LondonBlock
:
big
.
NewInt
(
0
),
ArrowGlacierBlock
:
big
.
NewInt
(
0
),
ArrowGlacierBlock
:
big
.
NewInt
(
0
),
GrayGlacierBlock
:
big
.
NewInt
(
0
),
GrayGlacierBlock
:
big
.
NewInt
(
0
),
ShanghaiBlock
:
nil
,
CancunBlock
:
nil
,
// Activated proof of stake. We manually build/commit blocks in the simulator anyway,
// Activated proof of stake. We manually build/commit blocks in the simulator anyway,
// and the timestamp verification of PoS is not against the wallclock,
// and the timestamp verification of PoS is not against the wallclock,
// preventing blocks from getting stuck temporarily in the future-blocks queue, decreasing setup time a lot.
// preventing blocks from getting stuck temporarily in the future-blocks queue, decreasing setup time a lot.
...
...
op-chain-ops/ether/db.go
View file @
e9045720
...
@@ -19,14 +19,15 @@ func MustOpenDB(dataDir string) ethdb.Database {
...
@@ -19,14 +19,15 @@ func MustOpenDB(dataDir string) ethdb.Database {
// the caller to pass in LevelDB cache parameters.
// the caller to pass in LevelDB cache parameters.
func
MustOpenDBWithCacheOpts
(
dataDir
string
,
cacheSize
,
handles
int
)
ethdb
.
Database
{
func
MustOpenDBWithCacheOpts
(
dataDir
string
,
cacheSize
,
handles
int
)
ethdb
.
Database
{
dir
:=
filepath
.
Join
(
dataDir
,
"geth"
,
"chaindata"
)
dir
:=
filepath
.
Join
(
dataDir
,
"geth"
,
"chaindata"
)
db
,
err
:=
rawdb
.
NewLevelDBDatabaseWithFreezer
(
db
,
err
:=
rawdb
.
Open
(
rawdb
.
OpenOptions
{
dir
,
Type
:
"leveldb"
,
cacheSize
,
Directory
:
dir
,
handles
,
AncientsDirectory
:
filepath
.
Join
(
dir
,
"ancient"
),
filepath
.
Join
(
dir
,
"ancient"
),
Namespace
:
""
,
""
,
Cache
:
cacheSize
,
true
,
Handles
:
handles
,
)
ReadOnly
:
true
,
})
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Crit
(
"error opening raw DB"
,
"err"
,
err
)
log
.
Crit
(
"error opening raw DB"
,
"err"
,
err
)
}
}
...
...
op-chain-ops/genesis/check.go
View file @
e9045720
...
@@ -7,20 +7,20 @@ import (
...
@@ -7,20 +7,20 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/migration"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/migration"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
)
)
// MaxSlotChecks is the maximum number of storage slots to check
// MaxSlotChecks is the maximum number of storage slots to check
...
@@ -181,8 +181,25 @@ func PostCheckUntouchables(udb state.Database, currDB *state.StateDB, prevRoot c
...
@@ -181,8 +181,25 @@ func PostCheckUntouchables(udb state.Database, currDB *state.StateDB, prevRoot c
log
.
Info
(
"checked code hash"
,
"address"
,
addr
,
"hash"
,
hash
)
log
.
Info
(
"checked code hash"
,
"address"
,
addr
,
"hash"
,
hash
)
// Ensure that the current/previous roots match
// Ensure that the current/previous roots match
prevRoot
:=
prevDB
.
StorageTrie
(
addr
)
.
Hash
()
var
prevRoot
,
currRoot
common
.
Hash
currRoot
:=
currDB
.
StorageTrie
(
addr
)
.
Hash
()
prevStorage
,
err
:=
prevDB
.
StorageTrie
(
addr
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to open previous-db storage trie of %s: %w"
,
addr
,
err
)
}
if
prevStorage
==
nil
{
prevRoot
=
types
.
EmptyRootHash
}
else
{
prevRoot
=
prevStorage
.
Hash
()
}
currStorage
,
err
:=
currDB
.
StorageTrie
(
addr
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to open current-db storage trie of %s: %w"
,
addr
,
err
)
}
if
currStorage
==
nil
{
currRoot
=
types
.
EmptyRootHash
}
else
{
currRoot
=
currStorage
.
Hash
()
}
if
prevRoot
!=
currRoot
{
if
prevRoot
!=
currRoot
{
return
fmt
.
Errorf
(
"expected storage root for %s to be %s, but got %s"
,
addr
,
prevRoot
,
currRoot
)
return
fmt
.
Errorf
(
"expected storage root for %s to be %s, but got %s"
,
addr
,
prevRoot
,
currRoot
)
}
}
...
@@ -191,12 +208,11 @@ func PostCheckUntouchables(udb state.Database, currDB *state.StateDB, prevRoot c
...
@@ -191,12 +208,11 @@ func PostCheckUntouchables(udb state.Database, currDB *state.StateDB, prevRoot c
// Sample storage slots to ensure that they are not modified.
// Sample storage slots to ensure that they are not modified.
var
count
int
var
count
int
expSlots
:=
make
(
map
[
common
.
Hash
]
common
.
Hash
)
expSlots
:=
make
(
map
[
common
.
Hash
]
common
.
Hash
)
err
:=
prevDB
.
ForEachStorage
(
addr
,
func
(
key
,
value
common
.
Hash
)
bool
{
if
err
:=
prevDB
.
ForEachStorage
(
addr
,
func
(
key
,
value
common
.
Hash
)
bool
{
count
++
count
++
expSlots
[
key
]
=
value
expSlots
[
key
]
=
value
return
count
<
MaxSlotChecks
return
count
<
MaxSlotChecks
})
});
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error iterating over storage: %w"
,
err
)
return
fmt
.
Errorf
(
"error iterating over storage: %w"
,
err
)
}
}
...
...
op-chain-ops/genesis/db_migration.go
View file @
e9045720
...
@@ -256,7 +256,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
...
@@ -256,7 +256,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
// Otherwise we need to write the changes to disk. First we commit the state changes.
// Otherwise we need to write the changes to disk. First we commit the state changes.
log
.
Info
(
"Committing trie DB"
)
log
.
Info
(
"Committing trie DB"
)
if
err
:=
db
.
Database
()
.
TrieDB
()
.
Commit
(
newRoot
,
true
,
nil
);
err
!=
nil
{
if
err
:=
db
.
Database
()
.
TrieDB
()
.
Commit
(
newRoot
,
true
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
op-chain-ops/genesis/genesis.go
View file @
e9045720
...
@@ -51,8 +51,6 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
...
@@ -51,8 +51,6 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
ArrowGlacierBlock
:
big
.
NewInt
(
0
),
ArrowGlacierBlock
:
big
.
NewInt
(
0
),
GrayGlacierBlock
:
big
.
NewInt
(
0
),
GrayGlacierBlock
:
big
.
NewInt
(
0
),
MergeNetsplitBlock
:
big
.
NewInt
(
0
),
MergeNetsplitBlock
:
big
.
NewInt
(
0
),
ShanghaiBlock
:
nil
,
CancunBlock
:
nil
,
TerminalTotalDifficulty
:
big
.
NewInt
(
0
),
TerminalTotalDifficulty
:
big
.
NewInt
(
0
),
TerminalTotalDifficultyPassed
:
true
,
TerminalTotalDifficultyPassed
:
true
,
BedrockBlock
:
new
(
big
.
Int
)
.
SetUint64
(
uint64
(
config
.
L2GenesisBlockNumber
)),
BedrockBlock
:
new
(
big
.
Int
)
.
SetUint64
(
uint64
(
config
.
L2GenesisBlockNumber
)),
...
@@ -121,8 +119,6 @@ func NewL1Genesis(config *DeployConfig) (*core.Genesis, error) {
...
@@ -121,8 +119,6 @@ func NewL1Genesis(config *DeployConfig) (*core.Genesis, error) {
LondonBlock
:
big
.
NewInt
(
0
),
LondonBlock
:
big
.
NewInt
(
0
),
ArrowGlacierBlock
:
big
.
NewInt
(
0
),
ArrowGlacierBlock
:
big
.
NewInt
(
0
),
GrayGlacierBlock
:
big
.
NewInt
(
0
),
GrayGlacierBlock
:
big
.
NewInt
(
0
),
ShanghaiBlock
:
nil
,
CancunBlock
:
nil
,
}
}
if
config
.
CliqueSignerAddress
!=
(
common
.
Address
{})
{
if
config
.
CliqueSignerAddress
!=
(
common
.
Address
{})
{
...
...
op-chain-ops/genesis/layer_one.go
View file @
e9045720
...
@@ -216,7 +216,13 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
...
@@ -216,7 +216,13 @@ func BuildL1DeveloperGenesis(config *DeployConfig) (*core.Genesis, error) {
}
}
for
_
,
dep
:=
range
deployments
{
for
_
,
dep
:=
range
deployments
{
st
:=
stateDB
.
StorageTrie
(
dep
.
Address
)
st
,
err
:=
stateDB
.
StorageTrie
(
dep
.
Address
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to open storage trie of %s: %w"
,
dep
.
Address
,
err
)
}
if
st
==
nil
{
return
nil
,
fmt
.
Errorf
(
"missing account %s in state, address: %s"
,
dep
.
Name
,
dep
.
Address
)
}
iter
:=
trie
.
NewIterator
(
st
.
NodeIterator
(
nil
))
iter
:=
trie
.
NewIterator
(
st
.
NodeIterator
(
nil
))
depAddr
:=
dep
.
Address
depAddr
:=
dep
.
Address
...
...
op-chain-ops/genesis/migration_action/action.go
View file @
e9045720
...
@@ -76,7 +76,16 @@ func Migrate(cfg *Config) (*genesis.MigrationResult, error) {
...
@@ -76,7 +76,16 @@ func Migrate(cfg *Config) (*genesis.MigrationResult, error) {
chaindataPath
:=
filepath
.
Join
(
cfg
.
L2DBPath
,
"geth"
,
"chaindata"
)
chaindataPath
:=
filepath
.
Join
(
cfg
.
L2DBPath
,
"geth"
,
"chaindata"
)
ancientPath
:=
filepath
.
Join
(
chaindataPath
,
"ancient"
)
ancientPath
:=
filepath
.
Join
(
chaindataPath
,
"ancient"
)
ldb
,
err
:=
rawdb
.
NewLevelDBDatabaseWithFreezer
(
chaindataPath
,
4096
,
120
,
ancientPath
,
""
,
false
)
ldb
,
err
:=
rawdb
.
Open
(
rawdb
.
OpenOptions
{
Type
:
"leveldb"
,
Directory
:
chaindataPath
,
Cache
:
4096
,
Handles
:
120
,
AncientsDirectory
:
ancientPath
,
Namespace
:
""
,
ReadOnly
:
false
,
})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
op-chain-ops/state/memory_db.go
View file @
e9045720
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
)
)
var
_
vm
.
StateDB
=
(
*
MemoryStateDB
)(
nil
)
var
_
vm
.
StateDB
=
(
*
MemoryStateDB
)(
nil
)
...
@@ -312,3 +313,15 @@ func (db *MemoryStateDB) ForEachStorage(addr common.Address, cb func(common.Hash
...
@@ -312,3 +313,15 @@ func (db *MemoryStateDB) ForEachStorage(addr common.Address, cb func(common.Hash
}
}
return
nil
return
nil
}
}
func
(
db
*
MemoryStateDB
)
GetTransientState
(
addr
common
.
Address
,
key
common
.
Hash
)
common
.
Hash
{
panic
(
"transient state is unsupported"
)
}
func
(
db
*
MemoryStateDB
)
SetTransientState
(
addr
common
.
Address
,
key
,
value
common
.
Hash
)
{
panic
(
"transient state is unsupported"
)
}
func
(
db
*
MemoryStateDB
)
Prepare
(
rules
params
.
Rules
,
sender
,
coinbase
common
.
Address
,
dest
*
common
.
Address
,
precompiles
[]
common
.
Address
,
txAccesses
types
.
AccessList
)
{
// no-op, no transient state to prepare, nor any access-list to set/prepare
}
op-e2e/actions/l1_miner.go
View file @
e9045720
...
@@ -105,7 +105,7 @@ func (s *L1Miner) ActL1IncludeTx(from common.Address) Action {
...
@@ -105,7 +105,7 @@ func (s *L1Miner) ActL1IncludeTx(from common.Address) Action {
return
return
}
}
s
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
s
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
s
.
l1BuildingState
.
Prepare
(
tx
.
Hash
(),
len
(
s
.
l1Transactions
))
s
.
l1BuildingState
.
SetTxContext
(
tx
.
Hash
(),
len
(
s
.
l1Transactions
))
receipt
,
err
:=
core
.
ApplyTransaction
(
s
.
l1Cfg
.
Config
,
s
.
l1Chain
,
&
s
.
l1BuildingHeader
.
Coinbase
,
receipt
,
err
:=
core
.
ApplyTransaction
(
s
.
l1Cfg
.
Config
,
s
.
l1Chain
,
&
s
.
l1BuildingHeader
.
Coinbase
,
s
.
l1GasPool
,
s
.
l1BuildingState
,
s
.
l1BuildingHeader
,
tx
,
&
s
.
l1BuildingHeader
.
GasUsed
,
*
s
.
l1Chain
.
GetVMConfig
())
s
.
l1GasPool
,
s
.
l1BuildingState
,
s
.
l1BuildingHeader
,
tx
,
&
s
.
l1BuildingHeader
.
GasUsed
,
*
s
.
l1Chain
.
GetVMConfig
())
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -141,7 +141,7 @@ func (s *L1Miner) ActL1EndBlock(t Testing) {
...
@@ -141,7 +141,7 @@ func (s *L1Miner) ActL1EndBlock(t Testing) {
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"l1 state write error: %v"
,
err
)
t
.
Fatalf
(
"l1 state write error: %v"
,
err
)
}
}
if
err
:=
s
.
l1BuildingState
.
Database
()
.
TrieDB
()
.
Commit
(
root
,
false
,
nil
);
err
!=
nil
{
if
err
:=
s
.
l1BuildingState
.
Database
()
.
TrieDB
()
.
Commit
(
root
,
false
);
err
!=
nil
{
t
.
Fatalf
(
"l1 trie write error: %v"
,
err
)
t
.
Fatalf
(
"l1 trie write error: %v"
,
err
)
}
}
...
...
op-e2e/actions/l2_batcher.go
View file @
e9045720
...
@@ -192,7 +192,7 @@ func (s *L2Batcher) ActL2BatchSubmit(t Testing) {
...
@@ -192,7 +192,7 @@ func (s *L2Batcher) ActL2BatchSubmit(t Testing) {
GasFeeCap
:
gasFeeCap
,
GasFeeCap
:
gasFeeCap
,
Data
:
data
.
Bytes
(),
Data
:
data
.
Bytes
(),
}
}
gas
,
err
:=
core
.
IntrinsicGas
(
rawTx
.
Data
,
nil
,
false
,
true
,
true
)
gas
,
err
:=
core
.
IntrinsicGas
(
rawTx
.
Data
,
nil
,
false
,
true
,
true
,
false
)
require
.
NoError
(
t
,
err
,
"need to compute intrinsic gas"
)
require
.
NoError
(
t
,
err
,
"need to compute intrinsic gas"
)
rawTx
.
Gas
=
gas
rawTx
.
Gas
=
gas
...
@@ -275,7 +275,7 @@ func (s *L2Batcher) ActL2BatchSubmitGarbage(t Testing, kind GarbageKind) {
...
@@ -275,7 +275,7 @@ func (s *L2Batcher) ActL2BatchSubmitGarbage(t Testing, kind GarbageKind) {
GasFeeCap
:
gasFeeCap
,
GasFeeCap
:
gasFeeCap
,
Data
:
outputFrame
,
Data
:
outputFrame
,
}
}
gas
,
err
:=
core
.
IntrinsicGas
(
rawTx
.
Data
,
nil
,
false
,
true
,
true
)
gas
,
err
:=
core
.
IntrinsicGas
(
rawTx
.
Data
,
nil
,
false
,
true
,
true
,
false
)
require
.
NoError
(
t
,
err
,
"need to compute intrinsic gas"
)
require
.
NoError
(
t
,
err
,
"need to compute intrinsic gas"
)
rawTx
.
Gas
=
gas
rawTx
.
Gas
=
gas
...
...
op-e2e/actions/l2_engine.go
View file @
e9045720
...
@@ -3,18 +3,18 @@ package actions
...
@@ -3,18 +3,18 @@ package actions
import
(
import
(
"errors"
"errors"
"github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/beacon/engine"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/beacon"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
geth
"github.com/ethereum/go-ethereum/eth"
geth
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/eth/tracers"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/node"
...
@@ -53,7 +53,7 @@ type L2Engine struct {
...
@@ -53,7 +53,7 @@ type L2Engine struct {
l2ForceEmpty
bool
// when no additional txs may be processed (i.e. when sequencer drift runs out)
l2ForceEmpty
bool
// when no additional txs may be processed (i.e. when sequencer drift runs out)
l2TxFailed
[]
*
types
.
Transaction
// log of failed transactions which could not be included
l2TxFailed
[]
*
types
.
Transaction
// log of failed transactions which could not be included
payloadID
beacon
.
PayloadID
// ID of payload that is currently being built
payloadID
engine
.
PayloadID
// ID of payload that is currently being built
failL2RPC
error
// mock error
failL2RPC
error
// mock error
}
}
...
@@ -182,7 +182,7 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
...
@@ -182,7 +182,7 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
return
return
}
}
e
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
e
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
e
.
l2BuildingState
.
Prepare
(
tx
.
Hash
(),
len
(
e
.
l2Transactions
))
e
.
l2BuildingState
.
SetTxContext
(
tx
.
Hash
(),
len
(
e
.
l2Transactions
))
receipt
,
err
:=
core
.
ApplyTransaction
(
e
.
l2Cfg
.
Config
,
e
.
l2Chain
,
&
e
.
l2BuildingHeader
.
Coinbase
,
receipt
,
err
:=
core
.
ApplyTransaction
(
e
.
l2Cfg
.
Config
,
e
.
l2Chain
,
&
e
.
l2BuildingHeader
.
Coinbase
,
e
.
l2GasPool
,
e
.
l2BuildingState
,
e
.
l2BuildingHeader
,
tx
,
&
e
.
l2BuildingHeader
.
GasUsed
,
*
e
.
l2Chain
.
GetVMConfig
())
e
.
l2GasPool
,
e
.
l2BuildingState
,
e
.
l2BuildingHeader
,
tx
,
&
e
.
l2BuildingHeader
.
GasUsed
,
*
e
.
l2Chain
.
GetVMConfig
())
if
err
!=
nil
{
if
err
!=
nil
{
...
...
op-e2e/actions/l2_engine_api.go
View file @
e9045720
...
@@ -9,16 +9,15 @@ import (
...
@@ -9,16 +9,15 @@ import (
"math/big"
"math/big"
"time"
"time"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/beacon/engine"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/beacon"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
)
)
...
@@ -35,7 +34,7 @@ var (
...
@@ -35,7 +34,7 @@ var (
)
)
// computePayloadId computes a pseudo-random payloadid, based on the parameters.
// computePayloadId computes a pseudo-random payloadid, based on the parameters.
func
computePayloadId
(
headBlockHash
common
.
Hash
,
params
*
eth
.
PayloadAttributes
)
beacon
.
PayloadID
{
func
computePayloadId
(
headBlockHash
common
.
Hash
,
params
*
eth
.
PayloadAttributes
)
engine
.
PayloadID
{
// Hash
// Hash
hasher
:=
sha256
.
New
()
hasher
:=
sha256
.
New
()
hasher
.
Write
(
headBlockHash
[
:
])
hasher
.
Write
(
headBlockHash
[
:
])
...
@@ -49,7 +48,7 @@ func computePayloadId(headBlockHash common.Hash, params *eth.PayloadAttributes)
...
@@ -49,7 +48,7 @@ func computePayloadId(headBlockHash common.Hash, params *eth.PayloadAttributes)
hasher
.
Write
(
tx
)
hasher
.
Write
(
tx
)
}
}
_
=
binary
.
Write
(
hasher
,
binary
.
BigEndian
,
*
params
.
GasLimit
)
_
=
binary
.
Write
(
hasher
,
binary
.
BigEndian
,
*
params
.
GasLimit
)
var
out
beacon
.
PayloadID
var
out
engine
.
PayloadID
copy
(
out
[
:
],
hasher
.
Sum
(
nil
)[
:
8
])
copy
(
out
[
:
],
hasher
.
Sum
(
nil
)[
:
8
])
return
out
return
out
}
}
...
@@ -96,7 +95,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
...
@@ -96,7 +95,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
if
err
:=
tx
.
UnmarshalBinary
(
otx
);
err
!=
nil
{
if
err
:=
tx
.
UnmarshalBinary
(
otx
);
err
!=
nil
{
return
fmt
.
Errorf
(
"transaction %d is not valid: %w"
,
i
,
err
)
return
fmt
.
Errorf
(
"transaction %d is not valid: %w"
,
i
,
err
)
}
}
ea
.
l2BuildingState
.
Prepare
(
tx
.
Hash
(),
i
)
ea
.
l2BuildingState
.
SetTxContext
(
tx
.
Hash
(),
i
)
receipt
,
err
:=
core
.
ApplyTransaction
(
ea
.
l2Cfg
.
Config
,
ea
.
l2Chain
,
&
ea
.
l2BuildingHeader
.
Coinbase
,
receipt
,
err
:=
core
.
ApplyTransaction
(
ea
.
l2Cfg
.
Config
,
ea
.
l2Chain
,
&
ea
.
l2BuildingHeader
.
Coinbase
,
ea
.
l2GasPool
,
ea
.
l2BuildingState
,
ea
.
l2BuildingHeader
,
&
tx
,
&
ea
.
l2BuildingHeader
.
GasUsed
,
*
ea
.
l2Chain
.
GetVMConfig
())
ea
.
l2GasPool
,
ea
.
l2BuildingState
,
ea
.
l2BuildingHeader
,
&
tx
,
&
ea
.
l2BuildingHeader
.
GasUsed
,
*
ea
.
l2Chain
.
GetVMConfig
())
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -125,7 +124,7 @@ func (ea *L2EngineAPI) endBlock() (*types.Block, error) {
...
@@ -125,7 +124,7 @@ func (ea *L2EngineAPI) endBlock() (*types.Block, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"l2 state write error: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"l2 state write error: %w"
,
err
)
}
}
if
err
:=
ea
.
l2BuildingState
.
Database
()
.
TrieDB
()
.
Commit
(
root
,
false
,
nil
);
err
!=
nil
{
if
err
:=
ea
.
l2BuildingState
.
Database
()
.
TrieDB
()
.
Commit
(
root
,
false
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"l2 trie write error: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"l2 trie write error: %w"
,
err
)
}
}
return
block
,
nil
return
block
,
nil
...
@@ -135,12 +134,12 @@ func (ea *L2EngineAPI) GetPayloadV1(ctx context.Context, payloadId eth.PayloadID
...
@@ -135,12 +134,12 @@ func (ea *L2EngineAPI) GetPayloadV1(ctx context.Context, payloadId eth.PayloadID
ea
.
log
.
Trace
(
"L2Engine API request received"
,
"method"
,
"GetPayload"
,
"id"
,
payloadId
)
ea
.
log
.
Trace
(
"L2Engine API request received"
,
"method"
,
"GetPayload"
,
"id"
,
payloadId
)
if
ea
.
payloadID
!=
payloadId
{
if
ea
.
payloadID
!=
payloadId
{
ea
.
log
.
Warn
(
"unexpected payload ID requested for block building"
,
"expected"
,
ea
.
payloadID
,
"got"
,
payloadId
)
ea
.
log
.
Warn
(
"unexpected payload ID requested for block building"
,
"expected"
,
ea
.
payloadID
,
"got"
,
payloadId
)
return
nil
,
beacon
.
UnknownPayload
return
nil
,
engine
.
UnknownPayload
}
}
bl
,
err
:=
ea
.
endBlock
()
bl
,
err
:=
ea
.
endBlock
()
if
err
!=
nil
{
if
err
!=
nil
{
ea
.
log
.
Error
(
"failed to finish block building"
,
"err"
,
err
)
ea
.
log
.
Error
(
"failed to finish block building"
,
"err"
,
err
)
return
nil
,
beacon
.
UnknownPayload
return
nil
,
engine
.
UnknownPayload
}
}
return
eth
.
BlockAsPayload
(
bl
)
return
eth
.
BlockAsPayload
(
bl
)
}
}
...
@@ -180,7 +179,7 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
...
@@ -180,7 +179,7 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
return
&
eth
.
ForkchoiceUpdatedResult
{
PayloadStatus
:
INVALID_TERMINAL_BLOCK
,
PayloadID
:
nil
},
nil
return
&
eth
.
ForkchoiceUpdatedResult
{
PayloadStatus
:
INVALID_TERMINAL_BLOCK
,
PayloadID
:
nil
},
nil
}
}
}
}
valid
:=
func
(
id
*
beacon
.
PayloadID
)
*
eth
.
ForkchoiceUpdatedResult
{
valid
:=
func
(
id
*
engine
.
PayloadID
)
*
eth
.
ForkchoiceUpdatedResult
{
return
&
eth
.
ForkchoiceUpdatedResult
{
return
&
eth
.
ForkchoiceUpdatedResult
{
PayloadStatus
:
eth
.
PayloadStatusV1
{
Status
:
eth
.
ExecutionValid
,
LatestValidHash
:
&
state
.
HeadBlockHash
},
PayloadStatus
:
eth
.
PayloadStatusV1
{
Status
:
eth
.
ExecutionValid
,
LatestValidHash
:
&
state
.
HeadBlockHash
},
PayloadID
:
id
,
PayloadID
:
id
,
...
@@ -206,10 +205,10 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
...
@@ -206,10 +205,10 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
finalBlock
:=
ea
.
l2Chain
.
GetBlockByHash
(
state
.
FinalizedBlockHash
)
finalBlock
:=
ea
.
l2Chain
.
GetBlockByHash
(
state
.
FinalizedBlockHash
)
if
finalBlock
==
nil
{
if
finalBlock
==
nil
{
ea
.
log
.
Warn
(
"Final block not available in database"
,
"hash"
,
state
.
FinalizedBlockHash
)
ea
.
log
.
Warn
(
"Final block not available in database"
,
"hash"
,
state
.
FinalizedBlockHash
)
return
STATUS_INVALID
,
beacon
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"final block not available in database"
))
return
STATUS_INVALID
,
engine
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"final block not available in database"
))
}
else
if
rawdb
.
ReadCanonicalHash
(
ea
.
l2Database
,
finalBlock
.
NumberU64
())
!=
state
.
FinalizedBlockHash
{
}
else
if
rawdb
.
ReadCanonicalHash
(
ea
.
l2Database
,
finalBlock
.
NumberU64
())
!=
state
.
FinalizedBlockHash
{
ea
.
log
.
Warn
(
"Final block not in canonical chain"
,
"number"
,
block
.
NumberU64
(),
"hash"
,
state
.
HeadBlockHash
)
ea
.
log
.
Warn
(
"Final block not in canonical chain"
,
"number"
,
block
.
NumberU64
(),
"hash"
,
state
.
HeadBlockHash
)
return
STATUS_INVALID
,
beacon
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"final block not in canonical chain"
))
return
STATUS_INVALID
,
engine
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"final block not in canonical chain"
))
}
}
// Set the finalized block
// Set the finalized block
ea
.
l2Chain
.
SetFinalized
(
finalBlock
)
ea
.
l2Chain
.
SetFinalized
(
finalBlock
)
...
@@ -219,11 +218,11 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
...
@@ -219,11 +218,11 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
safeBlock
:=
ea
.
l2Chain
.
GetBlockByHash
(
state
.
SafeBlockHash
)
safeBlock
:=
ea
.
l2Chain
.
GetBlockByHash
(
state
.
SafeBlockHash
)
if
safeBlock
==
nil
{
if
safeBlock
==
nil
{
ea
.
log
.
Warn
(
"Safe block not available in database"
)
ea
.
log
.
Warn
(
"Safe block not available in database"
)
return
STATUS_INVALID
,
beacon
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"safe block not available in database"
))
return
STATUS_INVALID
,
engine
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"safe block not available in database"
))
}
}
if
rawdb
.
ReadCanonicalHash
(
ea
.
l2Database
,
safeBlock
.
NumberU64
())
!=
state
.
SafeBlockHash
{
if
rawdb
.
ReadCanonicalHash
(
ea
.
l2Database
,
safeBlock
.
NumberU64
())
!=
state
.
SafeBlockHash
{
ea
.
log
.
Warn
(
"Safe block not in canonical chain"
)
ea
.
log
.
Warn
(
"Safe block not in canonical chain"
)
return
STATUS_INVALID
,
beacon
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"safe block not in canonical chain"
))
return
STATUS_INVALID
,
engine
.
InvalidForkChoiceState
.
With
(
errors
.
New
(
"safe block not in canonical chain"
))
}
}
// Set the safe block
// Set the safe block
ea
.
l2Chain
.
SetSafe
(
safeBlock
)
ea
.
l2Chain
.
SetSafe
(
safeBlock
)
...
@@ -235,7 +234,7 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
...
@@ -235,7 +234,7 @@ func (ea *L2EngineAPI) ForkchoiceUpdatedV1(ctx context.Context, state *eth.Forkc
err
:=
ea
.
startBlock
(
state
.
HeadBlockHash
,
attr
)
err
:=
ea
.
startBlock
(
state
.
HeadBlockHash
,
attr
)
if
err
!=
nil
{
if
err
!=
nil
{
ea
.
log
.
Error
(
"Failed to start block building"
,
"err"
,
err
,
"noTxPool"
,
attr
.
NoTxPool
,
"txs"
,
len
(
attr
.
Transactions
),
"timestamp"
,
attr
.
Timestamp
)
ea
.
log
.
Error
(
"Failed to start block building"
,
"err"
,
err
,
"noTxPool"
,
attr
.
NoTxPool
,
"txs"
,
len
(
attr
.
Transactions
),
"timestamp"
,
attr
.
Timestamp
)
return
STATUS_INVALID
,
beacon
.
InvalidPayloadAttributes
.
With
(
err
)
return
STATUS_INVALID
,
engine
.
InvalidPayloadAttributes
.
With
(
err
)
}
}
return
valid
(
&
ea
.
payloadID
),
nil
return
valid
(
&
ea
.
payloadID
),
nil
...
@@ -249,7 +248,7 @@ func (ea *L2EngineAPI) NewPayloadV1(ctx context.Context, payload *eth.ExecutionP
...
@@ -249,7 +248,7 @@ func (ea *L2EngineAPI) NewPayloadV1(ctx context.Context, payload *eth.ExecutionP
for
i
,
tx
:=
range
payload
.
Transactions
{
for
i
,
tx
:=
range
payload
.
Transactions
{
txs
[
i
]
=
tx
txs
[
i
]
=
tx
}
}
block
,
err
:=
beacon
.
ExecutableDataToBlock
(
beacon
.
ExecutableDataV1
{
block
,
err
:=
engine
.
ExecutableDataToBlock
(
engine
.
ExecutableData
{
ParentHash
:
payload
.
ParentHash
,
ParentHash
:
payload
.
ParentHash
,
FeeRecipient
:
payload
.
FeeRecipient
,
FeeRecipient
:
payload
.
FeeRecipient
,
StateRoot
:
common
.
Hash
(
payload
.
StateRoot
),
StateRoot
:
common
.
Hash
(
payload
.
StateRoot
),
...
...
op-e2e/geth.go
View file @
e9045720
...
@@ -112,6 +112,7 @@ func initL1Geth(cfg *SystemConfig, genesis *core.Genesis, opts ...GethOption) (*
...
@@ -112,6 +112,7 @@ func initL1Geth(cfg *SystemConfig, genesis *core.Genesis, opts ...GethOption) (*
ethConfig
:=
&
ethconfig
.
Config
{
ethConfig
:=
&
ethconfig
.
Config
{
NetworkId
:
cfg
.
DeployConfig
.
L1ChainID
,
NetworkId
:
cfg
.
DeployConfig
.
L1ChainID
,
Genesis
:
genesis
,
Genesis
:
genesis
,
Miner
:
miner
.
Config
{
Etherbase
:
cfg
.
DeployConfig
.
CliqueSignerAddress
},
}
}
nodeConfig
:=
&
node
.
Config
{
nodeConfig
:=
&
node
.
Config
{
Name
:
"l1-geth"
,
Name
:
"l1-geth"
,
...
...
op-node/eth/types.go
View file @
e9045720
...
@@ -8,9 +8,9 @@ import (
...
@@ -8,9 +8,9 @@ import (
"github.com/holiman/uint256"
"github.com/holiman/uint256"
"github.com/ethereum/go-ethereum/beacon/engine"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/beacon"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/trie"
)
)
...
@@ -123,7 +123,7 @@ type Uint256Quantity = uint256.Int
...
@@ -123,7 +123,7 @@ type Uint256Quantity = uint256.Int
type
Data
=
hexutil
.
Bytes
type
Data
=
hexutil
.
Bytes
type
PayloadID
=
beacon
.
PayloadID
type
PayloadID
=
engine
.
PayloadID
type
ExecutionPayload
struct
{
type
ExecutionPayload
struct
{
ParentHash
common
.
Hash
`json:"parentHash"`
ParentHash
common
.
Hash
`json:"parentHash"`
...
...
op-node/rollup/types_test.go
View file @
e9045720
...
@@ -16,12 +16,13 @@ import (
...
@@ -16,12 +16,13 @@ import (
)
)
func
randConfig
()
*
Config
{
func
randConfig
()
*
Config
{
rng
:=
rand
.
New
(
rand
.
NewSource
(
1234
))
randHash
:=
func
()
(
out
[
32
]
byte
)
{
randHash
:=
func
()
(
out
[
32
]
byte
)
{
r
and
.
Read
(
out
[
:
])
r
ng
.
Read
(
out
[
:
])
return
return
}
}
randAddr
:=
func
()
(
out
common
.
Address
)
{
// we need generics...
randAddr
:=
func
()
(
out
common
.
Address
)
{
// we need generics...
r
and
.
Read
(
out
[
:
])
r
ng
.
Read
(
out
[
:
])
return
return
}
}
return
&
Config
{
return
&
Config
{
...
...
op-wheel/cheat/cheat.go
View file @
e9045720
...
@@ -35,7 +35,15 @@ type Cheater struct {
...
@@ -35,7 +35,15 @@ type Cheater struct {
func
OpenGethRawDB
(
dataDirPath
string
,
readOnly
bool
)
(
ethdb
.
Database
,
error
)
{
func
OpenGethRawDB
(
dataDirPath
string
,
readOnly
bool
)
(
ethdb
.
Database
,
error
)
{
// don't use readonly mode in actual DB, it doesn't work with Geth.
// don't use readonly mode in actual DB, it doesn't work with Geth.
db
,
err
:=
rawdb
.
NewLevelDBDatabaseWithFreezer
(
dataDirPath
,
2048
,
500
,
filepath
.
Join
(
dataDirPath
,
"ancient"
),
""
,
readOnly
)
db
,
err
:=
rawdb
.
Open
(
rawdb
.
OpenOptions
{
Type
:
"leveldb"
,
Directory
:
dataDirPath
,
AncientsDirectory
:
filepath
.
Join
(
dataDirPath
,
"ancient"
),
Namespace
:
""
,
Cache
:
2048
,
Handles
:
500
,
ReadOnly
:
readOnly
,
})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to open leveldb: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to open leveldb: %w"
,
err
)
}
}
...
@@ -99,7 +107,7 @@ func (ch *Cheater) RunAndClose(fn HeadFn) error {
...
@@ -99,7 +107,7 @@ func (ch *Cheater) RunAndClose(fn HeadFn) error {
blockHash
:=
header
.
Hash
()
blockHash
:=
header
.
Hash
()
// We have to manually commit the updated state root to the database.
// We have to manually commit the updated state root to the database.
if
err
:=
state
.
Database
()
.
TrieDB
()
.
Commit
(
stateRoot
,
true
,
nil
);
err
!=
nil
{
if
err
:=
state
.
Database
()
.
TrieDB
()
.
Commit
(
stateRoot
,
true
);
err
!=
nil
{
return
fmt
.
Errorf
(
"error committing trie db: %w"
,
err
)
return
fmt
.
Errorf
(
"error committing trie db: %w"
,
err
)
}
}
...
@@ -178,7 +186,13 @@ func StorageGet(address common.Address, key common.Hash, w io.Writer) HeadFn {
...
@@ -178,7 +186,13 @@ func StorageGet(address common.Address, key common.Hash, w io.Writer) HeadFn {
// to another account (maybe even in a different database!).
// to another account (maybe even in a different database!).
func
StorageReadAll
(
address
common
.
Address
,
w
io
.
Writer
)
HeadFn
{
func
StorageReadAll
(
address
common
.
Address
,
w
io
.
Writer
)
HeadFn
{
return
func
(
headState
*
state
.
StateDB
)
error
{
return
func
(
headState
*
state
.
StateDB
)
error
{
storage
:=
headState
.
StorageTrie
(
address
)
storage
,
err
:=
headState
.
StorageTrie
(
address
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to open storage trie of addr %s: %w"
,
address
,
err
)
}
if
storage
==
nil
{
return
fmt
.
Errorf
(
"no storage trie in state for account %s"
,
address
)
}
iter
:=
trie
.
NewIterator
(
storage
.
NodeIterator
(
nil
))
iter
:=
trie
.
NewIterator
(
storage
.
NodeIterator
(
nil
))
for
iter
.
Next
()
{
for
iter
.
Next
()
{
if
_
,
err
:=
fmt
.
Fprintf
(
w
,
"+ %x = %x
\n
"
,
iter
.
Key
,
dbValueToHash
(
iter
.
Value
));
err
!=
nil
{
if
_
,
err
:=
fmt
.
Fprintf
(
w
,
"+ %x = %x
\n
"
,
iter
.
Key
,
dbValueToHash
(
iter
.
Value
));
err
!=
nil
{
...
@@ -205,8 +219,20 @@ func dbValueToHash(enc []byte) common.Hash {
...
@@ -205,8 +219,20 @@ func dbValueToHash(enc []byte) common.Hash {
// Each difference is expressed with 1 character + or - to indicate the change from a to b, followed by key = value.
// Each difference is expressed with 1 character + or - to indicate the change from a to b, followed by key = value.
func
StorageDiff
(
out
io
.
Writer
,
addressA
,
addressB
common
.
Address
)
HeadFn
{
func
StorageDiff
(
out
io
.
Writer
,
addressA
,
addressB
common
.
Address
)
HeadFn
{
return
func
(
headState
*
state
.
StateDB
)
error
{
return
func
(
headState
*
state
.
StateDB
)
error
{
aStorage
:=
headState
.
StorageTrie
(
addressA
)
aStorage
,
err
:=
headState
.
StorageTrie
(
addressA
)
bStorage
:=
headState
.
StorageTrie
(
addressB
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to open storage trie of addr A %s: %w"
,
addressA
,
err
)
}
if
aStorage
==
nil
{
return
fmt
.
Errorf
(
"no storage trie in state for account A %s"
,
addressA
)
}
bStorage
,
err
:=
headState
.
StorageTrie
(
addressB
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to open storage trie of addr B %s: %w"
,
addressB
,
err
)
}
if
bStorage
==
nil
{
return
fmt
.
Errorf
(
"no storage trie in state for account B %s"
,
addressB
)
}
aIter
:=
trie
.
NewIterator
(
aStorage
.
NodeIterator
(
nil
))
aIter
:=
trie
.
NewIterator
(
aStorage
.
NodeIterator
(
nil
))
bIter
:=
trie
.
NewIterator
(
bStorage
.
NodeIterator
(
nil
))
bIter
:=
trie
.
NewIterator
(
bStorage
.
NodeIterator
(
nil
))
hasA
:=
aIter
.
Next
()
hasA
:=
aIter
.
Next
()
...
...
op-wheel/engine/engine.go
View file @
e9045720
...
@@ -6,9 +6,9 @@ import (
...
@@ -6,9 +6,9 @@ import (
"math/big"
"math/big"
"time"
"time"
"github.com/ethereum/go-ethereum/beacon/engine"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/beacon"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/node"
...
@@ -67,8 +67,8 @@ func headSafeFinalized(ctx context.Context, client client.RPC) (head *types.Bloc
...
@@ -67,8 +67,8 @@ func headSafeFinalized(ctx context.Context, client client.RPC) (head *types.Bloc
return
head
,
safe
,
finalized
,
nil
return
head
,
safe
,
finalized
,
nil
}
}
func
insertBlock
(
ctx
context
.
Context
,
client
client
.
RPC
,
payload
*
beacon
.
ExecutableDataV1
)
error
{
func
insertBlock
(
ctx
context
.
Context
,
client
client
.
RPC
,
payload
*
engine
.
ExecutableData
)
error
{
var
payloadResult
*
beacon
.
PayloadStatusV1
var
payloadResult
*
engine
.
PayloadStatusV1
if
err
:=
client
.
CallContext
(
ctx
,
&
payloadResult
,
"engine_newPayloadV1"
,
payload
);
err
!=
nil
{
if
err
:=
client
.
CallContext
(
ctx
,
&
payloadResult
,
"engine_newPayloadV1"
,
payload
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to insert block %d: %w"
,
payload
.
Number
,
err
)
return
fmt
.
Errorf
(
"failed to insert block %d: %w"
,
payload
.
Number
,
err
)
}
}
...
@@ -79,9 +79,9 @@ func insertBlock(ctx context.Context, client client.RPC, payload *beacon.Executa
...
@@ -79,9 +79,9 @@ func insertBlock(ctx context.Context, client client.RPC, payload *beacon.Executa
}
}
func
updateForkchoice
(
ctx
context
.
Context
,
client
client
.
RPC
,
head
,
safe
,
finalized
common
.
Hash
)
error
{
func
updateForkchoice
(
ctx
context
.
Context
,
client
client
.
RPC
,
head
,
safe
,
finalized
common
.
Hash
)
error
{
var
post
beacon
.
ForkChoiceResponse
var
post
engine
.
ForkChoiceResponse
if
err
:=
client
.
CallContext
(
ctx
,
&
post
,
"engine_forkchoiceUpdatedV1"
,
if
err
:=
client
.
CallContext
(
ctx
,
&
post
,
"engine_forkchoiceUpdatedV1"
,
beacon
.
ForkchoiceStateV1
{
engine
.
ForkchoiceStateV1
{
HeadBlockHash
:
head
,
HeadBlockHash
:
head
,
SafeBlockHash
:
safe
,
SafeBlockHash
:
safe
,
FinalizedBlockHash
:
finalized
,
FinalizedBlockHash
:
finalized
,
...
@@ -101,14 +101,14 @@ type BlockBuildingSettings struct {
...
@@ -101,14 +101,14 @@ type BlockBuildingSettings struct {
BuildTime
time
.
Duration
BuildTime
time
.
Duration
}
}
func
BuildBlock
(
ctx
context
.
Context
,
client
client
.
RPC
,
status
*
StatusData
,
settings
*
BlockBuildingSettings
)
(
*
beacon
.
ExecutableDataV1
,
error
)
{
func
BuildBlock
(
ctx
context
.
Context
,
client
client
.
RPC
,
status
*
StatusData
,
settings
*
BlockBuildingSettings
)
(
*
engine
.
ExecutableData
,
error
)
{
var
pre
beacon
.
ForkChoiceResponse
var
pre
engine
.
ForkChoiceResponse
if
err
:=
client
.
CallContext
(
ctx
,
&
pre
,
"engine_forkchoiceUpdatedV1"
,
if
err
:=
client
.
CallContext
(
ctx
,
&
pre
,
"engine_forkchoiceUpdatedV1"
,
beacon
.
ForkchoiceStateV1
{
engine
.
ForkchoiceStateV1
{
HeadBlockHash
:
status
.
Head
.
Hash
,
HeadBlockHash
:
status
.
Head
.
Hash
,
SafeBlockHash
:
status
.
Safe
.
Hash
,
SafeBlockHash
:
status
.
Safe
.
Hash
,
FinalizedBlockHash
:
status
.
Finalized
.
Hash
,
FinalizedBlockHash
:
status
.
Finalized
.
Hash
,
},
beacon
.
PayloadAttributesV1
{
},
engine
.
PayloadAttributes
{
Timestamp
:
status
.
Head
.
Time
+
settings
.
BlockTime
,
Timestamp
:
status
.
Head
.
Time
+
settings
.
BlockTime
,
Random
:
settings
.
Random
,
Random
:
settings
.
Random
,
SuggestedFeeRecipient
:
settings
.
FeeRecipient
,
SuggestedFeeRecipient
:
settings
.
FeeRecipient
,
...
@@ -130,7 +130,7 @@ func BuildBlock(ctx context.Context, client client.RPC, status *StatusData, sett
...
@@ -130,7 +130,7 @@ func BuildBlock(ctx context.Context, client client.RPC, status *StatusData, sett
case
<-
time
.
After
(
settings
.
BuildTime
)
:
case
<-
time
.
After
(
settings
.
BuildTime
)
:
}
}
var
payload
*
beacon
.
ExecutableDataV1
var
payload
*
engine
.
ExecutableData
if
err
:=
client
.
CallContext
(
ctx
,
&
payload
,
"engine_getPayloadV1"
,
pre
.
PayloadID
);
err
!=
nil
{
if
err
:=
client
.
CallContext
(
ctx
,
&
payload
,
"engine_getPayloadV1"
,
pre
.
PayloadID
);
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to get payload %v, %d time after instructing engine to build it: %w"
,
pre
.
PayloadID
,
settings
.
BuildTime
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to get payload %v, %d time after instructing engine to build it: %w"
,
pre
.
PayloadID
,
settings
.
BuildTime
,
err
)
}
}
...
@@ -149,7 +149,7 @@ func Auto(ctx context.Context, metrics Metricer, client client.RPC, log log.Logg
...
@@ -149,7 +149,7 @@ func Auto(ctx context.Context, metrics Metricer, client client.RPC, log log.Logg
ticker
:=
time
.
NewTicker
(
time
.
Millisecond
*
100
)
ticker
:=
time
.
NewTicker
(
time
.
Millisecond
*
100
)
defer
ticker
.
Stop
()
defer
ticker
.
Stop
()
var
lastPayload
*
beacon
.
ExecutableDataV1
var
lastPayload
*
engine
.
ExecutableData
var
buildErr
error
var
buildErr
error
for
{
for
{
select
{
select
{
...
@@ -264,10 +264,11 @@ func Copy(ctx context.Context, copyFrom client.RPC, copyTo client.RPC) error {
...
@@ -264,10 +264,11 @@ func Copy(ctx context.Context, copyFrom client.RPC, copyTo client.RPC) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
payload
:=
beacon
.
BlockToExecutableData
(
copyHead
)
payload
Env
:=
engine
.
BlockToExecutableData
(
copyHead
,
nil
)
if
err
:=
updateForkchoice
(
ctx
,
copyTo
,
copyHead
.
ParentHash
(),
copySafe
.
Hash
(),
copyFinalized
.
Hash
());
err
!=
nil
{
if
err
:=
updateForkchoice
(
ctx
,
copyTo
,
copyHead
.
ParentHash
(),
copySafe
.
Hash
(),
copyFinalized
.
Hash
());
err
!=
nil
{
return
err
return
err
}
}
payload
:=
payloadEnv
.
ExecutionPayload
if
err
:=
insertBlock
(
ctx
,
copyTo
,
payload
);
err
!=
nil
{
if
err
:=
insertBlock
(
ctx
,
copyTo
,
payload
);
err
!=
nil
{
return
err
return
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment