Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #998 from jovfer/bugfix/fix_android_publish_and_co…
Browse files Browse the repository at this point in the history
…nn_performance

RC 1.6.1
  • Loading branch information
jovfer authored Jul 27, 2018
2 parents 53aed50 + aef82a4 commit 39c76e8
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 33 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 1.6.0
## 1.6.0, 1.6.1

* Integrated tags based search in Anoncreds workflow:
* Updated `indy_prover_store_credential` API function to create tags for a stored credential object.
Expand Down Expand Up @@ -30,6 +30,10 @@ Performed the following changes related to Libindy Payments API:
* Added `ledger verify-payment-receipt` command in Indy CLI.
* Bugfixes

### 1.6.1 bugfixes
* Fix connection performance issue
* Fix Android publishing

Notes:

* There is [migration guide](doc/migration-guide-1.5.0-1.6.0.md) about API changes.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ The documents that provide necessary information for Libindy migration. This doc
to simplify their transition to API of Libindy 1.4.0.
* [v1.3.0 → v1.4.0](doc/migration-guide-1.3.0-1.4.0.md)
* [v1.4.0 → v1.5.0](doc/migration-guide-1.4.0-1.5.0.md)
* [v1.5.0 → v1.6.0](doc/migration-guide-1.5.0-1.6.0.md)
* [v1.5.0 → v1.6.x](doc/migration-guide-1.5.0-1.6.0.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libindy-objc",
"version": "1.6.0",
"version": "1.6.1",
"summary": "Summary TODO.",
"homepage": "TODO",
"license": {
Expand All @@ -11,7 +11,7 @@
"Daniel Hardman": "[email protected]"
},
"source": {
"http": "https://repo.sovrin.org/ios/libindy/stable/indy-objc/1.6.0/libindy-objc.zip"
"http": "https://repo.sovrin.org/ios/libindy/stable/indy-objc/1.6.1/libindy-objc.zip"
},
"platforms": {
"ios": "10.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libindy",
"version": "1.6.0",
"version": "1.6.1",
"summary": "Summary TODO.",
"description": "Description TODO.",
"homepage": "TODO",
Expand All @@ -15,7 +15,7 @@
"ios": "10.0"
},
"source": {
"http": "https://repo.sovrin.org/ios/libindy/stable/libindy-core/1.6.0/libindy.tar.gz"
"http": "https://repo.sovrin.org/ios/libindy/stable/libindy-core/1.6.1/libindy.tar.gz"
},
"source_files": "*.h",
"vendored_libraries": "*.a",
Expand Down
13 changes: 6 additions & 7 deletions ci/android-zip-and-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ is_stable="$7"
[ -z $is_stable ] && exit 7

if [ "${is_stable}" == "1" ]; then
ssh -v -oStrictHostKeyChecking=no -i $key [email protected] mkdir -p /var/repository/repos/android/${artifact}/stable/${version}
src = "/var/repository/repos/android/${artifact}/rc/${version}-${buildNumber}/${artifact}_android_${arch}_${version}.zip"
target = "/var/repository/repos/android/${artifact}/stable/$version"

cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key [email protected]
cd /var/repository/repos/android/${artifact}/stable/$version
cp -vr /var/repository/repos/android/${artifact}/rc/${version}-${buildNumber}/${artifact}_android_${arch}_${version}.zip .
ls -l /var/repository/repos/android/${artifact}/stable/$version
EOF
else
ssh -v -oStrictHostKeyChecking=no -i $key [email protected] mkdir -p $target
ssh -v -oStrictHostKeyChecking=no -i '$sovrin_repo_key' [email protected] cp -r $src $target

else
ssh -v -oStrictHostKeyChecking=no -i $key [email protected] mkdir -p /var/repository/repos/android/${artifact}/${branchName}/${version}-${buildNumber}

cat <<EOF | sftp -v -oStrictHostKeyChecking=no -i $key [email protected]
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.lock

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

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indy-cli"
version = "1.6.0"
version = "1.6.1"
authors = ["Vyacheslav Gudkov <[email protected]>"]

[features]
Expand Down
2 changes: 1 addition & 1 deletion cli/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
indy-cli (1.6.0) unstable; urgency=medium
indy-cli (1.6.1) unstable; urgency=medium

[ Hyperledger ]
* Created Indy-Cli
2 changes: 1 addition & 1 deletion libindy/Cargo.lock

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

2 changes: 1 addition & 1 deletion libindy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "indy"
version = "1.6.0"
version = "1.6.1"
authors = [
"Sergej Pupykin <[email protected]>",
"Vyacheslav Gudkov <[email protected]>",
Expand Down
4 changes: 3 additions & 1 deletion libindy/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libindy (1.6.0) unstable; urgency=medium
libindy (1.6.1) unstable; urgency=medium

[ Hyperledger ]

Expand Down Expand Up @@ -29,6 +29,8 @@ Performed the following changes related to Libindy Payments API:
* Removed EXPERIMENTAL notice from endpoints.
* Added `ledger verify-payment-receipt` command in Indy CLI.
* Bugfixes
* 1.6.1 bugfixes
* Fix connection performance issue

Notes:

Expand Down
49 changes: 42 additions & 7 deletions libindy/src/services/pool/networker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use self::zmq::Socket as ZSocket;
use services::pool::events::*;
use services::pool::types::*;
use std::cell::RefCell;
use std::collections::{BTreeMap, HashMap};
use std::collections::{BTreeMap, HashMap, HashSet};
use super::time::Duration;
use time::Tm;
use utils::sequence::SequenceUtils;
Expand All @@ -28,7 +28,7 @@ pub struct ZMQNetworker {
nodes: Vec<RemoteNode>,
active_timeout: i64,
conn_limit: usize,
preordered_nodes: Vec<String>
preordered_nodes: Vec<String>,
}

impl Networker for ZMQNetworker {
Expand Down Expand Up @@ -56,10 +56,15 @@ impl Networker for ZMQNetworker {
match pe.clone() {
Some(NetworkerEvent::SendAllRequest(_, req_id, _)) | Some(NetworkerEvent::SendOneRequest(_, req_id, _)) | Some(NetworkerEvent::Resend(req_id, _)) => {
let num = self.req_id_mappings.get(&req_id).map(|i| i.clone()).or_else(|| {
trace!("sending new request");
self.pool_connections.iter().next_back().and_then(|(pc_idx, pc)| {
if pc.is_active() && pc.req_cnt < self.conn_limit && pc.nodes.eq(&self.nodes) {
if pc.is_active() && pc.req_cnt < self.conn_limit
&& pc.nodes.iter().collect::<HashSet<&RemoteNode>>().eq(
&self.nodes.iter().collect::<HashSet<&RemoteNode>>()) {
trace!("existing connection available");
Some(*pc_idx)
} else {
trace!("existing connection unavailable");
None
}
})
Expand Down Expand Up @@ -176,7 +181,7 @@ impl PoolConnection {

thread_rng().shuffle(nodes.as_mut());

if !preordered_nodes.is_empty(){
if !preordered_nodes.is_empty() {
nodes.sort_by_key(|node: &RemoteNode| -> usize {
preordered_nodes.iter()
.position(|&ref name| node.name.eq(name))
Expand Down Expand Up @@ -240,8 +245,10 @@ impl PoolConnection {
}

fn is_active(&self) -> bool {
trace!("time worked: {:?}", time::now() - self.time_created);
time::now() - self.time_created < Duration::seconds(self.active_timeout)
trace!("is_active >> time worked: {:?}", time::now() - self.time_created);
let res = time::now() - self.time_created < Duration::seconds(self.active_timeout);
trace!("is_active << {}", res);
res
}

fn send_request(&mut self, pe: Option<NetworkerEvent>) -> Result<(), PoolError> {
Expand Down Expand Up @@ -467,6 +474,34 @@ pub mod networker_tests {
assert_eq!(vec![MESSAGE.to_string()], messages);
}

#[test]
fn networker_process_send_all_request_event_works_for_2_requests_and_different_nodes_order() {
let mut txn_1 = nodes_emulator::node();
let handle_1 = nodes_emulator::start(&mut txn_1);
let rn_1 = _remote_node(&txn_1);

let mut txn_2 = nodes_emulator::node_2();
let handle_2 = nodes_emulator::start(&mut txn_2);
let rn_2 = _remote_node(&txn_2);

let send_cnt = 2;

let mut networker = ZMQNetworker::new(POOL_CON_ACTIVE_TO, MAX_REQ_PER_POOL_CON, vec!["n2".to_string(), "n1".to_string()]);

networker.process_event(Some(NetworkerEvent::NodesStateUpdated(vec![rn_1, rn_2])));

for i in 0..send_cnt {
networker.process_event(Some(NetworkerEvent::SendAllRequest(MESSAGE.to_string(), i.to_string(), POOL_ACK_TIMEOUT)));
assert_eq!(1, networker.pool_connections.len());
}

let messages = handle_1.join().unwrap();
assert_eq!(vec![MESSAGE.to_string(); send_cnt], messages);

let messages = handle_2.join().unwrap();
assert_eq!(vec![MESSAGE.to_string(); send_cnt], messages);
}

#[test]
fn networker_process_send_six_request_event_works() {
let txn = nodes_emulator::node();
Expand Down Expand Up @@ -929,4 +964,4 @@ pub mod networker_tests {
assert_match!(Err(PoolError::CommonError(_)), res);
}
}
}
}
2 changes: 1 addition & 1 deletion libindy/src/services/pool/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl PoolConfig {
}
}

#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct RemoteNode {
pub name: String,
pub public_key: Vec<u8>,
Expand Down
2 changes: 1 addition & 1 deletion libnullpay/Cargo.lock

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

2 changes: 1 addition & 1 deletion libnullpay/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "null-payment-method"
version = "1.6.0"
version = "1.6.1"
authors = ["Nikita Khateev <[email protected]>"]
build = "build.rs"

Expand Down
2 changes: 1 addition & 1 deletion libnullpay/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libnullpay (1.6.0) unstable; urgency=medium
libnullpay (1.6.1) unstable; urgency=medium

[ Hyperledger ]
* Initial release
2 changes: 1 addition & 1 deletion wrappers/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.hyperledger</groupId>
<artifactId>indy</artifactId>
<packaging>jar</packaging>
<version>1.6.0</version>
<version>1.6.1</version>
<name>indy</name>
<description>This is the official SDK for Hyperledger Indy (https://www.hyperledger.org/projects),
which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org).
Expand Down
2 changes: 1 addition & 1 deletion wrappers/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "indy-sdk",
"version": "1.6.0",
"version": "1.6.1",
"description": "Native bindings for hyperledger indy",
"author": "hyperledger",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion wrappers/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='python3-indy',
version='1.6.0',
version='1.6.1',
packages=['indy'],
url='https://github.com/hyperledger/indy-sdk',
license='MIT/Apache-2.0',
Expand Down

0 comments on commit 39c76e8

Please sign in to comment.