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
99a53381
Unverified
Commit
99a53381
authored
Mar 20, 2024
by
Sebastian Stammler
Committed by
GitHub
Mar 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-batcher: fix "handle receipt" log message to properly log id (#9918)
it used to log the full transaction frames
parent
34e74508
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
driver.go
op-batcher/batcher/driver.go
+16
-16
No files found.
op-batcher/batcher/driver.go
View file @
99a53381
...
...
@@ -253,8 +253,8 @@ func (l *BatchSubmitter) calculateL2BlockRangeToStore(ctx context.Context) (eth.
func
(
l
*
BatchSubmitter
)
loop
()
{
defer
l
.
wg
.
Done
()
receiptsCh
:=
make
(
chan
txmgr
.
TxReceipt
[
tx
Data
])
queue
:=
txmgr
.
NewQueue
[
tx
Data
](
l
.
killCtx
,
l
.
Txmgr
,
l
.
Config
.
MaxPendingTransactions
)
receiptsCh
:=
make
(
chan
txmgr
.
TxReceipt
[
tx
ID
])
queue
:=
txmgr
.
NewQueue
[
tx
ID
](
l
.
killCtx
,
l
.
Txmgr
,
l
.
Config
.
MaxPendingTransactions
)
// start the receipt/result processing loop
receiptLoopDone
:=
make
(
chan
struct
{})
...
...
@@ -326,7 +326,7 @@ func (l *BatchSubmitter) loop() {
// publishStateToL1 queues up all pending TxData to be published to the L1, returning when there is
// no more data to queue for publishing or if there was an error queing the data.
func
(
l
*
BatchSubmitter
)
publishStateToL1
(
queue
*
txmgr
.
Queue
[
tx
Data
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txData
])
{
func
(
l
*
BatchSubmitter
)
publishStateToL1
(
queue
*
txmgr
.
Queue
[
tx
ID
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txID
])
{
for
{
// if the txmgr is closed, we stop the transaction sending
if
l
.
Txmgr
.
IsClosed
()
{
...
...
@@ -383,7 +383,7 @@ func (l *BatchSubmitter) clearState(ctx context.Context) {
}
// publishTxToL1 submits a single state tx to the L1
func
(
l
*
BatchSubmitter
)
publishTxToL1
(
ctx
context
.
Context
,
queue
*
txmgr
.
Queue
[
tx
Data
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txData
])
error
{
func
(
l
*
BatchSubmitter
)
publishTxToL1
(
ctx
context
.
Context
,
queue
*
txmgr
.
Queue
[
tx
ID
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txID
])
error
{
// send all available transactions
l1tip
,
err
:=
l
.
l1Tip
(
ctx
)
if
err
!=
nil
{
...
...
@@ -435,7 +435,7 @@ func (l *BatchSubmitter) safeL1Origin(ctx context.Context) (eth.BlockID, error)
// sendTransaction creates & queues for sending a transaction to the batch inbox address with the given `txData`.
// The method will block if the queue's MaxPendingTransactions is exceeded.
func
(
l
*
BatchSubmitter
)
sendTransaction
(
ctx
context
.
Context
,
txdata
txData
,
queue
*
txmgr
.
Queue
[
tx
Data
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txData
])
error
{
func
(
l
*
BatchSubmitter
)
sendTransaction
(
ctx
context
.
Context
,
txdata
txData
,
queue
*
txmgr
.
Queue
[
tx
ID
],
receiptsCh
chan
txmgr
.
TxReceipt
[
txID
])
error
{
var
err
error
// Do the gas estimation offline. A value of 0 will cause the [txmgr] to estimate the gas limit.
...
...
@@ -460,7 +460,7 @@ func (l *BatchSubmitter) sendTransaction(ctx context.Context, txdata txData, que
if
err
!=
nil
{
l
.
Log
.
Error
(
"Failed to post input to Plasma DA"
,
"error"
,
err
)
// requeue frame if we fail to post to the DA Provider so it can be retried
l
.
recordFailedTx
(
txdata
,
err
)
l
.
recordFailedTx
(
txdata
.
ID
()
,
err
)
return
nil
}
// signal plasma commitment tx with TxDataVersion1
...
...
@@ -477,7 +477,7 @@ func (l *BatchSubmitter) sendTransaction(ctx context.Context, txdata txData, que
candidate
.
GasLimit
=
intrinsicGas
}
queue
.
Send
(
txdata
,
*
candidate
,
receiptsCh
)
queue
.
Send
(
txdata
.
ID
()
,
*
candidate
,
receiptsCh
)
return
nil
}
...
...
@@ -505,7 +505,7 @@ func (l *BatchSubmitter) calldataTxCandidate(data []byte) *txmgr.TxCandidate {
}
}
func
(
l
*
BatchSubmitter
)
handleReceipt
(
r
txmgr
.
TxReceipt
[
tx
Data
])
{
func
(
l
*
BatchSubmitter
)
handleReceipt
(
r
txmgr
.
TxReceipt
[
tx
ID
])
{
// Record TX Status
if
r
.
Err
!=
nil
{
l
.
recordFailedTx
(
r
.
ID
,
r
.
Err
)
...
...
@@ -522,15 +522,15 @@ func (l *BatchSubmitter) recordL1Tip(l1tip eth.L1BlockRef) {
l
.
Metr
.
RecordLatestL1Block
(
l1tip
)
}
func
(
l
*
BatchSubmitter
)
recordFailedTx
(
txd
txData
,
err
error
)
{
l
.
Log
.
Warn
(
"Transaction failed to send"
,
logFields
(
tx
d
,
err
)
...
)
l
.
state
.
TxFailed
(
txd
.
ID
()
)
func
(
l
*
BatchSubmitter
)
recordFailedTx
(
id
txID
,
err
error
)
{
l
.
Log
.
Warn
(
"Transaction failed to send"
,
logFields
(
i
d
,
err
)
...
)
l
.
state
.
TxFailed
(
id
)
}
func
(
l
*
BatchSubmitter
)
recordConfirmedTx
(
txd
txData
,
receipt
*
types
.
Receipt
)
{
l
.
Log
.
Info
(
"Transaction confirmed"
,
logFields
(
tx
d
,
receipt
)
...
)
func
(
l
*
BatchSubmitter
)
recordConfirmedTx
(
id
txID
,
receipt
*
types
.
Receipt
)
{
l
.
Log
.
Info
(
"Transaction confirmed"
,
logFields
(
i
d
,
receipt
)
...
)
l1block
:=
eth
.
ReceiptBlockID
(
receipt
)
l
.
state
.
TxConfirmed
(
txd
.
ID
()
,
l1block
)
l
.
state
.
TxConfirmed
(
id
,
l1block
)
}
// l1Tip gets the current L1 tip as a L1BlockRef. The passed context is assumed
...
...
@@ -548,8 +548,8 @@ func (l *BatchSubmitter) l1Tip(ctx context.Context) (eth.L1BlockRef, error) {
func
logFields
(
xs
...
any
)
(
fs
[]
any
)
{
for
_
,
x
:=
range
xs
{
switch
v
:=
x
.
(
type
)
{
case
tx
Data
:
fs
=
append
(
fs
,
"tx_id"
,
v
.
ID
(),
"data_len"
,
v
.
Len
())
case
tx
ID
:
fs
=
append
(
fs
,
"tx_id"
,
v
.
String
())
case
*
types
.
Receipt
:
fs
=
append
(
fs
,
"tx"
,
v
.
TxHash
,
"block"
,
eth
.
ReceiptBlockID
(
v
))
case
error
:
...
...
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