NonceManager does not handle overflow #2815
Unanswered
kevinforrestconnors
asked this question in
Q&A
Replies: 1 comment 6 replies
-
I don’t understand what you are trying to do? Nonce must be sequential in Ethereum transactions, so you cannot set a random start value on different instances anyways. You must carry in from where you the last transaction was. A IEEE 754 number is safe for transaction count in general, because there isn’t enough energy in the observable universe to ever reach that many transactions on the Ethereum network. :) |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If the nonce in the NonceManager exceeds
Number.MAX_SAFE_INTEGER
, the NonceManager does not loop around and stops working.This makes it impossible to safely use a random number in
setTransactionCount
, and thus makes it difficult to use twoNonceManager
s in separate codebases, that represent the same contract, but which cannot interact with each other.Suggested fix:
incrementTransactionCount
should be modified to check if it will setthis._deltaCount
to an unsafe value, i.e.modify
setTransactionCount
to also verify that it is not overflowing thenonce
passed toethers.BigNumber.from
Beta Was this translation helpful? Give feedback.
All reactions