sui icon indicating copy to clipboard operation
sui copied to clipboard

[Sui Code Bug] 🐞 API method 'suix_getOwnedObjects' returns 504 error (Gateway Time-out) while using filter

Open AlberErre opened this issue 2 years ago • 0 comments

Steps to Reproduce Issue

While trying to execute suix_getOwnedObjects API methods using filter param, a 504 Gateway Time-out error is received.

As long as I can debug, it's a RPC issue, and looks like the filter logic is taking too much time to execute, which triggers a timeout on the RPC server.

You can reproduce this 504 error on this curl 🚨:

curl --location --request POST https://fullnode.testnet.sui.io:443 \
--header 'Content-Type: application/json' \
--data-raw '{"method":"suix_getOwnedObjects","jsonrpc":"2.0","params":["0x063db16b1d044897b193bac9b9acd80ae42b01021e78548bfc67e0fa084bfa81",{"filter":{"StructType":"0xee407524b519235f2ebb523ee6032346c3030d6a9588d0863ac4623d5e8f2624::setup::DeployerCap"},"options":{"showContent":true}},null,null],"id":"1"}'

Surprisingly, I tried to execute this suix_getOwnedObjects API method without this filter, and it responds correctly

Here is the curl without filter ✅:

curl --location --request POST https://fullnode.testnet.sui.io:443 \
--header 'Content-Type: application/json' \
--data-raw '{"method":"suix_getOwnedObjects","jsonrpc":"2.0","params":["0x063db16b1d044897b193bac9b9acd80ae42b01021e78548bfc67e0fa084bfa81",{"options":{"showContent":true}},null,null],"id":"1"}'

Expected Result

It's expected to obtain the results (ObjectsPage) correctly, without a 504 Gateway Time-out error.

Actual Result

a 504 Gateway Time-out error is received by calling the suix_getOwnedObjects API method while adding a filter param.

System Information

  • OS: MacOS Big Sur
  • Compiler: sui 0.32.1-133fd85bc

AlberErre avatar Apr 23 '23 13:04 AlberErre