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
fc13e850
Unverified
Commit
fc13e850
authored
Apr 18, 2023
by
Michael de Hoog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small simplification
parent
a1064b2a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
40 deletions
+36
-40
driver.go
op-batcher/batcher/driver.go
+36
-40
No files found.
op-batcher/batcher/driver.go
View file @
fc13e850
...
@@ -370,19 +370,14 @@ func (l *BatchSubmitter) handleReceipt(r txmgr.TxReceipt[txData]) {
...
@@ -370,19 +370,14 @@ func (l *BatchSubmitter) handleReceipt(r txmgr.TxReceipt[txData]) {
}
}
}
}
// publishStateToL1Factory produces a publishStateToL1Job job
// publishStateToL1Factory returns a txmgr factory function that pulls the block data
// loaded into `state`, and returns a txmgr transaction candidate that can be used to
// submit the associated data to the L1 in the form of channel frames. The factory
// will return an io.EOF error if no data is available.
func
(
l
*
BatchSubmitter
)
publishStateToL1Factory
()
txmgr
.
TxFactory
[
txData
]
{
func
(
l
*
BatchSubmitter
)
publishStateToL1Factory
()
txmgr
.
TxFactory
[
txData
]
{
return
func
(
ctx
context
.
Context
)
(
txmgr
.
TxCandidate
,
txData
,
error
)
{
return
func
(
ctx
context
.
Context
)
(
txmgr
.
TxCandidate
,
txData
,
error
)
{
return
l
.
publishStateToL1Job
(
ctx
)
// this is called from a separate goroutine in the txmgr.Queue,
}
// so lock to prevent concurrent access to the state
}
// publishStateToL1Job pulls the block data loaded into `state`, and returns a function that
// will submit the associated data to the L1 in the form of channel frames when called.
// Returns an io.EOF error if no data is available.
func
(
l
*
BatchSubmitter
)
publishStateToL1Job
(
ctx
context
.
Context
)
(
txmgr
.
TxCandidate
,
txData
,
error
)
{
// this is called from a separate goroutine in the tx queue, so we need
// to lock to prevent concurrent access to the state
l
.
publishLock
.
Lock
()
l
.
publishLock
.
Lock
()
defer
l
.
publishLock
.
Unlock
()
defer
l
.
publishLock
.
Unlock
()
...
@@ -416,6 +411,7 @@ func (l *BatchSubmitter) publishStateToL1Job(ctx context.Context) (txmgr.TxCandi
...
@@ -416,6 +411,7 @@ func (l *BatchSubmitter) publishStateToL1Job(ctx context.Context) (txmgr.TxCandi
GasLimit
:
intrinsicGas
,
GasLimit
:
intrinsicGas
,
}
}
return
candidate
,
txdata
,
nil
return
candidate
,
txdata
,
nil
}
}
}
func
(
l
*
BatchSubmitter
)
recordL1Tip
(
l1tip
eth
.
L1BlockRef
)
{
func
(
l
*
BatchSubmitter
)
recordL1Tip
(
l1tip
eth
.
L1BlockRef
)
{
...
...
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