mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
fmt
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user