Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Remove PyKzgResources. Reveal the state diff size. (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware authored Jan 17, 2024
1 parent 776d7a5 commit 0032f8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
5 changes: 2 additions & 3 deletions crates/native_blockifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub mod transaction_executor;
use errors::{add_py_exceptions, UndeclaredClassHashError};
use py_block_executor::PyBlockExecutor;
use py_transaction_execution_info::{
PyBouncerInfo, PyCallInfo, PyKzgResources, PyOrderedEvent, PyOrderedL2ToL1Message,
PyTransactionExecutionInfo, PyVmExecutionResources,
PyBouncerInfo, PyCallInfo, PyOrderedEvent, PyOrderedL2ToL1Message, PyTransactionExecutionInfo,
PyVmExecutionResources,
};
use py_validator::PyValidator;
use pyo3::prelude::*;
Expand All @@ -47,7 +47,6 @@ fn native_blockifier(py: Python<'_>, py_module: &PyModule) -> PyResult<()> {
py_module.add_class::<PyStateDiff>()?;
py_module.add_class::<PyTransactionExecutionInfo>()?;
py_module.add_class::<PyValidator>()?;
py_module.add_class::<PyKzgResources>()?;
py_module.add_class::<PyVmExecutionResources>()?;
py_module.add_class::<PyBouncerInfo>()?;
py_module.add_class::<StorageConfig>()?;
Expand Down
11 changes: 2 additions & 9 deletions crates/native_blockifier/src/py_transaction_execution_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,15 @@ impl From<VmExecutionResources> for PyVmExecutionResources {
}
}

#[pyclass]
#[derive(Clone, Default)]
pub struct PyKzgResources {
#[pyo3(get)]
// The number of felts needed to store the state diff, used for KZG data availability.
pub state_diff_size: usize,
}

#[pyclass]
#[derive(Clone, Default)]
pub struct PyBouncerInfo {
#[pyo3(get)]
// The number of felts needed to store L1<>L2 messages.
pub message_segment_length: usize,
#[pyo3(get)]
pub kzg_resources: PyKzgResources,
// The number of felts needed to store the state diff.
pub state_diff_size: usize,
#[pyo3(get)]
pub additional_os_resources: PyVmExecutionResources,
}
4 changes: 2 additions & 2 deletions crates/native_blockifier/src/transaction_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::py_block_executor::{into_block_context, PyGeneralConfig};
use crate::py_state_diff::{PyBlockInfo, PyStateDiff};
use crate::py_transaction::py_tx;
use crate::py_transaction_execution_info::{
PyBouncerInfo, PyKzgResources, PyTransactionExecutionInfo, PyVmExecutionResources,
PyBouncerInfo, PyTransactionExecutionInfo, PyVmExecutionResources,
};
use crate::py_utils::PyFelt;

Expand Down Expand Up @@ -102,7 +102,7 @@ impl<S: StateReader> TransactionExecutor<S> {
)?;
let py_bouncer_info = PyBouncerInfo {
message_segment_length: 0,
kzg_resources: PyKzgResources { state_diff_size: 0 },
state_diff_size: 0,
additional_os_resources: PyVmExecutionResources::from(additional_os_resources),
};

Expand Down

0 comments on commit 0032f8c

Please sign in to comment.