Is the default gas price of oraclize callbacks adjusted over time?

In the docs it says:

If no settings are specified, Oraclize will use the default values of 200,000 gas and 20 GWei. This last value is on the higher-end of the pricing spectrum right now, but it helps having faster confirmation times during network-wide congestions.

Is this default gas price of 20 GWei fixed forever? What happens if demand surges and 20 GWei is way too low, would my contract wait forever for the callback by oraclize?

Moreover, if I use oraclize_setCustomGasPrice once how can I reset the gas price to the default value? I mean I can alway say oraclize_setCustomGasPrice(20000000000), but this setting would only work if the default gas Price remains 20 Gwei forever. Hence, if it does change, how can my contract now about it?

1 Answer 1


In practice Oraclize never seem to change this value but in theory they could. If the value was too low then as you suggest your contract would never get the callback through. Presumably they'd raise their defaults in this situation.

The value could also be changed by someone who hacked their systems, so if your contract isn't already intrinsically able to be drained by Oraclize (eg as it might be if you have a lottery contract that can be called by anyone, and you're relying on them for random numbers), it's worth treating it as untrusted input and doing whatever you can to make sure it's within reasonable bounds.

When doing this, bear in mind that the attacker could call it repeatedly, and also that the attacker simultaneously be the sender of an attack transaction and the miner of that transaction, so you're not safe even if you can ensure that the amount that is sent really is spent on gas.

  • Couldn't the attacker simply be stopped by require(msg.value >= oraclizePrice), i.e. the user needs to pay up front for the callback that she or he initiates? Sep 23, 2017 at 12:21
  • Yes, that will work in some cases. Sep 23, 2017 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.