Skip to content

Commit

Permalink
Refactor/t775 update dependency bn254 (#797)
Browse files Browse the repository at this point in the history
* Use forge for testing the BLS signature implementation in solidity.
* Remove BN256.G2 dependency and related code.
* Remove function *verifyAggSig*.
* Point to solidity-bn254 v0.2.0.
* Use G2ParsedPoint in diff_test.rs.

Co-authored-by: Alex Xiong <[email protected]>
  • Loading branch information
philippecamacho and alxiong authored Dec 14, 2023
1 parent 0d12934 commit 2ed2568
Show file tree
Hide file tree
Showing 33 changed files with 318 additions and 1,964 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[submodule "lib/bn254"]
path = contracts/lib/bn254
url = https://github.com/EspressoSystems/solidity-bn254
branch = v0.1.1
branch = v0.2.0
[submodule "contracts/lib/solmate"]
path = contracts/lib/solmate
url = https://github.com/transmissions11/solmate
22 changes: 14 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

421 changes: 0 additions & 421 deletions contract-bindings/src/bls_helper.rs

This file was deleted.

119 changes: 0 additions & 119 deletions contract-bindings/src/bn256g2.rs

This file was deleted.

259 changes: 0 additions & 259 deletions contract-bindings/src/deploy_hot_shot.rs

This file was deleted.

142 changes: 2 additions & 140 deletions contract-bindings/src/hot_shot.rs

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions contract-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
//! Do not manually edit these files.
//! These files may be overwritten by the codegen system at any time.
pub mod abstract_stake_table;
pub mod bls_helper;
pub mod bls_sig;
pub mod bn254;
pub mod bn256g2;
pub mod bytes_lib;
pub mod deploy_hot_shot;
pub mod ed_on_bn254;
pub mod erc20;
pub mod example_token;
Expand Down
20 changes: 10 additions & 10 deletions contract-bindings/src/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,35 +98,35 @@ pub mod light_client {
name: ::std::borrow::ToOwned::to_owned("blockCommRoot"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
Expand Down Expand Up @@ -181,35 +181,35 @@ pub mod light_client {
name: ::std::borrow::ToOwned::to_owned("blockCommRoot"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("feeLedgerComm"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("stakeTableBlsKeyComm",),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("stakeTableSchnorrKeyComm",),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("stakeTableAmountComm",),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
::std::borrow::ToOwned::to_owned("BN254.ScalarField"),
),
},
::ethers::core::abi::ethabi::Param {
Expand Down
4 changes: 2 additions & 2 deletions contract-bindings/src/plonk_verifier.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contract-bindings/src/stake_table.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/lib/bn254
5 changes: 1 addition & 4 deletions contracts/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ ark-ff = "0.4"
ark-poly = "0.4"
ark-serialize = "0.4"
ark-std = { version = "0.4", default-features = false }
async-compatibility-layer = { git = "https://github.com/EspressoSystems/async-compatibility-layer", tag = "1.4.1", features = [
"logging-utils",
] }
async-std = "1.12.0"
clap = { version = "^4.4", features = ["derive"] }
contract-bindings = { path = "../../contract-bindings" }
crs = { git = "https://github.com/alxiong/crs" }
diff-test-bn254 = { git = "https://github.com/EspressoSystems/solidity-bn254.git", tag = "v0.2.0" }
digest = { version = "0.10", default-features = false, features = ["alloc"] }
ethers = { version = "2.0.4" }
ethers-providers = "2.0.4"
ethers-solc = "2.0.4"
hex = "0.4.3"
itertools = "0.12.0"
jf-plonk = { workspace = true }
Expand Down
Loading

0 comments on commit 2ed2568

Please sign in to comment.