Skip to content

Charge syscall gas inside wasm instrumentation #1153

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

Closed
Stebalien opened this issue Nov 28, 2022 · 2 comments
Closed

Charge syscall gas inside wasm instrumentation #1153

Stebalien opened this issue Nov 28, 2022 · 2 comments
Labels
P2 P2: Should be resolved Topic: Gas and limits
Milestone

Comments

@Stebalien
Copy link
Member

Currently, we charge a flat "syscall" gas on every syscall here:

charge_syscall_gas!(data.kernel);

However, we should be charging this gas before making the syscall to avoid letting an attacker perform an operation where it can't quite cover the gas.

Right now, it's not really an issue because we can only run into this situation once per message. However, with gas limits on internal sends (#966), it may be possible to trigger this multiple times.

Of course, it's not a huge issue because an attacker could only do this once per send, but it's still something we should look into.

@Stebalien Stebalien added P2 P2: Should be resolved Topic: Gas and limits labels Nov 28, 2022
@Stebalien Stebalien added this to the M2.1 Post-Testnet milestone Nov 28, 2022
@Stebalien
Copy link
Member Author

cc @raulk because it relates to #1149.

@Stebalien
Copy link
Member Author

Action: Look into this while the testnet is running and consider fixing. We will likely punt to M2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 P2: Should be resolved Topic: Gas and limits
Projects
None yet
Development

No branches or pull requests

1 participant