Closed kariy closed 3 days ago
Ohayo, sensei! This pull request introduces several new files and modules in the katana/primitives
crate, focusing on data availability and cryptographic operations. Key changes include the addition of functions for encoding and decoding state updates, the implementation of the inverse Fast Fourier Transform (IFFT), and the introduction of constants related to EIP-4844. Additionally, the Cargo.toml
file has been updated to manage dependencies more effectively.
File Path | Change Summary |
---|---|
crates/katana/primitives/Cargo.toml |
- Added num-traits and num-bigint = "0.4.6" dependencies.- Removed num-traits from [dev-dependencies] section.- Added rstest to [dev-dependencies] . |
crates/katana/primitives/src/da/blob.rs |
- Added pub fn recover(data: Vec<BigUint>) -> Vec<BigUint> for recovering original data from a blob.- Added pub fn transform(data: Vec<BigUint>) -> Vec<BigUint> for transforming data using FFT. |
crates/katana/primitives/src/da/eip4844.rs |
- Added constants: pub const BLOB_LEN: usize , pub static ref BLS_MODULUS: BigUint , pub static ref GENERATOR: BigUint , and pub static ref TWO: BigUint for EIP-4844 related operations. |
crates/katana/primitives/src/da/encoding.rs |
- Added pub fn encode_state_updates(value: StateUpdates) -> Vec<BigUint> and pub fn decode_state_updates(value: &[BigUint]) -> Result<StateUpdates, EncodingError> .- Introduced Metadata and ContractUpdate structs. |
crates/katana/primitives/src/da/math.rs |
- Added pub fn ifft(arr: Vec<BigUint>, xs: Vec<BigUint>, p: &BigUint) -> Vec<BigUint> and pub fn div_mod(a: BigUint, b: BigUint, p: &BigUint) -> BigUint for mathematical operations.- Introduced pub static ref TWO: BigUint . |
crates/katana/primitives/src/da/mod.rs |
- Added new modules: pub mod blob; , pub mod eip4844; , pub mod encoding; , pub mod math; , and pub mod serde; . |
crates/katana/primitives/src/da/serde.rs |
- Added pub fn parse_str_to_blob_data(data: &str) -> Vec<BigUint> for parsing hexadecimal string data. |
crates/katana/primitives/src/lib.rs |
- Added pub mod da; to expose the da module. |
crates/katana/primitives/tests/blobs.rs |
- Introduced test functions: fn parse_blobs_rt(#[case] blob: &str) -> Result<()> and fn read(path: &str) -> Vec<BigUint> for testing blob data parsing and encoding. |
Cargo.toml
file for dependency management.sozo
Attention: Patch coverage is 99.17012%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 68.61%. Comparing base (
731ff47
) to head (07ddee3
). Report is 1 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
crates/katana/primitives/src/da/encoding.rs | 98.80% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
recover
function for data recovery from blobs.BigUint
vectors.blob
,eip4844
,encoding
,math
, andserde
.Bug Fixes
Tests