Behavior differences between editor calls and direct sdk-js calls

Hello,

I would like to point out some of the differences between editor calls and direct sdk-js calls. An editor uses the same libraries that we use in raw as developers and also with the same versions. Despite the fact it is very time-consuming to try to figure out why one thing does not work while the other works and they both use the same core-libs at the back. Here are some things…

Oracle deployment (at init method)

In the init method, An oracle registration with Relative TTL higher than a certain number e.g. 64797 & higher will fail on invocation while with 64796 & lower will deploy the contract & direct calls can work with a higher number which are through importing sdk-js.

Try with AeStudio && RelativeTTL(64797):


image

Try with AeStudio && RelativeTTL(64796):

Try with https://contracts.aeternity.art/ && RelativeTTL(64797)

Try with https://contracts.aeternity.art/ && RelativeTTL(64796)

Try with SDK-js from custom js script, gasPrice: 5500000000 && RelativeTTL(999999)
Works!

Query Calls (by running query method)

This is a basic query call with argument value: "https://api.therocktrading.com/api/ticker/BTCEUR__result[0]__volume", false

Try with AeStudio

Try with https://contracts.aeternity.art/

Try with sdk-js custom script

→ When you get Query ID in return from calling query, that means the calls is successful.

Code to try with both Change the relative TTL accordingly and make the query calls as you like.

Note: On editors, I tried with higher gas and gasprice as well as per developers suggestions but this issue remains for now.

Let me know if you got the same experience.

Edit: I am adding this post here as ae-studio developers told me to do so, Hope to see some progress on this.

1 Like

I have no problem creating the contract with a RelativeTTL(999999) you just have to bump the gas limit - which coincidentally is exactly what I told the ae-studio developer…

Creating (and extending) oracles means that the oracle will be stored in the state tree. This is associated with a cost, that is relative to the TTL of the oracle. I guess what happens is that Gas limit “auto” (25k?) will run out of gas at exactly your magic number - something you’d also see if you looked at the error message (which you see when you debug/dry-run your call).

For the next “bug report”/question I suggest you post the actual transactions rather than pictures of errors, that is much more useful when trying to help.

2 Likes

Thanks for the reply,
It’s not some magic number just something i found working above or not… :slight_smile:
I am not sure how to get a transaction id on invocation failed, For passed will try to post it (I thought i should keep it parallel)

Tried with higher gas amount…

With even higher gas amount…

It didn’t worked as i mentioned before…

This is the account I am using æternity Explorer I didn’t see transactions of invocation failed contracts there or they will update later…

I just picked one of the claims (Try with https://contracts.aeternity.art/ and RelativeTTL(64797)) though I couldn’t be arsed to change the 999999 so I went with that; and I changed the Gas limit from auto to something large (5M ?) and it worked. The result is:

Deployed, and mined at this address: ct_2pJw7Ruptatsu6MM5RwhHUvxTRbfLXmusy5M6mNaNBbQNmdRZy

I’m still waiting for the actual transaction I just see more pictures??

2 Likes

Increasing gas amount (I set it to 5m) worked on https://contracts.aeternity.art/, Thanks for pointing that.

But for aestudio, The story is still the same…

æternity Explorer (Latest transaction from my account)

æternity Explorer (Sharing again, The account i am making transactions from…)

Not sharing(Image of the latest transactions failed with 5-10-100m as gas amount on ae studio).

2 Likes

Then let us inspect that transaction:
http://52.10.46.160:3013/v2/transactions/th_2W5ciDgTWU7V2yA1ELcvKs5sHVXTfZaFKey9Ug1aPqM8G8Vung/info

{"call_info":
 {"caller_id":"ak_yTc9dbaM9CYNVfLQLyXvyLGUvKzYzmmac3ehDHCGnZqBw5Bck",
  "caller_nonce":202,
  "contract_id":"ct_VebVgSoKGYhATxr8d1hB7pEBitbUAURsiYKGTqrUdqWmMaVB6",
  "gas_price":1000000000,
  "gas_used":25000,
  "height":508691,
  "log":[],
  "return_type":"error",
  "return_value":
  "cb_Xfbg4g=="}}

So it used 25000 gas - i.e. either you did not change the gas limit, or the gas limit setting in aestudio is broken.

Can we once and for all conclude that the problem is that the contract run out of gas?!

Then there are a couple of interesting questions here:

  • Why isn’t all (or at least the interesting) information (like gas used) shown in the explorer @philipp.chain
  • Why isn’t the tools dry-running failed transactions to show the proper error messages
4 Likes

Understandable & Thank you.

It will be better if things like “inspecting transaction” is also implemented on block explorer as i didn’t knew about the middleware host for testnet.

1 Like

Thats the reason i used pictures…
The log prints that it read the input now not sure that if that input is passed along with the call.

we will improve the general error msg in the SDK regarding out of gas:

AEstudio doesn’t use the custom gas limit currently for the ContractCreateTx:

this is already implemented but the new version of the explorer is not released yet. we will see improvements here very soon.

general information about gas limit and how to handle it is documented here:

1 Like

Yes, and had you posted the transaction instead of a picture it would have been immediately obvious that aestudio was broken. So the picture wasted even more of my time - just as predicted.

Adding some background to my slightly grumpy replies here… I was approached in other channels about this issue already last Friday. I explained “it looks like they run out of gas”.

Now, lot’s of wasted time and lot’s of pretty pictures later it turns out that was exactly the problem :man_shrugging:

1 Like

@VitalJeevanjot next time just provide the tx and/or the tx-hash instead of the pictures :slight_smile:

thanks anyway for pointing this out! only this way the tools can improve :crossed_fingers:

ok, thanx
@hanssv.chain @marco.chain

@hanssv.chain just trying to be descriptive and a suggestion that even you are right from the beginning but just had tried ae-studio yourself would have saved us the time :clock1: as well.

As I already pointed out that It is not easy to find test-net middleware host and gave suggestion to provide transaction inspection through middleware on block explorer (That would have saved even more time :clock1: )

Ae-studio currently don’t post (As you can see from logs) the transaction hash of failed transaction so there was no way of knowing magically that an account can list the transaction on block explorer which is failed (I needed to observe it to figure out).

@nikitafuchs.chain can you investigate this and add this information, too? (tx-hash of failed invocation)

opened another two issues on AEstudio side:

1 Like

thanx.