AccountsDB v2 supports Solana's fork-based execution model. When performing a query, the ancestors set defines which slots are visible. The lookup follows this priority:
- Unrooted Storage: Searched first for the most recent version of the account within the ancestor set.
- Rooted Storage: If not found in unrooted storage, the system checks the persistent SQLite storage.
- Deleted Accounts: Zero-lamport accounts are treated as deleted and return
null.
Example Scenario:
If a query is made for slot 6 with ancestors {1, 3, 6}:
- It returns the slot 6 version if modified there.
- If not, it returns the slot 3 version if modified there.
- If not, it returns the slot 1 version from rooted storage.
- It will not see modifications from slots 2, 4, or 5, as they are not in the ancestor set.