py-evm
py-evm copied to clipboard
fix: make KeyMapDB deep-copiable
What was wrong?
KeyMapDB would segfault on deepcopy, due to recursion in __getattr__
How was it fixed?
Todo:
-
[ ] Clean up commit history
-
[ ] Add or update documentation related to these changes
-
[ ] Add entry to the release notes
Cute Animal Picture
Sorry we never responded to this one. Do you have a way we can reproduce or do you mind writing a test case?
sure, you can reproduce just by creating an instance of KeyMapDB and trying to copy it.
In [1]: from eth.db.backends.memory import MemoryDB
In [2]: from eth.db.hash_trie import HashTrie
In [3]: t = HashTrie(MemoryDB({}))
In [4]: import copy
In [5]: copy.copy(t)
Segmentation fault (core dumped)
i'm guessing that KeyMapDB.__getattr__ is never actually used, otherwise the segfault would have been noticed before