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
9cb0af22
Unverified
Commit
9cb0af22
authored
Dec 09, 2021
by
Conner Fromknecht
Committed by
GitHub
Dec 09, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1904 from cfromknecht/bss-batch-creation-gauge
feat: add batchTxBuildTime performance gauge
parents
158743bc
3eb5590b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
0 deletions
+23
-0
spicy-mayflies-complain.md
.changeset/spicy-mayflies-complain.md
+5
-0
batch-submitter.ts
...es/batch-submitter/src/batch-submitter/batch-submitter.ts
+6
-0
state-batch-submitter.ts
...ch-submitter/src/batch-submitter/state-batch-submitter.ts
+6
-0
tx-batch-submitter.ts
...batch-submitter/src/batch-submitter/tx-batch-submitter.ts
+6
-0
No files found.
.changeset/spicy-mayflies-complain.md
0 → 100644
View file @
9cb0af22
---
'
@eth-optimism/batch-submitter'
:
patch
---
adds batchTxBuildTime gauge
packages/batch-submitter/src/batch-submitter/batch-submitter.ts
View file @
9cb0af22
...
@@ -31,6 +31,7 @@ interface BatchSubmitterMetrics {
...
@@ -31,6 +31,7 @@ interface BatchSubmitterMetrics {
batchesSubmitted
:
Counter
<
string
>
batchesSubmitted
:
Counter
<
string
>
failedSubmissions
:
Counter
<
string
>
failedSubmissions
:
Counter
<
string
>
malformedBatches
:
Counter
<
string
>
malformedBatches
:
Counter
<
string
>
batchTxBuildTime
:
Gauge
<
string
>
}
}
export
abstract
class
BatchSubmitter
{
export
abstract
class
BatchSubmitter
{
...
@@ -293,6 +294,11 @@ export abstract class BatchSubmitter {
...
@@ -293,6 +294,11 @@ export abstract class BatchSubmitter {
help
:
'
Count of malformed batches
'
,
help
:
'
Count of malformed batches
'
,
registers
:
[
metrics
.
registry
],
registers
:
[
metrics
.
registry
],
}),
}),
batchTxBuildTime
:
new
metrics
.
client
.
Gauge
({
name
:
'
batch_tx_build_time
'
,
help
:
'
Time to construct batch transaction
'
,
registers
:
[
metrics
.
registry
],
}),
}
}
}
}
}
}
packages/batch-submitter/src/batch-submitter/state-batch-submitter.ts
View file @
9cb0af22
...
@@ -154,6 +154,9 @@ export class StateBatchSubmitter extends BatchSubmitter {
...
@@ -154,6 +154,9 @@ export class StateBatchSubmitter extends BatchSubmitter {
startBlock
:
number
,
startBlock
:
number
,
endBlock
:
number
endBlock
:
number
):
Promise
<
TransactionReceipt
>
{
):
Promise
<
TransactionReceipt
>
{
const
batchTxBuildStart
=
performance
.
now
()
const
batch
=
await
this
.
_generateStateCommitmentBatch
(
startBlock
,
endBlock
)
const
batch
=
await
this
.
_generateStateCommitmentBatch
(
startBlock
,
endBlock
)
const
calldata
=
this
.
chainContract
.
interface
.
encodeFunctionData
(
const
calldata
=
this
.
chainContract
.
interface
.
encodeFunctionData
(
'
appendStateBatch
'
,
'
appendStateBatch
'
,
...
@@ -169,6 +172,9 @@ export class StateBatchSubmitter extends BatchSubmitter {
...
@@ -169,6 +172,9 @@ export class StateBatchSubmitter extends BatchSubmitter {
return
return
}
}
const
batchTxBuildEnd
=
performance
.
now
()
this
.
metrics
.
batchTxBuildTime
.
set
(
batchTxBuildEnd
-
batchTxBuildStart
)
const
offsetStartsAtIndex
=
startBlock
-
this
.
blockOffset
const
offsetStartsAtIndex
=
startBlock
-
this
.
blockOffset
this
.
logger
.
debug
(
'
Submitting batch.
'
,
{
calldata
})
this
.
logger
.
debug
(
'
Submitting batch.
'
,
{
calldata
})
...
...
packages/batch-submitter/src/batch-submitter/tx-batch-submitter.ts
View file @
9cb0af22
...
@@ -203,6 +203,8 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
...
@@ -203,6 +203,8 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
return
return
}
}
const
batchTxBuildStart
=
performance
.
now
()
const
params
=
await
this
.
_generateSequencerBatchParams
(
const
params
=
await
this
.
_generateSequencerBatchParams
(
startBlock
,
startBlock
,
endBlock
endBlock
...
@@ -226,6 +228,10 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
...
@@ -226,6 +228,10 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
if
(
!
wasBatchTruncated
&&
!
this
.
_shouldSubmitBatch
(
batchSizeInBytes
))
{
if
(
!
wasBatchTruncated
&&
!
this
.
_shouldSubmitBatch
(
batchSizeInBytes
))
{
return
return
}
}
const
batchTxBuildEnd
=
performance
.
now
()
this
.
metrics
.
batchTxBuildTime
.
set
(
batchTxBuildEnd
-
batchTxBuildStart
)
this
.
metrics
.
numTxPerBatch
.
observe
(
endBlock
-
startBlock
)
this
.
metrics
.
numTxPerBatch
.
observe
(
endBlock
-
startBlock
)
const
l1tipHeight
=
await
this
.
signer
.
provider
.
getBlockNumber
()
const
l1tipHeight
=
await
this
.
signer
.
provider
.
getBlockNumber
()
this
.
logger
.
debug
(
'
Submitting batch.
'
,
{
this
.
logger
.
debug
(
'
Submitting batch.
'
,
{
...
...
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