How does the load balancer work?

I am using ‘eth_blockNumber’ to do synchronizing checking, but I found that the latest block numbers provided by you are not consistent, sometimes the current check result can fall behind to the last check? I guess this is caused by your load balancer as it may redirect my requests to different back-end servers. How does your load balancer work? Which load balancer are you using? Thanks!

Hi @Kai_Li, when did you last test this and can you provide your code you’re using?

I tested it this Monday, I was using web3py such like:
INFURA = “https://mainnet.infura.io/v3/mysecretID
infura = Web3(Web3.HTTPProvider(INFURA))
current_height = infura.eth.blockNumber

We made a major change to our infrastructure on Tuesday, can you test this again and let me know if it is still occurring?

Hello, I don’t think the problem is solved, my requests are still redirected to different backend servers. In addition, to verify this, I sent an queued transaction (with future nonce), then I use ‘eth_getTransaction’ to retrieve it back, but I received nothing. May I know how exactly the load balance work?

Hi !@kai_li. Currently when you send a transaction through our API that transaction is immediately reflected in your nonce via eth_getTransactionCount but the transaction itself will may see a delay before it is available via eth_getTransactionByHash we are working on solving this propagation delay in the next few weeks. Does this match what you are experiencing?

Our architecture update in early December should have resolved any response inconsistencies for eth_getBlockByNumber. Are you still experiencing any issues with that specific request? Any additional detail you can provide or code snippets would be useful.

Hello @egalano, thanks for the response, based on recent observation, I think the consistency of ‘eth_blockNumber’ is well preserved, however, my application has a special need to send future transaction first, then send the predecessor transaction. The sample code snippet is as follows:
‘’’
future_nonce=w3.eth.getTransactionCount(address, “pending”)+1
TXo =w3.eth.sendTransaction({from:xxx, to:xxx, value:xxx, nonce:future_nonce})
print(w3.eth.getTransaction(TXo))
‘’’
This code snippet will throw error when executing the third statement.

Thanks for the detail. The strange thing with this behavior is that you are asking for the transaction which you just sent so you actually have all the information already. Are you using this as a method to check if the transaction has been propagated to the network before sending the next transaction?

Actually the above code snippet should be run in a distributed manner, consider two parties that hold a shared account, one party sends the first transaction and shares the TXID with the other party, then the other party retrieves the transaction details from Blockchain to audit the transaction, after auditing, she will send the next transaction to accommodate with the first transaction.

Hello, @egalano, I didn’t hear from you following this thread, do we have any solution regarding this problem? Thank you!

Any clarity on how this works? Does the load balancer still just send you to a random node that potentially has a different state to the node you were previously load balanced to?