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

Reexecute-blocks clean up #19

Merged
merged 10 commits into from
Aug 14, 2024

Conversation

notlesh
Copy link

@notlesh notlesh commented Aug 14, 2024

This is a PR for cleaning up keep-starknet-strange#306 and handling PR feedback.

Issue Number: N/A

Type

  • feature
  • bugfix
  • dev (no functional changes, no API changes)
  • fmt (formatting, renaming)
  • build
  • docs
  • testing

Description

Breaking changes?

  • yes
  • no

@notlesh notlesh requested a review from odesenfans as a code owner August 14, 2024 21:13
Copy link

@HermanObst HermanObst left a comment

Choose a reason for hiding this comment

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

LFGTM!!!

@notlesh notlesh merged commit 1c12870 into notlesh/reexecute-blocks Aug 14, 2024
5 checks passed
notlesh added a commit that referenced this pull request Aug 15, 2024
…strange#306)

* Feature: RPC-based state reader for Blockifier reexecution

Problem: we need a way to reexecute blocks with Blockifier.

Solution: implement the `StateReader` trait using the `starknet-rs`
crate to fetch all the relevant data from a Pathfinder node.

* test

* include ABI in serialization

* move code

* remove prove_block state reader

* rename to rpc-replay

* Add test case for failing deserialization

* Compile sierra class -> CASM when fetching class from Pathfinder RPC

* Print anyhow error verbosely

* Add sierra->compile->hash test

* A class hashing fn that works!

* Feature: support visited PCs

Problem: the code needed to only partially load programs based on
visited PCs was left as a TODO. We were wondering if this code could be
the cause of some hashing issues.

Solution: implement bytecode segment loading properly. We should now
support visited PCs to a reasonable extent.

* clippy

* fix IS_LEAF hint

* use visited pcs by default

* Include visited_pcs in prove_block

* Use compiled class hash instead of class hash as compiled_classes key

* Get bytecode segment as impl from exec_scopes

* Implement ITER_CURRENT_SEGMENT_INFO hint

* Fill out transaction class_hash when we can

* Fill in class_hash_to_compiled_class_hash

* Fix integration tests

* Query class proof from Pathfinder RPC

* Ensure class_hash is available when creating new ContractState

* Remove nonce-deduction code

* Copy build_starknet_storage_async to build contract storage

* Fix compile issues

* Fix compiler warnings

* Clean up creation of contract states and storages

* Feature: make OS per-contract storage customizable

Problem: we are facing issues integrating the model of
`OsSingleStarknetStorage` with Pathfinder, as we do not have a method to
traverse the tree to reach arbitrary leaves.

Solution: Make the OS generic on the per-contract storage type instead
of just the storage. This allows users to further customize the
behaviour of the OS when it comes to storage.

* fmt

* Impl PerContractStorage in prove_block

* Couple fixes for per contract storage impl

* fmt

* fmt

* Remove useless comment

* Remove massive test json

* clippy

* Fix bytecode segments test

* Ressurect ContractClassForPathfinderCompat

* fmt

* Reexecute-blocks clean up (#19)

* Move process_function_invocations() out of main()

* Remove debug logging

* Fail fast when txn has no sender_address

* Remove stale comment

* Use ffc_for_class_hash instead of clone_with_different_hash()

* Remove verbose class hash logging

* Query class proofs at previous block

* Not afraid of Carpal tunnel

* Add TODO about fetching classes at current block

* fmt

---------

Co-authored-by: Olivier Desenfans <desenfans.olivier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants