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
859e6437
Commit
859e6437
authored
Dec 12, 2023
by
Felipe Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(ufm): update deps
parent
1a34669c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
30 deletions
+84
-30
go.mod
op-ufm/go.mod
+25
-17
go.sum
op-ufm/go.sum
+45
-0
signer.go
op-ufm/pkg/metrics/clients/signer.go
+4
-3
roundtrip.go
op-ufm/pkg/provider/roundtrip.go
+10
-10
No files found.
op-ufm/go.mod
View file @
859e6437
module github.com/ethereum-optimism/optimism/op-ufm
module github.com/ethereum-optimism/optimism/op-ufm
go 1.20
go 1.21
toolchain go1.21.3
require (
require (
cloud.google.com/go/kms v1.12.1
cloud.google.com/go/kms v1.12.1
github.com/BurntSushi/toml v1.3.2
github.com/BurntSushi/toml v1.3.2
github.com/ethereum-optimism/optimism
/op-service v0.10.14
github.com/ethereum-optimism/optimism
v1.2.0
github.com/ethereum/go-ethereum v1.1
2
.1
github.com/ethereum/go-ethereum v1.1
3
.1
github.com/gorilla/mux v1.8.0
github.com/gorilla/mux v1.8.0
github.com/pkg/errors v0.9.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.1
6
.0
github.com/prometheus/client_golang v1.1
7
.0
github.com/rs/cors v1.9.0
github.com/rs/cors v1.9.0
)
)
...
@@ -18,6 +20,7 @@ require (
...
@@ -18,6 +20,7 @@ require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/VictoriaMetrics/fastcache v1.10.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.7.0 // indirect
github.com/bits-and-blooms/bitset v1.7.0 // indirect
...
@@ -25,15 +28,16 @@ require (
...
@@ -25,15 +28,16 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230
209160836-829675f94811
// indirect
github.com/cockroachdb/pebble v0.0.0-20230
906160148-46873a6a7a06
// indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.0 // indirect
github.com/consensys/gnark-crypto v0.12.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect
github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/ethereum/c-kzg-4844 v0.3.0 // indirect
github.com/ethereum/c-kzg-4844 v0.3.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
...
@@ -49,34 +53,38 @@ require (
...
@@ -49,34 +53,38 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/klauspost/compress v1.1
5.15
// indirect
github.com/klauspost/compress v1.1
6.7
// indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-runewidth v0.0.1
3
// indirect
github.com/mattn/go-runewidth v0.0.1
4
// indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/prometheus/client_model v0.
3.0
// indirect
github.com/prometheus/client_model v0.
4.1-0.20230718164431-9a2bf3000d16
// indirect
github.com/prometheus/common v0.4
2
.0 // indirect
github.com/prometheus/common v0.4
4
.0 // indirect
github.com/prometheus/procfs v0.1
0
.1 // indirect
github.com/prometheus/procfs v0.1
1
.1 // indirect
github.com/rivo/uniseg v0.
3.4
// indirect
github.com/rivo/uniseg v0.
4.3
// indirect
github.com/rogpeppe/go-internal v1.
9
.0 // indirect
github.com/rogpeppe/go-internal v1.
10
.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.1
0
// indirect
github.com/tklauser/go-sysconf v0.3.1
2
// indirect
github.com/tklauser/numcpus v0.
5.0
// indirect
github.com/tklauser/numcpus v0.
6.1
// indirect
github.com/urfave/cli v1.22.9 // indirect
github.com/urfave/cli v1.22.9 // indirect
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/api v0.132.0 // indirect
google.golang.org/api v0.132.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
...
...
op-ufm/go.sum
View file @
859e6437
This diff is collapsed.
Click to expand it.
op-ufm/pkg/metrics/clients/signer.go
View file @
859e6437
...
@@ -6,9 +6,10 @@ import (
...
@@ -6,9 +6,10 @@ import (
"time"
"time"
"github.com/ethereum-optimism/optimism/op-ufm/pkg/metrics"
"github.com/ethereum-optimism/optimism/op-ufm/pkg/metrics"
"github.com/ethereum/go-ethereum/common"
optls
"github.com/ethereum-optimism/optimism/op-service/tls"
signer
"github.com/ethereum-optimism/optimism/op-service/signer"
signer
"github.com/ethereum-optimism/optimism/op-service/signer"
optls
"github.com/ethereum-optimism/optimism/op-service/tls"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
...
@@ -29,9 +30,9 @@ func NewSignerClient(providerName string, logger log.Logger, endpoint string, tl
...
@@ -29,9 +30,9 @@ func NewSignerClient(providerName string, logger log.Logger, endpoint string, tl
return
&
InstrumentedSignerClient
{
c
:
c
,
providerName
:
providerName
},
nil
return
&
InstrumentedSignerClient
{
c
:
c
,
providerName
:
providerName
},
nil
}
}
func
(
i
*
InstrumentedSignerClient
)
SignTransaction
(
ctx
context
.
Context
,
chainId
*
big
.
Int
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
func
(
i
*
InstrumentedSignerClient
)
SignTransaction
(
ctx
context
.
Context
,
chainId
*
big
.
Int
,
from
*
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
tx
,
err
:=
i
.
c
.
SignTransaction
(
ctx
,
chainId
,
tx
)
tx
,
err
:=
i
.
c
.
SignTransaction
(
ctx
,
chainId
,
*
from
,
tx
)
if
err
!=
nil
{
if
err
!=
nil
{
metrics
.
RecordErrorDetails
(
i
.
providerName
,
"signer.SignTransaction"
,
err
)
metrics
.
RecordErrorDetails
(
i
.
providerName
,
"signer.SignTransaction"
,
err
)
return
nil
,
err
return
nil
,
err
...
...
op-ufm/pkg/provider/roundtrip.go
View file @
859e6437
...
@@ -57,7 +57,7 @@ func (p *Provider) RoundTrip(ctx context.Context) {
...
@@ -57,7 +57,7 @@ func (p *Provider) RoundTrip(ctx context.Context) {
}
}
}
}
tx
,
err
:=
p
.
createTx
(
ctx
,
client
,
nonce
)
from
,
tx
,
err
:=
p
.
createTx
(
ctx
,
client
,
nonce
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"cant create tx"
,
log
.
Error
(
"cant create tx"
,
"provider"
,
p
.
name
,
"provider"
,
p
.
name
,
...
@@ -67,7 +67,7 @@ func (p *Provider) RoundTrip(ctx context.Context) {
...
@@ -67,7 +67,7 @@ func (p *Provider) RoundTrip(ctx context.Context) {
}
}
nonce
=
tx
.
Nonce
()
nonce
=
tx
.
Nonce
()
signedTx
,
err
:=
p
.
sign
(
ctx
,
tx
)
signedTx
,
err
:=
p
.
sign
(
ctx
,
from
,
tx
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"cant sign tx"
,
log
.
Error
(
"cant sign tx"
,
"provider"
,
p
.
name
,
"provider"
,
p
.
name
,
...
@@ -192,7 +192,7 @@ func (p *Provider) RoundTrip(ctx context.Context) {
...
@@ -192,7 +192,7 @@ func (p *Provider) RoundTrip(ctx context.Context) {
"gasUsed"
,
receipt
.
GasUsed
)
"gasUsed"
,
receipt
.
GasUsed
)
}
}
func
(
p
*
Provider
)
createTx
(
ctx
context
.
Context
,
client
*
iclients
.
InstrumentedEthClient
,
nonce
uint64
)
(
*
types
.
Transaction
,
error
)
{
func
(
p
*
Provider
)
createTx
(
ctx
context
.
Context
,
client
*
iclients
.
InstrumentedEthClient
,
nonce
uint64
)
(
*
common
.
Address
,
*
types
.
Transaction
,
error
)
{
var
err
error
var
err
error
if
nonce
==
0
{
if
nonce
==
0
{
nonce
,
err
=
client
.
PendingNonceAt
(
ctx
,
p
.
walletConfig
.
Address
)
nonce
,
err
=
client
.
PendingNonceAt
(
ctx
,
p
.
walletConfig
.
Address
)
...
@@ -201,7 +201,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
...
@@ -201,7 +201,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
"provider"
,
p
.
name
,
"provider"
,
p
.
name
,
"nonce"
,
nonce
,
"nonce"
,
nonce
,
"err"
,
err
)
"err"
,
err
)
return
nil
,
err
return
nil
,
nil
,
err
}
}
}
}
...
@@ -210,7 +210,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
...
@@ -210,7 +210,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
log
.
Error
(
"cant get gas tip cap"
,
log
.
Error
(
"cant get gas tip cap"
,
"provider"
,
p
.
name
,
"provider"
,
p
.
name
,
"err"
,
err
)
"err"
,
err
)
return
nil
,
err
return
nil
,
nil
,
err
}
}
gasTipCap
=
new
(
big
.
Int
)
.
Mul
(
gasTipCap
,
big
.
NewInt
(
110
))
gasTipCap
=
new
(
big
.
Int
)
.
Mul
(
gasTipCap
,
big
.
NewInt
(
110
))
gasTipCap
=
new
(
big
.
Int
)
.
Div
(
gasTipCap
,
big
.
NewInt
(
100
))
gasTipCap
=
new
(
big
.
Int
)
.
Div
(
gasTipCap
,
big
.
NewInt
(
100
))
...
@@ -220,7 +220,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
...
@@ -220,7 +220,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
log
.
Error
(
"cant get base fee from head"
,
log
.
Error
(
"cant get base fee from head"
,
"provider"
,
p
.
name
,
"provider"
,
p
.
name
,
"err"
,
err
)
"err"
,
err
)
return
nil
,
err
return
nil
,
nil
,
err
}
}
baseFee
:=
head
.
BaseFee
baseFee
:=
head
.
BaseFee
...
@@ -252,7 +252,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
...
@@ -252,7 +252,7 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
log
.
Error
(
"cant estimate gas"
,
log
.
Error
(
"cant estimate gas"
,
"provider"
,
p
.
name
,
"provider"
,
p
.
name
,
"err"
,
err
)
"err"
,
err
)
return
nil
,
err
return
nil
,
nil
,
err
}
}
dynamicTx
.
Gas
=
gas
dynamicTx
.
Gas
=
gas
tx
:=
types
.
NewTx
(
dynamicTx
)
tx
:=
types
.
NewTx
(
dynamicTx
)
...
@@ -268,10 +268,10 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
...
@@ -268,10 +268,10 @@ func (p *Provider) createTx(ctx context.Context, client *iclients.InstrumentedEt
"gasFeeCap"
,
dynamicTx
.
GasFeeCap
,
"gasFeeCap"
,
dynamicTx
.
GasFeeCap
,
)
)
return
tx
,
nil
return
&
addr
,
tx
,
nil
}
}
func
(
p
*
Provider
)
sign
(
ctx
context
.
Context
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
func
(
p
*
Provider
)
sign
(
ctx
context
.
Context
,
from
*
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
if
p
.
walletConfig
.
SignerMethod
==
"static"
{
if
p
.
walletConfig
.
SignerMethod
==
"static"
{
log
.
Debug
(
"using static signer"
)
log
.
Debug
(
"using static signer"
)
privateKey
,
err
:=
crypto
.
HexToECDSA
(
p
.
walletConfig
.
PrivateKey
)
privateKey
,
err
:=
crypto
.
HexToECDSA
(
p
.
walletConfig
.
PrivateKey
)
...
@@ -297,7 +297,7 @@ func (p *Provider) sign(ctx context.Context, tx *types.Transaction) (*types.Tran
...
@@ -297,7 +297,7 @@ func (p *Provider) sign(ctx context.Context, tx *types.Transaction) (*types.Tran
return
nil
,
errors
.
New
(
"could not initialize signer client"
)
return
nil
,
errors
.
New
(
"could not initialize signer client"
)
}
}
signedTx
,
err
:=
client
.
SignTransaction
(
ctx
,
&
p
.
walletConfig
.
ChainID
,
tx
)
signedTx
,
err
:=
client
.
SignTransaction
(
ctx
,
&
p
.
walletConfig
.
ChainID
,
from
,
tx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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