Skip to content

Commit

Permalink
Update contracts submodule (#68)
Browse files Browse the repository at this point in the history
* Update contracts submodule

* cargo fmt
  • Loading branch information
nulltea authored Mar 5, 2024
1 parent d428089 commit e8f33fd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Verifier contracts for consensus proofs are auto-generated via the [`privacy-sca
Spectre uses `abigen` macro to generate smart contract types and `rstest` for consensus spec tests. To ensure that all the necessary data for macros expansion is present during first build or testing, please run:

```
git submodule update --init --recursive
just build-contracts
just download-spec-tests
```
Expand Down
2 changes: 1 addition & 1 deletion contracts
3 changes: 1 addition & 2 deletions lightclient-circuits/src/gadget/crypto/sha256_wide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<'a, F: Field> HashInstructions<F> for Sha256ChipWide<'a, F> {
for r in 0..num_input_rounds {
let remaining_words = num_input_words - r * NUM_WORDS_TO_ABSORB;

for w in 0..std::cmp::min(remaining_words, NUM_WORDS_TO_ABSORB){
for w in 0..std::cmp::min(remaining_words, NUM_WORDS_TO_ABSORB) {
let i = (r * NUM_WORDS_TO_ABSORB + w) * 4;
let checksum = gate.inner_product(
builder.main(),
Expand Down Expand Up @@ -127,4 +127,3 @@ pub fn word_to_bytes_le<F: Field>(
.chain(to_bytes_le::<_, 16>(&word.hi(), gate, ctx))
.collect()
}

5 changes: 4 additions & 1 deletion lightclient-circuits/tests/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ fn run_test_eth2_spec_mock<const K_ROTATION: u32, const K_SYNC: u32>(path: PathB
end_timer!(timer);

// check that sync committee poseidon commits match in both circuits
assert_eq!(sync_circuit.instances()[0][1], rotation_circuit.instances()[0][0]);
assert_eq!(
sync_circuit.instances()[0][1],
rotation_circuit.instances()[0][0]
);
}

#[rstest]
Expand Down
3 changes: 2 additions & 1 deletion test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ pub fn get_initial_sync_committee_poseidon<const EPOCHS_PER_SYNC_COMMITTEE_PERIO
.iter()
.map(|pk| pk.decompressed_bytes())
.collect_vec();
let committee_poseidon = poseidon_committee_commitment_from_uncompressed(&pubkeys_uncompressed, LIMB_BITS);
let committee_poseidon =
poseidon_committee_commitment_from_uncompressed(&pubkeys_uncompressed, LIMB_BITS);
let committee_poseidon =
ethers::prelude::U256::from_little_endian(&committee_poseidon.to_bytes());
let sync_period = (bootstrap.header.beacon.slot as usize) / EPOCHS_PER_SYNC_COMMITTEE_PERIOD;
Expand Down

0 comments on commit e8f33fd

Please sign in to comment.