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

katana: parallelize commitment computations #2719

Open
kariy opened this issue Nov 25, 2024 · 1 comment
Open

katana: parallelize commitment computations #2719

kariy opened this issue Nov 25, 2024 · 1 comment

Comments

@kariy
Copy link
Member

kariy commented Nov 25, 2024

let state_root = self.compute_new_state_root();
let transactions_commitment = self.compute_transaction_commitment();
let events_commitment = self.compute_event_commitment();
let receipts_commitment = self.compute_receipt_commitment();
let state_diff_commitment = self.compute_state_diff_commitment();

fn compute_receipt_commitment(&self) -> Felt {
let receipt_hashes = self.receipts.iter().map(|r| r.compute_hash()).collect::<Vec<Felt>>();
compute_merkle_root::<hash::Poseidon>(&receipt_hashes).unwrap()
}

let mut hashes = Vec::new();
for (tx, event) in events {
let event_hash = event_hash(tx, event);
hashes.push(event_hash);
}

there are few places where we can parallelize these computations. also create a benchmark so that we can have an idea how much speed up we would get.

@Abeeujah
Copy link

Hi, Can I work on this?

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

No branches or pull requests

2 participants