Skip to content

Conversation

@MarcosNicolau
Copy link
Member

@MarcosNicolau MarcosNicolau commented Jan 7, 2026

Description

Adds zisk in aggregation mode.

How to test

For proving

Setup:

  1. Get a linux machine
  2. Install proving keys for snark wrapping:
wget https://storage.googleapis.com/zisk-setup/zisk-0.15.0-plonk.tar.gz
tar -xvzf zisk-0.15.0-plonk.tar.gz
  1. Clone zisk repo:
git clone https://github.com/0xPolygonHermez/zisk
  1. Checkout to feature/bn128 branch:
git checkout feature/bn128
  1. Build the zisk-tools:
cargo build --release

# Or with gpu proving
cargo build --release --features gpu
  1. Install zisk toolchain following option 2: Building from source, see here.
  2. Copy the installed provingkey and provingKeySnark into ~/.zisk/.

Running

  1. Start ethereum package:
make ethereum_package_start
  1. Start gateway:
make agg_mode_gateway_start_ethereum_package
  1. Start payments poller:
make agg_mode_payments_poller_start_local
  1. Send payment and zisk proof:
make agg_mode_gateway_send_payment
make agg_mode_gateway_send_zisk_proof
  1. Start proof aggregator with zisk:
make proof_aggregator_start AGGREGATOR=zisk
  1. Verify the proof has been aggregated
make verify_aggregated_proof_zisk

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization
  • Refactor

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Changes to gas cost

Generated at commit: 1c5883b9f1368c5ddf00f4f27963ec8430860a3d, compared to commit: 51bd81652ff9dde9f0a417844ac37293e488d8d4

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
AlignedLayerServiceManager createNewTask +51 ❌ +0.07%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
AlignedLayerServiceManager 4,398,072 (0) createNewTask 56,922 (+48) +0.08% 76,813 (+51) +0.07% 77,074 (+84) +0.11% 77,812 (-84) -0.11% 256 (0)

@MarcosNicolau MarcosNicolau marked this pull request as ready for review January 12, 2026 13:03
@MarcosNicolau MarcosNicolau self-assigned this Jan 12, 2026
.db
.insert_task(
&recovered_address,
AggregationModeProvingSystem::ZISK.as_u16() as i32,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Every time we use the as_u16 method, we end up casting the result to i32. Why do we convert it to u16 in the first place?

let mut merkle_root = [0u8; 32];
for (idx, word) in publics.iter().enumerate() {
let start = idx * 4;
merkle_root[start..start + 4].copy_from_slice(&( *word as u32).to_le_bytes());
Copy link
Collaborator

Choose a reason for hiding this comment

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

This cast from u64 to u32 can silently truncate if the value exceeds the u32 maximum value. I think it may be worth ensuring that this cannot happen here.

}

// Next entry is the number of public inputs set by the program with 'ziskos::set_output'
// we should end up with a vector of length 4 as the public input is a 256 bits digest
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the vector is length 4 and each element of the vector is processed to a u32, then with the processing, we will end up with a 16-byte output, not a 32-byte one.

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

Successfully merging this pull request may close these issues.

3 participants