From 42fe4fe2c0d4dbe291fa8e7c448b85766eb89ee7 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Tue, 27 Aug 2024 12:08:10 -0700 Subject: [PATCH 1/6] chore: bump `kzg-rs` version --- crates/precompile/Cargo.toml | 4 +--- crates/primitives/Cargo.toml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index 9232e24b98..56eaac64e5 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -50,9 +50,7 @@ c-kzg = { version = "1.0.3", default-features = false, optional = true, features ] } # Optionally use `kzg-rs` for a pure Rust implementation of KZG point evaluation. -kzg-rs = { version = "0.1", default-features = false, features = [ - 'cache', -], optional = true } +kzg-rs = { version = "0.2.1", default-features = false, optional = true } # BLS12-381 precompiles blst = { version = "0.3.13", optional = true } diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 8dadd07554..c91bdaaeb6 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -37,9 +37,7 @@ c-kzg = { version = "1.0.3", default-features = false, optional = true, features ] } # Optionally use `kzg-rs` for a pure Rust implementation of KZG. -kzg-rs = { version = "0.1", default-features = false, features = [ - 'cache', -], optional = true } +kzg-rs = { version = "0.2.1", default-features = false, optional = true } # utility enumn = "0.1" From ae68d5caf97771bc0927778fba42bfce5ee4c4c7 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Tue, 27 Aug 2024 12:17:33 -0700 Subject: [PATCH 2/6] fix: remove serde req --- Cargo.lock | 142 +++++++++++++++++++++++------------ crates/primitives/Cargo.toml | 1 - 2 files changed, 93 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e528a35ed..1282bc64a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + [[package]] name = "addr2line" version = "0.22.0" @@ -405,7 +416,7 @@ dependencies = [ "ark-serialize 0.3.0", "ark-std 0.3.0", "derivative", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.3.3", @@ -425,7 +436,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.4.0", @@ -458,7 +469,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "quote", "syn 1.0.109", @@ -470,7 +481,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", @@ -495,7 +506,7 @@ checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-std 0.4.0", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.6", ] [[package]] @@ -719,19 +730,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" -dependencies = [ - "ff", - "group", - "pairing", - "rand_core", - "subtle", -] - [[package]] name = "blst" version = "0.3.13" @@ -1410,11 +1408,28 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "bitvec", + "byteorder", + "ff_derive", "rand_core", "subtle", ] +[[package]] +name = "ff_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f54704be45ed286151c5e11531316eaef5b8f5af7d597b806fdb8af108d84a" +dependencies = [ + "addchain", + "cfg-if", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2127,17 +2142,15 @@ dependencies = [ [[package]] name = "kzg-rs" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9920cd4460ce3cbca19c62f3bb9a9611562478a4dc9d2c556f4a7d049c5b6b" +checksum = "ea38b4917cfb194709222324913a33a999b25f9da59e2c8da304fc0ef55f996a" dependencies = [ - "bls12_381", - "glob", + "ff", "hex", "once_cell", - "serde", - "serde_derive", - "serde_yaml", + "sha2", + "sp1_bls12_381", ] [[package]] @@ -2254,7 +2267,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-complex", "num-integer", "num-iter", @@ -2262,6 +2275,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -2313,7 +2337,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-integer", "num-traits", ] @@ -3238,7 +3262,7 @@ dependencies = [ "ark-ff 0.4.2", "bytes", "fastrlp", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "parity-scale-codec", "primitive-types", @@ -3590,19 +3614,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha1" version = "0.10.6" @@ -3661,7 +3672,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "thiserror", "time", @@ -3688,6 +3699,16 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "socket2" version = "0.5.7" @@ -3698,6 +3719,35 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sp1-lib" +version = "1.2.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f600a97b145e66f0f5e56595527c359f5cc8cb1f9dc8a6da1ba34bb845c9d1e" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "hex", + "serde", + "snowbridge-amcl", +] + +[[package]] +name = "sp1_bls12_381" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27c4b8901334dc09099dd82f80a72ddfc76b0046f4b342584c808f1931bed5a" +dependencies = [ + "cfg-if", + "ff", + "group", + "pairing", + "rand_core", + "sp1-lib", + "subtle", +] + [[package]] name = "spin" version = "0.5.2" @@ -4276,12 +4326,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.7.1" diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index c91bdaaeb6..e21af1d0c7 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -73,7 +73,6 @@ serde = [ "bitvec/serde", "bitflags/serde", "c-kzg?/serde", - "kzg-rs?/serde", ] arbitrary = [ "std", From 66b568645cc3b510863d89010a5a61844af86dd9 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Tue, 27 Aug 2024 12:44:18 -0700 Subject: [PATCH 3/6] ci: check `kzg-rs` in no-std mode --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edc5c1642e..fedccca9d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - features: ["", "optimism"] + features: ["", "optimism", "kzg-rs"] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable From 9a8197e45bfa70ab818707b5b093b7bff57b89b1 Mon Sep 17 00:00:00 2001 From: Bhargav Annem Date: Tue, 27 Aug 2024 21:21:08 -0700 Subject: [PATCH 4/6] chore: update kzg-rs dep --- crates/precompile/Cargo.toml | 2 +- crates/primitives/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/precompile/Cargo.toml b/crates/precompile/Cargo.toml index 56eaac64e5..9a603128bd 100644 --- a/crates/precompile/Cargo.toml +++ b/crates/precompile/Cargo.toml @@ -50,7 +50,7 @@ c-kzg = { version = "1.0.3", default-features = false, optional = true, features ] } # Optionally use `kzg-rs` for a pure Rust implementation of KZG point evaluation. -kzg-rs = { version = "0.2.1", default-features = false, optional = true } +kzg-rs = { version = "0.2.2", default-features = false, optional = true } # BLS12-381 precompiles blst = { version = "0.3.13", optional = true } diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index e21af1d0c7..3669b16059 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -37,7 +37,7 @@ c-kzg = { version = "1.0.3", default-features = false, optional = true, features ] } # Optionally use `kzg-rs` for a pure Rust implementation of KZG. -kzg-rs = { version = "0.2.1", default-features = false, optional = true } +kzg-rs = { version = "0.2.2", default-features = false, optional = true } # utility enumn = "0.1" From 2c915a0548bb9256c114fbd82f5a15cbb983b0cf Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 28 Aug 2024 12:16:19 +0200 Subject: [PATCH 5/6] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fedccca9d4..e8154e6d56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - features: ["", "optimism", "kzg-rs"] + features: ["", "optimism kzg-rs"] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable From 81f05e4f9b7fc35ee44ac5c303ae66c8634fa015 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 28 Aug 2024 12:18:39 +0200 Subject: [PATCH 6/6] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8154e6d56..c3cb25136a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - features: ["", "optimism kzg-rs"] + features: ["", "optimism,kzg-rs"] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable