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
b2828b84
Unverified
Commit
b2828b84
authored
Mar 27, 2024
by
Sebastian Stammler
Committed by
GitHub
Mar 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
txmgr: add blob base fee metrics (#9988)
parent
9951ff77
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
metrics.go
op-batcher/metrics/metrics.go
+2
-2
noop.go
op-service/txmgr/metrics/noop.go
+1
-0
tx_metrics.go
op-service/txmgr/metrics/tx_metrics.go
+14
-1
txmgr.go
op-service/txmgr/txmgr.go
+6
-1
No files found.
op-batcher/metrics/metrics.go
View file @
b2828b84
...
...
@@ -188,8 +188,8 @@ func NewMetrics(procName string) *Metrics {
blobUsedBytes
:
factory
.
NewHistogram
(
prometheus
.
HistogramOpts
{
Namespace
:
ns
,
Name
:
"blob_used_bytes"
,
Help
:
"Blob size in bytes
being submitted
."
,
Buckets
:
prometheus
.
LinearBuckets
(
0.0
,
eth
.
MaxBlobDataSize
/
13
,
1
3
),
Help
:
"Blob size in bytes
(of last blob only for multi-blob txs)
."
,
Buckets
:
prometheus
.
LinearBuckets
(
0.0
,
eth
.
MaxBlobDataSize
/
13
,
1
4
),
}),
batcherTxEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
""
,
"batcher_tx"
,
"BatcherTx"
,
[]
string
{
"stage"
}),
...
...
op-service/txmgr/metrics/noop.go
View file @
b2828b84
...
...
@@ -15,5 +15,6 @@ func (*NoopTxMetrics) RecordTxConfirmationLatency(int64) {}
func
(
*
NoopTxMetrics
)
TxConfirmed
(
*
types
.
Receipt
)
{}
func
(
*
NoopTxMetrics
)
TxPublished
(
string
)
{}
func
(
*
NoopTxMetrics
)
RecordBaseFee
(
*
big
.
Int
)
{}
func
(
*
NoopTxMetrics
)
RecordBlobBaseFee
(
*
big
.
Int
)
{}
func
(
*
NoopTxMetrics
)
RecordTipCap
(
*
big
.
Int
)
{}
func
(
*
NoopTxMetrics
)
RPCError
()
{}
op-service/txmgr/metrics/tx_metrics.go
View file @
b2828b84
...
...
@@ -18,6 +18,7 @@ type TxMetricer interface {
TxConfirmed
(
*
types
.
Receipt
)
TxPublished
(
string
)
RecordBaseFee
(
*
big
.
Int
)
RecordBlobBaseFee
(
*
big
.
Int
)
RecordTipCap
(
*
big
.
Int
)
RPCError
()
}
...
...
@@ -34,6 +35,7 @@ type TxMetrics struct {
publishEvent
*
metrics
.
Event
confirmEvent
metrics
.
EventVec
baseFee
prometheus
.
Gauge
blobBaseFee
prometheus
.
Gauge
tipCap
prometheus
.
Gauge
rpcError
prometheus
.
Counter
}
...
...
@@ -107,7 +109,13 @@ func MakeTxMetrics(ns string, factory metrics.Factory) TxMetrics {
baseFee
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
Name
:
"basefee_wei"
,
Help
:
"Latest L1 baseFee (in Wei)"
,
Help
:
"Latest L1 base fee (in Wei)"
,
Subsystem
:
"txmgr"
,
}),
blobBaseFee
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
Name
:
"blob_basefee_wei"
,
Help
:
"Latest Blob base fee (in Wei)"
,
Subsystem
:
"txmgr"
,
}),
tipCap
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
...
...
@@ -163,6 +171,11 @@ func (t *TxMetrics) RecordBaseFee(baseFee *big.Int) {
t
.
baseFee
.
Set
(
bff
)
}
func
(
t
*
TxMetrics
)
RecordBlobBaseFee
(
blobBaseFee
*
big
.
Int
)
{
bff
,
_
:=
blobBaseFee
.
Float64
()
t
.
blobBaseFee
.
Set
(
bff
)
}
func
(
t
*
TxMetrics
)
RecordTipCap
(
tipcap
*
big
.
Int
)
{
tcf
,
_
:=
tipcap
.
Float64
()
t
.
tipCap
.
Set
(
tcf
)
...
...
op-service/txmgr/txmgr.go
View file @
b2828b84
...
...
@@ -317,7 +317,6 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
}
}
return
m
.
signWithNextNonce
(
ctx
,
txMessage
)
// signer sets the nonce field of the tx
}
// MakeSidecar builds & returns the BlobTxSidecar and corresponding blob hashes from the raw blob
...
...
@@ -599,6 +598,11 @@ func (m *SimpleTxManager) queryReceipt(ctx context.Context, txHash common.Hash,
}
m
.
metr
.
RecordBaseFee
(
tip
.
BaseFee
)
if
tip
.
ExcessBlobGas
!=
nil
{
blobFee
:=
eip4844
.
CalcBlobFee
(
*
tip
.
ExcessBlobGas
)
m
.
metr
.
RecordBlobBaseFee
(
blobFee
)
}
m
.
l
.
Debug
(
"Transaction mined, checking confirmations"
,
"tx"
,
txHash
,
"block"
,
eth
.
ReceiptBlockID
(
receipt
),
"tip"
,
eth
.
HeaderBlockID
(
tip
),
"numConfirmations"
,
m
.
cfg
.
NumConfirmations
)
...
...
@@ -752,6 +756,7 @@ func (m *SimpleTxManager) suggestGasPriceCaps(ctx context.Context) (*big.Int, *b
var
blobFee
*
big
.
Int
if
head
.
ExcessBlobGas
!=
nil
{
blobFee
=
eip4844
.
CalcBlobFee
(
*
head
.
ExcessBlobGas
)
m
.
metr
.
RecordBlobBaseFee
(
blobFee
)
}
return
tip
,
baseFee
,
blobFee
,
nil
}
...
...
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