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
11a6a988
Unverified
Commit
11a6a988
authored
Jan 13, 2022
by
Conner Fromknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: consolidate batch_build_time benchmarking code
parent
b64628ec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
11 deletions
+3
-11
driver.go
go/batch-submitter/drivers/proposer/driver.go
+0
-5
driver.go
go/batch-submitter/drivers/sequencer/driver.go
+0
-6
service.go
go/batch-submitter/service.go
+3
-0
No files found.
go/batch-submitter/drivers/proposer/driver.go
View file @
11a6a988
...
...
@@ -6,7 +6,6 @@ import (
"fmt"
"math/big"
"strings"
"time"
"github.com/ethereum-optimism/optimism/go/batch-submitter/bindings/ctc"
"github.com/ethereum-optimism/optimism/go/batch-submitter/bindings/scc"
...
...
@@ -167,8 +166,6 @@ func (d *Driver) CraftBatchTx(
log
.
Info
(
name
+
" crafting batch tx"
,
"start"
,
start
,
"end"
,
end
,
"nonce"
,
nonce
)
batchTxBuildStart
:=
time
.
Now
()
var
(
stateRoots
[][
stateRootSize
]
byte
totalStateRootSize
uint64
...
...
@@ -188,8 +185,6 @@ func (d *Driver) CraftBatchTx(
stateRoots
=
append
(
stateRoots
,
block
.
Root
())
}
batchTxBuildTime
:=
float64
(
time
.
Since
(
batchTxBuildStart
)
/
time
.
Millisecond
)
d
.
metrics
.
BatchTxBuildTime
.
Set
(
batchTxBuildTime
)
d
.
metrics
.
NumElementsPerBatch
.
Observe
(
float64
(
len
(
stateRoots
)))
log
.
Info
(
name
+
" batch constructed"
,
"num_state_roots"
,
len
(
stateRoots
))
...
...
go/batch-submitter/drivers/sequencer/driver.go
View file @
11a6a988
...
...
@@ -6,7 +6,6 @@ import (
"fmt"
"math/big"
"strings"
"time"
"github.com/ethereum-optimism/optimism/go/batch-submitter/bindings/ctc"
"github.com/ethereum-optimism/optimism/go/batch-submitter/drivers"
...
...
@@ -164,8 +163,6 @@ func (d *Driver) CraftBatchTx(
log
.
Info
(
name
+
" crafting batch tx"
,
"start"
,
start
,
"end"
,
end
,
"nonce"
,
nonce
)
batchTxBuildStart
:=
time
.
Now
()
var
(
batchElements
[]
BatchElement
totalTxSize
uint64
...
...
@@ -223,9 +220,6 @@ func (d *Driver) CraftBatchTx(
continue
}
// Record the batch_tx_build_time.
batchTxBuildTime
:=
float64
(
time
.
Since
(
batchTxBuildStart
)
/
time
.
Millisecond
)
d
.
metrics
.
BatchTxBuildTime
.
Set
(
batchTxBuildTime
)
d
.
metrics
.
NumElementsPerBatch
.
Observe
(
float64
(
len
(
batchElements
)))
d
.
metrics
.
BatchPruneCount
.
Set
(
float64
(
pruneCount
))
...
...
go/batch-submitter/service.go
View file @
11a6a988
...
...
@@ -171,6 +171,7 @@ func (s *Service) eventLoop() {
}
nonce
:=
new
(
big
.
Int
)
.
SetUint64
(
nonce64
)
batchTxBuildStart
:=
time
.
Now
()
tx
,
err
:=
s
.
cfg
.
Driver
.
CraftBatchTx
(
s
.
ctx
,
start
,
end
,
nonce
,
)
...
...
@@ -179,6 +180,8 @@ func (s *Service) eventLoop() {
"err"
,
err
)
continue
}
batchTxBuildTime
:=
time
.
Since
(
batchTxBuildStart
)
/
time
.
Millisecond
s
.
metrics
.
BatchTxBuildTime
.
Set
(
float64
(
batchTxBuildTime
))
// Construct the transaction submission clousure that will attempt
// to send the next transaction at the given nonce and gas price.
...
...
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