its done because if it receives bad data, it gives the node that sent it a score and if the score reaches a certain level the node bans the malicious node
Hm? From a 30 second look at the code, I don't think it actually does record the node that gave it a transaction. As in, a mapping from transaction to the peer that gave it.
I'm not sure how blockcypher and blockchain.com do it, or why they think this stat is useful to add anyway. Are they connected to what, 1000 peers?
blockcypher is connected to a pretty significant portion of the network, actually. A couple years ago, I searched for bitcoin transactions it believed were first relayed by my node. Can't remember the exact stat, but it probably had the majority of transactions that I actually made, and quite a lot of false positive's too. [Ever since then, I wrote a small hacky patch to core to increase privacy of transactions that were coming from my node by only sending to a random single outbound peer and then sleeping until it ends up fully propagated]