In eos, there's controller->head_block_id() internally, but can i get it in a smart contract?
Not at this moment. Maybe in the future. However controller->head_block_id() will return the id of previous block, as the current block is not produced yet.
Head block changes constantly. It can not be exposed to contracts, as the results would be nondeterministic.
Most helpful comment
Head block changes constantly. It can not be exposed to contracts, as the results would be nondeterministic.