wrote p2p-fetch logic