py-evm icon indicating copy to clipboard operation
py-evm copied to clipboard

Explore usage of pyrsistent library

Open cburgdorf opened this issue 6 years ago • 0 comments

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

  1. Explore which areas of the code could benefit from that library

  2. Refactor those areas to use immutable datatypes from pyrsistent

cburgdorf avatar Nov 04 '19 12:11 cburgdorf