feat: add storage interface with pruning methods#182
Conversation
a24510a to
e1801e2
Compare
691fff9 to
9dc8078
Compare
e1801e2 to
d728795
Compare
6089737 to
3e311c7
Compare
5ef8999 to
84c813c
Compare
d728795 to
b5d8c02
Compare
84c813c to
9ca3987
Compare
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Incomplete documentation comment. The comment ends with 'and' but doesn't specify what happens after deletion.
| /// 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`. |
| pub enum ExternalStorageError { | ||
| Other(eyre::Error), | ||
| } |
There was a problem hiding this comment.
Can we use thiserror for easier error definition?
| pub enum ExternalStorageError { | |
| Other(eyre::Error), | |
| } | |
| #[derive(Debug, Error)] | |
| pub enum ExternalStorageError { | |
| #[error("Other error: {0}")] | |
| Other(eyre::Error), | |
| } |
emhane
left a comment
There was a problem hiding this comment.
lgtm, smol comment. pending @dhyaniarun1993
|
|
||
| /// Error type for storage operations | ||
| pub enum ExternalStorageError { | ||
| Other(eyre::Error), |
There was a problem hiding this comment.
pls add a todo comment that this is just a placeholder
| @@ -0,0 +1,164 @@ | |||
| #![allow(dead_code, unreachable_pub)] | |||
There was a problem hiding this comment.
| #![allow(dead_code, unreachable_pub)] | |
| #![expect(dead_code, unreachable_pub)] |
use expect instead of allow
c5ab8a4 to
49d51e1
Compare
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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 <dhyaniarun7@gmail.com>
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.