-
Notifications
You must be signed in to change notification settings - Fork 767
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
Limit resources to 63/64 on sub calls and remove 0
as special case for "take all"
#6846
Comments
Hello! Can I help with this? |
0
as special case for "take all
0
as special case for "take all0
as special case for "take all"
Yes. It should be a fairly small change to do. Basically, when we create the nested meter for the sub call we need to limit it by 63/64 of the remaining gas:
Same for the storage meter: polkadot-sdk/substrate/frame/revive/src/storage/meter.rs Lines 289 to 299 in 48c6574
But please first verify first if it is really 63/64 by checking geth source code (its easy the have one filer per op code). I also extended the issue (see title) by another thing because I think it is connected: Right now passing |
I was unaware of this mechanism in Ethereum, so I looked it up - https://github.com/ethereum/EIPs/blob/master/EIPS/eip-150.md I've searched at https://github.com/ethereum/go-ethereum to confirm the In All of the above have a
TL;DR 63/64 is still the number to use. |
As of right now when calling a sub contract on
pallet_revive
we allow the sub call to use up all the resources that the caller specifies that are allowed to be used. However, oh Eth this value is capped by 63/64 of the remaining gas. We want to do the same.Especially, because Solidity will not be able to limit any other resource than ref_time. Limiting of all resources will be enabled by a pre-compile.
The text was updated successfully, but these errors were encountered: