Compare commits

..

5 Commits

16 changed files with 185 additions and 10637 deletions

View File

@@ -51,9 +51,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
rollup_relayer:
runs-on:
@@ -97,9 +95,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
blob_uploader:
runs-on:
@@ -143,9 +139,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
rollup-db-cli:
runs-on:
@@ -189,9 +183,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
bridgehistoryapi-fetcher:
runs-on:
@@ -235,9 +227,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
bridgehistoryapi-api:
runs-on:
@@ -281,9 +271,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
bridgehistoryapi-db-cli:
runs-on:
@@ -327,9 +315,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
coordinator-api:
runs-on:
@@ -372,9 +358,7 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest
coordinator-cron:
runs-on:
@@ -418,6 +402,4 @@ jobs:
push: true
tags: |
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
scrolltech/${{ env.REPOSITORY }}:latest
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:latest

View File

@@ -39,7 +39,8 @@ on:
options:
- "11.7.1"
- "12.2.2"
default: "11.7.1"
- "12.9.1"
default: "12.9.1"
CARGO_CHEF_TAG:
description: "Cargo chef version"
required: true

208
Cargo.lock generated
View File

@@ -28,41 +28,6 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]]
name = "aead"
version = "0.6.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac8202ab55fcbf46ca829833f347a82a2a4ce0596f0304ac322c2d100030cd56"
dependencies = [
"crypto-common 0.2.0-rc.4",
"inout",
]
[[package]]
name = "aes"
version = "0.9.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e713c57c2a2b19159e7be83b9194600d7e8eb3b7c2cd67e671adf47ce189a05"
dependencies = [
"cfg-if",
"cipher",
"cpufeatures",
]
[[package]]
name = "aes-gcm"
version = "0.11.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2be322be4a73a3a55ad74b9833238e76bfd6034ce69a05c1b41c879f6a3bdca6"
dependencies = [
"aead",
"aes",
"cipher",
"ctr",
"ghash",
"subtle",
]
[[package]]
name = "ahash"
version = "0.8.12"
@@ -298,9 +263,9 @@ dependencies = [
[[package]]
name = "alloy-json-abi"
version = "1.3.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "459f98c6843f208856f338bfb25e65325467f7aff35dfeb0484d0a76e059134b"
checksum = "8b26fdd571915bafe857fccba4ee1a4f352965800e46a53e4a5f50187b7776fa"
dependencies = [
"alloy-primitives",
"alloy-sol-type-parser",
@@ -570,9 +535,9 @@ dependencies = [
[[package]]
name = "alloy-sol-macro"
version = "1.3.1"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d20d867dcf42019d4779519a1ceb55eba8d7f3d0e4f0a89bcba82b8f9eb01e48"
checksum = "a14f21d053aea4c6630687c2f4ad614bed4c81e14737a9b904798b24f30ea849"
dependencies = [
"alloy-sol-macro-expander",
"alloy-sol-macro-input",
@@ -584,9 +549,9 @@ dependencies = [
[[package]]
name = "alloy-sol-macro-expander"
version = "1.3.1"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b74e91b0b553c115d14bd0ed41898309356dc85d0e3d4b9014c4e7715e48c8ad"
checksum = "34d99282e7c9ef14eb62727981a985a01869e586d1dec729d3bb33679094c100"
dependencies = [
"alloy-sol-macro-input",
"const-hex",
@@ -602,9 +567,9 @@ dependencies = [
[[package]]
name = "alloy-sol-macro-input"
version = "1.3.1"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84194d31220803f5f62d0a00f583fd3a062b36382e2bea446f1af96727754565"
checksum = "eda029f955b78e493360ee1d7bd11e1ab9f2a220a5715449babc79d6d0a01105"
dependencies = [
"const-hex",
"dunce",
@@ -618,9 +583,9 @@ dependencies = [
[[package]]
name = "alloy-sol-type-parser"
version = "1.3.1"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe8c27b3cf6b2bb8361904732f955bc7c05e00be5f469cec7e2280b6167f3ff0"
checksum = "10db1bd7baa35bc8d4a1b07efbf734e73e5ba09f2580fb8cee3483a36087ceb2"
dependencies = [
"serde",
"winnow 0.7.10",
@@ -628,9 +593,9 @@ dependencies = [
[[package]]
name = "alloy-sol-types"
version = "1.3.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a285b46e3e0c177887028278f04cc8262b76fd3b8e0e20e93cea0a58c35f5ac5"
checksum = "6185e98a79cf19010722f48a74b5a65d153631d2f038cabd250f4b9e9813b8ad"
dependencies = [
"alloy-json-abi",
"alloy-primitives",
@@ -1490,15 +1455,6 @@ dependencies = [
"generic-array",
]
[[package]]
name = "block-buffer"
version = "0.11.0-rc.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9ef36a6fcdb072aa548f3da057640ec10859eb4e91ddf526ee648d50c76a949"
dependencies = [
"hybrid-array",
]
[[package]]
name = "bls12_381"
version = "0.7.1"
@@ -1713,17 +1669,6 @@ dependencies = [
"windows-link",
]
[[package]]
name = "cipher"
version = "0.5.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e12a13eb01ded5d32ee9658d94f553a19e804204f2dc811df69ab4d9e0cb8c7"
dependencies = [
"block-buffer 0.11.0-rc.5",
"crypto-common 0.2.0-rc.4",
"inout",
]
[[package]]
name = "clang-sys"
version = "1.8.1"
@@ -1788,7 +1733,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys 0.48.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -1990,16 +1935,6 @@ dependencies = [
"typenum",
]
[[package]]
name = "crypto-common"
version = "0.2.0-rc.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8235645834fbc6832939736ce2f2d08192652269e11010a6240f61b908a1c6"
dependencies = [
"hybrid-array",
"rand_core 0.9.3",
]
[[package]]
name = "ctor"
version = "0.2.9"
@@ -2010,15 +1945,6 @@ dependencies = [
"syn 2.0.101",
]
[[package]]
name = "ctr"
version = "0.10.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27e41d01c6f73b9330177f5cf782ae5b581b5f2c7840e298e0275ceee5001434"
dependencies = [
"cipher",
]
[[package]]
name = "cuda-config"
version = "0.1.0"
@@ -2272,7 +2198,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer 0.10.4",
"const-oid",
"crypto-common 0.1.6",
"crypto-common",
"subtle",
]
@@ -2326,19 +2252,6 @@ dependencies = [
"spki",
]
[[package]]
name = "ecies"
version = "0.1.0"
source = "git+https://github.com/scroll-tech/ecies-rs#e32a93f736aac2158bf5982b8e4786b82be8b854"
dependencies = [
"aes-gcm",
"digest 0.10.7",
"hkdf",
"k256",
"sha2 0.10.9",
"thiserror 2.0.12",
]
[[package]]
name = "educe"
version = "0.6.0"
@@ -2483,7 +2396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18"
dependencies = [
"libc",
"windows-sys 0.52.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -2917,15 +2830,6 @@ dependencies = [
"syn 2.0.101",
]
[[package]]
name = "ghash"
version = "0.6.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f88107cb02ed63adcc4282942e60c4d09d80208d33b360ce7c729ce6dae1739"
dependencies = [
"polyval",
]
[[package]]
name = "gimli"
version = "0.31.1"
@@ -3283,15 +3187,6 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
[[package]]
name = "hkdf"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
dependencies = [
"hmac",
]
[[package]]
name = "hmac"
version = "0.12.1"
@@ -3369,15 +3264,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hybrid-array"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7116c472cf19838450b1d421b4e842569f52b519d640aee9ace1ebcf5b21051"
dependencies = [
"typenum",
]
[[package]]
name = "hyper"
version = "0.14.32"
@@ -3698,15 +3584,6 @@ dependencies = [
"serde",
]
[[package]]
name = "inout"
version = "0.2.0-rc.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1603f76010ff924b616c8f44815a42eb10fb0b93d308b41deaa8da6d4251fd4b"
dependencies = [
"hybrid-array",
]
[[package]]
name = "instant"
version = "0.1.13"
@@ -3908,7 +3785,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [
"cfg-if",
"windows-targets 0.48.5",
"windows-targets 0.52.6",
]
[[package]]
@@ -4477,7 +4354,7 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56"
dependencies = [
"proc-macro-crate 1.3.1",
"proc-macro-crate 3.3.0",
"proc-macro2",
"quote",
"syn 2.0.101",
@@ -6239,17 +6116,6 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "polyval"
version = "0.7.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ffd40cc99d0fbb02b4b3771346b811df94194bc103983efa0203c8893755085"
dependencies = [
"cfg-if",
"cpufeatures",
"universal-hash",
]
[[package]]
name = "portable-atomic"
version = "1.11.1"
@@ -6530,7 +6396,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
"windows-sys 0.52.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -7921,7 +7787,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.52.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -8312,7 +8178,7 @@ dependencies = [
[[package]]
name = "scroll-zkvm-prover"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"base64 0.22.1",
"bincode 1.3.3",
@@ -8339,7 +8205,7 @@ dependencies = [
[[package]]
name = "scroll-zkvm-types"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"alloy-primitives",
"base64 0.22.1",
@@ -8359,7 +8225,7 @@ dependencies = [
[[package]]
name = "scroll-zkvm-types-base"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"alloy-primitives",
"alloy-serde 1.0.30",
@@ -8372,7 +8238,7 @@ dependencies = [
[[package]]
name = "scroll-zkvm-types-batch"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"alloy-primitives",
"c-kzg",
@@ -8394,7 +8260,7 @@ dependencies = [
[[package]]
name = "scroll-zkvm-types-bundle"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"rkyv",
"scroll-zkvm-types-base",
@@ -8404,12 +8270,9 @@ dependencies = [
[[package]]
name = "scroll-zkvm-types-chunk"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"alloy-primitives",
"alloy-sol-types",
"ecies",
"itertools 0.14.0",
"rkyv",
"sbv-core",
"sbv-helpers",
@@ -8417,13 +8280,12 @@ dependencies = [
"sbv-trie",
"scroll-zkvm-types-base",
"serde",
"thiserror 2.0.12",
]
[[package]]
name = "scroll-zkvm-verifier"
version = "0.6.0"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=5c361ad#5c361ad2eec9a2f115671d6a4dab1628aae63259"
source = "git+https://github.com/scroll-tech/zkvm-prover?rev=060be4c#060be4c0461b0a197c5be47fc74415165a0abe25"
dependencies = [
"bincode 1.3.3",
"eyre",
@@ -8944,7 +8806,7 @@ dependencies = [
"cfg-if",
"libc",
"psm",
"windows-sys 0.52.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -9080,9 +8942,9 @@ dependencies = [
[[package]]
name = "syn-solidity"
version = "1.3.1"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0b198d366dbec045acfcd97295eb653a7a2b40e4dc764ef1e79aafcad439d3c"
checksum = "b9ac494e7266fcdd2ad80bf4375d55d27a117ea5c866c26d0e97fe5b3caeeb75"
dependencies = [
"paste",
"proc-macro2",
@@ -9174,7 +9036,7 @@ dependencies = [
"getrandom 0.3.3",
"once_cell",
"rustix",
"windows-sys 0.52.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -9745,16 +9607,6 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "universal-hash"
version = "0.6.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a55be643b40a21558f44806b53ee9319595bc7ca6896372e4e08e5d7d83c9cd6"
dependencies = [
"crypto-common 0.2.0-rc.4",
"subtle",
]
[[package]]
name = "unroll"
version = "0.1.5"

View File

@@ -17,9 +17,9 @@ repository = "https://github.com/scroll-tech/scroll"
version = "4.5.47"
[workspace.dependencies]
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "5c361ad" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "5c361ad" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "5c361ad" }
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "060be4c" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "060be4c" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "060be4c" }
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master", features = ["scroll", "rkyv"] }
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
@@ -32,7 +32,6 @@ metrics-tracing-context = "0.16.0"
anyhow = "1.0"
alloy = { version = "1", default-features = false }
alloy-primitives = { version = "1.3", default-features = false, features = ["tiny-keccak"] }
alloy-sol-types = { version = "1.3", default-features = false }
# also use this to trigger "serde" feature for primitives
alloy-serde = { version = "1", default-features = false }

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -252,7 +252,6 @@ mod tests {
batch_hash: B256::repeat_byte(4),
withdraw_root: B256::repeat_byte(5),
msg_queue_hash: B256::repeat_byte(6),
encryption_key: None,
};
let bundle_pi_hash = bundle_info.pi_hash(ForkName::EuclidV1);
BundleProofMetadata {

View File

@@ -30,9 +30,9 @@ where
{
panic_catch(|| {
for w in proofs.windows(2) {
// w[1].metadata
// .pi_hash_info()
// .validate(w[0].metadata.pi_hash_info(), fork_name);
w[1].metadata
.pi_hash_info()
.validate(w[0].metadata.pi_hash_info(), fork_name);
}
})
.map_err(|e| eyre::eyre!("Chunk data validation failed: {}", e))?;

View File

@@ -189,7 +189,6 @@ impl BatchProvingTask {
blob_bytes: self.blob_bytes.clone(),
reference_header,
point_eval_witness,
version: 0,
}
}

View File

@@ -41,7 +41,6 @@ impl BundleProvingTask {
fn build_guest_input(&self) -> BundleWitness {
BundleWitness {
version: 0,
batch_proofs: self.batch_proofs.iter().map(|proof| proof.into()).collect(),
batch_infos: self
.batch_proofs
@@ -72,8 +71,7 @@ impl TryFrom<BundleProvingTask> for ProvingTask {
fn try_from(value: BundleProvingTask) -> Result<Self> {
let witness = value.build_guest_input();
let serialized_witness = if crate::witness_use_legacy_mode() {
//to_rkyv_bytes::<RancorError>(&witness)?.into_vec()
unimplemented!();
to_rkyv_bytes::<RancorError>(&witness)?.into_vec()
} else {
super::encode_task_to_witness(&witness)?
};

View File

@@ -127,11 +127,9 @@ impl ChunkProvingTask {
fn build_guest_input(&self) -> ChunkWitness {
ChunkWitness::new(
0,
&self.block_witnesses,
self.prev_msg_queue_hash,
self.fork_name.to_lowercase().as_str().into(),
None,
)
}

View File

@@ -7,8 +7,14 @@ import (
// SenderConfig The config for transaction sender
type SenderConfig struct {
// The RPC endpoint of the ethereum or scroll public node.
// The RPC endpoint of the ethereum or scroll public node (for backward compatibility).
// If WriteEndpoints is specified, this endpoint will be used only for reading.
// If WriteEndpoints is empty, this endpoint will be used for both reading and writing.
Endpoint string `json:"endpoint"`
// The RPC endpoints to send transactions to (optional).
// If specified, transactions will be sent to all these endpoints in parallel.
// If empty, transactions will be sent to the Endpoint.
WriteEndpoints []string `json:"write_endpoints,omitempty"`
// The time to trigger check pending txs in sender.
CheckPendingTime uint64 `json:"check_pending_time"`
// The number of blocks to wait to escalate increase gas price of the transaction.

View File

@@ -345,8 +345,16 @@ func (r *Layer2Relayer) commitGenesisBatch(batchHash string, batchHeader []byte,
// - backlogCount > r.cfg.BatchSubmission.BacklogMax -> forceSubmit
// - we have at least minBatches AND price hits a desired target price
func (r *Layer2Relayer) ProcessPendingBatches() {
// Get effective batch limits based on whether validium mode is enabled.
minBatches, maxBatches := r.getEffectiveBatchLimits()
// First, get the backlog count to determine batch submission strategy
backlogCount, err := r.batchOrm.GetFailedAndPendingBatchesCount(r.ctx)
if err != nil {
log.Error("Failed to fetch pending L2 batches count", "err", err)
return
}
r.metrics.rollupL2RelayerBacklogCounts.Set(float64(backlogCount))
// Get effective batch limits based on validium mode and backlog size.
minBatches, maxBatches := r.getEffectiveBatchLimits(backlogCount)
// get pending batches from database in ascending order by their index.
dbBatches, err := r.batchOrm.GetFailedAndPendingBatches(r.ctx, maxBatches)
@@ -360,15 +368,6 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
return
}
// if backlog outgrow max size, forcesubmit enough oldest batches
backlogCount, err := r.batchOrm.GetFailedAndPendingBatchesCount(r.ctx)
r.metrics.rollupL2RelayerBacklogCounts.Set(float64(backlogCount))
if err != nil {
log.Error("Failed to fetch pending L2 batches", "err", err)
return
}
var forceSubmit bool
startChunk, err := r.chunkOrm.GetChunkByIndex(r.ctx, dbBatches[0].StartChunkIndex)
@@ -563,12 +562,22 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
log.Info("Sent the commitBatches tx to layer1", "batches count", len(batchesToSubmit), "start index", firstBatch.Index, "start hash", firstBatch.Hash, "end index", lastBatch.Index, "end hash", lastBatch.Hash, "tx hash", txHash.String())
}
// getEffectiveBatchLimits returns the effective min and max batch limits based on whether validium mode is enabled.
func (r *Layer2Relayer) getEffectiveBatchLimits() (int, int) {
// getEffectiveBatchLimits returns the effective min and max batch limits based on whether validium mode is enabled
// and the current backlog size.
// When backlogCount >= backlog_max: submit min_batches for fast inclusion at slightly higher price.
// When backlogCount < backlog_max: submit max_batches for better cost amortization.
func (r *Layer2Relayer) getEffectiveBatchLimits(backlogCount int64) (int, int) {
if r.cfg.ValidiumMode {
return 1, 1 // minBatches=1, maxBatches=1
}
return r.cfg.BatchSubmission.MinBatches, r.cfg.BatchSubmission.MaxBatches
// If backlog is at or above max, prioritize fast inclusion by submitting min_batches
if backlogCount >= r.cfg.BatchSubmission.BacklogMax {
return r.cfg.BatchSubmission.MinBatches, r.cfg.BatchSubmission.MinBatches
}
// Otherwise, prioritize cost efficiency by trying to submit max_batches
return r.cfg.BatchSubmission.MaxBatches, r.cfg.BatchSubmission.MaxBatches
}
func (r *Layer2Relayer) contextIDFromBatches(codecVersion encoding.CodecVersion, batches []*dbBatchWithChunks) string {

View File

@@ -56,6 +56,7 @@ func setupEnv(t *testing.T) {
cfg.L2Config.RelayerConfig.SenderConfig.Endpoint, err = testApps.GetPoSL1EndPoint()
assert.NoError(t, err)
cfg.L2Config.RelayerConfig.SenderConfig.WriteEndpoints = []string{cfg.L2Config.RelayerConfig.SenderConfig.Endpoint, cfg.L2Config.RelayerConfig.SenderConfig.Endpoint}
cfg.L1Config.RelayerConfig.SenderConfig.Endpoint, err = testApps.GetL2GethEndPoint()
assert.NoError(t, err)

View File

@@ -7,6 +7,7 @@ import (
"fmt"
"math/big"
"strings"
"sync"
"time"
"github.com/holiman/uint256"
@@ -67,7 +68,8 @@ type FeeData struct {
type Sender struct {
config *config.SenderConfig
gethClient *gethclient.Client
client *ethclient.Client // The client to retrieve on chain data or send transaction.
client *ethclient.Client // The client to retrieve on chain data (read-only)
writeClients []*ethclient.Client // The clients to send transactions to (write operations)
transactionSigner *TransactionSigner
chainID *big.Int // The chain id of the endpoint
ctx context.Context
@@ -90,9 +92,10 @@ func NewSender(ctx context.Context, config *config.SenderConfig, signerConfig *c
return nil, fmt.Errorf("invalid params, EscalateMultipleNum; %v, EscalateMultipleDen: %v", config.EscalateMultipleNum, config.EscalateMultipleDen)
}
// Initialize read client
rpcClient, err := rpc.Dial(config.Endpoint)
if err != nil {
return nil, fmt.Errorf("failed to dial eth client, err: %w", err)
return nil, fmt.Errorf("failed to dial read client, err: %w", err)
}
client := ethclient.NewClient(rpcClient)
@@ -105,12 +108,42 @@ func NewSender(ctx context.Context, config *config.SenderConfig, signerConfig *c
return nil, fmt.Errorf("failed to create transaction signer, err: %w", err)
}
// Initialize write clients
var writeClients []*ethclient.Client
if len(config.WriteEndpoints) > 0 {
// Use specified write endpoints
for i, endpoint := range config.WriteEndpoints {
writeRpcClient, err := rpc.Dial(endpoint)
if err != nil {
return nil, fmt.Errorf("failed to dial write client %d (endpoint: %s), err: %w", i, endpoint, err)
}
writeClient := ethclient.NewClient(writeRpcClient)
// Verify the write client is connected to the same chain
writeChainID, err := writeClient.ChainID(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get chain ID from write client %d (endpoint: %s), err: %w", i, endpoint, err)
}
if writeChainID.Cmp(chainID) != 0 {
return nil, fmt.Errorf("write client %d (endpoint: %s) has different chain ID %s, expected %s", i, endpoint, writeChainID.String(), chainID.String())
}
writeClients = append(writeClients, writeClient)
}
log.Info("initialized sender with multiple write clients", "service", service, "name", name, "readEndpoint", config.Endpoint, "writeEndpoints", config.WriteEndpoints)
} else {
// Use read client for writing (backward compatibility)
writeClients = append(writeClients, client)
log.Info("initialized sender with single client", "service", service, "name", name, "endpoint", config.Endpoint)
}
// Create sender instance first and then initialize nonce
sender := &Sender{
ctx: ctx,
config: config,
gethClient: gethclient.New(rpcClient),
client: client,
writeClients: writeClients,
chainID: chainID,
transactionSigner: transactionSigner,
db: db,
@@ -169,6 +202,82 @@ func (s *Sender) getFeeData(target *common.Address, data []byte, sidecar *gethTy
}
}
// sendTransactionToMultipleClients sends a transaction to all write clients in parallel
// and returns success if at least one client succeeds
func (s *Sender) sendTransactionToMultipleClients(signedTx *gethTypes.Transaction) error {
ctx, cancel := context.WithTimeout(s.ctx, 15*time.Second)
defer cancel()
if len(s.writeClients) == 1 {
// Single client - use direct approach
return s.writeClients[0].SendTransaction(ctx, signedTx)
}
// Multiple clients - send in parallel
type result struct {
endpoint string
err error
}
resultChan := make(chan result, len(s.writeClients))
var wg sync.WaitGroup
// Send transaction to all write clients in parallel
for i, client := range s.writeClients {
wg.Add(1)
// Determine endpoint URL for this client
endpoint := s.config.WriteEndpoints[i]
go func(ep string, writeClient *ethclient.Client) {
defer wg.Done()
err := writeClient.SendTransaction(ctx, signedTx)
resultChan <- result{endpoint: ep, err: err}
}(endpoint, client)
}
// Wait for all goroutines to finish
go func() {
wg.Wait()
close(resultChan)
}()
// Collect results
var errs []error
for res := range resultChan {
if res.err != nil {
errs = append(errs, fmt.Errorf("%s: %w", res.endpoint, res.err))
log.Warn("failed to send transaction to write client",
"endpoint", res.endpoint,
"txHash", signedTx.Hash().Hex(),
"nonce", signedTx.Nonce(),
"from", s.transactionSigner.GetAddr().String(),
"error", res.err)
} else {
log.Info("successfully sent transaction to write client",
"endpoint", res.endpoint,
"txHash", signedTx.Hash().Hex(),
"nonce", signedTx.Nonce(),
"from", s.transactionSigner.GetAddr().String())
}
}
// Check if at least one client succeeded
if len(errs) < len(s.writeClients) {
successCount := len(s.writeClients) - len(errs)
if len(errs) > 0 {
log.Info("transaction partially succeeded",
"txHash", signedTx.Hash().Hex(),
"successCount", successCount,
"totalClients", len(s.writeClients),
"failures", errors.Join(errs...))
}
return nil
}
// All clients failed
return fmt.Errorf("failed to send transaction to all %d write clients: %w", len(s.writeClients), errors.Join(errs...))
}
// SendTransaction send a signed L2tL1 transaction.
func (s *Sender) SendTransaction(contextID string, target *common.Address, data []byte, blobs []*kzg4844.Blob) (common.Hash, uint64, error) {
s.metrics.sendTransactionTotal.WithLabelValues(s.service, s.name).Inc()
@@ -230,7 +339,7 @@ func (s *Sender) SendTransaction(contextID string, target *common.Address, data
return common.Hash{}, 0, fmt.Errorf("failed to insert transaction, err: %w", err)
}
if err := s.client.SendTransaction(s.ctx, signedTx); err != nil {
if err := s.sendTransactionToMultipleClients(signedTx); err != nil {
// Delete the transaction from the pending transaction table if it fails to send.
if updateErr := s.pendingTransactionOrm.DeleteTransactionByTxHash(s.ctx, signedTx.Hash()); updateErr != nil {
log.Error("failed to delete transaction", "tx hash", signedTx.Hash().String(), "from", s.transactionSigner.GetAddr().String(), "nonce", signedTx.Nonce(), "err", updateErr)
@@ -645,7 +754,7 @@ func (s *Sender) checkPendingTransaction() {
return
}
if err := s.client.SendTransaction(s.ctx, newSignedTx); err != nil {
if err := s.sendTransactionToMultipleClients(newSignedTx); err != nil {
if strings.Contains(err.Error(), "nonce too low") {
// When we receive a 'nonce too low' error but cannot find the transaction receipt, it indicates another transaction with this nonce has already been processed, so this transaction will never be mined and should be marked as failed.
log.Warn("nonce too low detected, marking all non-confirmed transactions with same nonce as failed", "nonce", originalTx.Nonce(), "address", s.transactionSigner.GetAddr().Hex(), "txHash", originalTx.Hash().Hex(), "newTxHash", newSignedTx.Hash().Hex(), "err", err)

View File

@@ -36,7 +36,7 @@ E2E_HANDLE_SET ?= ../tests/prover-e2e/testset.json
DUMP_DIR ?= .work
prover:
GO_TAG=${GO_TAG} GIT_REV=${GIT_REV} ZK_VERSION=${ZK_VERSION} cargo build --locked --release -Z unstable-options --lockfile-path ../crates/gpu_override/Cargo.lock -p prover
GO_TAG=${GO_TAG} GIT_REV=${GIT_REV} ZK_VERSION=${ZK_VERSION} cargo build --locked --release --features cuda -p prover
version:
echo ${GO_TAG}-${GIT_REV}-${ZK_VERSION}