1
Looking at the source code of bitcoin core, the serialization part, I see that there's no serialization abstraction layer that accounts for a possible different endianness or different binary layouts on different machines.
This is not only for disk serialization, but also for network serialization.
If bitcoin core was used on a big-endian machine, or a machine with int size not equal to 32-bit, it'll fail to connect to the network because all sizes will be incorrectly interpreted and values will be different.
Am I missing something or did I arrive at the correct conclusion?
The byteswap has been addressed in MCCCS's answer (it's done by
htole16and the like). For the word size, can you explain specifically what you think is wrong? That code appears, at first glance, to make proper use of theuintNN_ttypes. – Nate Eldredge – 2018-12-14T17:27:13.080@NateEldredge Many of the data structures being serialized use int/long/short/..., and serialize those directly. The serialization code per se does the right thing, but the data being serialized wouldn't. – Pieter Wuille – 2018-12-14T19:56:06.693