-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SIMD-0220: Snapshots use Accounts Lattice Hash
- Loading branch information
1 parent
781cfdd
commit 75f4c7c
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
simd: '0220' | ||
title: Snapshots use Accounts Lattice Hash | ||
authors: | ||
- Brooks Prumo | ||
category: Standard | ||
type: Core | ||
status: Review | ||
created: 2025-01-08 | ||
feature: LTsNAP8h1voEVVToMNBNqoiNQex4aqfUrbFhRH3mSQ2 | ||
development: | ||
- Agave: Implemented (v2.2.0) | ||
--- | ||
|
||
## Summary | ||
|
||
Use the **Accounts Lattice Hash** as the **Snapshot Hash**, which enables | ||
removing the merkle-based accounts hash calculation. | ||
|
||
|
||
## Motivation | ||
|
||
This SIMD follows on from SIMD-215, and shares its motivation: | ||
|
||
> The main goal is to scale Solana to billions accounts | ||
When snapshots are taken, they contain a **Snapshot Hash**. This hash is | ||
based on the merkle-based hash of the total account state. As established in | ||
SIMD-215, this merkle-based hashing of all accounts hinders scaling. And since | ||
SIMD-215 added the **Accounts Lattice Hash**, which is a hash of the total | ||
account state, the merkle-based hash of all accounts used in the current | ||
**Snapshot Hash** is redundant work. The **Snapshot Hash** can be updated to | ||
use the **Accounts Lattice Hash** instead. | ||
|
||
|
||
## New Terminology | ||
|
||
None. | ||
|
||
|
||
## Detailed Design | ||
|
||
When constructing the **Snapshot Hash**, the merkle-based hash of all accounts | ||
will be replaced by the **Accounts Lattice Hash**. And since SIMD-215 removes | ||
the **Epoch Accounts Hash**, the **Snapshot Hash** becomes: | ||
|
||
``` | ||
snapshot_hash := accounts_lattice_hash.out() | ||
``` | ||
|
||
Specifically, the **Snapshot Hash** for slot `S` is the 32-byte blake3 of the | ||
**Accounts Lattice Hash** at slot `S`. | ||
|
||
Note that SIMD-215 is a prerequisite for this SIMD. | ||
|
||
|
||
## Alternatives Considered | ||
|
||
None. | ||
|
||
|
||
## Impact | ||
|
||
Only validators will be impacted, and their performance will improve since the | ||
merkle-based hashing of all accounts will no longer be performed. | ||
|
||
|
||
## Security Considerations | ||
|
||
None. | ||
|
||
|
||
## Backwards Compatibility | ||
|
||
Snapshots will have a new hash, so consumers of snapshots will need to know | ||
which method to use for hash validation. |