-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
feat: introduce block.prevrandao
as alias for block.difficulty
#3085
Conversation
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Codecov Report
@@ Coverage Diff @@
## master #3085 +/- ##
==========================================
- Coverage 88.36% 88.33% -0.03%
==========================================
Files 98 98
Lines 11020 11028 +8
Branches 2605 2608 +3
==========================================
+ Hits 9738 9742 +4
- Misses 832 834 +2
- Partials 450 452 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@fubuloubu since all conversations are resolved, I think it's time to trigger the CI. |
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.
oh i didn't mean to resolve this: https://github.com/vyperlang/vyper/pull/3085/files#r965129658
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
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.
@pcaversaccio could you add a warning then depending on the EVM version? if the user tries to use block.difficulty
in >= paris, warn. if the user tries to use block.prevrandao
in pre-paris, warn. the fact that the two usages compile to the same opcode is handy for backwards compatibility reasons, but ultimately we do not want users to be thinking of them as the same thing as they have (very) different semantics.
@charles-cooper thanks for implementing the warning! |
@fubuloubu implemented a warning depending on usage in 7107788. could you please sign off if it makes sense to you? and then i can merge |
block.prevrandao
as alias for block.difficulty
block.prevrandao
as alias for block.difficulty
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 resolved my last bit of feedback
What I did
EIP-4399 renames the
DIFFICULTY (0x44)
opcode toPREVRANDAO (0x44)
. The return value of theDIFFICULTY (0x44)
instruction after this change is the output of the randomness beacon provided by the beacon chain.How I did it
With my brain.
How to verify it
Ask Vitalik's masternode.
Commit message
Description for the changelog
Add
block.prevrandao
as alias forblock.difficulty
.Cute Animal Picture