-
Notifications
You must be signed in to change notification settings - Fork 12k
Refactor Nonces from contract to library to mitigate nonces collision between Votes and ERC20Permit #3848
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
base: next-v5.0
Are you sure you want to change the base?
Conversation
… between Votes and ERC20Permit
I see more issues:
We have started new EIP to specify how exactly nonces should serve different signature-based operations: ethereum/EIPs#6077 |
There is no such difference between 4.8.0 and the current 5.0 branch.
In the case of Permit we've just implemented the EIP and it doesn't have nonce cancellation (although it's simple to create a permit to cancel a nonce), and in the case of Votes we've implemented a small variant of the COMP interface and didn't add nonce cancellation. We can consider it though. Regarding "nonce collision". Can you explain the scenario where you see it being a problem that permits and delegation use the same nonce sequence? In my experience a signature is produced and used almost immediately. Are signatures ever long lived? |
@frangio these different typehashes describes different offchain signature-based activities. Why they should rely on the same sequence of nonces? What if we would end up to token with 5-10 typehashes, will they all be in the same sequence? For example with Permit and Votes: if you would delegate by signature, it will be auto-cancelled if you will perform trade with permit on DEX/Aggregator. Delegatee for example could perform late claim of delegations only from those who had top balances for example. |
Yeah. While I agree with this PR conceptually, it's a breaking change and I don't think there's a way to make it backwards compatible. |
@frangio we can add missing methods to keep compatibility with prev versions... |
How do you make that work? They would be reduced back to a single sequence because applications will take the result of |
@frangio I don't understand how exactly it is working in |
I see now:
So it was already a breaking change, of unifying this sequences. I think since 5.0 is not final we can reconsider this. And we can return |
I feel we can keep |
PR Checklist