This commit is contained in:
Ho
2025-11-08 17:01:41 +09:00
parent 02c9360ca2
commit bdddfbd7fc
4 changed files with 24 additions and 18 deletions

View File

@@ -24,8 +24,7 @@ fn encode_task_to_witness<T: serde::Serialize>(task: &T) -> eyre::Result<Vec<u8>
fn check_aggregation_proofs<Metadata: MultiVersionPublicInputs>(
metadata: &[Metadata],
version: Version,
) -> eyre::Result<()>
{
) -> eyre::Result<()> {
panic_catch(|| {
for w in metadata.windows(2) {
w[1].validate(&w[0], version);

View File

@@ -237,20 +237,20 @@ impl BatchProvingTask {
// patch: ensure block_hash field is ZERO for scroll domain
let chunk_infos = self
.chunk_proofs
.iter()
.map(|p|
if version.domain == Domain::Scroll {
ChunkInfo {
prev_blockhash: B256::ZERO,
post_blockhash: B256::ZERO,
..p.metadata.chunk_info.clone()
}
} else {
p.metadata.chunk_info.clone()
.chunk_proofs
.iter()
.map(|p| {
if version.domain == Domain::Scroll {
ChunkInfo {
prev_blockhash: B256::ZERO,
post_blockhash: B256::ZERO,
..p.metadata.chunk_info.clone()
}
).collect();
} else {
p.metadata.chunk_info.clone()
}
})
.collect();
BatchWitness {
version: version.as_version_byte(),
@@ -269,7 +269,10 @@ impl BatchProvingTask {
// 2. validate every adjacent proof pair
let witness = self.build_guest_input();
let metadata = BatchInfo::from(&witness);
super::check_aggregation_proofs(witness.chunk_infos.as_slice(), Version::from(self.version))?;
super::check_aggregation_proofs(
witness.chunk_infos.as_slice(),
Version::from(self.version),
)?;
Ok(metadata)
}

View File

@@ -63,7 +63,10 @@ impl BundleProvingTask {
// 2. validate every adjacent proof pair
let witness = self.build_guest_input();
let metadata = BundleInfo::from(&witness);
super::check_aggregation_proofs(witness.batch_infos.as_slice(), Version::from(self.version))?;
super::check_aggregation_proofs(
witness.batch_infos.as_slice(),
Version::from(self.version),
)?;
Ok(metadata)
}

View File

@@ -33,7 +33,8 @@ impl TryFromWithInterpreter<ChunkTask> for ChunkProvingTask {
) -> Result<Self> {
let mut block_witnesses = Vec::new();
for block_hash in value.block_hashes {
let witness = interpreter.try_fetch_block_witness(block_hash, block_witnesses.last())?;
let witness =
interpreter.try_fetch_block_witness(block_hash, block_witnesses.last())?;
block_witnesses.push(witness);
}