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
92310636
Unverified
Commit
92310636
authored
May 10, 2021
by
Mark Tyneway
Committed by
GitHub
May 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: geth miner timestamp bug (#836)
* l2geth: use correct timestamp protection * chore: add changeset
parent
2479b4ab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
gorgeous-countries-listen.md
.changeset/gorgeous-countries-listen.md
+5
-0
worker.go
l2geth/miner/worker.go
+2
-3
No files found.
.changeset/gorgeous-countries-listen.md
0 → 100644
View file @
92310636
---
'
@eth-optimism/l2geth'
:
patch
---
Prevent montonicity errors in the miner
l2geth/miner/worker.go
View file @
92310636
...
@@ -863,12 +863,11 @@ func (w *worker) commitNewTx(tx *types.Transaction) error {
...
@@ -863,12 +863,11 @@ func (w *worker) commitNewTx(tx *types.Transaction) error {
tstart
:=
time
.
Now
()
tstart
:=
time
.
Now
()
parent
:=
w
.
chain
.
CurrentBlock
()
parent
:=
w
.
chain
.
CurrentBlock
()
timestamp
:=
tx
.
L1Timestamp
()
num
:=
parent
.
Number
()
num
:=
parent
.
Number
()
// Preserve liveliness as best as possible. Must panic on L1 to L2
// Preserve liveliness as best as possible. Must panic on L1 to L2
// transactions as the timestamp cannot be malleated
// transactions as the timestamp cannot be malleated
if
parent
.
Time
()
>
t
imestamp
{
if
parent
.
Time
()
>
t
x
.
L1Timestamp
()
{
log
.
Error
(
"Monotonicity violation"
,
"index"
,
num
)
log
.
Error
(
"Monotonicity violation"
,
"index"
,
num
)
if
tx
.
QueueOrigin
()
.
Uint64
()
==
uint64
(
types
.
QueueOriginSequencer
)
{
if
tx
.
QueueOrigin
()
.
Uint64
()
==
uint64
(
types
.
QueueOriginSequencer
)
{
tx
.
SetL1Timestamp
(
parent
.
Time
())
tx
.
SetL1Timestamp
(
parent
.
Time
())
...
@@ -898,7 +897,7 @@ func (w *worker) commitNewTx(tx *types.Transaction) error {
...
@@ -898,7 +897,7 @@ func (w *worker) commitNewTx(tx *types.Transaction) error {
Number
:
num
.
Add
(
num
,
common
.
Big1
),
Number
:
num
.
Add
(
num
,
common
.
Big1
),
GasLimit
:
w
.
config
.
GasFloor
,
GasLimit
:
w
.
config
.
GasFloor
,
Extra
:
w
.
extra
,
Extra
:
w
.
extra
,
Time
:
t
imestamp
,
Time
:
t
x
.
L1Timestamp
()
,
}
}
if
err
:=
w
.
engine
.
Prepare
(
w
.
chain
,
header
);
err
!=
nil
{
if
err
:=
w
.
engine
.
Prepare
(
w
.
chain
,
header
);
err
!=
nil
{
return
fmt
.
Errorf
(
"Failed to prepare header for mining: %w"
,
err
)
return
fmt
.
Errorf
(
"Failed to prepare header for mining: %w"
,
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