Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

feat: implement subarray equality check using RLC#189

Open
NikolayKostadinov21 wants to merge 8 commits intosuccinctlabs:mainfrom
metacraft-labs:rlp-todos/subarray_equal
Open

feat: implement subarray equality check using RLC#189
NikolayKostadinov21 wants to merge 8 commits intosuccinctlabs:mainfrom
metacraft-labs:rlp-todos/subarray_equal

Conversation

@NikolayKostadinov21
Copy link
Copy Markdown

No description provided.

Comment thread plonky2x/src/frontend/builder/mod.rs Outdated
variable.to_be_bits(self)
}

/// Takes a slice of bits and returns the number with little-endian bit representation as a Variable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end sentence with period

Comment thread plonky2x/src/frontend/builder/mod.rs Outdated

/// Takes a slice of bits and returns the number with little-endian bit representation as a Variable
pub fn le_sum(&mut self, bits: &[BoolVariable]) -> Variable {
let bits_in_booltarget = bits
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just call it let bits =

Comment thread plonky2x/src/frontend/eth/mpt/rlc.rs Outdated
if a[a_offset + i] != b[b_offset + i] {
return 0;
impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> {
/// Generates a commitment for a subarray using RLC
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add period to end

Comment thread plonky2x/src/frontend/eth/mpt/rlc.rs Outdated
let mut is_within_subarray: Variable = self.zero();
let mut commitment = self.zero();

let _one: Variable = self.one();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let one, instead of let _one

builder.assert_subarray_equal(&a, a_offset, &b, b_offset, len);

let pw = PartialWitness::new();
let circuit = builder.build();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this use circuit.inputs() and circuit.prove()?

Comment thread plonky2x/src/frontend/eth/mpt/rlc.rs Outdated

let pw = PartialWitness::new();
let circuit = builder.build();
let proof = circuit.data.prove(pw).unwrap();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here!

@jtguibas
Copy link
Copy Markdown
Contributor

@NikolayKostadinov21 Overall, looks like a solid implementation of the subarray equality check. I'll take a closer look at the actual RLC implementation and make sure the logic looks correct in a bit.

In the meantime, it would be great if you could address the comments I left on the PR!

@jtguibas jtguibas changed the title Implement subarray equality check using RLC feat: implement subarray equality check using RLC Sep 22, 2023
@Xearty Xearty force-pushed the rlp-todos/subarray_equal branch from f77d751 to 7dc11d8 Compare October 3, 2023 07:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants