Compare commits

..

3 Commits

Author SHA1 Message Date
Steven
b09c2bbecb fix: upgrade to use scroll-prover v0.5.7 (#749) 2023-08-07 20:51:24 +08:00
HAOYUatHZ
7d2a516be1 bump version (#747) 2023-08-07 16:30:56 +08:00
Péter Garamvölgyi
ee55fe3d51 fix: do not update batch rollup_status to FinalizationFailed on tx error (#745) 2023-08-07 16:18:57 +08:00
5 changed files with 32 additions and 35 deletions

View File

@@ -424,7 +424,6 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
return
case types.ProvingTaskVerified:
log.Info("Start to roll up zk proof", "hash", hash)
success := false
var parentBatchStateRoot string
if batch.Index > 0 {
@@ -438,24 +437,14 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
parentBatchStateRoot = parentBatch.StateRoot
}
defer func() {
// TODO: need to revisit this and have a more fine-grained error handling
if !success {
log.Info("Failed to upload the proof, change rollup status to RollupFinalizeFailed", "hash", hash)
if err = r.batchOrm.UpdateRollupStatus(r.ctx, hash, types.RollupFinalizeFailed); err != nil {
log.Warn("UpdateRollupStatus failed", "hash", hash, "err", err)
}
}
}()
aggProof, err := r.batchOrm.GetVerifiedProofByHash(r.ctx, hash)
if err != nil {
log.Warn("get verified proof by hash failed", "hash", hash, "err", err)
log.Error("get verified proof by hash failed", "hash", hash, "err", err)
return
}
if err = aggProof.SanityCheck(); err != nil {
log.Warn("agg_proof sanity check fails", "hash", hash, "error", err)
log.Error("agg_proof sanity check fails", "hash", hash, "error", err)
return
}
@@ -478,8 +467,18 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
finalizeTxHash := &txHash
if err != nil {
if !errors.Is(err, sender.ErrNoAvailableAccount) && !errors.Is(err, sender.ErrFullPending) {
log.Error("finalizeBatchWithProof in layer1 failed",
"index", batch.Index, "hash", batch.Hash, "err", err)
// This can happen normally if we try to finalize 2 or more
// batches around the same time. The 2nd tx might fail since
// the client does not see the 1st tx's updates at this point.
// TODO: add more fine-grained error handling
log.Error(
"finalizeBatchWithProof in layer1 failed",
"index", batch.Index,
"hash", batch.Hash,
"RollupContractAddress", r.cfg.RollupContractAddress,
"calldata", common.Bytes2Hex(data),
"err", err,
)
}
return
}
@@ -489,11 +488,10 @@ func (r *Layer2Relayer) ProcessCommittedBatches() {
// record and sync with db, @todo handle db error
err = r.batchOrm.UpdateFinalizeTxHashAndRollupStatus(r.ctx, hash, finalizeTxHash.String(), types.RollupFinalizing)
if err != nil {
log.Warn("UpdateFinalizeTxHashAndRollupStatus failed",
log.Error("UpdateFinalizeTxHashAndRollupStatus failed",
"index", batch.Index, "batch hash", batch.Hash,
"tx hash", finalizeTxHash.String(), "err", err)
}
success = true
r.processingFinalization.Store(txID, hash)
case types.ProvingTaskFailed:

View File

@@ -90,10 +90,9 @@ func testL2RelayerProcessCommittedBatches(t *testing.T) {
statuses, err := batchOrm.GetRollupStatusByHashList(context.Background(), []string{batch.Hash})
assert.NoError(t, err)
assert.Equal(t, 1, len(statuses))
assert.Equal(t, types.RollupFinalizeFailed, statuses[0])
// no valid proof, rollup status remains the same
assert.Equal(t, types.RollupCommitted, statuses[0])
err = batchOrm.UpdateRollupStatus(context.Background(), batch.Hash, types.RollupCommitted)
assert.NoError(t, err)
proof := &message.BatchProof{
Proof: []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},
}

View File

@@ -32,7 +32,7 @@ dependencies = [
[[package]]
name = "aggregator"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"ark-std",
"env_logger 0.10.0",
@@ -432,7 +432,7 @@ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
[[package]]
name = "bus-mapping"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"eth-types",
"ethers-core",
@@ -1048,7 +1048,7 @@ dependencies = [
[[package]]
name = "eth-types"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"ethers-core",
"ethers-signers",
@@ -1225,7 +1225,7 @@ dependencies = [
[[package]]
name = "external-tracer"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"eth-types",
"geth-utils",
@@ -1438,7 +1438,7 @@ dependencies = [
[[package]]
name = "gadgets"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"digest 0.7.6",
"eth-types",
@@ -1478,7 +1478,7 @@ dependencies = [
[[package]]
name = "geth-utils"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"env_logger 0.9.3",
"gobuild 0.1.0-alpha.2 (git+https://github.com/scroll-tech/gobuild.git)",
@@ -2076,7 +2076,7 @@ dependencies = [
[[package]]
name = "keccak256"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"env_logger 0.9.3",
"eth-types",
@@ -2263,7 +2263,7 @@ dependencies = [
[[package]]
name = "mock"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"eth-types",
"ethers-core",
@@ -2278,7 +2278,7 @@ dependencies = [
[[package]]
name = "mpt-zktrie"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"bus-mapping",
"eth-types",
@@ -2754,7 +2754,7 @@ dependencies = [
[[package]]
name = "prover"
version = "0.4.0"
source = "git+https://github.com/scroll-tech/scroll-prover?tag=v0.5.6#e4ac08a856684de12ce4fe8ce4f3fb7f45f87043"
source = "git+https://github.com/scroll-tech/scroll-prover?tag=v0.5.7#e775132e2f19c15d8a12ecce42ab5928148b40f2"
dependencies = [
"aggregator",
"anyhow",
@@ -4039,7 +4039,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
[[package]]
name = "types"
version = "0.4.0"
source = "git+https://github.com/scroll-tech/scroll-prover?tag=v0.5.6#e4ac08a856684de12ce4fe8ce4f3fb7f45f87043"
source = "git+https://github.com/scroll-tech/scroll-prover?tag=v0.5.7#e775132e2f19c15d8a12ecce42ab5928148b40f2"
dependencies = [
"base64 0.13.1",
"blake2",
@@ -4490,7 +4490,7 @@ checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9"
[[package]]
name = "zkevm-circuits"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.6#aa2d252c260781e5ddfa309b36f7543df68d142e"
source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.5.7#fb86b7442aea82589cd7b6b9c2ec45ef2c9d7101"
dependencies = [
"array-init",
"bus-mapping",

View File

@@ -20,8 +20,8 @@ maingate = { git = "https://github.com/scroll-tech/halo2wrong", branch = "halo2-
halo2curves = { git = "https://github.com/scroll-tech/halo2curves.git", branch = "0.3.1-derive-serde" }
[dependencies]
prover = { git = "https://github.com/scroll-tech/scroll-prover", tag = "v0.5.6" }
types = { git = "https://github.com/scroll-tech/scroll-prover", tag = "v0.5.6" }
prover = { git = "https://github.com/scroll-tech/scroll-prover", tag = "v0.5.7" }
types = { git = "https://github.com/scroll-tech/scroll-prover", tag = "v0.5.7" }
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop" }
log = "0.4"

View File

@@ -5,7 +5,7 @@ import (
"runtime/debug"
)
var tag = "v4.1.18"
var tag = "v4.1.20"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {