-
Notifications
You must be signed in to change notification settings - Fork 615
test: wasm proof verifying with native bb #13499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
8156584
f5c1de3
2b8fed1
4d5e916
33901e4
4cf99ed
fb5662f
059fa3f
c2d78cf
564e0a6
3d45f5f
589346c
cefc90d
0aa3206
9ef5b77
e0209c1
a19569d
f2c6a1f
d9044fd
5df58f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ | |
| #include <iostream> | ||
| #include <map> | ||
| #include <memory> | ||
| #include <msgpack.hpp> // Include the header for msgpack::sbuffer | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is still causing some compilation errors |
||
| #include <optional> | ||
| #include <type_traits> | ||
| #include <vector> | ||
|
|
@@ -452,6 +453,24 @@ template <typename T> uint8_t* to_heap_buffer(T const& value) | |
| return ptr; | ||
| } | ||
|
|
||
| // TODO: make this compile | ||
| template <typename T> uint8_t* to_heap_msgpack_buffer(T const& value) | ||
| { | ||
| using serialize::write; | ||
| msgpack::sbuffer buffer; | ||
| msgpack::pack(buffer, value); | ||
|
|
||
| // Initial serialization of the value. Creates a vector of bytes. | ||
| std::vector<char> buf(buffer.data(), buffer.data() + buffer.size()); | ||
|
|
||
| // Serialize this byte vector, giving us a length prefixed buffer of bytes. | ||
| auto heap_buf = to_buffer(buf); | ||
|
|
||
| auto* ptr = (uint8_t*)aligned_alloc(64, heap_buf.size()); // NOLINT | ||
| std::copy(heap_buf.begin(), heap_buf.end(), ptr); | ||
| return ptr; | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from Adam, a reading function should contain: |
||
| template <typename T> std::vector<T> many_from_buffer(std::vector<uint8_t> const& buffer) | ||
| { | ||
| const size_t num_elements = buffer.size() / sizeof(T); | ||
|
|
@@ -539,6 +558,7 @@ inline void write(auto& buf, const msgpack_concepts::HasMsgPack auto& obj) | |
| (_write_msgpack_field(buf, obj_fields), ...); | ||
| }); | ||
| } | ||
|
|
||
| } // namespace serialize | ||
| // clang-format off | ||
| // NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast, cert-dcl58-cpp) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ import { | |
| witnessGenMockRollupRootCircuit, | ||
| } from './index.js'; | ||
| import { proveAvm, proveClientIVC, proveRollupHonk, proveTube } from './prove_native.js'; | ||
| import { proveClientIVC as proveClientIVCWASM } from './prove_wasm.js'; | ||
| import type { KernelPublicInputs } from './types/index.js'; | ||
|
|
||
| /* eslint-disable camelcase */ | ||
|
|
@@ -58,7 +59,7 @@ describe('Rollup IVC Integration', () => { | |
|
|
||
| const [bytecodes, witnessStack, tailPublicInputs] = await generate3FunctionTestingIVCStack(); | ||
| clientIVCPublicInputs = tailPublicInputs; | ||
| const proof = await proveClientIVC(bbBinaryPath, clientIVCWorkingDirectory, witnessStack, bytecodes, logger); | ||
| const proof = await proveClientIVCWASM(bytecodes, witnessStack, 16); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should be able to run |
||
| await writeClientIVCProofToOutputDirectory(proof, clientIVCWorkingDirectory); | ||
| const verifyResult = await verifyClientIvcProof( | ||
| bbBinaryPath, | ||
|
|
@@ -93,7 +94,7 @@ describe('Rollup IVC Integration', () => { | |
| workingDirectory = await fs.mkdtemp(path.join(os.tmpdir(), 'bb-rollup-ivc-integration-')); | ||
| }); | ||
|
|
||
| it('Should be able to generate a proof of a 3 transaction rollup', async () => { | ||
| it.only('Should be able to generate a proof of a 3 transaction rollup', async () => { | ||
| const privateBaseRollupWitnessResult = await witnessGenMockRollupBasePrivateCircuit({ | ||
| tube_data: { | ||
| public_inputs: clientIVCPublicInputs, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the problematic function on the verifier side