mintlayer-core
mintlayer-core copied to clipboard
Raw protocol tests for p2p
(Created on Aug 25, 2023 by @ImplOfAnImpl)
Currently, the "binary protocol" is specified via a number of serializable structs that are scattered all over the code base. E.g. Locator from chainstate, SemVer from common::primitives, SignedTransaction, SignedBlockHeader and Block from common::chain are all parts of the protocol; if any of those structs or one of their parts is modified in any way (without upping the protocol version), the protocol compatibility will be broken.
To prevent this, it'd be nice to have "raw protocol" tests, which wouldn't re-use any existing structs, but instead construct messages "by hand". (Note: it might be a good idea to implement them in the form of a test node in a different language, e.g. Python).