From a6d9cd151bb81c8969fa16948771c53df3398d05 Mon Sep 17 00:00:00 2001 From: Enrique Avila Date: Sun, 24 Apr 2022 15:57:28 +0100 Subject: [PATCH 1/6] got rid of the automatic usage of net api --- cmd/rpcdaemon/cli/config.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index 69a80dcd49d..815a81ba512 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -317,7 +317,6 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, if cc.TerminalTotalDifficulty != nil { hasEthApiEnabled := false hasEngineApiEnabled := false - hasNetApiEnabled := false for _, api := range cfg.API { switch api { @@ -325,9 +324,6 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, hasEthApiEnabled = true case "engine": hasEngineApiEnabled = true - case "net": - hasNetApiEnabled = true - } } if !hasEthApiEnabled { @@ -337,11 +333,6 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, if !hasEngineApiEnabled { cfg.API = append(cfg.API, "engine") } - - if !hasNetApiEnabled { - cfg.API = append(cfg.API, "net") - } - } } From 75d00f25bef7a628a14506da417328df9e32988e Mon Sep 17 00:00:00 2001 From: Enrique Avila Date: Sun, 24 Apr 2022 15:59:37 +0100 Subject: [PATCH 2/6] less confusing comment --- cmd/rpcdaemon/cli/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index 815a81ba512..bfa1bc76cc5 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -313,7 +313,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, cfg.Snapshot = ethconfig.NewSnapshotCfg(cfg.Snapshot.Enabled, cfg.Snapshot.KeepBlocks) } - // if chain config has terminal total difficulty then rpc has to have these API's to function + // if chain config has terminal total difficulty then rpc must have eth and engine APIs enableds if cc.TerminalTotalDifficulty != nil { hasEthApiEnabled := false hasEngineApiEnabled := false From 06329375896252ed0b29fa30164bef7affde300b Mon Sep 17 00:00:00 2001 From: Enrique Avila Date: Sun, 24 Apr 2022 16:21:58 +0100 Subject: [PATCH 3/6] ops --- cmd/rpcdaemon/cli/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index bfa1bc76cc5..10a8312a373 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -325,6 +325,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, case "engine": hasEngineApiEnabled = true } + } if !hasEthApiEnabled { cfg.API = append(cfg.API, "eth") From 5023a6372772cd60da22a79b8b14daa3599e3c3e Mon Sep 17 00:00:00 2001 From: Enrique Avila Date: Sun, 24 Apr 2022 16:22:17 +0100 Subject: [PATCH 4/6] ops2 --- cmd/rpcdaemon/cli/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index 10a8312a373..b853b77d0f1 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -324,7 +324,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, hasEthApiEnabled = true case "engine": hasEngineApiEnabled = true - } + } } if !hasEthApiEnabled { From 61543a10b3e55c973105a6509cc355a9e175d6d8 Mon Sep 17 00:00:00 2001 From: Enrique Avila Date: Sun, 24 Apr 2022 18:53:34 +0100 Subject: [PATCH 5/6] important --- cmd/rpcdaemon/cli/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index b853b77d0f1..c277c393b23 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -288,6 +288,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, } log.Info("if you run RPCDaemon on same machine with Erigon add --datadir option") } + if db != nil { var cc *params.ChainConfig if err := db.View(context.Background(), func(tx kv.Tx) error { From dc749bfe39e71488380f1c13ce54773ac3715147 Mon Sep 17 00:00:00 2001 From: Enrique Avila Date: Sun, 24 Apr 2022 19:02:54 +0100 Subject: [PATCH 6/6] ops --- cmd/rpcdaemon/cli/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index c277c393b23..6c505fc00f6 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -288,7 +288,7 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger, } log.Info("if you run RPCDaemon on same machine with Erigon add --datadir option") } - + if db != nil { var cc *params.ChainConfig if err := db.View(context.Background(), func(tx kv.Tx) error {