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
3a35b74e
Unverified
Commit
3a35b74e
authored
Apr 19, 2023
by
Michael de Hoog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move receipt handling down and add back sendTransaction to simplify diff
parent
ecb90d63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
24 deletions
+31
-24
driver.go
op-batcher/batcher/driver.go
+31
-24
No files found.
op-batcher/batcher/driver.go
View file @
3a35b74e
...
...
@@ -337,17 +337,6 @@ func (l *BatchSubmitter) drainState(receiptsCh chan txmgr.TxReceipt[txData], que
}
}
func
(
l
*
BatchSubmitter
)
handleReceipt
(
r
txmgr
.
TxReceipt
[
txData
])
{
// Record TX Status
if
r
.
Err
!=
nil
{
l
.
log
.
Warn
(
"unable to publish tx"
,
"err"
,
r
.
Err
,
"data_size"
,
r
.
ID
.
Len
())
l
.
recordFailedTx
(
r
.
ID
.
ID
(),
r
.
Err
)
}
else
{
l
.
log
.
Info
(
"tx successfully published"
,
"tx_hash"
,
r
.
Receipt
.
TxHash
,
"data_size"
,
r
.
ID
.
Len
())
l
.
recordConfirmedTx
(
r
.
ID
.
ID
(),
r
.
Receipt
)
}
}
// 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
...
...
@@ -372,20 +361,38 @@ func (l *BatchSubmitter) publishStateToL1(ctx context.Context, queue *txmgr.Queu
return
}
// Do the gas estimation offline. A value of 0 will cause the [txmgr] to estimate the gas limit.
data
:=
txdata
.
Bytes
()
intrinsicGas
,
err
:=
core
.
IntrinsicGas
(
data
,
nil
,
false
,
true
,
true
,
false
)
if
err
!=
nil
{
l
.
log
.
Error
(
"Failed to calculate intrinsic gas"
,
"error"
,
err
)
return
}
l
.
sendTransaction
(
txdata
,
queue
,
receiptsCh
)
}
}
candidate
:=
txmgr
.
TxCandidate
{
To
:
&
l
.
Rollup
.
BatchInboxAddress
,
TxData
:
data
,
GasLimit
:
intrinsicGas
,
}
queue
.
Send
(
txdata
,
candidate
,
receiptsCh
)
// sendTransaction creates & submits a transaction to the batch inbox address with the given `data`.
// It currently uses the underlying `txmgr` to handle transaction sending & price management.
// This is a blocking method. It should not be called concurrently.
func
(
l
*
BatchSubmitter
)
sendTransaction
(
txdata
txData
,
queue
*
txmgr
.
Queue
[
txData
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txData
])
{
// Do the gas estimation offline. A value of 0 will cause the [txmgr] to estimate the gas limit.
data
:=
txdata
.
Bytes
()
intrinsicGas
,
err
:=
core
.
IntrinsicGas
(
data
,
nil
,
false
,
true
,
true
,
false
)
if
err
!=
nil
{
l
.
log
.
Error
(
"Failed to calculate intrinsic gas"
,
"error"
,
err
)
return
}
candidate
:=
txmgr
.
TxCandidate
{
To
:
&
l
.
Rollup
.
BatchInboxAddress
,
TxData
:
data
,
GasLimit
:
intrinsicGas
,
}
queue
.
Send
(
txdata
,
candidate
,
receiptsCh
)
}
func
(
l
*
BatchSubmitter
)
handleReceipt
(
r
txmgr
.
TxReceipt
[
txData
])
{
// Record TX Status
if
r
.
Err
!=
nil
{
l
.
log
.
Warn
(
"unable to publish tx"
,
"err"
,
r
.
Err
,
"data_size"
,
r
.
ID
.
Len
())
l
.
recordFailedTx
(
r
.
ID
.
ID
(),
r
.
Err
)
}
else
{
l
.
log
.
Info
(
"tx successfully published"
,
"tx_hash"
,
r
.
Receipt
.
TxHash
,
"data_size"
,
r
.
ID
.
Len
())
l
.
recordConfirmedTx
(
r
.
ID
.
ID
(),
r
.
Receipt
)
}
}
...
...
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