From 5c59b745852912575c0da094720ee270349c40d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 13 Apr 2024 19:58:40 +0200 Subject: [PATCH 1/2] fix: curio: Start BoostAdapters before blocking rpc serve --- cmd/curio/run.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/curio/run.go b/cmd/curio/run.go index 0f2785f2a3c..d360b6af45e 100644 --- a/cmd/curio/run.go +++ b/cmd/curio/run.go @@ -131,15 +131,15 @@ var runCmd = &cli.Command{ } defer taskEngine.GracefullyTerminate() + if err := lmrpc.ServeCurioMarketRPCFromConfig(dependencies.DB, dependencies.Full, dependencies.Cfg); err != nil { + return xerrors.Errorf("starting market RPCs: %w", err) + } + err = rpc.ListenAndServe(ctx, dependencies, shutdownChan) // Monitor for shutdown. if err != nil { return err } - if err := lmrpc.ServeCurioMarketRPCFromConfig(dependencies.DB, dependencies.Full, dependencies.Cfg); err != nil { - return xerrors.Errorf("starting market RPCs: %w", err) - } - finishCh := node.MonitorShutdown(shutdownChan) //node.ShutdownHandler{Component: "rpc server", StopFunc: rpcStopper}, //node.ShutdownHandler{Component: "curio", StopFunc: stop}, From 4f042ebad017fc00dccde5a2e400c74d065a033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sun, 14 Apr 2024 11:50:22 +0200 Subject: [PATCH 2/2] curio/lmrpc: Override unspecified rpc address to localhost --- curiosrc/market/lmrpc/lmrpc.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/curiosrc/market/lmrpc/lmrpc.go b/curiosrc/market/lmrpc/lmrpc.go index 0f58be45c79..dd78802894a 100644 --- a/curiosrc/market/lmrpc/lmrpc.go +++ b/curiosrc/market/lmrpc/lmrpc.go @@ -68,9 +68,8 @@ func MakeTokens(cfg *config.CurioConfig) (map[address.Address]string, error) { return xerrors.Errorf("net resolve: %w", err) } - if len(laddr.IP) == 0 { - // set localhost - laddr.IP = net.IPv4(127, 0, 0, 1) + if len(laddr.IP) == 0 || laddr.IP.IsUnspecified() { + return xerrors.Errorf("market rpc server listen address must be a specific address, not %s (probably missing bind IP)", listen) } // need minimal provider with just the config @@ -171,9 +170,8 @@ func ServeCurioMarketRPC(db *harmonydb.DB, full api.FullNode, maddr address.Addr return xerrors.Errorf("net resolve: %w", err) } - if len(laddr.IP) == 0 { - // set localhost - laddr.IP = net.IPv4(127, 0, 0, 1) + if len(laddr.IP) == 0 || laddr.IP.IsUnspecified() { + return xerrors.Errorf("market rpc server listen address must be a specific address, not %s (probably missing bind IP)", listen) } rootUrl := url.URL{ Scheme: "http",