Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace regex in trie diff main #758

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion zero/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ hashbrown.workspace = true
hex.workspace = true
itertools.workspace = true
keccak-hash.workspace = true
lazy-regex = "3.3.0"
lru.workspace = true
mpt_trie.workspace = true
num-traits.workspace = true
once_cell.workspace = true
paladin-core.workspace = true
plonky2.workspace = true
plonky2_maybe_rayon.workspace = true
regex = "1.5.4"
rlp.workspace = true
ruint = { workspace = true, features = ["num-traits", "primitive-types"] }
serde.workspace = true
Expand Down
11 changes: 6 additions & 5 deletions zero/src/bin/trie_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use anyhow::Result;
use clap::{Parser, ValueHint};
use evm_arithmetization::generation::DebugOutputTries;
use futures::{future, TryStreamExt};
use lazy_regex::regex_captures;
use paladin::directive::{Directive, IndexedStream};
use paladin::runtime::Runtime;
use regex::Regex;
use trace_decoder::observer::TriesObserver;
use tracing::{error, info};
use zero::ops::register;
Expand Down Expand Up @@ -130,10 +130,11 @@ async fn main() -> Result<()> {
{
// Try to parse block and batch index from error message.
let error_message = e2.to_string();
let re = Regex::new(r"block:(\d+) batch:(\d+)")?;
if let Some(cap) = re.captures(&error_message) {
let block_number: u64 = cap[1].parse()?;
let batch_index: usize = cap[2].parse()?;
if let Some((_, block_number, block_index)) =
regex_captures!(r"block:(\d+) batch:(\d+)", error_message.as_str())
{
let block_number: u64 = block_number.parse()?;
let batch_index: usize = block_index.parse()?;

let prover_tries =
zero::debug_utils::load_tries_from_disk(block_number, batch_index)?;
Expand Down
Loading