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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Implicit transaction nonces for idempotent transactions #15812

Closed
MitchK opened this issue Jan 5, 2018 · 2 comments
Closed

Comments

@MitchK
Copy link

MitchK commented Jan 5, 2018

We currently write a lots of transactions per account (storing hashes in a smart contract) and sometimes have the problem that a transaction cannot be executed for arbitrary reasons, for example if the gas price is too low.

Following transactions depend on this "non-executable transaction" because of the transaction nonce. If the transaction times out and gets discarded, any following transactions then have to be signed again by the issuer with a lower nonce in order to go through.

For our use case, there is no big harm if the issuer is able to write the same hash to the contract twice - the transaction issuer will just lose a little bit of Ether to pay for the gas.

It would help if one could set the transaction nonce to a value "derived" or "implicit", which basically means "determine the nonce of this transaction based on the nonce of the previous account state". This transaction nonce could be determined by the miner.

I understand that you probably don't want this in a case where you transfer value from one account to a other, meaning, when you replay a transaction, the outcome would be different (i.e. resulting in a higher balance on the other person's account).

@infamousrev
Copy link

The nonce is also to offer replay protection, if you signed transaction number x, then you only gave permission to include transaction number x.

I understand you don't mind if the transaction gets included twice, but would you still be fine with the transaction being included 10000x (wasting all your ether on gas)?

The account abstraction that will be implemented in the next hardfork might allow for more complicated use cases like the one you mentioned, but the trade-off between functionality and security is a delicate one.

@karalabe
Copy link
Member

karalabe commented Jan 5, 2018

The nonce is part of the data being signed by the sender, so in the current form the miner can in no shape or form change it (or any other field on the transaction). Account abstraction might help with your usecase as @infamousrev mentioned, but you need to put your thoughts down on the relevant EIP (ethereum/EIPs#86) to have it discussed and considered.

@karalabe karalabe closed this as completed Jan 5, 2018
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

3 participants