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

fix: pathfinder block hash mismatch block 0 (sequencer mode) #333

Merged
merged 10 commits into from
Oct 16, 2024

Conversation

apoorvsadana
Copy link
Contributor

@apoorvsadana apoorvsadana commented Oct 14, 2024

The compute_hash method for state commitments was not sorting the storage entries. Maybe this wasn't caught because the feeder gateway always returns state diffs in a sorted order. I have fixed this and added a test case.

The current code iterates over storage_diffs twice (once to sort storage entries and then to sort storage diffs as well). I feel this is cleaner compared to another alternative of writing custom logic for sorting which takes a mutable and also this doesn't have that much of an overhead. Happy to hear thoughts though!

Copy link
Collaborator

@Trantorian1 Trantorian1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good. Check comments for a minor nitpick.

crates/primitives/state_update/src/lib.rs Outdated Show resolved Hide resolved
@Trantorian1 Trantorian1 merged commit 198e87e into main Oct 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants