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
5b67802e
Unverified
Commit
5b67802e
authored
Nov 08, 2023
by
Adrian Sutton
Committed by
GitHub
Nov 08, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7993 from ethereum-optimism/dencun-header-change
Dencun header changes
parents
2bf094a8
e289de04
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
2 deletions
+75
-2
dencun_fork_test.go
op-e2e/actions/dencun_fork_test.go
+53
-0
l1_miner.go
op-e2e/actions/l1_miner.go
+7
-0
types.go
op-service/sources/types.go
+15
-2
No files found.
op-e2e/actions/dencun_fork_test.go
0 → 100644
View file @
5b67802e
package
actions
import
(
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
func
TestDencunL1Fork
(
gt
*
testing
.
T
)
{
t
:=
NewDefaultTesting
(
gt
)
dp
:=
e2eutils
.
MakeDeployParams
(
t
,
defaultRollupTestParams
)
sd
:=
e2eutils
.
Setup
(
t
,
dp
,
defaultAlloc
)
activation
:=
sd
.
L1Cfg
.
Timestamp
+
24
sd
.
L1Cfg
.
Config
.
CancunTime
=
&
activation
log
:=
testlog
.
Logger
(
t
,
log
.
LvlDebug
)
_
,
_
,
miner
,
sequencer
,
_
,
verifier
,
_
,
batcher
:=
setupReorgTestActors
(
t
,
dp
,
sd
,
log
)
l1Head
:=
miner
.
l1Chain
.
CurrentBlock
()
require
.
False
(
t
,
sd
.
L1Cfg
.
Config
.
IsCancun
(
l1Head
.
Number
,
l1Head
.
Time
),
"Cancun not active yet"
)
// start op-nodes
sequencer
.
ActL2PipelineFull
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
// build empty L1 blocks, crossing the fork boundary
miner
.
ActL1SetFeeRecipient
(
common
.
Address
{
'A'
,
0
})
miner
.
ActEmptyBlock
(
t
)
miner
.
ActEmptyBlock
(
t
)
// Cancun activates here
miner
.
ActEmptyBlock
(
t
)
// verify Cancun is active
l1Head
=
miner
.
l1Chain
.
CurrentBlock
()
require
.
True
(
t
,
sd
.
L1Cfg
.
Config
.
IsCancun
(
l1Head
.
Number
,
l1Head
.
Time
),
"Cancun active"
)
// build L2 chain up to and including L2 blocks referencing Cancun L1 blocks
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActBuildToL1Head
(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
batcher
.
ActSubmitAll
(
t
)
miner
.
ActL1IncludeTx
(
batcher
.
batcherAddr
)(
t
)
miner
.
ActL1EndBlock
(
t
)
// sync verifier
verifier
.
ActL1HeadSignal
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
// verify verifier accepted Cancun L1 inputs
require
.
Equal
(
t
,
l1Head
.
Hash
(),
verifier
.
SyncStatus
()
.
SafeL2
.
L1Origin
.
Hash
,
"verifier synced L1 chain that includes Cancun headers"
)
require
.
Equal
(
t
,
sequencer
.
SyncStatus
()
.
UnsafeL2
,
verifier
.
SyncStatus
()
.
UnsafeL2
,
"verifier and sequencer agree"
)
}
op-e2e/actions/l1_miner.go
View file @
5b67802e
...
@@ -76,6 +76,13 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action {
...
@@ -76,6 +76,13 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action {
if
s
.
l1Cfg
.
Config
.
IsShanghai
(
header
.
Number
,
header
.
Time
)
{
if
s
.
l1Cfg
.
Config
.
IsShanghai
(
header
.
Number
,
header
.
Time
)
{
header
.
WithdrawalsHash
=
&
types
.
EmptyWithdrawalsHash
header
.
WithdrawalsHash
=
&
types
.
EmptyWithdrawalsHash
}
}
if
s
.
l1Cfg
.
Config
.
IsCancun
(
header
.
Number
,
header
.
Time
)
{
var
root
common
.
Hash
var
zero
uint64
header
.
BlobGasUsed
=
&
zero
header
.
ExcessBlobGas
=
&
zero
header
.
ParentBeaconRoot
=
&
root
}
s
.
l1Building
=
true
s
.
l1Building
=
true
s
.
l1BuildingHeader
=
header
s
.
l1BuildingHeader
=
header
...
...
op-service/sources/types.go
View file @
5b67802e
...
@@ -107,7 +107,16 @@ type rpcHeader struct {
...
@@ -107,7 +107,16 @@ type rpcHeader struct {
BaseFee
*
hexutil
.
Big
`json:"baseFeePerGas"`
BaseFee
*
hexutil
.
Big
`json:"baseFeePerGas"`
// WithdrawalsRoot was added by EIP-4895 and is ignored in legacy headers.
// WithdrawalsRoot was added by EIP-4895 and is ignored in legacy headers.
WithdrawalsRoot
*
common
.
Hash
`json:"withdrawalsRoot"`
WithdrawalsRoot
*
common
.
Hash
`json:"withdrawalsRoot,omitempty"`
// BlobGasUsed was added by EIP-4844 and is ignored in legacy headers.
BlobGasUsed
*
hexutil
.
Uint64
`json:"blobGasUsed,omitempty"`
// ExcessBlobGas was added by EIP-4844 and is ignored in legacy headers.
ExcessBlobGas
*
hexutil
.
Uint64
`json:"excessBlobGas,omitempty"`
// ParentBeaconRoot was added by EIP-4788 and is ignored in legacy headers.
ParentBeaconRoot
*
common
.
Hash
`json:"parentBeaconBlockRoot,omitempty"`
// untrusted info included by RPC, may have to be checked
// untrusted info included by RPC, may have to be checked
Hash
common
.
Hash
`json:"hash"`
Hash
common
.
Hash
`json:"hash"`
...
@@ -160,6 +169,10 @@ func (hdr *rpcHeader) createGethHeader() *types.Header {
...
@@ -160,6 +169,10 @@ func (hdr *rpcHeader) createGethHeader() *types.Header {
Nonce
:
hdr
.
Nonce
,
Nonce
:
hdr
.
Nonce
,
BaseFee
:
(
*
big
.
Int
)(
hdr
.
BaseFee
),
BaseFee
:
(
*
big
.
Int
)(
hdr
.
BaseFee
),
WithdrawalsHash
:
hdr
.
WithdrawalsRoot
,
WithdrawalsHash
:
hdr
.
WithdrawalsRoot
,
// Cancun
BlobGasUsed
:
(
*
uint64
)(
hdr
.
BlobGasUsed
),
ExcessBlobGas
:
(
*
uint64
)(
hdr
.
ExcessBlobGas
),
ParentBeaconRoot
:
hdr
.
ParentBeaconRoot
,
}
}
}
}
...
@@ -189,7 +202,7 @@ func (block *rpcBlock) verify() error {
...
@@ -189,7 +202,7 @@ func (block *rpcBlock) verify() error {
}
}
for
i
,
tx
:=
range
block
.
Transactions
{
for
i
,
tx
:=
range
block
.
Transactions
{
if
tx
==
nil
{
if
tx
==
nil
{
return
fmt
.
Errorf
(
"block tx %d is n
ul
l"
,
i
)
return
fmt
.
Errorf
(
"block tx %d is n
i
l"
,
i
)
}
}
}
}
if
computed
:=
types
.
DeriveSha
(
types
.
Transactions
(
block
.
Transactions
),
trie
.
NewStackTrie
(
nil
));
block
.
TxHash
!=
computed
{
if
computed
:=
types
.
DeriveSha
(
types
.
Transactions
(
block
.
Transactions
),
trie
.
NewStackTrie
(
nil
));
block
.
TxHash
!=
computed
{
...
...
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