disallowing _all_ earlier timestamps (ie. taking median timestamp of 1 block), since it opens up another rather nasty vulnerability if you fix it that way.
Interesting. Can you tell more?
Another question; Currently it does not allow block timestamp <= median time.. ie eventually the timestamp has to increase. Is there any reason for that, so could it be < mediantime, which would allow same timestamps?
Re the first question, if you disallow all earlier timestamps - what happens when I start mining and publishing blocks with timestamps 2 hours ahead? I now have another 2 hours in which to mine the next one - during this time, no honest nodes can mine (_no_ earlier timestamps than my block are considered valid), and as soon as the timestamp for my most recent DoS block rolls by, I have another one ready and mined (I have 2 hours to prepare it) to publish, so I can keep denying the rest of the network service while I mine the chain with the most work in it, even though I don't have much hashrate.
For example, if your chain has 1 minute blocks, but I have 2 hours in which to mine my next DoS block, I need less than 1% of the hashrate to do it.
What about if we take the median of the past 3 blocks as the lowest acceptable timestamp?
Now:
1. Attacker mines a block (with a timestamp 2 hour in future). Consider this a random occurence, and evaluate probabilities _after_ this happens, because the attacker is going to keep getting blocks randomly, and each time he gets one, he gets an opportunity.
Currently, honest nodes can mine - 2 of the last 3 blocks have "normal" timestamps, so the median is low enough that everyone can mine. Our attacker needs to accomplish (2).
2. Attacker mines a second block with a timestamp 2 hours in the future. His chance to do this before the rest of the network (once (1) has already occured) is exactly his proportion of nethash.
For example, an attacker with 10% of nethash, on a chain with 1 minute blocks, achieves (1) every 10 minutes, and once in every 10 times he does (1) he manages to do (2). Ie. he can DoS the network every 100 minutes on average.
But once he's managed to achieve (2), he can keep doing it, even with very little hashrate, because the mainnet can't mine anything, or rather all their efforts are wasted - all their blocks with honest timestamps are invalid, so the attacker can keep mining blocks with timestamps that will be valid when he releases them, while everyone else keeps trying to mine blocks with timestamps that won't be valid. Immediately the most recent DoS block timestamp rolls around, our mainnet should, on average, take another minute to get a block with a valid timestamp and break the cycle, yet our attacker is ready to release his pre-prepared block right away, before they get a chance to do so.
In fact, it gets worse, because once he has 3 in a row, the honest nodes now need to mine 2 valid timestamped blocks in a row in order to unfreeze the network. Good luck doing that with our attacker continually releasing his pre-prepared blocks. You'd either have to fix the problem and roll the whole chain back, or get the honest miners also trying to generate timestamps immediately after the most recent DoS block (eg. the honest nodes intentionally generating future timestamps) which would turn it back to a 51% attack.
Note that our attacker can not only deny mining to the honest nodes, he can also achieve the chain with the highest total work, without needing a majority of the hashrate to do it, because he can keep working whilst stopping everyone else from doing so.
So, the median of 3 blocks alone isn't the fix, since on chains with short blocktimes the 2 hour window in the future where blocks are accepted as valid is also an issue.
I actually suspect the 11 block median isn't random or any kind of arbitrary choice, and that Satoshi made it that way for a reason. If our attacker has to get 6 future timestamped blocks in a series of 11, rather than just 2 out of 3, his job of beginning the attack is much harder.
About your second question, I haven't considered why that is. Maybe it's related - it's interesting, and I'll ponder it.