p2p in miner for broadcast + fix serialization of messages