It is a part of the consensus layer. The btcd bug happened because they were checking a segwit v0 rule against all txs at the network layer when they shouldn't have been