Skip to content

Commit c211d3a

Browse files
authored
fix(l1): remove incorrect debug_assert on trie iteration (#4434)
**Motivation** When adding support for trie iteration from a given starting point, we added a `debug_assert!` that checks that the internal stack isn't empty, but this is incorrect; it is entirely possible that the stack is empty if the trie is empty, in that case we simply return an empty iterator, which is fine. **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
1 parent c008bfc commit c211d3a

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

crates/common/trie/trie_iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ impl TrieIterator {
2828
/// Manually push the correct nodes to the stack so iteration doesn't rewind back
2929
/// to left children of a traversed branch node.
3030
pub fn advance(&mut self, key: PathRLP) -> Result<(), TrieError> {
31-
debug_assert!(!self.stack.is_empty());
3231
let Some((root_path, root_ref)) = self.stack.pop() else {
3332
return Ok(());
3433
};

0 commit comments

Comments
 (0)