1

I have a contract that I want to automatically check the price of ethereum everyday. right now I have a method called startContract which calls a function setConversion which makes a query set for 1 day in the future. When the __callback method sees the query id created by the check price query it calls setConversionCb which in turn calls setConversion. The problem I've noticed while running my contract with Truffle, ethereum-bridge and testrpc is that after several queries to Oraclize I get an out of gas error in the ethereum-bridge console.

See here (contract addresses annonymized):

[2017-04-21T01:43:35.879Z] INFO sending __callback tx...
    {"contract_myid":"0xc1f9a50449102fbdbd32ef8cb9c22b623d55480e4474","contract_address":"0x17c89ee345e2521b8eb6e91e576"}
[2017-04-21T01:43:36.969Z] ERROR callback tx error, contract myid: 0xc1f9a50449102fbdbd32ef8cb9c22b8973537dbcf665c0be60623d55480e4474
    {"message":"VM Exception while processing transaction: out of gas","stack":"Error: VM Exception while processing transaction: out of gas
.
.
.

Since there is a gas limit, I feel like this approach would be unsustainable if I plan on making the query every day for upwards of a month. What is the best way of handling this? Ethereum Alarm Clock? Or is there simply a change in my existing logic I can make?

  • Hi Denis, Thomas from Oraclize here. The out-of-gas is definitely related to some application specific issue that is not being properly handled. In order to help you further, I would need to see your specific code though, can you maybe provide it (at least the relevant parts as the full __callback method code and the exact oraclize_query that you are sending)? – Thomas Bertani Apr 21 '17 at 8:02
  • What makes you say that? The reason Im asking is because I was able to to avoid the error for a significantly long time by increasing the gas limit in the query call. – Daniel Kobe Apr 21 '17 at 19:36
  • Well, it is just my best guess, without seeing the code (with just the info you have provided) that's all I (and anybody else) can do. I would be happy to help once more details (like the callback code and the query, at the very least) are provided. Thanks! – Thomas Bertani Apr 22 '17 at 8:22
  • Also, the callback tx is what gets called so the error cannot really be anywhere else (assumining that the Oraclize callback tx.data is not malformed, which based on our experience, public txs and the feedback we get, it never happened in the last 2 years). – Thomas Bertani Apr 22 '17 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.