Skip to content

Commit

Permalink
grin v5.3 (0138) Update new 5.3.x branch, update rust-secp to 0.7.14 (m…
Browse files Browse the repository at this point in the history
…imblewimble#3787)

* Add secp context for all calls
  • Loading branch information
bayk committed Jun 23, 2024
1 parent b0e747f commit a640448
Show file tree
Hide file tree
Showing 35 changed files with 335 additions and 267 deletions.
66 changes: 28 additions & 38 deletions Cargo.lock

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

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mwc"
version = "5.3.0"
version = "5.3.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format."
license = "Apache-2.0"
Expand Down Expand Up @@ -32,14 +32,14 @@ serde_json = "1"
term = "0.6"
cursive_table_view = "0.14.0"

grin_api = { path = "./api", version = "5.3.0" }
grin_config = { path = "./config", version = "5.3.0" }
grin_chain = { path = "./chain", version = "5.3.0" }
grin_core = { path = "./core", version = "5.3.0" }
grin_keychain = { path = "./keychain", version = "5.3.0" }
grin_p2p = { path = "./p2p", version = "5.3.0" }
grin_servers = { path = "./servers", version = "5.3.0" }
grin_util = { path = "./util", version = "5.3.0" }
grin_api = { path = "./api", version = "5.3.1" }
grin_config = { path = "./config", version = "5.3.1" }
grin_chain = { path = "./chain", version = "5.3.1" }
grin_core = { path = "./core", version = "5.3.1" }
grin_keychain = { path = "./keychain", version = "5.3.1" }
grin_p2p = { path = "./p2p", version = "5.3.1" }
grin_servers = { path = "./servers", version = "5.3.1" }
grin_util = { path = "./util", version = "5.3.1" }

[dependencies.cursive]
version = "0.20"
Expand All @@ -50,5 +50,5 @@ features = ["pancurses-backend"]
built = { version = "0.4", features = ["git2"]}

[dev-dependencies]
grin_chain = { path = "./chain", version = "5.3.0" }
grin_store = { path = "./store", version = "5.3.0" }
grin_chain = { path = "./chain", version = "5.3.1" }
grin_store = { path = "./store", version = "5.3.1" }
14 changes: 7 additions & 7 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_api"
version = "5.3.0"
version = "5.3.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "APIs for grin, a simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format."
license = "Apache-2.0"
Expand Down Expand Up @@ -30,12 +30,12 @@ url = "2.1"
bytes = "0.5"
chrono = { version = "0.4.11", features = ["serde"] }

grin_core = { path = "../core", version = "5.3.0" }
grin_chain = { path = "../chain", version = "5.3.0" }
grin_p2p = { path = "../p2p", version = "5.3.0" }
grin_pool = { path = "../pool", version = "5.3.0" }
grin_store = { path = "../store", version = "5.3.0" }
grin_util = { path = "../util", version = "5.3.0" }
grin_core = { path = "../core", version = "5.3.1" }
grin_chain = { path = "../chain", version = "5.3.1" }
grin_p2p = { path = "../p2p", version = "5.3.1" }
grin_pool = { path = "../pool", version = "5.3.1" }
grin_store = { path = "../store", version = "5.3.1" }
grin_util = { path = "../util", version = "5.3.1" }

# NOTE. We can't have hyper-rustls the same version for Android and non android. because if how rust builds dependency.
# Android must have v0.20+
Expand Down
10 changes: 5 additions & 5 deletions chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_chain"
version = "5.3.0"
version = "5.3.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Chain implementation for grin, a simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format."
license = "Apache-2.0"
Expand All @@ -23,10 +23,10 @@ chrono = "0.4.11"
lru-cache = "0.1"
lazy_static = "1"

grin_core = { path = "../core", version = "5.3.0" }
grin_keychain = { path = "../keychain", version = "5.3.0" }
grin_store = { path = "../store", version = "5.3.0" }
grin_util = { path = "../util", version = "5.3.0" }
grin_core = { path = "../core", version = "5.3.1" }
grin_keychain = { path = "../keychain", version = "5.3.1" }
grin_store = { path = "../store", version = "5.3.1" }
grin_util = { path = "../util", version = "5.3.1" }

[dev-dependencies]
env_logger = "0.7"
Expand Down
3 changes: 1 addition & 2 deletions chain/tests/mine_simple_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,7 @@ where
let commit = build.keychain.commit(value, &key_id, switch)?;

// invert commitment
let commit = secp::Secp256k1::commit_sum(vec![], vec![commit])?;
//build.keychain.secp().commit_sum(vec![], vec![commit])?;
let commit = build.keychain.secp().commit_sum(vec![], vec![commit])?;

eprintln!("Building output: {}, {:?}", value, commit);

Expand Down
18 changes: 9 additions & 9 deletions chain/tests/nrd_validation_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ fn process_block_nrd_validation() -> Result<(), Error> {
let msg = kernel.msg_to_sign().unwrap();

// // Generate a kernel with public excess and associated signature.
let excess = BlindingFactor::rand();
let skey = excess.secret_key().unwrap();
let excess = BlindingFactor::rand(keychain.secp());
let skey = excess.secret_key(keychain.secp()).unwrap();
kernel.excess = keychain.secp().commit(0, skey).unwrap();
let pubkey = &kernel.excess.to_pubkey().unwrap();
let pubkey = &kernel.excess.to_pubkey(keychain.secp()).unwrap();
kernel.excess_sig =
aggsig::sign_with_blinding(&keychain.secp(), &msg, &excess, Some(&pubkey)).unwrap();
kernel.verify().unwrap();
Expand Down Expand Up @@ -232,10 +232,10 @@ fn process_block_nrd_validation_relative_height_1() -> Result<(), Error> {
let msg = kernel.msg_to_sign().unwrap();

// // Generate a kernel with public excess and associated signature.
let excess = BlindingFactor::rand();
let skey = excess.secret_key().unwrap();
let excess = BlindingFactor::rand(keychain.secp());
let skey = excess.secret_key(keychain.secp()).unwrap();
kernel.excess = keychain.secp().commit(0, skey).unwrap();
let pubkey = &kernel.excess.to_pubkey().unwrap();
let pubkey = &kernel.excess.to_pubkey(keychain.secp()).unwrap();
kernel.excess_sig =
aggsig::sign_with_blinding(&keychain.secp(), &msg, &excess, Some(&pubkey)).unwrap();
kernel.verify().unwrap();
Expand Down Expand Up @@ -331,10 +331,10 @@ fn process_block_nrd_validation_fork() -> Result<(), Error> {
let msg = kernel.msg_to_sign().unwrap();

// // Generate a kernel with public excess and associated signature.
let excess = BlindingFactor::rand();
let skey = excess.secret_key().unwrap();
let excess = BlindingFactor::rand(keychain.secp());
let skey = excess.secret_key(keychain.secp()).unwrap();
kernel.excess = keychain.secp().commit(0, skey).unwrap();
let pubkey = &kernel.excess.to_pubkey().unwrap();
let pubkey = &kernel.excess.to_pubkey(keychain.secp()).unwrap();
kernel.excess_sig =
aggsig::sign_with_blinding(&keychain.secp(), &msg, &excess, Some(&pubkey)).unwrap();
kernel.verify().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions chain/tests/test_pibd_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ fn test_pibd_copy_impl(
dest_root_dir: &str,
dest_template_dir: Option<&str>,
) {
global::set_local_chain_type(global::ChainTypes::Testnet);
let mut genesis = genesis::genesis_test();
global::set_local_chain_type(global::ChainTypes::Floonet);
let mut genesis = genesis::genesis_floo();

if is_test_chain {
global::set_local_chain_type(global::ChainTypes::AutomatedTesting);
Expand Down
Loading

0 comments on commit a640448

Please sign in to comment.