Skip to content

Commit

Permalink
Merge pull request #1177 from eqlabs/class_fix
Browse files Browse the repository at this point in the history
fix: sierra classes sync bug
  • Loading branch information
Mirko-von-Leipzig committed Jun 29, 2023
2 parents dd8aecd + 745ae44 commit 7cd2119
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.6.3] - 2023-06-29

### Fixed

- Sierra class hash not in declared classes sync bug

## [0.6.2] - 2023-06-29

### Added
Expand Down
9 changes: 6 additions & 3 deletions crates/pathfinder/src/state/sync/l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ pub async fn download_new_classes(
} => {
// NOTE: we _have_ to use the same compiled_class_class hash as returned by the feeder gateway,
// since that's what has been added to the class commitment tree.
let casm_hash = state_diff
let Some(casm_hash) = state_diff
.declared_classes
.iter()
.find_map(|declared_class| {
Expand All @@ -375,8 +375,11 @@ pub async fn download_new_classes(
} else {
None
}
})
.context("Sierra class hash not in declared classes")?;
}) else {
// This can occur if the sierra was in here as a deploy contract, if the class was
// declared in a previous block but not yet persisted by the database.
continue;
};
tx_event
.send(SyncEvent::SierraClass {
sierra_definition,
Expand Down

0 comments on commit 7cd2119

Please sign in to comment.