I have quite an issue here. I have a web3 py script for integration. It works perfectly on my local machine and also interacting with the smart contract directly from testnet.

The problem is, on AWS lambda (this is where the backend I am integrating with is backend), when I send a transaction first, it work. But when I want to send the second transaction, it gives the error "nonce too low"

Now, it does not give this error in the local machine or interacting from the testnet directly.

I will really appreciate any help on this.

summary is, it is working perfectly on local machine and testnet but not perfectly on AWS lambda

thank you

Dec 19, 2023, 12:29 PM
It shouldn't be the case. Maybe you are not waiting for first tx to be mined before generating second instance of lambda
Dec 19, 2023, 7:32 PM
Fixed. I had to increment the nonce and save the increment in the database cos for reasons not known, the lambda can't increase the nonce
Dec 19, 2023, 7:47 PM
Watch out for race conditions
Dec 19, 2023, 8:16 PM
True. Any better idea to solve this?
Dec 19, 2023, 8:53 PM
offload signer from lambda to a single ec2 and use a simple thread lock on that
Dec 19, 2023, 9:00 PM

© 2024 Draquery.com All rights reserved.