Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry on nonce too low #53

Open
lukemarsden opened this issue Jul 17, 2023 · 2 comments
Open

retry on nonce too low #53

lukemarsden opened this issue Jul 17, 2023 · 2 comments

Comments

@lukemarsden
Copy link
Contributor

as seen below, when there's contention on the smart contract because of the short block times we are more likely to see this, we just need to retry in the client

2023-07-17 12:19:02,606;ResourceProvider;馃煚 post resource offer
Exception in thread Thread-1 (platformListener):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/app/modicum/ResourceProvider.py", line 303, in platformListener
    self.postDefaultOffer()
  File "/app/modicum/ResourceProvider.py", line 90, in postDefaultOffer
    self.postOffer({"request": "post",
  File "/app/modicum/ResourceProvider.py", line 78, in postOffer
    ).transact({
  File "/usr/local/lib/python3.10/dist-packages/web3/contract/contract.py", line 479, in transact
    return transact_with_contract_function(
  File "/usr/local/lib/python3.10/dist-packages/web3/contract/utils.py", line 172, in transact_with_contract_function
    txn_hash = w3.eth.send_transaction(transact_transaction)
  File "/usr/local/lib/python3.10/dist-packages/web3/eth/eth.py", line 362, in send_transaction
    return self._send_transaction(transaction)
  File "/usr/local/lib/python3.10/dist-packages/web3/module.py", line 68, in caller
    result = w3.manager.request_blocking(
  File "/usr/local/lib/python3.10/dist-packages/web3/manager.py", line 232, in request_blocking
    return self.formatted_response(
  File "/usr/local/lib/python3.10/dist-packages/web3/manager.py", line 205, in formatted_response
    raise ValueError(response["error"])
ValueError: {'code': -32000, 'message': 'nonce too low: next nonce 120, tx nonce 119'}
@lukemarsden
Copy link
Contributor Author

fixed in f51092e

@lukemarsden
Copy link
Contributor Author

didn't work. nonce was baked into raw transaction and retrying that is pointless

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

No branches or pull requests

1 participant