-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Handle https://github.com/neo-project/neo/issues/2528 #3520
base: master
Are you sure you want to change the base?
Conversation
In Neo.VM.Benchmark my time cost for NeoIssue2528 was reduced from 3.81s to 0.146s. |
And here's another script that bullies the GC even with the fix in this PR. |
|
This require a hardfork |
I think it does not require a hardfork. It's just trying to skip Tarjan to save time. |
not sure, maybe there are cases where checkZeroRef FAULT the execution |
By the way, replacing UNPACK PACK with NEWARRAY0 DROP does not make a DoS, because the new empty array is not added to tracked_item successfully in |
If you remove the linq expression. That would increase performance dramatically |
Its just affect when and how often the GC will be triggered, no hardfork is required. |
I think that's not true @Jim8y.
If ReferenceCounter.Count now is equal, GC is not triggered, before it may have been triggered with a FAULT result. So maybe now it's |
Yeah, it can be tricky the way GC works, no guarantees that execution result is the same. |
Can we remove the linq expression instead of using |
Maybe it's possible to let each compound item remember a hashset of its subitems on stack. I'm not 100% sure for now. |
But will GC change the result? isn't it just reconstruct the RC? it will reducing, instead of increasing the RC, so if it is not fault, it will not fault by GC from what i understand. @shargon @roman-khimov |
Reduce the checks, but it was increased before, in all the pushes |
Description
If we use
<
instead of<=
, there is always possibility to bully the GC.Fixes #2528
VwEAwkpKAfsHdwARwG8AnXcAbwAl9////xHAzwJwlAAAdwAQzm8AnXcAbwAl9////0U=
Type of change
How Has This Been Tested?
invoke script
VwEAwkpKAfsHdwARwG8AnXcAbwAl9////xHAzwJwlAAAdwAQzm8AnXcAbwAl9////0U=
Checklist: