Skip to content
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

Gas costs should be tied to the protocol version not the contract protocol version. #142

Open
RitaMAllenCA opened this issue Apr 21, 2023 · 2 comments
Assignees

Comments

@RitaMAllenCA
Copy link

No description provided.

@RitaMAllenCA
Copy link
Author

The gas costs are injected into the wasm when it is installed. So an old contract locks in costs. to get the new costs, an author needs to do an upgrade.
wasm isn't mutable once its installed, so cannot be altered to inject different costs
better thing to have done would have been to store the raw wasm and inject costs everytime its loaded up. but that would incur a perf hit and could be attacked there's a couple of different options as well, all with trade offs.

Maybe move the wasm out of global state, into a separate wasm store, and just store the content addressed hash of the wasm in global state. Doesn't change the issue that already installed contracts are baked.
DEpreprocessor: its technically possible to undo gas injector, and stack limit. Both processing steps add easily detectable patterns to the wasm that could be removed to arrive at the original wasm (or a wasm that behaves exacly same way as original but without processing). every time that legacy contract is used, its attackable
other option is to do a forced upgrade to a new contract version and a forced disable of the old and currently, contract owners can reenable disabled versions. so we would potentially need to block that for contract versions from no longer supported protocol versions.

@devendran-m
Copy link

devendran-m commented Sep 26, 2024

Per Ed, will not fix in existing VM, but the 2.1 VM does do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants