Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
rw table sort chronological by rw counter
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Oct 9, 2023
1 parent feab0b1 commit 9eff5a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zkevm-circuits/src/witness/rw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ impl RwMap {
/// Build Rws for assignment
pub fn table_assignments(&self, keep_chronological_order: bool) -> Vec<Rw> {
let mut rows: Vec<Rw> = self.0.values().flatten().cloned().collect();
if !keep_chronological_order {
if keep_chronological_order {
rows.sort_by_key(|row| row.rw_counter());
} else {
rows.sort_by_key(|row| {
(
row.tag() as u64,
Expand All @@ -169,6 +171,7 @@ impl RwMap {
)
});
}

rows
}
}
Expand Down

0 comments on commit 9eff5a5

Please sign in to comment.