Skip to content

Implement read and commit functionality in PartialTrieDb#2205

Draft
goodlyrottenapple wants to merge 1 commit intosam/partial_trie_dbfrom
sam/partial_trie_db_2
Draft

Implement read and commit functionality in PartialTrieDb#2205
goodlyrottenapple wants to merge 1 commit intosam/partial_trie_dbfrom
sam/partial_trie_db_2

Conversation

@goodlyrottenapple
Copy link
Copy Markdown
Contributor

No description provided.

// read_account / read_storage on the PartialTrieDb and compared.
//
// Returns true if verification passes.
bool verify_witness(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is only for debugging and shouldn't be called in CI, but might nonetheless be useful to keep behind a flag for diagnosing witness mismatches.

/// Like read_account, but returns std::nullopt (outer) when the lookup
/// hits an unresolved HashStub.
std::optional<std::optional<Account>>
read_account_maybe(Address const &addr);
Copy link
Copy Markdown
Contributor Author

@goodlyrottenapple goodlyrottenapple Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method, together with read_storage_maybe, are only needed for debug and should not be called in zkvm execution. They are used in verify_witness. If we decide to drop that method, we should remove these too.

@goodlyrottenapple goodlyrottenapple force-pushed the sam/partial_trie_db branch 3 times, most recently from f8dc4ee to 27e8e93 Compare April 16, 2026 10:19
@dhil dhil self-requested a review April 16, 2026 16:49
@goodlyrottenapple goodlyrottenapple force-pushed the sam/partial_trie_db branch 2 times, most recently from 0c17d70 to f49ba87 Compare April 17, 2026 12:39
@Baltoli Baltoli force-pushed the sam/partial_trie_db branch from 90b42cc to ff24ec2 Compare April 20, 2026 14:03
@goodlyrottenapple goodlyrottenapple force-pushed the sam/partial_trie_db branch 2 times, most recently from f4a3813 to d1e6f74 Compare April 20, 2026 15:34
@Baltoli Baltoli force-pushed the sam/partial_trie_db branch from d1e6f74 to 0690f9f Compare April 20, 2026 18:42
@goodlyrottenapple goodlyrottenapple force-pushed the sam/partial_trie_db branch 2 times, most recently from 40c9f98 to 6d36b9a Compare April 21, 2026 12:45
Co-Authored-By: Claude Sonnet 4.7 <noreply@anthropic.com>
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.

1 participant