Where are the treestates stored?
In other words, when a JoinSplit transaction is being validated, where is the anchor being checked?
A look at https://github.com/zcash/zcash/blob/master/src/primitives/block.h brings me to conclude that the commitments (i.e., notes) merkle-tree is not stored in the block-header.
Is it in a LevelDB database?
What is the data-structure it uses for storing the mapping of trees roots for blocks?
Any answer with a specific reference to code will be very appreciated.