Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Update VM #932

Merged
merged 1 commit into from
Apr 17, 2019
Merged

Update VM #932

merged 1 commit into from
Apr 17, 2019

Conversation

ixje
Copy link
Member

@ixje ixje commented Apr 17, 2019

What current issue(s) does this address, or what feature is it adding?

How did you solve this problem?

How did you make sure your solution works?

  • for the VM update I ran the newer JSON test files + make test
  • for the VM memory leak I ran this test before and after fixing and confirmed the memory usage now stays low
import unittest
import binascii
from neo.VM.ExecutionEngine import ExecutionEngine
from neo.VM import InteropService
from neo.Core.Cryptography.Crypto import Crypto
from pympler.tracker import SummaryTracker


class VMLeak(unittest.TestCase):
    def test_vm_context_leak(self):
        service = InteropService.InteropService()
        script_container = None
        script_table = None
        tracker = SummaryTracker()
        for _ in range(10000):
            engine = ExecutionEngine(crypto=Crypto.Default(), service=service, container=script_container, table=script_table, exit_on_error=True)
            script_data = binascii.unhexlify('00C57655C86B00C5766AC86A56C86C')
            engine.LoadScript(script_data)
            engine.Execute()
        tracker.print_diff()

Are there any special changes in the code that we should be aware of?

Please check the following, if applicable:

  • Did you add any tests?
  • Did you run make lint?
  • Did you run make test?
  • Are you making a PR to a feature branch or development rather than master?
  • Did you add an entry to CHANGELOG.rst? (if not, please do)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 86.908% when pulling eedb575 on ixje:vm-update into 56a4240 on CityOfZion:development.

@ixje ixje merged commit 5c5a2e1 into CityOfZion:development Apr 17, 2019
@ixje ixje deleted the vm-update branch April 17, 2019 15:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants