Skip to content

Commit 80121a6

Browse files
committed
chore: Push raw public inputs to L1
1 parent 52d6b02 commit 80121a6

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

l1-contracts/src/core/Rollup.sol

-34
Original file line numberDiff line numberDiff line change
@@ -259,40 +259,6 @@ contract Rollup is Leonidas, IRollup, ITestRollup {
259259
revert Errors.Rollup__InvalidProposedArchive(expectedArchive, _archive);
260260
}
261261

262-
bytes32[] memory publicInputs =
263-
new bytes32[](4 + Constants.HEADER_LENGTH + Constants.AGGREGATION_OBJECT_LENGTH);
264-
// the archive tree root
265-
publicInputs[0] = _archive;
266-
// this is the _next_ available leaf in the archive tree
267-
// normally this should be equal to the block number (since leaves are 0-indexed and blocks 1-indexed)
268-
// but in yarn-project/merkle-tree/src/new_tree.ts we prefill the tree so that block N is in leaf N
269-
publicInputs[1] = bytes32(header.globalVariables.blockNumber + 1);
270-
271-
publicInputs[2] = vkTreeRoot;
272-
273-
bytes32[] memory headerFields = HeaderLib.toFields(header);
274-
for (uint256 i = 0; i < headerFields.length; i++) {
275-
publicInputs[i + 3] = headerFields[i];
276-
}
277-
278-
publicInputs[headerFields.length + 3] = _proverId;
279-
280-
// the block proof is recursive, which means it comes with an aggregation object
281-
// this snippet copies it into the public inputs needed for verification
282-
// it also guards against empty _aggregationObject used with mocked proofs
283-
uint256 aggregationLength = _aggregationObject.length / 32;
284-
for (uint256 i = 0; i < Constants.AGGREGATION_OBJECT_LENGTH && i < aggregationLength; i++) {
285-
bytes32 part;
286-
assembly {
287-
part := calldataload(add(_aggregationObject.offset, mul(i, 32)))
288-
}
289-
publicInputs[i + 4 + Constants.HEADER_LENGTH] = part;
290-
}
291-
292-
if (!verifier.verify(_proof, publicInputs)) {
293-
revert Errors.Rollup__InvalidProof();
294-
}
295-
296262
blocks[header.globalVariables.blockNumber].isProven = true;
297263

298264
_progressState();

yarn-project/sequencer-client/src/publisher/l1-publisher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export class L1Publisher {
284284
archive: archiveRoot.toBuffer(),
285285
proverId: proverId.toBuffer(),
286286
aggregationObject: serializeToBuffer(aggregationObject),
287-
proof: proof.withoutPublicInputs(),
287+
proof: proof.toBuffer(),
288288
};
289289

290290
// Process block

0 commit comments

Comments
 (0)