From e2fec2a0814a3fc3b97ef88611502a20c98c8cd0 Mon Sep 17 00:00:00 2001
From: Enrique Jose  Avila Asapche <eavilaasapche@gmail.com>
Date: Mon, 25 Apr 2022 15:57:54 +0300
Subject: [PATCH] got rid of the automatic usage of net api (#3952)

* got rid of the automatic usage of net api

* less confusing comment

* ops

* ops2

* important

* ops
---
 cmd/rpcdaemon/cli/config.go | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go
index 69a80dcd49..6c505fc00f 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 {
@@ -313,11 +314,10 @@ 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
-			hasNetApiEnabled := false
 
 			for _, api := range cfg.API {
 				switch api {
@@ -325,8 +325,6 @@ func RemoteServices(ctx context.Context, cfg httpcfg.HttpCfg, logger log.Logger,
 					hasEthApiEnabled = true
 				case "engine":
 					hasEngineApiEnabled = true
-				case "net":
-					hasNetApiEnabled = true
 				}
 			}
 
@@ -337,11 +335,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")
-			}
-
 		}
 	}
 
-- 
GitLab