diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index af0d06b7b7..07428f0ce7 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -262,14 +262,6 @@ template finalizedDepositsMerkleizer(m: Eth1Monitor): auto = proc fixupWeb3Urls*(web3Url: var string) = var normalizedUrl = toLowerAscii(web3Url) - # TODO https://github.com/status-im/nimbus-eth2/issues/3521 - if normalizedUrl.startsWith("https://") or - normalizedUrl.startsWith("http://"): - fatal "Web3 HTTP URLs not supported; use ws:// Web3 URLs", - normalizedUrl, - web3Url - quit 1 - if not (normalizedUrl.startsWith("https://") or normalizedUrl.startsWith("http://") or normalizedUrl.startsWith("wss://") or diff --git a/tests/test_eth1_monitor.nim b/tests/test_eth1_monitor.nim index 7f52c516af..686c4f2c10 100644 --- a/tests/test_eth1_monitor.nim +++ b/tests/test_eth1_monitor.nim @@ -10,6 +10,45 @@ import ./testutil suite "Eth1 monitor": + test "Rewrite HTTPS Infura URLs": + var + mainnetWssUrl = "wss://mainnet.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e" + mainnetHttpUrl = "http://mainnet.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + mainnetHttpsUrl = "https://mainnet.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + goerliWssUrl = "wss://goerli.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e" + goerliHttpUrl = "http://goerli.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + goerliHttpsUrl = "https://goerli.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + gethHttpUrl = "http://localhost:8545" + gethHttpsUrl = "https://localhost:8545" + gethWsUrl = "ws://localhost:8545" + unspecifiedProtocolUrl = "localhost:8545" + + fixupWeb3Urls mainnetWssUrl + fixupWeb3Urls mainnetHttpUrl + fixupWeb3Urls mainnetHttpsUrl + fixupWeb3Urls goerliWssUrl + fixupWeb3Urls goerliHttpUrl + fixupWeb3Urls goerliHttpsUrl + fixupWeb3Urls gethHttpUrl + fixupWeb3Urls gethHttpsUrl + fixupWeb3Urls gethWsUrl + fixupWeb3Urls unspecifiedProtocolUrl + + check: + mainnetWssUrl == "wss://mainnet.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e" + mainnetHttpUrl == "http://mainnet.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + mainnetHttpsUrl == "https://mainnet.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + + goerliWssUrl == "wss://goerli.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e" + goerliHttpUrl == "http://goerli.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + goerliHttpsUrl == "https://goerli.infura.io/v3/6224f3c792cc443fafb64e70a98f871e" + + gethHttpUrl == "http://localhost:8545" + gethHttpsUrl == "https://localhost:8545" + unspecifiedProtocolUrl == "ws://localhost:8545" + + gethWsUrl == "ws://localhost:8545" + test "Roundtrip engine RPC and consensus ExecutionPayload representations": # Each Eth2Digest field is chosen randomly. Each uint64 field is random, # with boosted probabilities for 0, 1, and high(uint64). There can be 0,