From a9ca4a22fff6a171a81852b2df6a0525f4cf3846 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 8 Jun 2023 18:11:34 +0200 Subject: [PATCH] Remove blockstream server The blockstream's electrums servers seems very unstable and causes a lot of noise in the logs, even after our optimizations we did in ba416cedb989b0eebc8768ec7fc56de662647803. Closes: https://github.com/keep-network/keep-core/issues/3612 --- config/_electrum_urls/mainnet | 1 - config/_electrum_urls/testnet | 2 +- config/electrum.go | 16 ---------------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/config/_electrum_urls/mainnet b/config/_electrum_urls/mainnet index a517074b70..8fef8d7393 100644 --- a/config/_electrum_urls/mainnet +++ b/config/_electrum_urls/mainnet @@ -1,4 +1,3 @@ wss://electrumx-server.tbtc.network:8443 wss://electrum.boar.network:2083 wss://bitcoin.threshold.p2p.org:50004 -ssl://electrum.blockstream.info:50002 diff --git a/config/_electrum_urls/testnet b/config/_electrum_urls/testnet index 2f284f4d69..10eb8a28ec 100644 --- a/config/_electrum_urls/testnet +++ b/config/_electrum_urls/testnet @@ -1,2 +1,2 @@ wss://electrumx-server.test.tbtc.network:8443 -ssl://electrum.blockstream.info:60002 + diff --git a/config/electrum.go b/config/electrum.go index 522aa24685..b3e9b20847 100644 --- a/config/electrum.go +++ b/config/electrum.go @@ -5,7 +5,6 @@ import ( "fmt" "math/rand" "strings" - "time" "github.com/keep-network/keep-core/pkg/bitcoin" ) @@ -13,12 +12,6 @@ import ( //go:embed _electrum_urls/* var electrumURLs embed.FS -// Keep Alive Interval value used for Blockstream's electrum connections. -// This value is used only if a Blockstream's server is randomly selected from -// the list of embedded Electrum servers. It does not apply if a Blockstream's -// server connection is explicitly set in the client's configuration. -var blockstreamKeepAliveInterval = 55 * time.Second - // readElectrumUrls reads Electrum URLs from an embedded file for the // given Bitcoin network. func readElectrumUrls(network bitcoin.Network) ( @@ -78,14 +71,5 @@ func (c *Config) resolveElectrum(rng *rand.Rand) error { // and we don't want to override them. c.Bitcoin.Electrum.URL = selectedURL - // Blockstream's servers timeout session after 60 seconds of inactivity which - // is much shorter than expected 600 seconds. To workaround connection drops - // and logs pollution with warning we reduce the KeepAliveInterval for the - // Blockstream's servers to less than 60 seconds. - if c.Bitcoin.Electrum.KeepAliveInterval == 0 && - strings.Contains(selectedURL, "electrum.blockstream.info") { - c.Bitcoin.Electrum.KeepAliveInterval = blockstreamKeepAliveInterval - } - return nil }