Skip to content

Commit 1b98cb9

Browse files
committed
update deps and fix fallback preimages
1 parent cb70002 commit 1b98cb9

File tree

10 files changed

+32987
-527
lines changed

10 files changed

+32987
-527
lines changed

cmd/celestiadaserver.go

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ import (
1212

1313
flag "github.com/spf13/pflag"
1414

15-
"github.com/ethereum/go-ethereum/log"
15+
gethlog "github.com/ethereum/go-ethereum/log"
1616
"github.com/ethereum/go-ethereum/metrics"
1717
"github.com/ethereum/go-ethereum/metrics/exp"
1818

1919
"github.com/offchainlabs/nitro/cmd/genericconf"
2020
"github.com/offchainlabs/nitro/cmd/util/confighelpers"
21+
"github.com/offchainlabs/nitro/daprovider/daclient"
2122
"github.com/offchainlabs/nitro/util/headerreader"
23+
"github.com/offchainlabs/nitro/util/rpcclient"
2224

2325
das "github.com/celestiaorg/nitro-das-celestia/daserver"
2426
"github.com/celestiaorg/nitro-das-celestia/daserver/types"
@@ -33,7 +35,9 @@ type CelestiaDAServerConfig struct {
3335

3436
CelestiaDa das.DAConfig `koanf:"celestia"`
3537

36-
DasClientConfig das.ClientConfig `koanf:"das"`
38+
DasClientConfig daclient.ClientConfig `koanf:"das"`
39+
40+
FallbackEnabled bool `koanf:"fallback-enabled"`
3741

3842
LogLevel string `koanf:"log-level"`
3943
LogType string `koanf:"log-type"`
@@ -50,18 +54,19 @@ var DefaultCelestiaDAServerConfig = CelestiaDAServerConfig{
5054
RPCPort: 9876,
5155
RPCServerTimeouts: genericconf.HTTPServerTimeoutConfigDefault,
5256
RPCServerBodyLimit: genericconf.HTTPServerBodyLimitDefault,
57+
FallbackEnabled: true,
5358
LogLevel: "INFO",
5459
LogType: "plaintext",
5560
Metrics: false,
5661
MetricsServer: genericconf.MetricsServerConfigDefault,
5762
PProf: false,
5863
PprofCfg: genericconf.PProfDefault,
59-
DasClientConfig: das.DefaultConfig,
64+
DasClientConfig: daclient.DefaultClientConfig,
6065
}
6166

6267
func main() {
6368
if err := startup(); err != nil {
64-
log.Error("Error running CelestiaDAServer", "err", err)
69+
gethlog.Error("Error running CelestiaDAServer", "err", err)
6570
}
6671
}
6772

@@ -87,9 +92,11 @@ func parseDAServer(args []string) (*CelestiaDAServerConfig, error) {
8792
f.String("log-level", DefaultCelestiaDAServerConfig.LogLevel, "log level, valid values are CRIT, ERROR, WARN, INFO, DEBUG, TRACE")
8893
f.String("log-type", DefaultCelestiaDAServerConfig.LogType, "log type (plaintext or json)")
8994

95+
f.Bool("fallback-enabled", DefaultCelestiaDAServerConfig.FallbackEnabled, "enable fallbacks to arbitrum anytrust")
96+
9097
das.CelestiaDAConfigAddOptions("celestia", f)
9198

92-
das.ClientConfigAddOptions("das", f)
99+
daclient.ClientConfigAddOptions("das", f)
93100

94101
k, err := confighelpers.BeginCommonParse(f, args)
95102
if err != nil {
@@ -123,7 +130,7 @@ func (c *L1ReaderCloser) String() string {
123130
func startMetrics(cfg *CelestiaDAServerConfig) error {
124131
mAddr := fmt.Sprintf("%v:%v", cfg.MetricsServer.Addr, cfg.MetricsServer.Port)
125132
pAddr := fmt.Sprintf("%v:%v", cfg.PprofCfg.Addr, cfg.PprofCfg.Port)
126-
if cfg.Metrics && !metrics.Enabled {
133+
if cfg.Metrics && cfg.PProf && mAddr == pAddr {
127134
return fmt.Errorf("metrics must be enabled via command line by adding --metrics, json config has no effect")
128135
}
129136
if cfg.Metrics && cfg.PProf && mAddr == pAddr {
@@ -160,9 +167,9 @@ func startup() error {
160167
flag.Usage()
161168
return fmt.Errorf("error parsing log type when creating handler: %w", err)
162169
}
163-
glogger := log.NewGlogHandler(handler)
170+
glogger := gethlog.NewGlogHandler(handler)
164171
glogger.Verbosity(logLevel)
165-
log.SetDefault(log.NewLogger(glogger))
172+
gethlog.SetDefault(gethlog.NewLogger(glogger))
166173

167174
if err := startMetrics(serverConfig); err != nil {
168175
return err
@@ -184,8 +191,9 @@ func startup() error {
184191
celestiaReader = celestiaDA
185192
celestiaWriter = celestiaDA
186193

187-
if serverConfig.DasClientConfig.EnableFallback {
188-
client, err := das.NewClient(serverConfig.DasClientConfig)
194+
if serverConfig.FallbackEnabled {
195+
clientConfig := serverConfig.DasClientConfig.RPC
196+
client, err := daclient.NewClient(ctx, func() *rpcclient.ClientConfig { return &clientConfig })
189197
if err != nil {
190198
panic(fmt.Sprintf("Failed to create client: %v", err))
191199
}

daserver/bridgegen/bridgegen.go

Lines changed: 31761 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

daserver/bridgegen/go.mod

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module github.com/offchainlabs/nitro/solgen/go/bridgegen
2+
3+
go 1.23.0
4+
5+
require github.com/ethereum/go-ethereum v1.15.6
6+
7+
require (
8+
github.com/Microsoft/go-winio v0.6.2 // indirect
9+
github.com/StackExchange/wmi v1.2.1 // indirect
10+
github.com/bits-and-blooms/bitset v1.17.0 // indirect
11+
github.com/consensys/bavard v0.1.22 // indirect
12+
github.com/consensys/gnark-crypto v0.14.0 // indirect
13+
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
14+
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
15+
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
16+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
17+
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
18+
github.com/ethereum/go-verkle v0.2.2 // indirect
19+
github.com/fsnotify/fsnotify v1.6.0 // indirect
20+
github.com/go-ole/go-ole v1.3.0 // indirect
21+
github.com/google/uuid v1.3.0 // indirect
22+
github.com/gorilla/websocket v1.4.2 // indirect
23+
github.com/holiman/uint256 v1.3.2 // indirect
24+
github.com/mmcloughlin/addchain v0.4.0 // indirect
25+
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
26+
github.com/supranational/blst v0.3.14 // indirect
27+
github.com/tklauser/go-sysconf v0.3.12 // indirect
28+
github.com/tklauser/numcpus v0.6.1 // indirect
29+
golang.org/x/crypto v0.35.0 // indirect
30+
golang.org/x/sync v0.11.0 // indirect
31+
golang.org/x/sys v0.30.0 // indirect
32+
rsc.io/tmplfunc v0.0.3 // indirect
33+
)

0 commit comments

Comments
 (0)