juno icon indicating copy to clipboard operation
juno copied to clipboard

Prove Juno blocks

Open rianhughes opened this issue 2 years ago • 1 comments

The goal is to generate inputs for a STARK Prover, using Juno blocks+state.

  • [X] Look into the different options on how we can generate Prover inputs. Namely the CairoRunner from SNOS and Cairo-lang.

  • [X] Define what data we need to run this CairoRunner. Answer: SNOSInputs

  • [X] Look into the python code we can use to run the CairoLang CairoRunner.

  • [X] Understand how the python code builds SNOSInputs

  • [X] Define the SNOSInpts type, and outline the different logic needed to generate SNOSInputs

  • [X] Build logic to execute the transactions, and adapt the resulting traces

  • [X] Implement the State selector logic for: Invoke, Declare, Deploy, DeployAccount, L1Handler, CallInfo, ExecutionInfo

  • [X] Get and implement an example SNOS Config

  • [X] Implement ClasshHashtoCompiledClassHash

  • [X] Populate the transactions, deprecated contracts, and cairo1 contracts.

  • [X] Update stateReader to return the Contract Storage Root

  • [X] Implement logic to get the ContractStorage

  • [X] Use the python code to generate test data for a state with the 0 and 1 contracts

  • [X] Implement a test that generates the SNOSInputs and compares against the python test data (excluding commitentInfo)

  • [X] Implement the getCommitmentInfoLogic

  • [X] Fix the failing block-hash assert in the test

  • [X] complete test with 0x0 and 0x1 contracts

  • [] get test data where a single class is declared

  • [] impl test for single class

  • [] get test data where a single class is declared + contract deployed

  • [] impl test for single class + contract deployed

  • [] get test data where a single class is declared + contract deployed + invoke txn

  • [] impl test for single class + contract deployed + invoke txn

==

  • [] Figure out to to interface the python code with Juno state so we can run the CairoRunner
  • [] Run the CairoRunner using the SNOSInputs generated by Juno, and Juno state.

rianhughes avatar Mar 19 '24 08:03 rianhughes

We will need to modify core.StateReader, and core.StateHistoryReader, so that we can access:

  • the contract and class tries at a given height. This is needed to get the modified nodes when updating state (requires StorageTrieAt. currently expose NodesFromRoot and StorageTrie for a given state) We also need to access the root of these tries at any given height (requires StorageTrieAt or StorageTrieRootAt ).

  • contract storage root. This is needed to get commitment info about the contract storage at a given height (currently ContractStorageRoot was implemented to expose ContractRoot. However, we need ContractStorageRootAt)

rianhughes avatar Apr 17 '24 08:04 rianhughes