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

Generic P2P tests as JSON documents

Open pipermerriam opened this issue 8 years ago • 1 comments

What is wrong?

It would be nice to have a test suite for our p2p code that was generic in some of the ways that the JSON-fixture tests are for the vm.

How can it be done

It seems like we should be able to come up with a JSON document which defined the setup of the network, and then a sequence of operations to be performed by the nodes on the network, and then an end state that we expect the network to resolve to.

This is tangentially related to a need for a generic simulation framework which I think the beginnings of already exist. However, I think we need to start zeroing in on how we make some of these things generic so that we can work towards a generic simulation runner that can run any of our defined network conditions. This pattern seems common in some of the other codebases and if done well, it should pay off in lower testing overhead going forward.

I'm currently not familiar enough with the innards to know exactly what this should look like but hoping to dig in soon.

pipermerriam avatar Nov 06 '17 15:11 pipermerriam

That's definitely a worthwhile goal, and since it'd probably involve spawning multiple processes to simulate various peers, I imagine we could benefit from using hive

gsalgado avatar Nov 06 '17 16:11 gsalgado