Skip to content

Commit

Permalink
op-signer: bump optimism dep to latest (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwrd authored Feb 27, 2025
1 parent 2b72964 commit edcb433
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
23 changes: 14 additions & 9 deletions op-signer/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,25 @@ func (s *SignerApp) initRPC(cfg *Config) error {
ClientCAs: caCertPool,
ClientAuth: tls.VerifyClientCertIfGiven, // necessary for k8s healthz probes, but we check the cert in service/auth.go
}
serverTlsConfig := &oprpc.ServerTLSConfig{
serverTlsConfig := &httputil.ServerTLSConfig{
Config: tlsConfig,
CLIConfig: &cfg.TLSConfig,
}

rpcCfg := cfg.RPCConfig
s.rpc = oprpc.NewServer(
rpcCfg.ListenAddr,
rpcCfg.ListenPort,
s.version,
oprpc.WithLogger(s.log),
oprpc.WithTLSConfig(serverTlsConfig),
oprpc.WithMiddleware(service.NewAuthMiddleware()),
oprpc.WithHTTPRecorder(opmetrics.NewPromHTTPRecorder(s.registry, "signer")),
s.rpc = oprpc.ServerFromConfig(
&oprpc.ServerConfig{
Host: rpcCfg.ListenAddr,
Port: rpcCfg.ListenPort,
RpcOptions: []oprpc.Option{
oprpc.WithMiddleware(service.NewAuthMiddleware()),
oprpc.WithHTTPRecorder(opmetrics.NewPromHTTPRecorder(s.registry, "signer")),
oprpc.WithLogger(s.log),
},
HttpOptions: []httputil.Option{
httputil.WithServerTLS(serverTlsConfig),
},
},
)

serviceCfg, err := service.ReadConfig(cfg.ServiceConfigPath)
Expand Down
6 changes: 3 additions & 3 deletions op-signer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.22.0

require (
cloud.google.com/go/kms v1.12.1
github.com/ethereum-optimism/optimism v1.11.2-0.20250221171021-7ceadae45635
github.com/ethereum/go-ethereum v1.15.1
github.com/ethereum-optimism/optimism v1.11.3-0.20250227141522-48b645a69aa4
github.com/ethereum/go-ethereum v1.15.3
github.com/golang/mock v1.6.0
github.com/googleapis/gax-go v1.0.3
github.com/googleapis/gax-go/v2 v2.11.0
Expand Down Expand Up @@ -118,6 +118,6 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101500.0-rc.3
replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101500.2-rc.1

//replace github.com/ethereum-optimism/optimism => ../../optimism
8 changes: 4 additions & 4 deletions op-signer/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v1.101500.0-rc.3 h1:mtrsbMlLvAAsBbMn5YVq0Lt/OZhUM38oqXG770emxL4=
github.com/ethereum-optimism/op-geth v1.101500.0-rc.3/go.mod h1:OMpyVMMy5zpAAHlR5s/aGbXRk+7cIKczUEIJj54APbY=
github.com/ethereum-optimism/optimism v1.11.2-0.20250221171021-7ceadae45635 h1:0Pt1vvptBBIzvjenY3GeLD1ZXpNBaOm4bjNtR2njkVM=
github.com/ethereum-optimism/optimism v1.11.2-0.20250221171021-7ceadae45635/go.mod h1:2DzlZHYfBt0781Qfx9fMP9d64W6Pn3Sa8D9pRw5+WLw=
github.com/ethereum-optimism/op-geth v1.101500.2-rc.1 h1:CCQtyKKobjMbK9jYd676YbH6Xcvntdn6jIOxFTCb5B8=
github.com/ethereum-optimism/op-geth v1.101500.2-rc.1/go.mod h1:OMpyVMMy5zpAAHlR5s/aGbXRk+7cIKczUEIJj54APbY=
github.com/ethereum-optimism/optimism v1.11.3-0.20250227141522-48b645a69aa4 h1:5yNGINxEMKNcw+jWd6ydv+UGBGEuSAARb+1YCpvAJuo=
github.com/ethereum-optimism/optimism v1.11.3-0.20250227141522-48b645a69aa4/go.mod h1:tjdwXgEUi2UsbwYMjBxJBVuxXgYsCCmkX9mk9Aa6TfA=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8=
Expand Down
3 changes: 2 additions & 1 deletion op-signer/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/holiman/uint256"
"github.com/prometheus/client_golang/prometheus"

"github.com/ethereum-optimism/infra/op-signer/service/provider"
Expand Down Expand Up @@ -91,7 +92,7 @@ func (s *EthService) SignTransaction(ctx context.Context, args signer.Transactio
if len(authConfig.ToAddresses) > 0 && !containsNormalized(authConfig.ToAddresses, args.To.Hex()) {
return nil, &UnauthorizedTransactionError{"to address not authorized"}
}
if len(authConfig.MaxValue) > 0 && args.Value.ToInt().Cmp(authConfig.MaxValueToInt()) > 0 {
if len(authConfig.MaxValue) > 0 && ((*uint256.Int)(args.Value)).ToBig().Cmp(authConfig.MaxValueToInt()) > 0 {
return nil, &UnauthorizedTransactionError{"value exceeds maximum"}
}

Expand Down

0 comments on commit edcb433

Please sign in to comment.