Closed
Description
Currently, we charge a flat "syscall" gas on every syscall here:
ref-fvm/fvm/src/syscalls/bind.rs
Line 127 in 9c35c30
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.