Skip to content

Commit

Permalink
fix: free raw result returned from CCC (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram authored Aug 22, 2023
1 parent be1600f commit e85c70c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
6 changes: 6 additions & 0 deletions rollup/circuitcapacitychecker/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 76 in rollup/circuitcapacitychecker/impl.go

View workflow job for this annotation

GitHub Actions / build-geth

cannot use _cgo0 (variable of type *_Ctype_char) as type unsafe.Pointer in argument to _Cfunc_free
}()
log.Debug("check circuit capacity for tx done", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash)

result := &WrappedRowUsage{}
Expand Down Expand Up @@ -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)

Check failure on line 125 in rollup/circuitcapacitychecker/impl.go

View workflow job for this annotation

GitHub Actions / build-geth

cannot use _cgo0 (variable of type *_Ctype_char) as type unsafe.Pointer in argument to _Cfunc_free
}()
log.Debug("check circuit capacity for block done", "id", ccc.ID, "blockNumber", traces.Header.Number, "blockHash", traces.Header.Hash())

result := &WrappedRowUsage{}
Expand Down

0 comments on commit e85c70c

Please sign in to comment.