From 832d09d9b51b13717dfe224d14cc0b0c3565f6ed Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Thu, 23 Feb 2023 09:24:23 +0000 Subject: [PATCH] remove default timeouts --- rosetta/infra/harmony-mainnet.conf | 26 +++++++++++++++++++++----- rosetta/infra/harmony-pstn.conf | 26 +++++++++++++++++++++----- rosetta/services/construction_check.go | 2 +- rpc/rpc.go | 8 ++------ 4 files changed, 45 insertions(+), 17 deletions(-) diff --git a/rosetta/infra/harmony-mainnet.conf b/rosetta/infra/harmony-mainnet.conf index a929eeeab..8d51609cb 100644 --- a/rosetta/infra/harmony-mainnet.conf +++ b/rosetta/infra/harmony-mainnet.conf @@ -1,4 +1,4 @@ -Version = "2.5.11" +Version = "2.5.13" [BLSKeys] KMSConfigFile = "" @@ -41,9 +41,12 @@ Version = "2.5.11" AuthPort = 9501 Enabled = true IP = "0.0.0.0" + IdleTimeout = "120s" Port = 9500 + ReadTimeout = "30s" RosettaEnabled = true RosettaPort = 9700 + WriteTimeout = "30s" [Log] Console = false @@ -62,6 +65,8 @@ Version = "2.5.11" NetworkType = "mainnet" [P2P] + ConnManagerHighWatermark = 192 + ConnManagerLowWatermark = 160 DisablePrivateIPScan = false DiscConcurrency = 0 IP = "0.0.0.0" @@ -69,8 +74,6 @@ Version = "2.5.11" MaxConnsPerIP = 10 MaxPeers = 0 Port = 9000 - ConnManagerLowWatermark = 160 - ConnManagerHighWatermark = 192 WaitForEachPeerToConnect = false [Pprof] @@ -84,6 +87,7 @@ Version = "2.5.11" [RPCOpt] DebugEnabled = false EthRPCsEnabled = true + EvmCallTimeout = "5s" LegacyRPCsEnabled = true RateLimterEnabled = true RequestsPerSecond = 1000 @@ -104,11 +108,23 @@ Version = "2.5.11" DiscHighCap = 128 DiscSoftLowCap = 8 Downloader = false - StagedSync = false Enabled = false InitStreams = 8 - MinPeers = 5 MaxAdvertiseWaitTime = 30 + MinPeers = 5 + StagedSync = false + + [Sync.StagedSyncCfg] + DoubleCheckBlockHashes = false + InsertChainBatchSize = 0 + LogProgress = false + MaxBackgroundBlocks = 0 + MaxBlocksPerSyncCycle = 0 + MaxMemSyncCycleSize = 0 + TurboMode = false + UseMemDB = false + VerifyAllSig = false + VerifyHeaderBatchSize = 0 [TxPool] AccountSlots = 16 diff --git a/rosetta/infra/harmony-pstn.conf b/rosetta/infra/harmony-pstn.conf index edb911f87..1bb865c1a 100644 --- a/rosetta/infra/harmony-pstn.conf +++ b/rosetta/infra/harmony-pstn.conf @@ -1,4 +1,4 @@ -Version = "2.5.11" +Version = "2.5.13" [BLSKeys] KMSConfigFile = "" @@ -41,9 +41,12 @@ Version = "2.5.11" AuthPort = 9501 Enabled = true IP = "0.0.0.0" + IdleTimeout = "120s" Port = 9500 + ReadTimeout = "30s" RosettaEnabled = true RosettaPort = 9700 + WriteTimeout = "30s" [Log] Console = false @@ -62,6 +65,8 @@ Version = "2.5.11" NetworkType = "partner" [P2P] + ConnManagerHighWatermark = 192 + ConnManagerLowWatermark = 160 DisablePrivateIPScan = false DiscConcurrency = 0 IP = "0.0.0.0" @@ -69,8 +74,6 @@ Version = "2.5.11" MaxConnsPerIP = 10 MaxPeers = 0 Port = 9000 - ConnManagerLowWatermark = 160 - ConnManagerHighWatermark = 192 WaitForEachPeerToConnect = false [Pprof] @@ -84,6 +87,7 @@ Version = "2.5.11" [RPCOpt] DebugEnabled = false EthRPCsEnabled = true + EvmCallTimeout = "5s" LegacyRPCsEnabled = true RateLimterEnabled = true RequestsPerSecond = 1000 @@ -104,11 +108,23 @@ Version = "2.5.11" DiscHighCap = 128 DiscSoftLowCap = 8 Downloader = false - StagedSync = false Enabled = false InitStreams = 8 - MinPeers = 2 MaxAdvertiseWaitTime = 30 + MinPeers = 2 + StagedSync = false + + [Sync.StagedSyncCfg] + DoubleCheckBlockHashes = false + InsertChainBatchSize = 0 + LogProgress = false + MaxBackgroundBlocks = 0 + MaxBlocksPerSyncCycle = 0 + MaxMemSyncCycleSize = 0 + TurboMode = false + UseMemDB = false + VerifyAllSig = false + VerifyHeaderBatchSize = 0 [TxPool] AccountSlots = 16 diff --git a/rosetta/services/construction_check.go b/rosetta/services/construction_check.go index 1c3e1db69..f60296971 100644 --- a/rosetta/services/construction_check.go +++ b/rosetta/services/construction_check.go @@ -270,7 +270,7 @@ func (s *ConstructAPI) ConstructionMetadata( callArgs.To = &contractAddress } evmExe, err := rpc.DoEVMCall( - ctx, s.hmy, callArgs, latest, rpc.CallTimeout, + ctx, s.hmy, callArgs, latest, s.hmy.NodeAPI.GetConfig().NodeConfig.RPCServer.EvmCallTimeout, ) if err != nil { return nil, common.NewError(common.CatchAllError, map[string]interface{}{ diff --git a/rpc/rpc.go b/rpc/rpc.go index 1bae7367d..a8f1e121a 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -4,7 +4,6 @@ import ( "fmt" "net" "strings" - "time" "github.com/harmony-one/harmony/eth/rpc" "github.com/harmony-one/harmony/hmy" @@ -28,8 +27,6 @@ const ( const ( // APIVersion used for DApp's, bumped after RPC refactor (7/2020) APIVersion = "1.1" - // CallTimeout is the timeout given to all contract calls - CallTimeout = 5 * time.Second // LogTag is the tag found in the log for all RPC logs LogTag = "[RPC]" // HTTPPortOffset .. @@ -58,9 +55,8 @@ var ( wsEndpoint = "" wsAuthEndpoint = "" httpVirtualHosts = []string{"*"} - // httpTimeouts = rpc.DefaultHTTPTimeouts - httpOrigins = []string{"*"} - wsOrigins = []string{"*"} + httpOrigins = []string{"*"} + wsOrigins = []string{"*"} ) // Version of the RPC