Skip to content

Commit

Permalink
fix(ccc): fix CCC build errors (ethereum#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram committed Sep 8, 2023
1 parent 7d79f27 commit 1d824f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion params/version.go
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 4 // Major version component of the current release
VersionMinor = 4 // Minor version component of the current release
VersionPatch = 3 // Patch version component of the current release
VersionPatch = 4 // Patch version component of the current release
VersionMeta = "sepolia" // Version metadata to append to the version string
)

Expand Down
13 changes: 6 additions & 7 deletions rollup/circuitcapacitychecker/impl.go
Expand Up @@ -11,6 +11,7 @@ import "C" //nolint:typecheck

import (
"encoding/json"
"fmt"
"sync"
"unsafe"

Expand Down Expand Up @@ -147,7 +148,7 @@ func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types.
}

// CheckTxNum compares whether the tx_count in ccc match the expected
func (ccc *CircuitCapacityChecker) CheckTxNum(expected int) (bool, unit64, error) {
func (ccc *CircuitCapacityChecker) CheckTxNum(expected int) (bool, uint64, error) {
ccc.Lock()
defer ccc.Unlock()

Expand All @@ -159,14 +160,12 @@ func (ccc *CircuitCapacityChecker) CheckTxNum(expected int) (bool, unit64, error
log.Debug("ccc get_tx_num end", "id", ccc.ID)

result := &WrappedTxNum{}
if err = json.Unmarshal([]byte(C.GoString(rawResult)), result); err != nil {
log.Error("fail to json unmarshal get_tx_num result", "id", ccc.ID, "err", err)
return false, 0, ErrUnknown
if err := json.Unmarshal([]byte(C.GoString(rawResult)), result); err != nil {
return false, 0, fmt.Errorf("fail to json unmarshal get_tx_num result, id: %d, err: %w", ccc.ID, err)
}
if result.Error != "" {
log.Error("fail to get_tx_num in CircuitCapacityChecker", "id", ccc.ID, "err", result.Error)
return false, 0, ErrUnknown
return false, 0, fmt.Errorf("fail to get_tx_num in CircuitCapacityChecker, id: %d, err: %w", ccc.ID, result.Error)
}

return result.TxNum == unit64(expected), result.TxNum, nil
return result.TxNum == uint64(expected), result.TxNum, nil
}

0 comments on commit 1d824f4

Please sign in to comment.