Use of BTCRelay without paying fees #44
Description
With Metropolis, there will be a new opcode, REVERT
(ethereum/EIPs#206) and RETURNDATA
(ethereum/EIPs#211).
The REVERT
opcode will function as a throw
, reverting state-changes, but will not burn the remaining gas. Additionally, it can return some data, in order to provide the callee with information about the error.
Unfortunately, this EVM-change undermines the model for synchronous oracles which accept payment; it's possible to
- Make a call to
BTCFreelay
- Make a call to
InternalCall
3. Perform call toBTCRelay
for verification, along with payment
4. Performrevert
along with the response from BTCRelay
This would revert the payment(s), but still grant access to the return value.
Note: Even without RETURNDATA
, it would still be possible to perform this attack, albeit with less data being extracted. Example gist showing how to 'freeload' on btcrelay using revert
without returndata
: https://gist.github.com/holiman/51f9b02b64f864b896129d329757460c .
Note 2, this can also be performed already today, using a regular throw
, but the attack is quite 'messy' since it needs to handle several intricate cases of OOG
due to remaining gas being discarded at every throw
.
I'm filing this as an issue, even if it's not yet implemented, so there can be a discussion about possible future modifications that can be made. Also, posting it as a 'known issue' here makes in not eligible for a reward in the bug bounty.