Lets say we eventually introduce a way for the user to construct their own block tree entries. Would two such entries be equal if they have a bunch of different values in their fields, but point to the same block?
I’m not sure what that would mean conceptually. If we’re using the block tree to store validation status as we do now, that would mean we’d let the user define conflicting validation states about a block in the same index?
My conceptual understanding of a BlockTreeEntry is that it’s just an iterator into a block tree to efficiently let us look up information (e.g. serialized bytes, validation information, …) about that block, that wouldn’t be possible with e.g. just a block hash. The fact that CBlockIndex currently embeds, rather than lets us look up, some of that information (e.g. nStatus) seems like an implementation detail that we should not expose in the kernel API? If we then want to allow multiple validation states for the same block, the user could create multiple “validation trees” and use the same BlockTreeEntry to query or create validation information across those validation trees?
So yes, it seems to me like BlockTreeEntry should be equal when they refer to the same block.