erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.09k stars 1.08k forks source link

Can not connect to websocket with web3py (--ws is on) #10068

Open fridary opened 4 months ago

fridary commented 4 months ago

Erigon version: erigon version 2.59.3-088fd8ef OS & Version: Ubuntu 20.04.6 LTS Erigon Command (with flags/config): ExecStart=/home/root/erigon/build/bin/erigon --internalcl --datadir=/disk_sde/erigon --ws --http.api=eth,erigon,engine,web3,net,debug,trace,txpool --authrpc.jwtsecret=/home/root/erigon/jwtsecret --metrics --prune.h.before=13916166 --prune.r.before=13916166 --prune.t.before=13916166 --prune.c.before=13916166 --torrent.download.rate=128mb Chain/Network: mainnet

I can not connect to web socket host, although http works. I don't know if it matters, node was synced without --ws flag. Now I have added, rebooted server and anyway can not connect to ws. With journal I can see ws started on 8546 port, but I can not connect still. What I do wrong?

Actual behaviour

Script exits with error no connection.

Steps to reproduce the behaviour

from web3 import Web3
wss = 'wss://127.0.0.1:8545/' # 8546 also does not work
web3 = Web3(Web3.WebsocketProvider(wss))
if not web3.is_connected():
    exit("w3 not connected")

Backtrace

-- Reboot --
apr 25 19:43:47 root-pc systemd[1]: Started Erigon Node.
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.659] logging to file system                   log dir=/disk_sde/erigon/logs file prefix=erigon log level=info json=false
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.662] Enabling metrics export to prometheus    path=http://127.0.0.1:6060/debug/metrics/prometheus
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.664] Build info                               git_branch=HEAD git_tag=v2.59.3 git_commit=088fd8ef69389a72da6faa0fc7903a4ba5726911
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.665] Starting Erigon on Ethereum mainnet...
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.669] Maximum peer count                       ETH=100 total=100
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.670] starting HTTP APIs                       port=8545 APIs=eth,erigon,engine,web3,net,debug,trace,txpool
apr 25 19:43:49 root-pc erigon[4066]: [INFO] [04-25|19:43:49.670] torrent verbosity                        level=WRN
apr 25 19:43:51 root-pc erigon[4066]: [INFO] [04-25|19:43:51.780] Set global gas cap                       cap=50000000
apr 25 19:43:51 root-pc erigon[4066]: [INFO] [04-25|19:43:51.882] [Downloader] Running with                ipv6-enabled=true ipv4-enabled=true download.rate=128mb upload.rate=4mb
apr 25 19:43:51 root-pc erigon[4066]: [INFO] [04-25|19:43:51.900] Opening Database                         label=chaindata path=/disk_sde/erigon/chaindata
apr 25 19:43:51 root-pc erigon[4066]: [INFO] [04-25|19:43:51.905] [db] open                                lable=chaindata sizeLimit=12TB pageSize=8192
apr 25 19:43:51 root-pc erigon[4066]: [INFO] [04-25|19:43:51.912] Initialised chain configuration          config="{ChainID: 1, Homestead: 1150000, DAO: 1920000, Tangerine Whistle: 2463000, Spurious Dragon: 2675000, Byzantium: 4370000, Constantinople: 7280000, Petersburg: 7280000, Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Gray Glacier: 15050000, Terminal Total Difficulty: 58750000000000000000000, Merge Netsplit: <nil>, Shanghai: 1681338455, Cancun: 1710338135, Prague: <nil>, Osaka: <nil>, Engine: ethash, NoPruneContracts: map[0x00000000219ab540356cBB839Cbe05303d7705Fa:true]}" genesis=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
apr 25 19:44:41 root-pc erigon[4066]: [INFO] [04-25|19:44:41.443] Initialising Ethereum protocol           network=1
apr 25 19:44:41 root-pc erigon[4066]: [INFO] [04-25|19:44:41.443] Disk storage enabled for ethash DAGs     dir=/disk_sde/erigon/ethash-dags count=2
apr 25 19:44:42 root-pc erigon[4066]: [INFO] [04-25|19:44:42.938] Starting private RPC server              on=127.0.0.1:9090
apr 25 19:44:42 root-pc erigon[4066]: [INFO] [04-25|19:44:42.938] new subscription to logs established
apr 25 19:44:42 root-pc erigon[4066]: [INFO] [04-25|19:44:42.938] [Checkpoint Sync] Requesting beacon state uri=https://mainnet-checkpoint-sync.stakely.io/eth/v2/debug/beacon/states/finalized
apr 25 19:44:42 root-pc erigon[4066]: [INFO] [04-25|19:44:42.955] [txpool] Started
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.805] rpc filters: subscribing to Erigon events
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.805] new subscription to newHeaders established
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.805] New txs subscriber joined
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.806] Reading JWT secret                       path=/home/root/erigon/jwtsecret
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.806] JsonRpc endpoint opened                  ws=true ws.compression=true grpc=false websocket.url=127.0.0.1:8546 http.url=127.0.0.1:8545
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.808] HTTP endpoint opened for Engine API      url=127.0.0.1:8551 ws=true ws.compression=true
apr 25 19:44:48 root-pc erigon[4066]: [WARN] [04-25|19:44:48.832] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.834] Started P2P networking                   version=67 self=enode://2734723951d34a6e40dd4c94c93fa97e8c5fe58fca385c9df3cce54323a8d0c3fcffa1dcef40da5f877255c03153605c3b97de8b00ed761fbf81e452155f9fbb@127.0.0.1:30304 name=erigon/v2.59.3-088fd8ef/linux-amd64/go1.22.1
apr 25 19:44:48 root-pc erigon[4066]: [WARN] [04-25|19:44:48.834] NAT ExternalIP resolution has failed, try to pass a different --nat option err="no UPnP or NAT-PMP router discovered"
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.836] Started P2P networking                   version=68 self=enode://2734723951d34a6e40dd4c94c93fa97e8c5fe58fca385c9df3cce54323a8d0c3fcffa1dcef40da5f877255c03153605c3b97de8b00ed761fbf81e452155f9fbb@127.0.0.1:30303 name=erigon/v2.59.3-088fd8ef/linux-amd64/go1.22.1
apr 25 19:44:48 root-pc erigon[4066]: [INFO] [04-25|19:44:48.850] [1/12 Snapshots] Requesting downloads
apr 25 19:44:52 root-pc erigon[4066]: [INFO] [04-25|19:44:52.870] [snapshots:download] Blocks Stat         blocks=19643k indices=19643k alloc=3.4GB sys=5.6GB
apr 25 19:45:22 root-pc erigon[4066]: [INFO] [04-25|19:45:22.139] Static peers                             len=0
apr 25 19:45:22 root-pc erigon[4066]: [INFO] [04-25|19:45:22.141] [Sentinel] Sentinel started              app=caplin enr=enr:-Ly4QBgxvX7Nh13ytbM2t9eCXH_AcqXme_KJuUtI4n346AWRFwevt9Iu_sykvAsX6lx-pdMNQIfsQ1ypY4lOH9lNfrsBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpBqlaGpBAAAAP__________gmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQOU62IZmhm739SPOwd6WMHszknx--Yv9SZu8Hs_269WkYhzeW5jbmV0cwCDdGNwgg-hg3VkcIIPoA
apr 25 19:45:22 root-pc erigon[4066]: [INFO] [04-25|19:45:22.141] Started Ethereum 2.0 Gossip Service      app=caplin
apr 25 19:45:27 root-pc erigon[4066]: [INFO] [04-25|19:45:27.546] [Caplin] starting clstages loop          app=caplin
apr 25 19:45:27 root-pc erigon[4066]: [INFO] [04-25|19:45:27.546] Starting downloading History             app=caplin stage=DownloadHistoricalBlocks from=8936544
apr 25 19:45:29 root-pc erigon[4066]: [INFO] [04-25|19:45:29.427] Backfilling finished
apr 25 19:45:32 root-pc erigon[4066]: [INFO] [04-25|19:45:32.550] Ready to insert history, waiting for sync cycle to finish app=caplin stage=DownloadHistoricalBlocks
apr 25 19:45:32 root-pc erigon[4066]: [INFO] [04-25|19:45:32.551] [Caplin] Forward Sync                    app=caplin stage=ForwardSync from=8936544 to=8936625
apr 25 19:46:06 root-pc erigon[4066]: [INFO] [04-25|19:46:06.336] [Caplin] Forward Sync                    app=caplin stage=ForwardSync progress=8936583 distance-from-chain-tip=8m24s estimated-time-remaining=32s
apr 25 19:46:22 root-pc erigon[4066]: [INFO] [04-25|19:46:22.141] P2P                                      app=caplin peers=28
apr 25 19:46:32 root-pc erigon[4066]: [INFO] [04-25|19:46:32.712] [Caplin] Forward Sync                    app=caplin stage=ForwardSync progress=8936609 distance-from-chain-tip=3m12s estimated-time-remaining=18s
apr 25 19:47:22 root-pc erigon[4066]: [INFO] [04-25|19:47:22.116] [3/12 Senders] Started                   from=19733631 to=19733667
apr 25 19:47:22 root-pc erigon[4066]: [INFO] [04-25|19:47:22.141] P2P                                      app=caplin peers=43
apr 25 19:47:22 root-pc erigon[4066]: [INFO] [04-25|19:47:22.169] [4/12 Execution] Blocks execution        from=19733631 to=19733667
apr 25 19:47:28 root-pc erigon[4066]: [INFO] [04-25|19:47:28.485] [4/12 Execution] Completed on            block=19733667
apr 25 19:47:28 root-pc erigon[4066]: [INFO] [04-25|19:47:28.485] [5/12 HashState] Promoting plain state   from=19733631 to=19733667
apr 25 19:47:28 root-pc erigon[4066]: [INFO] [04-25|19:47:28.485] [5/12 HashState] Incremental promotion   from=19733631 to=19733667 codes=true csbucket=AccountChangeSet
apr 25 19:47:29 root-pc erigon[4066]: [INFO] [04-25|19:47:29.111] [5/12 HashState] Incremental promotion   from=19733631 to=19733667 codes=false csbucket=AccountChangeSet
apr 25 19:47:31 root-pc erigon[4066]: [INFO] [04-25|19:47:31.282] [5/12 HashState] Incremental promotion   from=19733631 to=19733667 codes=false csbucket=StorageChangeSet
apr 25 19:47:33 root-pc erigon[4066]: [INFO] [04-25|19:47:33.844] [6/12 IntermediateHashes] Generating intermediate hashes from=19733631 to=19733667
apr 25 19:47:41 root-pc erigon[4066]: [INFO] [04-25|19:47:41.437] [p2p] GoodPeers                          eth68=2 eth67=1
apr 25 19:47:41 root-pc erigon[4066]: [INFO] [04-25|19:47:41.999] [mem] memory stats                       Rss=15.4MB Size=0B Pss=15.4MB SharedClean=3.0KB SharedDirty=0B PrivateClean=4.4MB PrivateDirty=11.1MB Referenced=15.4MB Anonymous=11.1MB Swap=0B alloc=6.5GB sys=12.0GB
apr 25 19:47:42 root-pc erigon[4066]: [INFO] [04-25|19:47:42.939] [txpool] stat                            pending=0 baseFee=0 queued=2179 alloc=6.6GB sys=12.0GB
apr 25 19:47:45 root-pc erigon[4066]: [INFO] [04-25|19:47:45.902] [7/12 CallTraces] Pruned call trace intermediate table from=19643631 to=19643666
apr 25 19:47:54 root-pc erigon[4066]: [INFO] [04-25|19:47:54.426] RPC Daemon notified of new headers       from=19733631 to=19733667 amount=36 hash=0xfd0f5e61ac37c101d70943e23c942f1f235101c4a6669b2d043e00d648c2e6d3 header sending=65.636µs log sending=406ns
apr 25 19:47:54 root-pc erigon[4066]: [INFO] [04-25|19:47:54.426] head updated                             hash=0xfd0f5e61ac37c101d70943e23c942f1f235101c4a6669b2d043e00d648c2e6d3 number=19733667
apr 25 19:48:22 root-pc erigon[4066]: [INFO] [04-25|19:48:22.142] P2P                                      app=caplin peers=48
apr 25 19:48:46 root-pc erigon[4066]: [INFO] [04-25|19:48:46.868] [4/12 Execution] Completed on            block=19733674
apr 25 19:48:48 root-pc erigon[4066]: [WARN] [04-25|19:48:48.666] [rpc] served                             conn=127.0.0.1:40296 method=eth_call reqid=9 t=604.913µs err="execution reverted"
apr 25 19:48:49 root-pc erigon[4066]: [INFO] [04-25|19:48:49.461] RPC Daemon notified of new headers       from=19733667 to=19733674 amount=7 hash=0x48ef31e37ae7c9dffadfc0023741c97995902ba97f82512ef0118d9c0f75ec0f header sending=31.941µs log sending=598ns
apr 25 19:48:49 root-pc erigon[4066]: [INFO] [04-25|19:48:49.461] head updated                             hash=0x48ef31e37ae7c9dffadfc0023741c97995902ba97f82512ef0118d9c0f75ec0f number=19733674
apr 25 19:48:56 root-pc erigon[4066]: [INFO] [04-25|19:48:56.618] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:48:56 root-pc erigon[4066]: [INFO] [04-25|19:48:56.967] RPC Daemon notified of new headers       from=19733674 to=19733675 amount=1 hash=0xbe5af363943d964b6b0321769f04eede6deb4fd65b7ee9970f5d553ae8422851 header sending=24.78µs log sending=473ns
apr 25 19:48:56 root-pc erigon[4066]: [INFO] [04-25|19:48:56.967] head updated                             hash=0xbe5af363943d964b6b0321769f04eede6deb4fd65b7ee9970f5d553ae8422851 number=19733675
apr 25 19:49:10 root-pc erigon[4066]: [INFO] [04-25|19:49:10.949] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:49:11 root-pc erigon[4066]: [INFO] [04-25|19:49:11.203] RPC Daemon notified of new headers       from=19733675 to=19733676 amount=1 hash=0xdd47ac9e4cacded49b69b38822a6c0bb684fd387f1d45ca5f8cc1f981eae2060 header sending=29.547µs log sending=469ns
apr 25 19:49:11 root-pc erigon[4066]: [INFO] [04-25|19:49:11.203] head updated                             hash=0xdd47ac9e4cacded49b69b38822a6c0bb684fd387f1d45ca5f8cc1f981eae2060 number=19733676
apr 25 19:49:19 root-pc erigon[4066]: [INFO] [04-25|19:49:19.111] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:49:19 root-pc erigon[4066]: [INFO] [04-25|19:49:19.506] RPC Daemon notified of new headers       from=19733676 to=19733677 amount=1 hash=0x07e101c9340eeca872e7bdfadeabd3fd9e0dcf00a8222aea6f5303e9df823e39 header sending=21.609µs log sending=591ns
apr 25 19:49:19 root-pc erigon[4066]: [INFO] [04-25|19:49:19.506] head updated                             hash=0x07e101c9340eeca872e7bdfadeabd3fd9e0dcf00a8222aea6f5303e9df823e39 number=19733677
apr 25 19:49:22 root-pc erigon[4066]: [INFO] [04-25|19:49:22.141] P2P                                      app=caplin peers=51
apr 25 19:49:32 root-pc erigon[4066]: [INFO] [04-25|19:49:32.186] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:49:32 root-pc erigon[4066]: [INFO] [04-25|19:49:32.599] RPC Daemon notified of new headers       from=19733677 to=19733678 amount=1 hash=0xa38b037c0737db5ce86a00d3d62247dc9858f5ac5e66cd51578215078b7f31e3 header sending=33.865µs log sending=360ns
apr 25 19:49:32 root-pc erigon[4066]: [INFO] [04-25|19:49:32.600] head updated                             hash=0xa38b037c0737db5ce86a00d3d62247dc9858f5ac5e66cd51578215078b7f31e3 number=19733678
apr 25 19:49:36 root-pc erigon[4066]: [WARN] [04-25|19:49:36.986] [rpc] served                             conn=127.0.0.1:51290 method=eth_call reqid=7 t=1.189038ms err="execution reverted"
apr 25 19:49:36 root-pc erigon[4066]: [WARN] [04-25|19:49:36.994] [rpc] served                             conn=127.0.0.1:51290 method=eth_call reqid=9 t=255.321µs err="execution reverted"
apr 25 19:49:37 root-pc erigon[4066]: [WARN] [04-25|19:49:37.001] [rpc] served                             conn=127.0.0.1:51290 method=eth_call reqid=11 t=218.947µs err="execution reverted"
apr 25 19:49:43 root-pc erigon[4066]: [INFO] [04-25|19:49:43.175] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:49:43 root-pc erigon[4066]: [INFO] [04-25|19:49:43.470] RPC Daemon notified of new headers       from=19733678 to=19733679 amount=1 hash=0x345223b4f868563ef5e800086700847ff13e73d0767750bcceab42feaa519879 header sending=18.134µs log sending=451ns
apr 25 19:49:43 root-pc erigon[4066]: [INFO] [04-25|19:49:43.470] head updated                             hash=0x345223b4f868563ef5e800086700847ff13e73d0767750bcceab42feaa519879 number=19733679
apr 25 19:49:58 root-pc erigon[4066]: [INFO] [04-25|19:49:58.782] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:49:59 root-pc erigon[4066]: [WARN] [04-25|19:49:59.457] [rpc] served                             conn=127.0.0.1:33602 method=eth_call reqid=1 t=1.87125ms err="execution reverted"
apr 25 19:49:59 root-pc erigon[4066]: [WARN] [04-25|19:49:59.465] [rpc] served                             conn=127.0.0.1:33602 method=eth_call reqid=3 t=201.585µs err="execution reverted"
apr 25 19:49:59 root-pc erigon[4066]: [WARN] [04-25|19:49:59.473] [rpc] served                             conn=127.0.0.1:33602 method=eth_call reqid=5 t=254.225µs err="execution reverted"
apr 25 19:49:59 root-pc erigon[4066]: [INFO] [04-25|19:49:59.592] RPC Daemon notified of new headers       from=19733679 to=19733680 amount=1 hash=0xf9dfad74dec36b2be07cd790ebb859b7d06b73f02cd7257a112796e3138b4947 header sending=21.297µs log sending=439ns
apr 25 19:49:59 root-pc erigon[4066]: [INFO] [04-25|19:49:59.592] head updated                             hash=0xf9dfad74dec36b2be07cd790ebb859b7d06b73f02cd7257a112796e3138b4947 number=19733680
apr 25 19:50:00 root-pc erigon[4066]: [WARN] [04-25|19:50:00.146] [rpc] served                             conn=127.0.0.1:34200 method=eth_call reqid=1 t=1.692181ms err="execution reverted"
apr 25 19:50:00 root-pc erigon[4066]: [WARN] [04-25|19:50:00.150] [rpc] served                             conn=127.0.0.1:34200 method=eth_call reqid=3 t=154.988µs err="execution reverted"
apr 25 19:50:00 root-pc erigon[4066]: [WARN] [04-25|19:50:00.155] [rpc] served                             conn=127.0.0.1:34200 method=eth_call reqid=5 t=203.716µs err="execution reverted"
apr 25 19:50:07 root-pc erigon[4066]: [WARN] [04-25|19:50:07.171] [rpc] served                             conn=127.0.0.1:52380 method=eth_call reqid=9 t=296.94µs err="execution reverted"
apr 25 19:50:08 root-pc erigon[4066]: [WARN] [04-25|19:50:08.557] [rpc] served                             conn=127.0.0.1:53830 method=eth_call reqid=19 t=556.745µs err="execution reverted"
apr 25 19:50:08 root-pc erigon[4066]: [WARN] [04-25|19:50:08.563] [rpc] served                             conn=127.0.0.1:53830 method=eth_call reqid=21 t=344.342µs err="execution reverted"
apr 25 19:50:08 root-pc erigon[4066]: [WARN] [04-25|19:50:08.569] [rpc] served                             conn=127.0.0.1:53830 method=eth_call reqid=23 t=347.994µs err="execution reverted"
apr 25 19:50:22 root-pc erigon[4066]: [INFO] [04-25|19:50:22.141] P2P                                      app=caplin peers=57
apr 25 19:50:31 root-pc erigon[4066]: [INFO] [04-25|19:50:31.655] [4/12 Execution] Completed on            block=19733683
apr 25 19:50:32 root-pc erigon[4066]: [INFO] [04-25|19:50:32.674] RPC Daemon notified of new headers       from=19733680 to=19733683 amount=3 hash=0xbae163314f49dd65a8c86d9e4f5baad602f2b7395a3f16b98dc6bb5df1b4c244 header sending=22.957µs log sending=340ns
apr 25 19:50:32 root-pc erigon[4066]: [INFO] [04-25|19:50:32.674] head updated                             hash=0xbae163314f49dd65a8c86d9e4f5baad602f2b7395a3f16b98dc6bb5df1b4c244 number=19733683
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.216] [rpc] served                             conn=127.0.0.1:36796 method=eth_call reqid=1 t=1.725374ms err="execution reverted"
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.222] [rpc] served                             conn=127.0.0.1:36796 method=eth_call reqid=3 t=259.414µs err="execution reverted"
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.227] [rpc] served                             conn=127.0.0.1:36796 method=eth_call reqid=5 t=294.33µs err="execution reverted"
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.348] [rpc] served                             conn=127.0.0.1:37074 method=eth_call reqid=9 t=224.958µs err="execution reverted"
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.387] [rpc] served                             conn=127.0.0.1:37256 method=eth_call reqid=9 t=279.752µs err="execution reverted"
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.507] [rpc] served                             conn=127.0.0.1:37654 method=eth_call reqid=5 t=410.807µs err="execution reverted"
apr 25 19:50:38 root-pc erigon[4066]: [WARN] [04-25|19:50:38.565] [rpc] served                             conn=127.0.0.1:37772 method=eth_call reqid=9 t=234.708µs err="execution reverted"
apr 25 19:50:39 root-pc erigon[4066]: [WARN] [04-25|19:50:39.580] [rpc] served                             conn=127.0.0.1:41134 method=eth_call reqid=9 t=354.325µs err="execution reverted"
apr 25 19:50:39 root-pc erigon[4066]: [WARN] [04-25|19:50:39.810] [rpc] served                             conn=127.0.0.1:39504 method=eth_call reqid=15 t=216.625µs err="execution reverted"
apr 25 19:50:41 root-pc erigon[4066]: [WARN] [04-25|19:50:41.009] [rpc] served                             conn=127.0.0.1:45346 method=eth_call reqid=9 t=191.811µs err="execution reverted"
apr 25 19:50:41 root-pc erigon[4066]: [INFO] [04-25|19:50:41.300] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:50:41 root-pc erigon[4066]: [INFO] [04-25|19:50:41.437] [p2p] GoodPeers                          eth67=2 eth68=5
apr 25 19:50:42 root-pc erigon[4066]: [INFO] [04-25|19:50:42.721] [mem] memory stats                       Rss=29.1MB Size=0B Pss=29.1MB SharedClean=3.0KB SharedDirty=0B PrivateClean=16.1MB PrivateDirty=13.0MB Referenced=29.1MB Anonymous=13.0MB Swap=0B alloc=9.8GB sys=13.3GB
apr 25 19:50:42 root-pc erigon[4066]: [WARN] [04-25|19:50:42.771] [rpc] served                             conn=127.0.0.1:45416 method=eth_call reqid=9 t=288.17µs err="execution reverted"
apr 25 19:50:42 root-pc erigon[4066]: [INFO] [04-25|19:50:42.928] RPC Daemon notified of new headers       from=19733683 to=19733684 amount=1 hash=0x006000b050cfae8b5ffaabea330f25248cdb12b9466432224f24c23eaf9314ef header sending=17.751µs log sending=372ns
apr 25 19:50:42 root-pc erigon[4066]: [INFO] [04-25|19:50:42.928] head updated                             hash=0x006000b050cfae8b5ffaabea330f25248cdb12b9466432224f24c23eaf9314ef number=19733684
apr 25 19:50:42 root-pc erigon[4066]: [INFO] [04-25|19:50:42.941] [txpool] stat                            pending=227 baseFee=884 queued=82 alloc=10.2GB sys=13.3GB
apr 25 19:50:53 root-pc erigon[4066]: [INFO] [04-25|19:50:53.572] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:50:53 root-pc erigon[4066]: [INFO] [04-25|19:50:53.869] RPC Daemon notified of new headers       from=19733684 to=19733685 amount=1 hash=0x097868d1f89e8a2d67337771931ad2375d83820c18aa54700a9d1f82a0a579f2 header sending=19.256µs log sending=316ns
apr 25 19:50:53 root-pc erigon[4066]: [INFO] [04-25|19:50:53.869] head updated                             hash=0x097868d1f89e8a2d67337771931ad2375d83820c18aa54700a9d1f82a0a579f2 number=19733685
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.120] [rpc] served                             conn=127.0.0.1:37442 method=eth_call reqid=13 t=447.002µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.125] [rpc] served                             conn=127.0.0.1:37442 method=eth_call reqid=15 t=211.05µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.129] [rpc] served                             conn=127.0.0.1:37442 method=eth_call reqid=17 t=207.279µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.565] [rpc] served                             conn=127.0.0.1:41612 method=eth_call reqid=9 t=548.324µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.571] [rpc] served                             conn=127.0.0.1:41612 method=eth_call reqid=11 t=285.369µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.577] [rpc] served                             conn=127.0.0.1:41612 method=eth_call reqid=13 t=346.5µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.577] [rpc] served                             conn=127.0.0.1:41398 method=eth_call reqid=19 t=253.285µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.583] [rpc] served                             conn=127.0.0.1:41398 method=eth_call reqid=21 t=224.028µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.588] [rpc] served                             conn=127.0.0.1:41398 method=eth_call reqid=23 t=215.566µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.854] [rpc] served                             conn=127.0.0.1:46246 method=eth_call reqid=7 t=505.967µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.863] [rpc] served                             conn=127.0.0.1:46246 method=eth_call reqid=9 t=585.747µs err="execution reverted"
apr 25 19:51:02 root-pc erigon[4066]: [WARN] [04-25|19:51:02.870] [rpc] served                             conn=127.0.0.1:46246 method=eth_call reqid=11 t=429.894µs err="execution reverted"
apr 25 19:51:08 root-pc erigon[4066]: [INFO] [04-25|19:51:08.169] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:51:08 root-pc erigon[4066]: [INFO] [04-25|19:51:08.421] RPC Daemon notified of new headers       from=19733685 to=19733686 amount=1 hash=0xa83a7f555d72530bb92ebb49c46bc8ad050b0bf54098301d87e1bfc0b1168190 header sending=35.234µs log sending=547ns
apr 25 19:51:08 root-pc erigon[4066]: [INFO] [04-25|19:51:08.421] head updated                             hash=0xa83a7f555d72530bb92ebb49c46bc8ad050b0bf54098301d87e1bfc0b1168190 number=19733686
apr 25 19:51:16 root-pc erigon[4066]: [INFO] [04-25|19:51:16.308] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:51:16 root-pc erigon[4066]: [INFO] [04-25|19:51:16.624] RPC Daemon notified of new headers       from=19733686 to=19733687 amount=1 hash=0x0b9890d520e02566cea01e3b9f517f1dc304eb4cf0393f9bbc8e7394b3fb132e header sending=17.461µs log sending=452ns
apr 25 19:51:16 root-pc erigon[4066]: [INFO] [04-25|19:51:16.624] head updated                             hash=0x0b9890d520e02566cea01e3b9f517f1dc304eb4cf0393f9bbc8e7394b3fb132e number=19733687
apr 25 19:51:21 root-pc erigon[4066]: [WARN] [04-25|19:51:21.015] [rpc] served                             conn=127.0.0.1:42996 method=eth_call reqid=1 t=247.777µs err="execution reverted"
apr 25 19:51:21 root-pc erigon[4066]: [WARN] [04-25|19:51:21.023] [rpc] served                             conn=127.0.0.1:42996 method=eth_call reqid=3 t=274.082µs err="execution reverted"
apr 25 19:51:21 root-pc erigon[4066]: [WARN] [04-25|19:51:21.033] [rpc] served                             conn=127.0.0.1:42996 method=eth_call reqid=5 t=170.348µs err="execution reverted"
apr 25 19:51:22 root-pc erigon[4066]: [INFO] [04-25|19:51:22.141] P2P                                      app=caplin peers=49
apr 25 19:51:31 root-pc erigon[4066]: [INFO] [04-25|19:51:31.201] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:51:31 root-pc erigon[4066]: [INFO] [04-25|19:51:31.644] RPC Daemon notified of new headers       from=19733687 to=19733688 amount=1 hash=0xe5768705dce170be4633815f5ae99431dd55aa3188b82fa3001b3eae9902fa44 header sending=20.041µs log sending=427ns
apr 25 19:51:31 root-pc erigon[4066]: [INFO] [04-25|19:51:31.644] head updated                             hash=0xe5768705dce170be4633815f5ae99431dd55aa3188b82fa3001b3eae9902fa44 number=19733688
apr 25 19:51:37 root-pc erigon[4066]: [WARN] [04-25|19:51:37.152] [rpc] served                             conn=127.0.0.1:57786 method=eth_call reqid=3 t=361.044µs err="execution reverted"
apr 25 19:51:37 root-pc erigon[4066]: [WARN] [04-25|19:51:37.164] [rpc] served                             conn=127.0.0.1:57786 method=eth_call reqid=5 t=340.215µs err="execution reverted"
apr 25 19:51:42 root-pc erigon[4066]: [INFO] [04-25|19:51:42.071] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:51:42 root-pc erigon[4066]: [INFO] [04-25|19:51:42.490] RPC Daemon notified of new headers       from=19733688 to=19733689 amount=1 hash=0x1c6d22f0899c3419b2b09ebea26bfe7d14ebcfab0e08932ddc51bf304c73dee4 header sending=23.14µs log sending=440ns
apr 25 19:51:42 root-pc erigon[4066]: [INFO] [04-25|19:51:42.490] head updated                             hash=0x1c6d22f0899c3419b2b09ebea26bfe7d14ebcfab0e08932ddc51bf304c73dee4 number=19733689
apr 25 19:51:52 root-pc erigon[4066]: [INFO] [04-25|19:51:52.961] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:51:53 root-pc erigon[4066]: [INFO] [04-25|19:51:53.357] RPC Daemon notified of new headers       from=19733689 to=19733690 amount=1 hash=0xab8d3306039aae91418aeb24f9c6ba1b145a51db54a4f193ec50a895c8f57efa header sending=22.658µs log sending=402ns
apr 25 19:51:53 root-pc erigon[4066]: [INFO] [04-25|19:51:53.357] head updated                             hash=0xab8d3306039aae91418aeb24f9c6ba1b145a51db54a4f193ec50a895c8f57efa number=19733690
apr 25 19:52:06 root-pc erigon[4066]: [INFO] [04-25|19:52:06.280] [updateForkchoice] Fork choice update: flushing in-memory state (built by previous newPayload)
apr 25 19:52:06 root-pc erigon[4066]: [INFO] [04-25|19:52:06.296] RPC Daemon notified of new headers       from=19733690 to=19733691 amount=1 hash=0x6bb140f14d5798de21b63474dcfdb355754c29b83efd772b6b1da8bf5399ebf0 header sending=18.2µs log sending=562ns
apr 25 19:52:06 root-pc erigon[4066]: [INFO] [04-25|19:52:06.296] head updated                             hash=0x6bb140f14d5798de21b63474dcfdb355754c29b83efd772b6b1da8bf5399ebf0 number=19733691
fridary commented 4 months ago

I did this way and now it works:

ws = 'ws://127.0.0.1:8546/'
async def get_event():
    async with websockets.connect(ws) as ws:
        await ws.send('{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}')

But what is the point of Web3.WebsocketProvider, who knows?

fridary commented 4 months ago

I found an article https://cryptomarketpool.com/how-to-query-the-ethereum-mempool-txpool-with-python/ where python script loads like

wss = 'wss://EnterYourWSSInformationHere'
web3 = Web3(Web3.WebsocketProvider(wss))

So that means this way must work, but my script does not.