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
fbfec7e4
Unverified
Commit
fbfec7e4
authored
Dec 04, 2023
by
Evan Richard
Committed by
GitHub
Dec 04, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8115 from ethereum-optimism/eip4844-e2e-minimal
EIP4844: Add single minimal e2e test.
parents
fb528c63
7e780be0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
2 deletions
+95
-2
fakepos.go
op-e2e/e2eutils/geth/fakepos.go
+2
-2
blobs.go
op-e2e/e2eutils/transactions/blobs.go
+55
-0
system_test.go
op-e2e/system_test.go
+38
-0
No files found.
op-e2e/e2eutils/geth/fakepos.go
View file @
fbfec7e4
...
...
@@ -138,7 +138,7 @@ func (f *fakePoS) Start() error {
tim
.
Stop
()
return
nil
}
envelope
,
err
:=
f
.
engineAPI
.
GetPayloadV
2
(
*
res
.
PayloadID
)
envelope
,
err
:=
f
.
engineAPI
.
GetPayloadV
3
(
*
res
.
PayloadID
)
if
err
!=
nil
{
f
.
log
.
Error
(
"failed to finish building L1 block"
,
"err"
,
err
)
continue
...
...
@@ -178,7 +178,7 @@ func (f *fakePoS) Start() error {
continue
}
}
if
_
,
err
:=
f
.
engineAPI
.
ForkchoiceUpdatedV
2
(
engine
.
ForkchoiceStateV1
{
if
_
,
err
:=
f
.
engineAPI
.
ForkchoiceUpdatedV
3
(
engine
.
ForkchoiceStateV1
{
HeadBlockHash
:
envelope
.
ExecutionPayload
.
BlockHash
,
SafeBlockHash
:
safe
.
Hash
(),
FinalizedBlockHash
:
finalized
.
Hash
(),
...
...
op-e2e/e2eutils/transactions/blobs.go
0 → 100644
View file @
fbfec7e4
package
transactions
import
(
"crypto/ecdsa"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
"github.com/holiman/uint256"
)
var
(
emptyBlob
kzg4844
.
Blob
emptyBlobCommit
kzg4844
.
Commitment
emptyBlobProof
kzg4844
.
Proof
)
func
init
()
{
var
err
error
emptyBlob
=
kzg4844
.
Blob
{}
emptyBlobCommit
,
err
=
kzg4844
.
BlobToCommitment
(
emptyBlob
)
if
err
!=
nil
{
panic
(
"failed to create empty blob commitment: "
+
err
.
Error
())
}
emptyBlobProof
,
err
=
kzg4844
.
ComputeBlobProof
(
emptyBlob
,
emptyBlobCommit
)
if
err
!=
nil
{
panic
(
"failed to create empty blob proof: "
+
err
.
Error
())
}
}
// with thanks to fjl
// https://github.com/ethereum/go-ethereum/commit/2a6beb6a39d7cb3c5906dd4465d65da6efcc73cd
func
CreateEmptyBlobTx
(
key
*
ecdsa
.
PrivateKey
,
withSidecar
bool
,
chainID
uint64
)
*
types
.
BlobTx
{
sidecar
:=
&
types
.
BlobTxSidecar
{
Blobs
:
[]
kzg4844
.
Blob
{
emptyBlob
},
Commitments
:
[]
kzg4844
.
Commitment
{
emptyBlobCommit
},
Proofs
:
[]
kzg4844
.
Proof
{
emptyBlobProof
},
}
blobTx
:=
&
types
.
BlobTx
{
ChainID
:
uint256
.
NewInt
(
chainID
),
Nonce
:
0
,
GasTipCap
:
uint256
.
NewInt
(
2200000000000
),
GasFeeCap
:
uint256
.
NewInt
(
5000000000000
),
Gas
:
25000
,
To
:
common
.
Address
{
0x03
,
0x04
,
0x05
},
Value
:
uint256
.
NewInt
(
99
),
Data
:
make
([]
byte
,
50
),
BlobFeeCap
:
uint256
.
NewInt
(
150000000000
),
BlobHashes
:
sidecar
.
BlobHashes
(),
}
if
withSidecar
{
blobTx
.
Sidecar
=
sidecar
}
return
blobTx
}
op-e2e/system_test.go
View file @
fbfec7e4
...
...
@@ -31,6 +31,8 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-e2e/config"
gethutils
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/transactions"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-node/metrics"
rollupNode
"github.com/ethereum-optimism/optimism/op-node/node"
...
...
@@ -171,6 +173,42 @@ func TestSystemE2EDencunAtGenesis(t *testing.T) {
require
.
NotNil
(
t
,
head
.
ExcessBlobGas
(),
"L1 is building dencun blocks since genesis"
)
}
// TestSystemE2EDencunAtGenesis tests if L2 finalizes when blobs are present on L1
func
TestSystemE2EDencunAtGenesisWithBlobs
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
//cancun is on from genesis:
genesisActivation
:=
uint64
(
0
)
cfg
.
DeployConfig
.
L1CancunTimeOffset
=
&
genesisActivation
// i.e. turn cancun on at genesis time + 0
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
// send a blob-containing txn on l1
ethPrivKey
:=
sys
.
Cfg
.
Secrets
.
Alice
txData
:=
transactions
.
CreateEmptyBlobTx
(
ethPrivKey
,
true
,
sys
.
Cfg
.
L1ChainIDBig
()
.
Uint64
())
tx
:=
types
.
MustSignNewTx
(
ethPrivKey
,
types
.
LatestSignerForChainID
(
cfg
.
L1ChainIDBig
()),
txData
)
// send blob-containing txn
sendCtx
,
sendCancel
:=
context
.
WithTimeout
(
context
.
Background
(),
15
*
time
.
Second
)
defer
sendCancel
()
l1Client
:=
sys
.
Clients
[
"l1"
]
err
=
l1Client
.
SendTransaction
(
sendCtx
,
tx
)
require
.
NoError
(
t
,
err
,
"Sending L1 empty blob tx"
)
// Wait for transaction on L1
blockContainsBlob
,
err
:=
geth
.
WaitForTransaction
(
tx
.
Hash
(),
l1Client
,
30
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for blob tx on L1"
)
// end sending blob-containing txns on l1
l2Client
:=
sys
.
Clients
[
"sequencer"
]
finalizedBlock
,
err
:=
gethutils
.
WaitForL1OriginOnL2
(
blockContainsBlob
.
BlockNumber
.
Uint64
(),
l2Client
,
30
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for L1 origin of blob tx on L2"
)
finalizationTimeout
:=
30
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
_
,
err
=
gethutils
.
WaitForBlockToBeSafe
(
finalizedBlock
.
Header
()
.
Number
,
l2Client
,
finalizationTimeout
)
require
.
Nil
(
t
,
err
,
"Waiting for safety of L2 block"
)
}
// TestSystemE2E sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that L1 deposits are reflected on L2.
// All nodes are run in process (but are the full nodes, not mocked or stubbed).
func
TestSystemE2E
(
t
*
testing
.
T
)
{
...
...
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