MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.85k stars 839 forks source link

Remove the need of reflection of p2p message (de)serialization #1195

Closed lontivero closed 5 months ago

lontivero commented 6 months ago

Reflection makes code stripping impossible and that's an impediment for fully supporting AOT.

This PR is a first step in the removal of reflection and here we start from removing it from the peer-to-peer message serialization/deserialization.

Note: sorry for the eol change in NBitcoin/Protocol/Payloads/AddrPayload.cs, the truth is that NBitcoin has a problem of inconsistency where half of the files are CRLF while the other half are LF so, it is always painful for any contributor.

lontivero commented 6 months ago

Ping @NicolasDorier

lontivero commented 6 months ago

I reordered the messages based on my experience but I have no numbers to tell me which messages are more frequent.