From e69e47725fd87db68c5073ee0604732ed40bbc7b Mon Sep 17 00:00:00 2001 From: Tristan Wilson Date: Mon, 16 Oct 2023 17:40:19 +0200 Subject: [PATCH 1/2] Add --log-type option for daserver This adds the ability to have json logs. --- cmd/daserver/daserver.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cmd/daserver/daserver.go b/cmd/daserver/daserver.go index 335aba6a1b..b2f8728a7d 100644 --- a/cmd/daserver/daserver.go +++ b/cmd/daserver/daserver.go @@ -44,6 +44,7 @@ type DAServerConfig struct { Conf genericconf.ConfConfig `koanf:"conf"` LogLevel int `koanf:"log-level"` + LogType string `koanf:"log-type"` Metrics bool `koanf:"metrics"` MetricsServer genericconf.MetricsServerConfig `koanf:"metrics-server"` @@ -62,11 +63,12 @@ var DefaultDAServerConfig = DAServerConfig{ RESTServerTimeouts: genericconf.HTTPServerTimeoutConfigDefault, DataAvailability: das.DefaultDataAvailabilityConfig, Conf: genericconf.ConfConfigDefault, + LogLevel: int(log.LvlInfo), + LogType: "plaintext", Metrics: false, MetricsServer: genericconf.MetricsServerConfigDefault, PProf: false, PprofCfg: genericconf.PProfDefault, - LogLevel: 3, } func main() { @@ -99,6 +101,8 @@ func parseDAServer(args []string) (*DAServerConfig, error) { genericconf.PProfAddOptions("pprof-cfg", f) f.Int("log-level", int(log.LvlInfo), "log level; 1: ERROR, 2: WARN, 3: INFO, 4: DEBUG, 5: TRACE") + f.String("log-type", DefaultDAServerConfig.LogType, "log type (plaintext or json)") + das.DataAvailabilityConfigAddDaserverOptions("data-availability", f) genericconf.ConfConfigAddOptions("conf", f) @@ -178,7 +182,12 @@ func startup() error { confighelpers.PrintErrorAndExit(errors.New("please specify at least one of --enable-rest or --enable-rpc"), printSampleUsage) } - glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false))) + logFormat, err := genericconf.ParseLogType(serverConfig.LogType) + if err != nil { + flag.Usage() + panic(fmt.Sprintf("Error parsing log type: %v", err)) + } + glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, logFormat)) glogger.Verbosity(log.Lvl(serverConfig.LogLevel)) log.Root().SetHandler(glogger) From c77006ac01ccacabb62a6da9ccf1e2681b93555d Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Mon, 16 Oct 2023 22:55:14 -0600 Subject: [PATCH 2/2] Change default sequencer MaxBlockSpeed to 250ms --- execution/gethexec/sequencer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/execution/gethexec/sequencer.go b/execution/gethexec/sequencer.go index 77442f65e4..61792ed9b5 100644 --- a/execution/gethexec/sequencer.go +++ b/execution/gethexec/sequencer.go @@ -85,7 +85,7 @@ type SequencerConfigFetcher func() *SequencerConfig var DefaultSequencerConfig = SequencerConfig{ Enable: false, - MaxBlockSpeed: time.Millisecond * 100, + MaxBlockSpeed: time.Millisecond * 250, MaxRevertGasReject: params.TxGas + 10000, MaxAcceptableTimestampDelta: time.Hour, Forwarder: DefaultSequencerForwarderConfig,