How a lot time does Bitcoin Core retailer details about forks?
Ceaselessly. When pruning is enabled, after a while block information is deleted no matter whether or not it is in the primary chain or not.
Observe nonetheless that Bitcoin Core will solely obtain and retailer blocks alongside chains which, in some unspecified time in the future, have the potential to grow to be the very best identified chain. If somebody declares headers to you of a fork, however these headers wouldn’t have sufficient mixed proof-of-work to beat the chain you have already got, its blocks is not going to be downloaded. Particularly, which means that throughout preliminary synchronization you’ll typically not see any forks.
And what sort of data does it retailer?
Block headers are saved without end. Block information is saved till it’s pruned (if that’s enabled, without end in any other case). The UTXO set and mempool are solely maintained for the present time, on the tip. If a reorg occurs, the consequences of the currently-active chain are rewinded, and the consequences of the brand new chain are utilized, to each the UTXO set and mempool.