Skip to content

Commit 4637e65

Browse files
committed
Merge tag 'scroll-v5.4.2' into sentio-dev
feat: delay Curie fork on mainnet by 1 day (scroll-tech#821)
2 parents 1262a02 + 69aae68 commit 4637e65

15 files changed

+82
-46
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG BUILDNUM=""
55
ARG SCROLL_LIB_PATH=/scroll/lib
66

77
# Build libzkp dependency
8-
FROM scrolltech/go-rust-builder:go-1.20-rust-nightly-2022-12-10 as chef
8+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as chef
99
WORKDIR app
1010

1111
FROM chef as planner
@@ -23,7 +23,7 @@ RUN cargo build --release
2323
RUN find ./ | grep libzktrie.so | xargs -I{} cp {} /app/target/release/
2424

2525
# Build Geth in a stock Go builder container
26-
FROM scrolltech/go-rust-builder:go-1.20-rust-nightly-2022-12-10 as builder
26+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as builder
2727

2828
ADD . /go-ethereum
2929

Dockerfile.alltools

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.20-alpine as builder
7+
FROM golang:1.21-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

Dockerfile.mockccc

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG BUILDNUM=""
55
ARG SCROLL_LIB_PATH=/scroll/lib
66

77
# Build Geth in a stock Go builder container
8-
FROM scrolltech/go-rust-builder:go-1.20-rust-nightly-2022-12-10 as builder
8+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as builder
99

1010
ADD . /go-ethereum
1111
RUN cd /go-ethereum && env GO111MODULE=on go run build/ci.go install ./cmd/geth

Dockerfile.mockccc.alpine

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.20-alpine as builder
7+
FROM golang:1.21-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ require (
5151
github.com/rjeczalik/notify v0.9.1
5252
github.com/rs/cors v1.7.0
5353
github.com/scroll-tech/da-codec v0.0.0-20240605080813-32bfc9fccde7
54-
github.com/scroll-tech/zktrie v0.8.2
54+
github.com/scroll-tech/zktrie v0.8.4
5555
github.com/shirou/gopsutil v3.21.11+incompatible
5656
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4
5757
github.com/stretchr/testify v1.9.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
394394
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
395395
github.com/scroll-tech/da-codec v0.0.0-20240605080813-32bfc9fccde7 h1:CDrPMqifvAVyYqu0x1J5qickVV0b51tApPnOwDYLESI=
396396
github.com/scroll-tech/da-codec v0.0.0-20240605080813-32bfc9fccde7/go.mod h1:1wWYii0OPwd5kw+xrz0PFgS420xNadrNF1x/ELJT+TM=
397-
github.com/scroll-tech/zktrie v0.8.2 h1:UMuIfA+jdgWMLmTgTL64Emo+zzMOdcnH0+eYdDcshxQ=
398-
github.com/scroll-tech/zktrie v0.8.2/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
397+
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=
398+
github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
399399
github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
400400
github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
401401
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

metrics/prometheus/collector.go

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func (c *collector) addTimer(name string, m metrics.Timer) {
7777
pv := []float64{0.5, 0.75, 0.95, 0.99, 0.999, 0.9999}
7878
ps := m.Percentiles(pv)
7979
c.writeSummaryCounter(name, m.Count())
80+
c.writeSummaryCounter(mutateKey(name+"_total"), m.Total().Nanoseconds())
8081
c.buff.WriteString(fmt.Sprintf(typeSummaryTpl, mutateKey(name)))
8182
for i := range pv {
8283
c.writeSummaryPercentile(name, strconv.FormatFloat(pv[i], 'f', -1, 64), ps[i])

metrics/prometheus/collector_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ test_meter 9999999
8484
# TYPE test_timer_count counter
8585
test_timer_count 6
8686
87+
# TYPE test_timer_total_count counter
88+
test_timer_total_count 230000000
89+
8790
# TYPE test_timer summary
8891
test_timer {quantile="0.5"} 2.25e+07
8992
test_timer {quantile="0.75"} 4.8e+07

params/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ var (
319319
ArchimedesBlock: big.NewInt(0),
320320
ShanghaiBlock: big.NewInt(0),
321321
BernoulliBlock: big.NewInt(3747132),
322-
CurieBlock: nil,
322+
CurieBlock: big.NewInt(4740239),
323323
DescartesBlock: nil,
324324
Clique: &CliqueConfig{
325325
Period: 3,
@@ -358,7 +358,7 @@ var (
358358
ArchimedesBlock: big.NewInt(0),
359359
ShanghaiBlock: big.NewInt(0),
360360
BernoulliBlock: big.NewInt(5220340),
361-
CurieBlock: nil,
361+
CurieBlock: big.NewInt(6924036),
362362
DescartesBlock: nil,
363363
Clique: &CliqueConfig{
364364
Period: 3,

params/version.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323

2424
const (
2525
VersionMajor = 5 // Major version component of the current release
26-
VersionMinor = 3 // Minor version component of the current release
27-
VersionPatch = 39 // Patch version component of the current release
26+
VersionMinor = 4 // Minor version component of the current release
27+
VersionPatch = 2 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

rollup/circuitcapacitychecker/impl.go

+24-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ import (
1414
"encoding/json"
1515
"fmt"
1616
"sync"
17+
"time"
1718
"unsafe"
1819

1920
"github.com/scroll-tech/go-ethereum/core/types"
2021
"github.com/scroll-tech/go-ethereum/log"
22+
"github.com/scroll-tech/go-ethereum/metrics"
2123
)
2224

2325
// mutex for concurrent CircuitCapacityChecker creations
24-
var creationMu sync.Mutex
26+
var (
27+
creationMu sync.Mutex
28+
encodeTimer = metrics.NewRegisteredTimer("ccc/encode", nil)
29+
)
2530

2631
func init() {
2732
C.init()
@@ -67,6 +72,7 @@ func (ccc *CircuitCapacityChecker) ApplyTransaction(traces *types.BlockTrace) (*
6772
return nil, ErrUnknown
6873
}
6974

75+
encodeStart := time.Now()
7076
ccc.jsonBuffer.Reset()
7177
err := json.NewEncoder(&ccc.jsonBuffer).Encode(traces)
7278
if err != nil {
@@ -79,8 +85,15 @@ func (ccc *CircuitCapacityChecker) ApplyTransaction(traces *types.BlockTrace) (*
7985
C.free(unsafe.Pointer(tracesStr))
8086
}()
8187

88+
rustTrace := C.parse_json_to_rust_trace(tracesStr)
89+
if rustTrace == nil {
90+
log.Error("fail to parse json in to rust trace", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash)
91+
return nil, ErrUnknown
92+
}
93+
encodeTimer.UpdateSince(encodeStart)
94+
8295
log.Debug("start to check circuit capacity for tx", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash)
83-
rawResult := C.apply_tx(C.uint64_t(ccc.ID), tracesStr)
96+
rawResult := C.apply_tx(C.uint64_t(ccc.ID), rustTrace)
8497
defer func() {
8598
C.free_c_chars(rawResult)
8699
}()
@@ -114,6 +127,7 @@ func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types.
114127
ccc.Lock()
115128
defer ccc.Unlock()
116129

130+
encodeStart := time.Now()
117131
ccc.jsonBuffer.Reset()
118132
err := json.NewEncoder(&ccc.jsonBuffer).Encode(traces)
119133
if err != nil {
@@ -126,8 +140,15 @@ func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types.
126140
C.free(unsafe.Pointer(tracesStr))
127141
}()
128142

143+
rustTrace := C.parse_json_to_rust_trace(tracesStr)
144+
if rustTrace == nil {
145+
log.Error("fail to parse json in to rust trace", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash)
146+
return nil, ErrUnknown
147+
}
148+
encodeTimer.UpdateSince(encodeStart)
149+
129150
log.Debug("start to check circuit capacity for block", "id", ccc.ID, "blockNumber", traces.Header.Number, "blockHash", traces.Header.Hash())
130-
rawResult := C.apply_block(C.uint64_t(ccc.ID), tracesStr)
151+
rawResult := C.apply_block(C.uint64_t(ccc.ID), rustTrace)
131152
defer func() {
132153
C.free_c_chars(rawResult)
133154
}()

rollup/circuitcapacitychecker/libzkp/Cargo.lock

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup/circuitcapacitychecker/libzkp/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ poseidon = { git = "https://github.com/scroll-tech/poseidon.git", branch = "main
2323
bls12_381 = { git = "https://github.com/scroll-tech/bls12_381", branch = "feat/impl_scalar_field" }
2424

2525
[dependencies]
26-
prover = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.10.5", default-features = false, features = ["parallel_syn", "scroll", "shanghai", "strict-ccc"] }
26+
prover = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.10.6", default-features = false, features = ["parallel_syn", "scroll", "shanghai", "strict-ccc"] }
2727

2828
anyhow = "1.0"
2929
base64 = "0.13.0"

rollup/circuitcapacitychecker/libzkp/libzkp.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
void init();
55
uint64_t new_circuit_capacity_checker();
66
void reset_circuit_capacity_checker(uint64_t id);
7-
char* apply_tx(uint64_t id, char *tx_traces);
8-
char* apply_block(uint64_t id, char *block_trace);
7+
char* apply_tx(uint64_t id, void* tx_traces);
8+
char* apply_block(uint64_t id, void* block_trace);
99
char* get_tx_num(uint64_t id);
1010
char* set_light_mode(uint64_t id, bool light_mode);
1111
void free_c_chars(char* ptr);
12+
void* parse_json_to_rust_trace(char* trace_json_ptr);

0 commit comments

Comments
 (0)