|
| 1 | +#[cfg(feature = "os_input")] |
| 2 | +use std::collections::HashMap; |
| 3 | + |
1 | 4 | use serde::{Deserialize, Serialize}; |
2 | 5 | use starknet_api::block::BlockNumber; |
| 6 | +#[cfg(feature = "os_input")] |
| 7 | +use starknet_api::core::{ClassHash, ContractAddress}; |
3 | 8 | use starknet_api::core::{GlobalRoot, StateDiffCommitment}; |
4 | 9 | use starknet_api::state::ThinStateDiff; |
| 10 | +#[cfg(feature = "os_input")] |
| 11 | +use starknet_committer::block_committer::input::StarknetStorageKey; |
| 12 | +#[cfg(feature = "os_input")] |
| 13 | +use starknet_committer::patricia_merkle_tree::types::StarknetForestProofs; |
5 | 14 |
|
6 | 15 | #[derive(Clone, Debug, Serialize, Deserialize)] |
7 | 16 | pub struct CommitBlockRequest { |
@@ -32,3 +41,21 @@ pub enum RevertBlockResponse { |
32 | 41 | // Nothing to revert. A future block that has not been committed. |
33 | 42 | Uncommitted, |
34 | 43 | } |
| 44 | + |
| 45 | +/// Commit a block and return merged Patricia witness proofs for OS input (pre- and post-commit |
| 46 | +/// paths). |
| 47 | +#[cfg(feature = "os_input")] |
| 48 | +#[derive(Clone, Debug, Serialize, Deserialize)] |
| 49 | +pub struct ReadPathsAndCommitBlockRequest { |
| 50 | + pub commit: CommitBlockRequest, |
| 51 | + pub class_hashes: Vec<ClassHash>, |
| 52 | + pub contract_addresses: Vec<ContractAddress>, |
| 53 | + pub contract_storage_keys: HashMap<ContractAddress, Vec<StarknetStorageKey>>, |
| 54 | +} |
| 55 | + |
| 56 | +#[cfg(feature = "os_input")] |
| 57 | +#[derive(Clone, Serialize, Deserialize)] |
| 58 | +pub struct ReadPathsAndCommitBlockResponse { |
| 59 | + pub global_root: GlobalRoot, |
| 60 | + pub patricia_proofs: StarknetForestProofs, |
| 61 | +} |
0 commit comments