As far as I know, to prevent double-spend attack and to confirm that a specific transaction is valid, miners have to go through all blocks in the blockchain and check the sender's history of transactions. until now, the blockchain has over 700,000 blocks. Isn't it computationally hard for miners as the blockchain grows?
Bitcoin nodes keep track of what's called the UTXO set – the set of all unspent transaction outputs. Every valid transaction must only spend existing and not previously spent outputs, so this is enough to prevent double-spending. The UTXO set can also be stored in a way to allow efficient (constant-time) lookups, so verifying transactions doesn't require more computing power as the UTXO set grows.