2
As in the title - I understand that nodes look at the last two weeks of calculated hashes and adjust the difficulty to bring the average time to 10 minutes. But how exactly is this done?
In particular, all the nodes would have to agree on the same target, else a newly mined block would be valid for some nodes and not others. This seems like a problem of consensus (in the traditional sense, not the Bitcoin way) which is very difficult, isn't it?