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 limits for calls #117

Open
xermicus opened this issue Nov 21, 2024 · 0 comments
Open

Gas limits for calls #117

xermicus opened this issue Nov 21, 2024 · 0 comments

Comments

@xermicus
Copy link
Member

xermicus commented Nov 21, 2024

Gas does not correspond to ref_time exactly as semantically equivalent code can exhibit totally different gas usage on EVM vs. ref_time usage on PVM.

Right now we ignore it, making all calls unconstrained. But those gas limits are a security feature.

Possible solutions:

  1. Scale the supplied gas limit with a fixed factor
  2. Treat the supplied gas as relative value relative to the EVM block gas limit and convert it to the corresponding relative ref_time limit. Drawback is that the compiler (i.e. the user) needs to know the absolute ref_time limit of the target blockchain. It also largely disconnects the semantic meaning of the value should the block limits in either chain change.

Also add a warning whenever a call with gas limit != 0 is compiled.

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

No branches or pull requests

1 participant