Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bbapi_chonk.hpp
Go to the documentation of this file.
1#pragma once
16
17#ifndef __wasm__
18#define BBAPI_CHONK_BATCH_VERIFIER_SUPPORTED
19#endif
20
21#ifdef BBAPI_CHONK_BATCH_VERIFIER_SUPPORTED
25#include <atomic>
26#include <mutex>
27#endif
28
29#include <string>
30#include <vector>
31
32namespace bb::bbapi {
33
34#ifdef BBAPI_CHONK_BATCH_VERIFIER_SUPPORTED
44 public:
47
50
52 uint32_t num_cores,
53 uint32_t batch_size,
54 const std::string& fifo_path);
55 void enqueue(VerifyRequest request);
56 void fail_request(uint64_t request_id, std::string error_message);
57 void stop();
58 bool is_running() const { return running_.load(); }
59
60 private:
64 bool fail_fifo_locked(const std::string& message);
65
67
68 std::mutex fifo_mutex_;
69 std::string fifo_path_;
70 int fifo_fd_ = -1;
73};
74#endif // BBAPI_CHONK_BATCH_VERIFIER_SUPPORTED
75
76} // namespace bb::bbapi
Asynchronous batch verifier for Chonk IVC proofs.
FIFO-streaming batch verification service for Chonk proofs.
void enqueue(VerifyRequest request)
ChonkBatchVerifierService(const ChonkBatchVerifierService &)=delete
void fail_request(uint64_t request_id, std::string error_message)
bool write_result(VerifyResult result)
void start(std::vector< std::shared_ptr< MegaZKFlavor::VKAndHash > > vks, uint32_t num_cores, uint32_t batch_size, const std::string &fifo_path)
ChonkBatchVerifierService & operator=(const ChonkBatchVerifierService &)=delete
bool fail_fifo_locked(const std::string &message)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
A request to verify a single Chonk proof.
Result of verifying a single proof within a batch.