Skip to content

Commit

Permalink
feat(protocol): update sp1 to 3.0.0 prod version (#18465)
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft authored Nov 8, 2024
1 parent 591ee8e commit 0b11101
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 65 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"p256-verifier": "github:taikoxyz/p256-verifier#v0.1.0",
"risc0-ethereum": "github:risc0/risc0-ethereum#v1.1.2",
"solady": "github:Vectorized/solady#v0.0.231",
"sp1-contracts": "github:succinctlabs/sp1-contracts#v3.0.0-rc3"
"sp1-contracts": "github:succinctlabs/sp1-contracts#v3.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/protocol/script/layer1/DeployProtocolOnL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.24;

import "@openzeppelin/contracts/utils/Strings.sol";
import "@risc0/contracts/groth16/RiscZeroGroth16Verifier.sol";
import { SP1Verifier as SuccinctVerifier } from "@sp1-contracts/src/v3.0.0-rc3/SP1VerifierPlonk.sol";
import { SP1Verifier as SuccinctVerifier } from "@sp1-contracts/src/v3.0.0/SP1VerifierPlonk.sol";

// Actually this one is deployed already on mainnet, but we are now deploying our own (non via-ir)
// version. For mainnet, it is easier to go with one of:
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/script/layer1/DeploySP1Verifier.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import { SP1Verifier as SuccinctVerifier } from "@sp1-contracts/src/v3.0.0-rc3/SP1VerifierPlonk.sol";
import { SP1Verifier as SuccinctVerifier } from "@sp1-contracts/src/v3.0.0/SP1VerifierPlonk.sol";
import "test/shared/DeployCapability.sol";
import "src/layer1/verifiers/SP1Verifier.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/script/layer1/UpdateSP1Verifier.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "@sp1-contracts/src/v3.0.0-rc3/SP1VerifierPlonk.sol";
import "@sp1-contracts/src/v3.0.0/SP1VerifierPlonk.sol";
import "test/shared/DeployCapability.sol";

contract UpdateSP1Verifier is DeployCapability {
Expand Down
14 changes: 7 additions & 7 deletions packages/protocol/test/layer1/verifiers/SP1PlonkVerifier.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import { SP1Verifier as SuccinctVerifier } from "@sp1-contracts/src/v3.0.0-rc3/SP1VerifierPlonk.sol";
import { SP1Verifier as SuccinctVerifier } from "@sp1-contracts/src/v3.0.0/SP1VerifierPlonk.sol";
import "../based/TaikoL1TestBase.sol";

contract SuccinctVerifierTest is TaikoL1TestBase {
Expand Down Expand Up @@ -29,7 +29,7 @@ contract SuccinctVerifierTest is TaikoL1TestBase {
);

sp1.setProgramTrusted(
bytes32(0x00b6e596137c781eb0d53073d86d8a7ab56cffc5b5f04b5297ef2e62ac0c56bf), true
bytes32(0x004e167a367ef584f118c2fac6ffdda82e5349913a165703fb1895f0da412bff), true
);
}

Expand All @@ -42,8 +42,8 @@ contract SuccinctVerifierTest is TaikoL1TestBase {
vm.startPrank(Emma);

bytes memory sp1Proof =
hex"8fd4de722cab7cfc38b19720f0152ca6311a0a907219bf8dd0c449fe0b3e919f786053d124bd3e9bf8cfa21c98cbea4a43cf70c9c96af9a867a57277a763f5d19331cb772086bb134e1a27d16405dde7b59a654d2146a7d822fa9782e461b3cb4eb272000dc4d93a25a6be5cf1006217fb4be228102117d0a317052b4dd0434482ded2021ab08599ceadcf1cc15c9348dd32ec50d2b6c4b646e0c12472b266832b269d0926a6e6b95b473aa3fdce76052ca64818631c2bcdbe603ad8f87ed0bdd01ab9a00c2e00635547b918704c8ea4b5c7d3e1e8ddf7720f1f58178d10b254ce1090e20fcbdc1f89ccfc9ff88cc25ff96ebc683eed7f9792584446f923a7b30e0d248b133655fcdba58c2c6b8f4b79f4276211df7a78ef5ce97063fed0ebcbb005d47804fd8a75f57cc5f0524ce41601dcbbbc21f73eeac25cc28ec8b66f1e03e8a7202a878463c8ac8038639e4fd211be2b095055e8f06392e0c82c1bae65f791f0c92a6e77bec5e2b62812a9060949dbcca69f714c8b0cca0272d718c9c9b5d410cd2ebbdbb9a143dea6eeb17f39115475409169245f3b61b1c46a9ea6a3296797820c8892a15001619923a972ddbbd8c7dc16df8a698b63ff84f5b34236d464ab252495aebe4902046fb4879e5ca9be9a51b26d672718491adb533ab900b40ef3e70138310b399d6c544e35d4750d3ef44cfa8b721dcff6f5c55a5587da65c1216a26550a3e35dfa4bf583b90e99b3ac051901b689b17ac0390f6e49a334c62d6f1082cda2cafad0d059e00b61173d7ce925fbea86e03c8fe76d47d98ac2090e6051f4d0528029ff31747260bdd9692dc105bd598fb4816a45ef9e13705714fcdda1c19e82a87e5dbf0caff752ce3396a4ebe6d9399c4d422285bcfff0cdf81bddf19ffeb7b405da2dceb60e661c597226eaba2e753e81a92ad19cec6510bd82de50beeff70200e2241cf7fe9d8270c9a4779480c49995d5c99cd9ae7d5c1f9acdf1b4635b78b4a2d8975ce0f587eccce699f590594d837426c5bd59fc078f811ba2717e3816f83cb191077a3ccbb5cd09adf92ff69bcbc9fcaf0fd22bc0c573750251553c7f2cec501e12761e48a9c7377e307c5202ec5707ff6b9e41b3a3085380fc07b0fed0e3abf32aaa6922d7d9649f8a13a1083fe58ccfa9501757be0e85a2ecfd9c2bbeffce6922a421a2ccdca93c7632974a8c6618558e5a33eb4d8ed1d";
bytes32 vKey = bytes32(0x00b6e596137c781eb0d53073d86d8a7ab56cffc5b5f04b5297ef2e62ac0c56bf);
hex"54bdcae329f3f04a73d0e51b60e37a3dc2eb812b6c818895fbda375c24ce943d40a1a3541655911e01acabfb1ed0a04027e641f5e492e883d2ca77a03266b485a61563fe1c751fa9821101c5e755f8963df8493e967224867963a4b459457ca1ae23b7c62e7b320dcb495d119ca771ce2030f6aeeb44c328bc03f8a892c69da84aa43ca1201baeb122781539d987fc6fd706123398a8d50f837817873890c18269c3d3dd0e782114074808a1ff3548b49f0b499424c689e4bf5d74cb876237240d6473dc1ab63fc429bee770b10527113efff5ee6f2705031d6c7370d0a60154f19e8dd20ba14bd5fd5683ac1094f7981b122d908442fa6cd1ca460ffbf49e7e162fbc0d25280c78297ab4f7026a04448422da8e376ebb2b359d6c7be1ec1a660d07dfa82ac8c2d89f04fa02cb3a86a2066188f92895f2f42dc2f6f7e5713067a14a925a02fdffdcb99f7ad1df29281d3120d1196595b53b22a386a3eae6043435445f140976aafc537cbad06c46ca5ad2b16a7da0c4bd45ac880aef87078e7347cb464f0db47c51e064400751c2f032fd0fb92d8e4cf42c5bdda442d7a3c28e3dce3bdd10d8e014089f3a9ddc8c56dd154fe487beaf0ac01e73da68271378808786e69b1b709cfdd5666f53d46c569c965ea013a17e733efa740beddb8e56183138db1723e68dc91a3c893c7d05439388d387ed0fbeb19c7e996083b39858b07762a87c21ae07df5ea0fe21cb4974dc52d4e21553864af5e7d7042bfd0703aed1cf80171006aec8456ef123dc1ae4ec805c9d301f0dfe4788a0c5c599ff7a3ed17390bb1f260665e92e3647d7b89fab2681bc7237943c4b45243f68705d53c2ce8e4c5303b8ae78d556d0c4a1efaa48aedbb7feef62a27332a462fbd4e7dff75f3df8d92ea73b5afcc5a42c1a564bcdd99f2dcfe8e0c9873fa0470753900a20f7e01bcd1b3e6c62b2f8cdbd7de3068b7f5dcbfd6c0e9a511baccef6c7adfc41dee3f2dd2bb2409707d3d21594e3f425f6f6873b5245ec7dd2473b9b14b7f80576e776f3068e65e12da6663c8fff51ab2cdf1960225945dea081c5a38231f62439ad08032e4131a32f5b70566b1b86b7fb0138d4e2497621d71b31580ec36043f2c57330190c8b7d5a408a9ca109ae6dc5b90c6f86b4c15d54d2da991591369cb03c3d9c0c5030e89f7de4a5b6e7975fad4d321b1e01863dc0dbe8d49517006c7587a38b";
bytes32 vKey = bytes32(0x004e167a367ef584f118c2fac6ffdda82e5349913a165703fb1895f0da412bff);
console2.logBytes(abi.encodePacked(vKey, sp1Proof));
// TierProof
TaikoData.TierProof memory proof =
Expand Down Expand Up @@ -104,11 +104,11 @@ contract SuccinctVerifierTest is TaikoL1TestBase {
// proof generation elf vk digest which is not a bn254 hash
// but a sha256 hash from the same Sp1Verifykey.
sp1.setProgramTrusted(
bytes32(0x5b72cb095f1e07ac1aa60e7b06d8a7ab2b67fe2d57c12d4a2fde5cc52c0c56bf), true
bytes32(0x270b3d1b1fbd613c23185f586ffdda82729a4c8968595c0f76312be15a412bff), true
);
// proof aggregation elf
sp1.setProgramTrusted(
bytes32(0x0041b4e466ae95d8e71c376eac1f45b8999d5eb1509b39edc12bf97521097880), true
bytes32(0x00d5ff4ed163b73e75aa1f60c399b3c778df24abe584fc6eee1ce5c444b74bcd), true
);

vm.startPrank(address(L1));
Expand Down Expand Up @@ -148,7 +148,7 @@ contract SuccinctVerifierTest is TaikoL1TestBase {

// TierProof
bytes memory data =
hex"0041b4e466ae95d8e71c376eac1f45b8999d5eb1509b39edc12bf975210978805b72cb095f1e07ac1aa60e7b06d8a7ab2b67fe2d57c12d4a2fde5cc52c0c56bf8fd4de721f01f0d571dab506ab0a8c4b99f357f11b4fc8b47ab97c2efa686437fc053872083c9e70147649c2fbaa5e68e77b014a024b20206b865bd3a1c28ced4d21cba41de4ac423e9fd71b6a0193f33ebb9e06805e13d95032fe8862548800823b85b3132160d62dddcc882a51c62aab4ba196f6fcf09fd0943ef8153ac99f9982f01a30052e27bb82d88f5506537c18880f36219fe17751b562ecf6e08685cdafcafe2bec9ca35246370a51e4570ee437eca2d9fd373fc26f74dc3c5658ed6fc9a5c60a2245b77dd711b1a96992551bd101a9ce764dff8704c87f95f8d4669b8bf65c25c086d160405532b0eff81477135ae6b3ef791c7539ded4f525ab0c4d0bc179029836461907f0cf3c04d681395a10c8240ced3da9d30dfabd9ef5e4adb75dda11027bad2cc8e8b4ab2648137fa9bb44e6c21ec3cff40c1e356dd9e2d0db572f2f030b9e591c91cc5210beb693fc66ce5d51ecbb23b3f24af0e0e280ea1e62a3036d2da06fdcde9a0c8db3a3773e03e1476588ff54e47543e86f7cdaf37bbaa8124b1d2544e423be363a8a07aed33b1fd242631902f91bcdcf8405e59886d9ae073a20596079eb474c33bb9d14bc8d84d9cc6033b211ddbb97039734bedaccef163c7ac8df54a7760434563ad4e90a5526e9ac1e3535707cb1cb1867aa83e6ca0ecc4fd402eda1c35213f546e3d171c9660965c08e3d5f3e4de6d0163e0a18d922d56ba61565738167c49d8b1262c48ae47d749ab7ddbd7caf8a235115649ef32817e387937415e50aecb1e4614b183d4e8813e5809100e8b36843c9e29291d21b6e3309c6f534b3e6a40443d0efee93b2fceae0e2a39e59c95dbd672dbefb1827d46c1e9794a4bea891fa3fcd8403916185369c0c94fd4e93a45f53d2fe3b3e15e8d2114f9afcb7a3863d92a3259fb315d5c0bc9ad09e887e119de3e74a49b60bb47a4d3901835087c7fd1d9686fd83f81fc1eb7d0498b1c5f9a4d299af7ded192d8fe5e012fded12f7f7238926fa8b5207220d524756c49076abaf6e8327120e7bb56699fcd13d94cb50bc01e306552db7e8af06efbb954bff76efc844da0e14952b5b8480b0522296e67a8ebc2581bf8a8c6bcb36228949b483d8ce592cd2186c2c8ea51515ae38ceaac637dc170bb9a1755cdb3d94ffdeee7d0c5f78ecb60fb12b04f1951c38a5520feffe350aeb4046a1909d478f0605933fb5edfe50d9";
hex"00d5ff4ed163b73e75aa1f60c399b3c778df24abe584fc6eee1ce5c444b74bcd270b3d1b1fbd613c23185f586ffdda82729a4c8968595c0f76312be15a412bff54bdcae3236b956a67d15b4682d972d50fbb3632ac950bd712dad2d4cc9c302856c11e6c2ed6722fc3e4904ed204eb05a9f32bae3f8e7d4fbdd854c3d269a33e601c39c90d02026cdcdd55268090e316df3ffc0eee6de2765eb0d767f1455cd35af89da20ade1e61dc074884d5317f0206abb720acf8c023d2740b41fe37f2cb00fe561725269f4321543b30d528ee3e8884ea493fc6b1629e9a7537e65353fb0afd7e8021d502cb556e7a2b600e859f3fc524ad681df470d8d0ccc463775434ca56de661b34a3b620726aed8affc8a90d7b798a92d6500dacd9fb7d43a37c301d70e59d2d192fa85b2f6689bd9a6d47df9ea45163a228c8291e8d6d0ed5d7d7be8bd6391d6496989df139eaff5fca0f9d47eccad8ff6fb7aa0b8bb3da8e73fa4ff825d208b0ce5a639f30501f200c12f8fa1bf5c4ac42c4a58ceb34bbb3b012121f6ff31ed772d57c421a75813f987888e7e3b984bff8465bbfbdd30d45fae9904816a21c99ca4a903ed19af479d4ce0a1b4e78e2a9b3bdb8dde8986e8f028da0dd37e3129a184b4d36427d130075802421e5c693297f4705a030454b105b91f3ce8be111967dd8016ec9aed42e42ed3ab53e1dc42a0b796557e05b658203ae972378db1a109898a02ac97adfe3d5b24e1ab0d49f7702b69d137e23264e5b2c5b6e72fc2b2a4562b793a2c00ead94de8890700aa3c2fe5baf59ab8b7f524d38ba3b71712151edd00307dc3c9f24ea9d1bbac6687c8f30dbe845663f7aaddaec9df8d1fd15ced22fa58272184fe02aad68fd5a90ee249fced2ef955c0af40e02be0621e7162413e629b4428cb929d0a2bd87375dcec17664fec3a5a6cd2f7039723d41f10b77f5f3b7b052db1043c302795d3d739eecd2d2f686c2c474dcc67d9e844ca50bdabc7ac085aeb02aff0b3cbf17aaa0114ba85eff4a938d87db17680a5995a90347b2a5eccaeeb1be204a6dd83da39fe9485822667a43d4a5451f494063075007f152eeb46e0bad0675cf6219b53b36b1ca474f13f6dae87d1efad3c71f89cd05a04a6c76f6703858650a5fd6e2b45be3bf299386595d8eca6c8c55d537e8b3263828c7be68c92bdae0be0ed101f89c0c4c16154867228dc47ff0a4fccb4bb72b7cf8aa2c4a9bd4fd01254e51a7fbf680f408b5ae9c189466625b0f41636d94060e805eb6da30eab1202b65d8226918c4b99a73a6874089dbc5eac08cfab3d7";
TaikoData.TierProof memory proof = TaikoData.TierProof({ tier: 0, data: data });

// `verifyProof()`
Expand Down
Loading

0 comments on commit 0b11101

Please sign in to comment.