1

I've got a very strang behaviour when running a oraclize call like in the following example:

class Test is Oraclize... {

  uint64[] timestamps;
  uint64[] numbers;

  function pushItem(uint64 number) {
    timestamps.push(uint64(now));
    numbers.push(number);
  }


  function sendRequest() {
    bytes bytesString = new bytes(...)
    // construct a json string for using as param for oraclize call
    // {"str": "<number1>,<timestamp1>,...<number n>,<timestamp n>,"}
    // e.g {"str": "1,1534703529,2,1534703544"}   
    oraclize_query(3600, "URL", apiURL, string(bytesString), gasLimit);
  }

  function __callback(...
}

Now the functions are called like this:

await test.pushItem(1);
await test.pushItem(2);
await test.sendRequest();

I ran this code a lot of times without any problems. But one time my backend got a call from oraclize where the parameters are in wrong direction: {"str": "2,1534703600,1,1534703513"} Also the timestamps in the request were not included in my timestamps array.

The only explanation I have is that on one node test.pushItem(2); was mined before test.pushItem(1);.

Since rinkeby works a little bit different than mainnet I would like to know if this can happen and can my assumption be right?

  • It can be, that Rinkeby's way of making blocks is the perpetrator but that is not really provable unless logs or any kinda of trace of the transactions that you initiated do exist. If you have those, it would be nice to make a gist and paste the link. – Kaki Master Of Time Aug 20 '18 at 21:59

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.