-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Use Trace208 in Votes to support ERC6372 clocks #4539
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
Merged
frangio
merged 10 commits into
OpenZeppelin:master
from
Amxx:refactor/checkpoints/use-trace208
Aug 30, 2023
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
06b4189
Use trace208 in Checkpoints to support full uint48 keys for ERC6372 c…
Amxx 48fba73
add changeset
Amxx 15ca017
Update wild-peas-remain.md
frangio 74b8d26
accept storage breakage when labeled as breaking
frangio d5ab954
trigger tests
frangio b2cd627
Merge branch 'master' into refactor/checkpoints/use-trace208
Amxx bd9595d
document
Amxx 2d93da5
Update ERC20Votes.sol
Amxx bc335f5
Update ERC20Votes.sol
Amxx 7927100
lint
frangio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
document
- Loading branch information
commit bd9595d894fe210a64d9f93d93b3f39120902e11
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this to
uint256? Using the smaller type prevents returning a number that is too large for the data structure to support it.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honestly not sure what it implies/change to use uint208 vs uint256 here (note that it's internal)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint208makes it a type error to override with a function that returnstype(uint256).max, for example, or any literal that is too large to fit uint208.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if multiple modules implement that function with different values (votes limit to 208, but other modules would limit to 224, 192 or 128 for some other reason) how would we resolve that ?
If the return types are different it's a mess. If they are both uint256 there may be some hope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a concrete problem we have currently so I would go with the option that is safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that issue happens during the 5.x cycle, would we be able to change it without a major change ?
I don't think overriding this with a bigger function is something anyone would realistically do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the only place we use it, we do an implicit upcast to uint256
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If something like this happens in a minor release I think we would just add an internal function with a name other than
_maxSupplyso they wouldn't clash, andERC20Votescould implement that internal function in terms of the existing one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you feel strongly about this I can accept it. The risk if >uint208 is returned is simply that some transfers might revert but it's a recoverable situation.