Skip to content

Commit

Permalink
Merge branch 'main' into special_prover
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Jan 30, 2023
2 parents 12cba14 + 2d93c95 commit a69474c
Show file tree
Hide file tree
Showing 22 changed files with 880 additions and 1,633 deletions.
16 changes: 14 additions & 2 deletions packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ library LibProving {
TaikoData.BlockMetadata meta;
BlockHeader header;
address prover;
bytes[] proofs; // The first zkProofsPerBlock are ZKPs
bytes[] proofs; // The first zkProofsPerBlock are ZKPs,
// followed by MKPs.
uint16[] circuits; // The circuits IDs (size === zkProofsPerBlock)
}

bytes32 public constant INVALIDATE_BLOCK_LOG_TOPIC =
Expand Down Expand Up @@ -58,6 +60,7 @@ library LibProving {
// Check and decode inputs
require(inputs.length == 3, "L1:inputs:size");
Evidence memory evidence = abi.decode(inputs[0], (Evidence));

bytes calldata anchorTx = inputs[1];
bytes calldata anchorReceipt = inputs[2];

Expand All @@ -69,6 +72,10 @@ library LibProving {
evidence.proofs.length == 2 + zkProofsPerBlock,
"L1:proof:size"
);
require(
evidence.circuits.length == zkProofsPerBlock,
"L1:circuits:size"
);

{
// Check anchor tx is valid
Expand Down Expand Up @@ -266,7 +273,12 @@ library LibProving {
require(
proofVerifier.verifyZKP({
verifierId: string(
abi.encodePacked("plonk_verifier_", i)
abi.encodePacked(
"plonk_verifier_",
i,
"_",
evidence.circuits[i]
)
),
zkproof: evidence.proofs[i],
blockHash: blockHash,
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/tasks/deploy_L1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ export async function deployContracts(hre: any) {
`${chainId}.${Buffer.from(
ethers.utils.arrayify(
ethers.utils.solidityPack(
["string", "uint256"],
["plonk_verifier_", 0]
["string", "uint256", "string", "uint16"],
["plonk_verifier_", 0, "_", 0]
)
)
).toString()}`,
Expand Down

0 comments on commit a69474c

Please sign in to comment.