Skip to content

Conversation

@meyer9
Copy link
Collaborator

@meyer9 meyer9 commented Sep 25, 2025

Fixes #177

I added a few methods that should allow atomically pruning and reorging blocks. Each function should represent a single transaction. We can store trie nodes, reorg, prune in a single transaction now. I kept the bulk insert methods available for storing the current state.

@github-actions github-actions bot added the W-historical-proofs Workstream: historical-proofs label Sep 25, 2025
@meyer9 meyer9 force-pushed the meyer9/165-add-empty-exex-crate branch from a24510a to e1801e2 Compare September 25, 2025 21:01
@meyer9 meyer9 force-pushed the meyer9/166-finalize-storage-interface branch from 691fff9 to 9dc8078 Compare September 25, 2025 21:01
@meyer9 meyer9 force-pushed the meyer9/165-add-empty-exex-crate branch from e1801e2 to d728795 Compare September 25, 2025 21:03
@meyer9 meyer9 force-pushed the meyer9/166-finalize-storage-interface branch 4 times, most recently from 6089737 to 3e311c7 Compare September 26, 2025 15:19
@meyer9 meyer9 marked this pull request as ready for review September 26, 2025 15:19
@meyer9 meyer9 linked an issue Sep 26, 2025 that may be closed by this pull request
@meyer9 meyer9 force-pushed the meyer9/166-finalize-storage-interface branch 2 times, most recently from 5ef8999 to 84c813c Compare September 29, 2025 16:13
@meyer9 meyer9 force-pushed the meyer9/165-add-empty-exex-crate branch from d728795 to b5d8c02 Compare September 29, 2025 16:13
Base automatically changed from meyer9/165-add-empty-exex-crate to unstable September 30, 2025 10:29
Copilot AI review requested due to automatic review settings October 8, 2025 15:45
@meyer9 meyer9 force-pushed the meyer9/166-finalize-storage-interface branch from 84c813c to 9ca3987 Compare October 8, 2025 15:45
@wiz-b4c72f16a4
Copy link

wiz-b4c72f16a4 bot commented Oct 8, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a storage interface with pruning and reorganization methods to support external proof generation. The interface defines traits for cursor-based operations and atomic storage transactions.

  • Adds comprehensive storage traits for external proof data management
  • Implements cursor-based iteration for trie nodes and hashed entries
  • Provides atomic methods for pruning, reorganization, and bulk operations

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/exex/external-proofs/src/storage.rs New storage interface with traits for cursors and external storage operations
crates/exex/external-proofs/src/lib.rs Adds storage module declaration
crates/exex/external-proofs/Cargo.toml Adds required dependencies for the storage interface

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

leaves_diff: HashedPostState,
) -> ExternalStorageResult<()>;

/// Deletes all updates > `latest_common_block_number` and
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Incomplete documentation comment. The comment ends with 'and' but doesn't specify what happens after deletion.

Suggested change
/// Deletes all updates > `latest_common_block_number` and
/// Deletes all updates greater than `latest_common_block_number` and replaces them by adding the provided `blocks_to_add`.

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 12
pub enum ExternalStorageError {
Other(eyre::Error),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use thiserror for easier error definition?

Suggested change
pub enum ExternalStorageError {
Other(eyre::Error),
}
#[derive(Debug, Error)]
pub enum ExternalStorageError {
#[error("Other error: {0}")]
Other(eyre::Error),
}

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

lgtm, smol comment. pending @dhyaniarun1993


/// Error type for storage operations
pub enum ExternalStorageError {
Other(eyre::Error),
Copy link
Member

Choose a reason for hiding this comment

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

pls add a todo comment that this is just a placeholder

@@ -0,0 +1,164 @@
#![allow(dead_code, unreachable_pub)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#![allow(dead_code, unreachable_pub)]
#![expect(dead_code, unreachable_pub)]

use expect instead of allow

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

let's rename ExternalProofs to OpProofs or OpProofsWindow or OpFPPreimages everywhere for better higher level naming of what we're implementing. i think OpProofs is the most suitable for sake of being short.

use std::fmt::Debug;

/// Error type for storage operations
pub enum ExternalStorageError {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub enum ExternalStorageError {
pub enum OpProofsWindowStorageError {

let's rename this, alt to OpProofsStorage

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll do this on a PR on top of this stack to reduce merge conflicts!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@emhane
Copy link
Member

emhane commented Oct 9, 2025

OpProofs or OpFPWindow

@meyer9 meyer9 force-pushed the meyer9/166-finalize-storage-interface branch from c5ab8a4 to 49d51e1 Compare October 9, 2025 15:51
@emhane emhane enabled auto-merge October 10, 2025 05:48
@emhane emhane disabled auto-merge October 10, 2025 06:18
@emhane emhane enabled auto-merge October 10, 2025 06:18
@emhane emhane disabled auto-merge October 10, 2025 06:18
@emhane emhane enabled auto-merge October 10, 2025 06:27
@emhane emhane disabled auto-merge October 10, 2025 06:29
@emhane emhane merged commit cbf7b49 into unstable Oct 10, 2025
39 of 40 checks passed
@emhane emhane deleted the meyer9/166-finalize-storage-interface branch October 10, 2025 06:29
emhane pushed a commit that referenced this pull request Oct 20, 2025
Fixes #177 

I added a few methods that should allow atomically pruning and reorging
blocks. Each function should represent a single transaction. We can
store trie nodes, reorg, prune in a single transaction now. I kept the
bulk insert methods available for storing the current state.

---------

Co-authored-by: Arun Dhyani <[email protected]>
meyer9 added a commit that referenced this pull request Oct 31, 2025
Fixes #177 

I added a few methods that should allow atomically pruning and reorging
blocks. Each function should represent a single transaction. We can
store trie nodes, reorg, prune in a single transaction now. I kept the
bulk insert methods available for storing the current state.

---------

Co-authored-by: Arun Dhyani <[email protected]>
emhane pushed a commit that referenced this pull request Nov 11, 2025
Fixes #177 

I added a few methods that should allow atomically pruning and reorging
blocks. Each function should represent a single transaction. We can
store trie nodes, reorg, prune in a single transaction now. I kept the
bulk insert methods available for storing the current state.

---------

Co-authored-by: Arun Dhyani <[email protected]>
meyer9 added a commit that referenced this pull request Nov 13, 2025
Fixes #177 

I added a few methods that should allow atomically pruning and reorging
blocks. Each function should represent a single transaction. We can
store trie nodes, reorg, prune in a single transaction now. I kept the
bulk insert methods available for storing the current state.

---------

Co-authored-by: Arun Dhyani <[email protected]>
emhane pushed a commit that referenced this pull request Nov 18, 2025
Fixes #177 

I added a few methods that should allow atomically pruning and reorging
blocks. Each function should represent a single transaction. We can
store trie nodes, reorg, prune in a single transaction now. I kept the
bulk insert methods available for storing the current state.

---------

Co-authored-by: Arun Dhyani <[email protected]>
emhane pushed a commit that referenced this pull request Nov 25, 2025
Fixes #177 

I added a few methods that should allow atomically pruning and reorging
blocks. Each function should represent a single transaction. We can
store trie nodes, reorg, prune in a single transaction now. I kept the
bulk insert methods available for storing the current state.

---------

Co-authored-by: Arun Dhyani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

W-historical-proofs Workstream: historical-proofs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide on storage interface with pruning methods

4 participants