I know that ASIC BOOST exploits the fact that the blockheaders are not a multiple of 64 bytes, but what is the change in Segwit that prevents this? Are they always a multiple of 64 bytes now for example?
There's 2 versions of ASICBOOST:
- Overt where miners use bits in the version number as extra nonce space
- Covert where miners "mine" merkle trees with 4 bytes collisions
The overt version is very easily detectable, whereas the covert one isn't.
To mine these merkle trees for the overt version, miners need to shuffle the transactions in the block.
Without Segwit transactions in a block, it is possible to do it in a very low number of SHA-256 operations ; with Segwit transactions, a change of order forces miners to recompute the witness commitment which is stored in the coinbase. That makes it way more expensive to mine merkle trees and destroys the advantage covert ASICBOOST provides.
You can find a detailed explanation here.