[Neo VM Bug]Fix negative counter issue
Description
This pr fixes the negative reference counter issue.
Fixes # https://github.com/neo-project/neo/pull/3301#discussion_r1631306729
Type of change
- [ ] Optimization (the change is only an optimization)
- [ ] Style (the change is only a code style for better maintenance or standard purpose)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How Has This Been Tested?
- [x] TestNegativeReferenceCounter
Test Configuration:
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
I prefer an exception instead of a denial of service, but this will be solved using memory instead of reference counter https://github.com/neo-project/neo-vm/issues/202
@shargon is a good point, should we catch this exception in vm and fault the execution?
I prefer an exception instead of a denial of service, but this will be solved using memory instead of reference counter https://github.com/neo-project/neo-vm/issues/202
@shargon is a good point, should we catch this exception in vm and fault the execution?
With this patch it will fault, isn't it?
I prefer an exception instead of a denial of service, but this will be solved using memory instead of reference counter neo-project/neo-vm#202
@shargon is a good point, should we catch this exception in vm and fault the execution?
With this patch it will fault, isn't it?
Surely it will, checked, its captured and faulted.
I agree with @AnnaShaleva
We should fix the root of the problem, not the consequence of it. To me, it should be a denial of service in case of negative reference counter, not the FAULTed transaction.
I agree with @AnnaShaleva
@vang1ong7ang, do you think we need to stop the node explicitly in case of negative reference counter?
do you think we need to stop the node explicitly in case of negative reference counter?
OK, I see, Jimmy has created another PR for that.
@vang1ong7ang, do you think we need to stop the node explicitly in case of negative reference counter?
@AnnaShaleva yes if it happens i suggest to killall