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
10f8865f
Unverified
Commit
10f8865f
authored
Jul 19, 2023
by
mergify[bot]
Committed by
GitHub
Jul 19, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into deps/delete-abstract-provider
parents
75a66eb2
ab8d533e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
3 deletions
+90
-3
config.go
op-node/p2p/config.go
+0
-3
engine_queue.go
op-node/rollup/derive/engine_queue.go
+5
-0
engine_queue_test.go
op-node/rollup/derive/engine_queue_test.go
+85
-0
No files found.
op-node/p2p/config.go
View file @
10f8865f
...
...
@@ -65,9 +65,6 @@ type Config struct {
DisableP2P
bool
NoDiscovery
bool
// Enable P2P-based alt-syncing method (req-resp protocol, not gossip)
AltSync
bool
ScoringParams
*
ScoringParams
// Whether to ban peers based on their [PeerScoring] score. Should be negative.
...
...
op-node/rollup/derive/engine_queue.go
View file @
10f8865f
...
...
@@ -420,6 +420,11 @@ func (eq *EngineQueue) tryNextUnsafePayload(ctx context.Context) error {
eq
.
unsafePayloads
.
Pop
()
return
nil
}
if
uint64
(
first
.
BlockNumber
)
<=
eq
.
unsafeHead
.
Number
{
eq
.
log
.
Info
(
"skipping unsafe payload, since it is older than unsafe head"
,
"unsafe"
,
eq
.
unsafeHead
.
ID
(),
"unsafe_payload"
,
first
.
ID
())
eq
.
unsafePayloads
.
Pop
()
return
nil
}
// Ensure that the unsafe payload builds upon the current unsafe head
// TODO: once we support snap-sync we can remove this condition, and handle the "SYNCING" status of the execution engine.
...
...
op-node/rollup/derive/engine_queue_test.go
View file @
10f8865f
...
...
@@ -1107,3 +1107,88 @@ func TestResetLoop(t *testing.T) {
l1F
.
AssertExpectations
(
t
)
eng
.
AssertExpectations
(
t
)
}
func
TestEngineQueue_StepPopOlderUnsafe
(
t
*
testing
.
T
)
{
logger
:=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
eng
:=
&
testutils
.
MockEngine
{}
l1F
:=
&
testutils
.
MockL1Source
{}
rng
:=
rand
.
New
(
rand
.
NewSource
(
1234
))
refA
:=
testutils
.
RandomBlockRef
(
rng
)
refA0
:=
eth
.
L2BlockRef
{
Hash
:
testutils
.
RandomHash
(
rng
),
Number
:
0
,
ParentHash
:
common
.
Hash
{},
Time
:
refA
.
Time
,
L1Origin
:
refA
.
ID
(),
SequenceNumber
:
0
,
}
gasLimit
:=
eth
.
Uint64Quantity
(
20
_000_000
)
cfg
:=
&
rollup
.
Config
{
Genesis
:
rollup
.
Genesis
{
L1
:
refA
.
ID
(),
L2
:
refA0
.
ID
(),
L2Time
:
refA0
.
Time
,
SystemConfig
:
eth
.
SystemConfig
{
BatcherAddr
:
common
.
Address
{
42
},
Overhead
:
[
32
]
byte
{
123
},
Scalar
:
[
32
]
byte
{
42
},
GasLimit
:
20
_000_000
,
},
},
BlockTime
:
1
,
SeqWindowSize
:
2
,
}
refA1
:=
eth
.
L2BlockRef
{
Hash
:
testutils
.
RandomHash
(
rng
),
Number
:
refA0
.
Number
+
1
,
ParentHash
:
refA0
.
Hash
,
Time
:
refA0
.
Time
+
cfg
.
BlockTime
,
L1Origin
:
refA
.
ID
(),
SequenceNumber
:
1
,
}
refA2
:=
eth
.
L2BlockRef
{
Hash
:
testutils
.
RandomHash
(
rng
),
Number
:
refA1
.
Number
+
1
,
ParentHash
:
refA1
.
Hash
,
Time
:
refA1
.
Time
+
cfg
.
BlockTime
,
L1Origin
:
refA
.
ID
(),
SequenceNumber
:
2
,
}
payloadA1
:=
&
eth
.
ExecutionPayload
{
ParentHash
:
refA1
.
ParentHash
,
FeeRecipient
:
common
.
Address
{},
StateRoot
:
eth
.
Bytes32
{},
ReceiptsRoot
:
eth
.
Bytes32
{},
LogsBloom
:
eth
.
Bytes256
{},
PrevRandao
:
eth
.
Bytes32
{},
BlockNumber
:
eth
.
Uint64Quantity
(
refA1
.
Number
),
GasLimit
:
gasLimit
,
GasUsed
:
0
,
Timestamp
:
eth
.
Uint64Quantity
(
refA1
.
Time
),
ExtraData
:
nil
,
BaseFeePerGas
:
*
uint256
.
NewInt
(
7
),
BlockHash
:
refA1
.
Hash
,
Transactions
:
[]
eth
.
Data
{},
}
prev
:=
&
fakeAttributesQueue
{
origin
:
refA
}
eq
:=
NewEngineQueue
(
logger
,
cfg
,
eng
,
metrics
.
NoopMetrics
,
prev
,
l1F
)
eq
.
unsafeHead
=
refA2
eq
.
safeHead
=
refA0
eq
.
finalized
=
refA0
eq
.
AddUnsafePayload
(
payloadA1
)
err
:=
eq
.
Step
(
context
.
Background
())
require
.
NoError
(
t
,
err
)
require
.
Nil
(
t
,
eq
.
unsafePayloads
.
Peek
(),
"should pop the unsafe payload because it is too old"
)
fmt
.
Println
(
eq
.
unsafePayloads
.
Peek
())
l1F
.
AssertExpectations
(
t
)
eng
.
AssertExpectations
(
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