diff --git a/cmd/daserver/entrypoint.go b/cmd/daserver/entrypoint.go index d06fd5b7..bfd468b0 100644 --- a/cmd/daserver/entrypoint.go +++ b/cmd/daserver/entrypoint.go @@ -3,7 +3,6 @@ package main import ( "context" "fmt" - "net/http" "github.com/Layr-Labs/op-plasma-eigenda/metrics" "github.com/urfave/cli/v2" @@ -16,22 +15,14 @@ import ( "github.com/ethereum-optimism/optimism/op-service/opio" ) -type App struct { - DAServer *http.Server - MetricsSvr *http.Server -} - func StartDAServer(cliCtx *cli.Context) error { - println("CHECKING") if err := CheckRequired(cliCtx); err != nil { return err } - println("Reading CLI CFG") cfg := ReadCLIConfig(cliCtx) if err := cfg.Check(); err != nil { return err } - println("HERERERER") m := metrics.NewMetrics("default") log := oplog.NewLogger(oplog.AppOut(cliCtx), oplog.ReadCLIConfig(cliCtx)).New("role", "eigenda_plasma_server") @@ -88,16 +79,16 @@ func StartDAServer(cliCtx *cli.Context) error { if cfg.MetricsCfg.Enabled { log.Debug("starting metrics server", "addr", cfg.MetricsCfg.ListenAddr, "port", cfg.MetricsCfg.ListenPort) - metricsSrv, err := m.StartServer(cfg.MetricsCfg.ListenAddr, cfg.MetricsCfg.ListenPort) + svr, err := m.StartServer(cfg.MetricsCfg.ListenAddr, cfg.MetricsCfg.ListenPort) if err != nil { return fmt.Errorf("failed to start metrics server: %w", err) } defer func() { - if err := metricsSrv.Stop(context.Background()); err != nil { + if err := svr.Stop(context.Background()); err != nil { log.Error("failed to stop metrics server", "err", err) } }() - log.Info("started metrics server", "addr", metricsSrv.Addr()) + log.Info("started metrics server", "addr", svr.Addr()) m.RecordUp() } diff --git a/daserver.go b/daserver.go index 275f0a3a..aff599e9 100644 --- a/daserver.go +++ b/daserver.go @@ -30,13 +30,13 @@ type DAServer struct { log log.Logger endpoint string store PlasmaStore - m *metrics.Metrics + m metrics.Metricer tls *rpc.ServerTLSConfig httpServer *http.Server listener net.Listener } -func NewDAServer(host string, port int, store PlasmaStore, log log.Logger, m *metrics.Metrics) *DAServer { +func NewDAServer(host string, port int, store PlasmaStore, log log.Logger, m metrics.Metricer) *DAServer { endpoint := net.JoinHostPort(host, strconv.Itoa(port)) return &DAServer{ m: m, diff --git a/test/e2e_test.go b/test/e2e_test.go index 84a7858f..dfb106f1 100644 --- a/test/e2e_test.go +++ b/test/e2e_test.go @@ -11,6 +11,7 @@ import ( "github.com/Layr-Labs/eigenda/encoding/kzg" plasma "github.com/Layr-Labs/op-plasma-eigenda" "github.com/Layr-Labs/op-plasma-eigenda/eigenda" + "github.com/Layr-Labs/op-plasma-eigenda/metrics" "github.com/Layr-Labs/op-plasma-eigenda/store" "github.com/Layr-Labs/op-plasma-eigenda/verify" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait" @@ -73,7 +74,7 @@ func createTestSuite(t *testing.T) (TestSuite, func()) { panic(err) } - server := plasma.NewDAServer(testSvrHost, testSvrPort, daStore, log) + server := plasma.NewDAServer(testSvrHost, testSvrPort, daStore, log, metrics.NoopMetrics) go func() { t.Log("Starting test plasma server on separate routine...") diff --git a/verify/verifier.go b/verify/verifier.go index 2133bcd0..2f53e714 100644 --- a/verify/verifier.go +++ b/verify/verifier.go @@ -39,11 +39,14 @@ func (v *Verifier) Verify(cert eigenda.Cert, blob []byte) error { if err != nil { return err } + + // blob to field elements inputFr, err := rs.ToFrArray(blob) if err != nil { return err } + // encode using FFT to evaluations polyEvals, _, err := encoder.ExtendPolyEval(inputFr) if err != nil { return err