1

Anyone knows why the nonce in geth is uint64 and not big.int? My main (and perhaps only) problem with this is that then the test-case "TransactionWithHihghNonce256" from:

https://github.com/ethereum/tests/blob/develop/TransactionTests/ttTransactionTest.json

is kinda problematic.

  • It would be probably better to ask this question on one of the geth developers channels to understand the reasoning behind the test. My guess is that is may be to test that geth handles an out of range nonce. – dbryson Jul 6 '17 at 1:29
  • 1
    I asked in the gitter-channel with a link to this question - but think it is better to have it persist on stackoverflow for people wondering the same thing later on – ligi Jul 6 '17 at 1:32
  • I think it is of that size mostly of convinience, uint32 is too small, and uint256 is too big. Since it counts the number of transactions of an account unless you are a bot making billions of operations every day, uint64 is kind a convenient size. – Ismael Jul 6 '17 at 16:49
-2

Nonce is a unique id per signed transaction per address. Which means two different addresses having done multiple transactions could theoretically at some point have same nonces. So considering that a 64 bit number could give enough combinations to sustain the uniqueness for a really long period, they must've chosen uint64

  • Nonces are not necessarily unique per address. They are mainly used to create a unique signature per signed transaction. The nonce is only part of the data signed in a transaction – dbryson Jul 6 '17 at 1:32
  • Yea - might not be a real-world problem (allthough this was also thought with "640K ought to be enough for anybody." back in the days ;-) My main problem is the test-case - this cannot work with long – ligi Jul 6 '17 at 1:40
  • @dbryson I just edited my answer to make it more accurate. Thanks for pointing that out – Prashanth Devadas Jul 6 '17 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.