MystenLabs / sui

Sui, a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language
https://sui.io
Apache License 2.0
5.97k stars 11.09k forks source link

Node JsonRPC `sui_executeTransactionBlock` got error response when omitted optional parameters #17666

Open Ljzn opened 4 months ago

Ljzn commented 4 months ago

Hello, SUI team. Today I broadcasted transaction with sui_executeTransactionBlock on my SUI node, got this error:

{
  "error":{
    "code":-32602,
    "message":"invalid type: string \"IP_ADDRESS_HIDDEN:37122\", expected struct SuiTransactionBlockResponseOptions at line 1 column 20"
  },
  "id":1,
  "jsonrpc":"2.0"
}

Should I upgrade my node?


It can be reproduced with this curl command:

curl -v -H "Content-Type: application/json" -d '{"id":1,"params":["AAACAAgAhNcXAAAAAAAgDlE5UxzI//0eAMPsZwG6aaH6dOpcQv0cU9LS6RkkWzgCAgABAQAAAQEDAAAAAAEBAMZACk2KlfimV6aRkKjqCUBjJiMgjceCMMBh+3gapTOOAY4KNVjfSMQyOrwYfhJcB1mzKDh36oXjdbKvQMBLf0NT2Um8BAAAAAAg+c+/kcfO5bRJ6hd4KOtDIk+lY28jPqnxcTxhbsJ4UH/GQApNipX4plemkZCo6glAYyYjII3HgjDAYft4GqUzju4CAAAAAAAAgI1bAAAAAAAA",["AJ8iPcybhsk+g0QkVI+/XjWHK+i6wzwNSxHHTyB0nOow8kzA6tN4+owxL2k3lvLBOuCn8Fdz/2chbLhe8t0V9w/LwM84jKi1T1jFXHrNAdHIYJKqWuzFgBXR3IfYMnmg7w=="]],"method":"sui_executeTransactionBlock","jsonrpc":"2.0"}' "https://fullnode.mainnet.sui.io/" -X POST ;
Ljzn commented 4 months ago

It seems a bug of interface when Gas Price in that TX is too low.

I tried with all 4 parameters of that method (the last 2 parameters are optional):

curl -v -H "Content-Type: application/json" -d '{"id":1,"params":["AAACAAgAhNcXAAAAAAAgDlE5UxzI//0eAMPsZwG6aaH6dOpcQv0cU9LS6RkkWzgCAgABAQAAAQEDAAAAAAEBAMZACk2KlfimV6aRkKjqCUBjJiMgjceCMMBh+3gapTOOAY4KNVjfSMQyOrwYfhJcB1mzKDh36oXjdbKvQMBLf0NT2Um8BAAAAAAg+c+/kcfO5bRJ6hd4KOtDIk+lY28jPqnxcTxhbsJ4UH/GQApNipX4plemkZCo6glAYyYjII3HgjDAYft4GqUzju4CAAAAAAAAgI1bAAAAAAAA",["AJ8iPcybhsk+g0QkVI+/XjWHK+i6wzwNSxHHTyB0nOow8kzA6tN4+owxL2k3lvLBOuCn8Fdz/2chbLhe8t0V9w/LwM84jKi1T1jFXHrNAdHIYJKqWuzFgBXR3IfYMnmg7w=="], {}, "WaitForLocalExecution"],"method":"sui_executeTransactionBlock","jsonrpc":"2.0"}' "https://fullnode.mainnet.sui.io/" -X POST ;

got the Gas Price too low error:

{"jsonrpc":"2.0","error":{"code":-32002,"message":"Transaction execution failed due to issues with transaction inputs, please review the errors and try again: Gas price 750 under reference gas price (RGP) 751."},"id":1}

So the the bug looks like happening when requesting sui_executeTransactionBlock with only 2 or 3 parameters, and the gas price is too low.

Ljzn commented 4 months ago

update: I tried that jsonRPC method with a new TX has higher gas price (751), and only 2 parameters, still get error:

"invalid type: string \"130.211.2.78:49714\", expected struct SuiTransactionBlockResponseOptions at line 1 column 20"

It succeed with all 4 parameters.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.