Skip to content

Conversation

BrianBland
Copy link
Collaborator

@BrianBland BrianBland commented Jul 25, 2025

Adds the ability to compute the state root with state diffs overlayed on top of the persistent db. This allows for rapid, stateless incremental root calculation via a RO transaction.

Performs iterative depth first search traversal using a stack. Adds all known leaves and branch hashes in lexicographic order to a HashBuilder, which also collects the set of known branch updates along the way. These known branch updates/hashes can then be used in a future incremental state root calculation, in order to avoid recomputing all leaf-level hashes.

Adds an OverlayState struct which supports minimal-overhead subslicing and cloning by holding the underlying data within an Arc. This defines not only a set of Account and Storage value updates (Some for upsert, None for deletion), but also may include known intermediate Hashes with shorter paths (not a multiple of 64 nibbles). When a Hash is encountered in the overlay root calculation traversal, this is assumed to be authoritative, bypassing traversal of all children.

Accounts in the overlay do not override the state root of the matching persisted account, if one exists.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jul 25, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch 2 times, most recently from e114fd6 to e2ea3ad Compare July 29, 2025 19:35
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from e3e202b to 000e22b Compare August 8, 2025 01:17
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from 000e22b to aaa2842 Compare August 15, 2025 23:05
@BrianBland BrianBland changed the title [WIP] Support computing state root with overlayed state Support computing state root with overlayed state Aug 15, 2025
@BrianBland BrianBland marked this pull request as ready for review August 15, 2025 23:47
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from 1931a50 to 4cecc8c Compare August 15, 2025 23:54
@BrianBland BrianBland requested review from jjtny1 and and-cb August 15, 2025 23:59
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from 967be05 to c0c602e Compare August 19, 2025 15:56
@cb-heimdall
Copy link
Collaborator

Review Error for and-cb @ 2025-08-20 20:07:10 UTC
User failed mfa authentication, either user does not exist or public email is not set on your github profile. \ see go/mfa-help

@BrianBland BrianBland requested a review from and-cb August 20, 2025 23:32
@cb-heimdall
Copy link
Collaborator

Review Error for and-cb @ 2025-08-21 01:27:48 UTC
User failed mfa authentication, either user does not exist or public email is not set on your github profile. \ see go/mfa-help

@and-cb and-cb self-requested a review August 21, 2025 16:33
@cb-heimdall
Copy link
Collaborator

Review Error for and-cb @ 2025-08-21 16:34:06 UTC
User failed mfa authentication, either user does not exist or public email is not set on your github profile. \ see go/mfa-help

@and-cb and-cb self-requested a review August 21, 2025 16:36
@cb-heimdall
Copy link
Collaborator

Review Error for and-cb @ 2025-08-21 16:37:40 UTC
User failed mfa authentication, either user does not exist or public email is not set on your github profile. \ see go/mfa-help

@BrianBland BrianBland requested a review from and-cb August 21, 2025 16:50
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from a521652 to 5267333 Compare August 22, 2025 01:23
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from 5267333 to 57565f1 Compare August 22, 2025 17:30
@BrianBland BrianBland requested review from and-cb and removed request for and-cb August 22, 2025 20:59
@BrianBland BrianBland force-pushed the brianbland/overlay-state-root branch from 57565f1 to 0501a67 Compare August 22, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants