From e85c70c156a14146ed435b9e6ada35b34bfe9783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Tue, 22 Aug 2023 05:27:17 +0200 Subject: [PATCH] fix: free raw result returned from CCC (#477) --- params/version.go | 2 +- rollup/circuitcapacitychecker/impl.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index b8f348c2aec7..7566ea31e6d7 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 4 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release - VersionPatch = 44 // Patch version component of the current release + VersionPatch = 45 // Patch version component of the current release VersionMeta = "sepolia" // Version metadata to append to the version string ) diff --git a/rollup/circuitcapacitychecker/impl.go b/rollup/circuitcapacitychecker/impl.go index ebc6c6330854..e55518a105cc 100644 --- a/rollup/circuitcapacitychecker/impl.go +++ b/rollup/circuitcapacitychecker/impl.go @@ -72,6 +72,9 @@ func (ccc *CircuitCapacityChecker) ApplyTransaction(traces *types.BlockTrace) (* log.Debug("start to check circuit capacity for tx", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash) rawResult := C.apply_tx(C.uint64_t(ccc.ID), tracesStr) + defer func() { + C.free(rawResult) + }() log.Debug("check circuit capacity for tx done", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash) result := &WrappedRowUsage{} @@ -118,6 +121,9 @@ func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types. log.Debug("start to check circuit capacity for block", "id", ccc.ID, "blockNumber", traces.Header.Number, "blockHash", traces.Header.Hash()) rawResult := C.apply_block(C.uint64_t(ccc.ID), tracesStr) + defer func() { + C.free(rawResult) + }() log.Debug("check circuit capacity for block done", "id", ccc.ID, "blockNumber", traces.Header.Number, "blockHash", traces.Header.Hash()) result := &WrappedRowUsage{}