py-evm
py-evm copied to clipboard
Explore usage of pyrsistent library
What is wrong?
We favor immutable datastructures over mutable ones. Working with immutable datastructures can be more pleasant with the pyrsistent library that provides out of the box datastructures with convenient APIs to create objects.
There are at least places within Clique Consensus that could benefit from using it.
https://github.com/ethereum/py-evm/blob/3c3fd7e114937faa98c6102d0c838124a7afe179/eth/consensus/clique/datatypes.py#L77-L98
How can it be fixed
-
Explore which areas of the code could benefit from that library
-
Refactor those areas to use immutable datatypes from pyrsistent