-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement extcodehash #77
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for your pull request!
|
||
let extcodehash_pointer = context.build_alloca(context.word_type(), "extcodehash_pointer"); | ||
|
||
context.build_runtime_call( |
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 does not fully resemble the EVM semantics: hash of the chosen account's code, the empty hash (0xc5d24601...) if the account has no code, or 0 if the account does not exist or has been destroyed
. Here is the syscall for reference.
I think with the current implementation in pallet-revive
, we are basically forced to emit some branches and make two syscalls for this. Which is not desired, everything the runtime can do for us easily it should do (it is faster and spares contract code size). So this needs a PR in the pallet first to let it distinguish between contract-accounts, no-contract accounts and unknown accounts and write back the correct value automatically. Then it can be properly implemented and tested.
Sorry in the corresponding issue #63 I should have wrote that out more clearly.
Closes #63. @ermalkaleci if you feel like takling this on the runtime side too, can I assign #63 to you? |
Absolutely, I would love to contribute. Hope this is good start :) |
Nice, thank you! Yeah we can take it from here. There's nothing complex to it, it is a good first issue. |
extcodehash
because we can't hardcode the hashTODO: