Skip to content

Commit

Permalink
U
Browse files Browse the repository at this point in the history
  • Loading branch information
silathdiir committed Oct 23, 2023
1 parent 33ed9d4 commit e718d42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prover/core/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewProverCore(cfg *config.ProverCoreConfig) (*ProverCore, error) {

var vk string
var rawVK *C.char
defer C.free_c_chars(rawVK)
defer C.free_c_chars(unsafe.Pointer(rawVK))
if cfg.ProofType == message.ProofTypeBatch {
C.init_batch_prover(paramsPathStr, assetsPathStr)
rawVK = C.get_batch_vk()
Expand Down Expand Up @@ -162,7 +162,7 @@ func (p *ProverCore) checkChunkProofs(chunkProofsByt []byte) (bool, error) {

log.Info("Start to check chunk proofs ...")
cResult := C.check_chunk_proofs(chunkProofsStr)
defer C.free_c_chars(cResult)
defer C.free_c_chars(unsafe.Pointer(cResult))
log.Info("Finish checking chunk proofs!")

var result CheckChunkProofsResponse
Expand All @@ -189,7 +189,7 @@ func (p *ProverCore) proveBatch(chunkInfosByt []byte, chunkProofsByt []byte) ([]

log.Info("Start to create batch proof ...")
bResult := C.gen_batch_proof(chunkInfosStr, chunkProofsStr)
defer C.free_c_chars(bResult)
defer C.free_c_chars(unsafe.Pointer(bResult))
log.Info("Finish creating batch proof!")

var result ProofResult
Expand All @@ -211,7 +211,7 @@ func (p *ProverCore) proveChunk(tracesByt []byte) ([]byte, error) {

log.Info("Start to create chunk proof ...")
cProof := C.gen_chunk_proof(tracesStr)
defer C.free_c_chars(cProof)
defer C.free_c_chars(unsafe.Pointer(cProof))
log.Info("Finish creating chunk proof!")

var result ProofResult
Expand Down Expand Up @@ -243,7 +243,7 @@ func (p *ProverCore) mayDumpProof(id string, proofByt []byte) error {

func (p *ProverCore) tracesToChunkInfo(tracesByt []byte) []byte {
tracesStr := C.CString(string(tracesByt))
defer C.free_c_chars(tracesStr)
defer C.free_c_chars(unsafe.Pointer(tracesStr))

cChunkInfo := C.block_traces_to_chunk_info(tracesStr)
defer C.free(unsafe.Pointer(cChunkInfo))
Expand Down

0 comments on commit e718d42

Please sign in to comment.