provable-things / ethereum-api

Provable API for Ethereum smart contracts
https://docs.provable.xyz/#ethereum
MIT License
801 stars 427 forks source link

Possible improvement #62

Closed sullof closed 6 years ago

sullof commented 6 years ago

With Tweedentity, since we try to let the user spend as less as possible for the gas, we continue to experience the same issue with Oraclize:

the query is called but the callback is triggered in the average 10 hours later or more.

I suppose that the reason why you prioritize transactions with higher gas price depends on how Ethereum manages multiple transactions from the same wallet, waiting for the confirmation of the one with the lower nounce before confirming the following. This implies that if you get stuck with a transaction at a low gas price the entire address would be blocked if you don't reverse the first transaction.

A solution could be that you use many wallets to call the callback. Ideally, I would set a wallet for any possible gas price, but even a reasonable interval should be much better than the current approach. For example, wallet 0xAA could trigger all the callbacks with gas price > 60, 0xBB the callback with gas price more than 50, etc.

The code in the __callback could be something like

function __callback(bytes32 myid,string result)   {
    require(isAValidOraclizeCBAddress(msg.sender));
...

What do you think?

D-Nice commented 6 years ago

Thanks for the suggestion.

On the contract-side of things, we've already built-in multiple callback address support in anticipation of this, which is fully backwards compatible with our initial system that did only support a single callback address: https://github.com/oraclize/ethereum-api/blob/master/connectors/oraclizeConnector.sol#L71-L77

It is on the off-chain service side that we were lacking this feature, but we had this same idea as you suggest, to have "callback lanes", to avoid the aforementioned issues you have experienced. It is something that has been worked on, and recently it has entered a stage that can be considered more complete, but we are still testing this before we bring it into production, and to ensure no bugs and issues, we're pretty stringent with the testing. The best ETA I can unfortunately give is soon, as it depends on the results of our testing etc... But we definitely understand it's an important need of our clients and will look to prioritize it to improve quality-of-service.

Let's leave this open until it makes it to the production environment.

sullof commented 6 years ago

Thanks so much. Let me know if I can be helpful some way.

D-Nice commented 6 years ago

This has been rolled out on mainnet last week.