Skip to content

Comments

Add RPC fallback verification to fix connection failures while calling if web3.is_connected()on Gensyn Testnet#2

Open
xailong-6969 wants to merge 1 commit intogensyn-ai:mainfrom
xailong-6969:main
Open

Add RPC fallback verification to fix connection failures while calling if web3.is_connected()on Gensyn Testnet#2
xailong-6969 wants to merge 1 commit intogensyn-ai:mainfrom
xailong-6969:main

Conversation

@xailong-6969
Copy link

@xailong-6969 xailong-6969 commented Nov 19, 2025

Adds fallback connection verification to handle cases where the standard connection check may return false on certain RPC provider configurations, ensuring more reliable connectivity to the Gensyn Testnet.

so i am attaching the main error log here:

image

When connecting to Gensyn Testnet using the official public RPC endpoint (https://gensyn-testnet.g.alchemy.com/public), the web3.is_connected() method returns False due to restricted web3_clientVersion access, causing the connection to fail even though the blockchain is fully accessible.

Reference: rl-swarm-contracts deployment config

Solution

Added a fallback verification in genrl/blockchain/connections.py that uses eth.block_number when web3.is_connected() fails.

The log demonstrates:

  • web3_clientVersion fails with HTTP 401
  • Fallback eth_blockNumber query succeeds
  • Connection established successfully to Gensyn Testnet
image_2025-11-19_16-21-54

i am attching here the screenshot of swarm_launcher.log after running the node with block_number method through the contract endpoint directly:

image image_2025-11-19_15-28-16

@jcd496 kindly look into this issue.

Adds fallback connection verification to handle cases where the standard connection check may return false on certain RPC provider configurations, ensuring more reliable connectivity to the Gensyn Testnet.
@jcd496
Copy link
Collaborator

jcd496 commented Nov 19, 2025

this is a great fix @xailong-6969 . We are working on a solution to the RPC issues right now. Depending on the outcome of the RPC solution, we may merge this as well. thanks!

@xailong-6969
Copy link
Author

this is a great fix @xailong-6969 . We are working on a solution to the RPC issues right now. Depending on the outcome of the RPC solution, we may merge this as well. thanks!

@jcd496 sure sir thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants