Json-RPC behaves incorrecly and testnet setup

I have a couple questions regarding the JSON-RPC and command line tools (I highlighted my concrete questions using bold markup).

derohe Release66

Why is it that my daemon (connected to a miner) in testnet only mines miniblocks at one topoheight endlessly? When restarting the miner and the daemon it instantly mines at the next height.
This makes it impossible for me to register new accounts needed to test smart contracts.
Is that a temporary issue or am I doing something wrong here?

derohe Release62

On this version registering new accounts works fine, but the daemon JSON-RPC handles getsc requests incorrectly (I guess):

I am using the stargate RPC documentation, please correct me if that is not the right API.

When requesting multiple keys using the "keysstring" parameter, the response always only contains the value of the last key requested.
Eg. request body:

{
	"id": "1",
	"method": "getsc",
	"jsonrpc": "2.0",
	"params": {
		"scid": "my_scid",
		"variables": false,
		"code": false,
		"keysstring": ["key_1", "key_2"]
	}
}

response:

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "valuesstring": [
      "value_of_key_2"
    ],
    "balance": 0,
    "code": "",
    "status": "OK"
  }
}

In the source code it uses Golang’s append() function, so this should not happen, eh???

Sadly, this makes the JSON-RPC unusable to efficiently obtain smart contract variables.

Should I file an issue for that over on github?

I am aware that I could obtain all the key-value pairs using the parameter "variables": true, but that seems to be highly inefficient because my use case is fetching few keys often.

If this method is not inefficient because of some graviton-magic, please let me know and I’ll base my project on that.

apparent smart contract size limit

I could not find any information on whether there actually is a size limit for smart contracts (in testnet).
I have a smart contract that is ca. 19.17kb.
I ensured that it is correct and parseable. However, when adding an arbitrary (correct) line, it won’t be accepted by the daemon. The code can be seen using the explorer (SC Arguments: [...]). The explorer does not show any values, neither does it list the code in a structured way. The smart contract does not contain any values (Initialize() is not called) and cannot be invoked.

All this does not happen when staying below ca. 19.17kb smart contract size.
I have enough unlocked funds in my testnet wallet.

What is my problem here and is there a limit to a smart contract’s size?

I hope this is the right place to ask for help.
If it is not, please direct me to the correct place.
I can still only use 2 links in this post, feel free to ask for clarifications.

Regarding your first version questions, please use version 73 (just recently released) for testing. You should also be seeing now an error message in the daemon if you’re running a private testnet and no additional peers:

RROR   we want to broadcast block, but donot have peers, most possibly block will go stale

In previous version 66, it was observed similar to your description but adding 1 or more peers modified the results and allowed it to work as expected.

1 Like

regarding your get_sc call, try this, again, in version 73. I cannot seem to replicate your issues as I’m getting back the correct values however please check again to be certain.

1 Like

regarding the SC size, 20kb limit:

Config max limit:

Set max storage limit:

Error / fail out if reached:

2 Likes