Skip to content

Improve QuickSilver performance #303

@themighty1

Description

@themighty1

Currently, our QS impl accumulates all the triples from all vm calls which leads to memory blowup.

E.g. proving 30KB of AES encrypted data requires ~12 mil triples or 12*48=~600MB of memory.

Additionally, the code initializes the memory often. The following hot path contributes to 0.8s of the runtime with 12 mil AND gates:

pub(crate) fn reserve(&mut self, n: usize) -> usize {
let idx = self.triples.len();
self.triples.resize_with(idx + n, Default::default);
self.adjust.resize_with(idx + n, |_| Default::default());
idx
}

We can avoid the memory/compute overhead by treating each individual vm call as a separate circuit and using its adjust bits for its local transcript which gets hashed to derive chi.

We would need to change the logic, so that upon executing the call, the prover/verifier immediately pre-compute the values for the consistency check and discard the triples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions