Where is the code responsible for validating that transactions in an incoming block do not double-spend funds?

Specifically, I am interested in how we handle forks in the blockchain at some point in the past. Does a validator need to keep the account-balance state at each non-finalized height?

A quick search through the code base brought up the ConfirmedBlock and VersionedConfirmedBlock types, but these seem to be structures that are read rather than validated. Would appreciate if someone could point me in the direction where block/transaction validation takes place.

Many thanks!

Hi @roybenabraham and welcome to the forum! :wave:

I’m not sure, but this sounds like a question that a dev on the Solana Discord would know.