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

Commit

Permalink
Merge pull request #1217 from holochain/release-0.0.10-alpha1
Browse files Browse the repository at this point in the history
Release 0.0.10-alpha1
  • Loading branch information
thedavidmeister committed Apr 4, 2019
2 parents 77a5708 + bee28ac commit 7951e54
Show file tree
Hide file tree
Showing 103 changed files with 695 additions and 507 deletions.
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,36 @@ jobs:
echo "$UNPINNED"
exit 1
fi
# don't allow changelog root items with no PR reference
- run:
name: no changelogs without PR references
command: |
# temporary avoid build fails due to greps
set +eo pipefail
export UNREFERENCED=`nix-shell --run hc-changelog-grep-pr-references`
set -eo pipefail
if [[ $UNREFERENCED ]]
then
echo "all root level changelog items need a PR reference:"
echo "$UNREFERENCED"
exit 1
fi
# flag any references to a nightly version in a readme other than the
# ${date} in nix-shell
- run:
name: no readmes with bad rust nightly versions
command: |
# temporary avoid build fails due to greps
set +eo pipefail
export BAD_NIGHTLY=`nix-shell --run hc-readme-grep-nightly`
set -eo pipefail
if [[ $BAD_NIGHTLY ]]
then
echo "there is an incorrect nightly version in a readme file:"
echo $BAD_NIGHTLY
exit 1
fi
app-spec-tests:
docker:
Expand Down
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ branches:
only:
- master
- develop
- /^holochain-nodejs-(test-\d+-)*v\d+\.\d+\.\d+-alpha/
- /^release-(test-)*v\d+\.\d+\.\d+-alpha/
- /^(test-\d+-)*v\d+\.\d+\.\d+-alpha/
- /^(holochain-nodejs-|release-)?v\d+\.\d+\.\d+-alpha\d+$/

_trusty_nodejs: &_trusty_nodejs
dist: trusty
Expand Down Expand Up @@ -78,7 +76,7 @@ _macosx_nodejs_template: &_macosx_nodejs_template
- . ./scripts/install/auto.sh

_to_deploy_template: &_to_deploy_template
if: tag =~ /^holochain-nodejs-(test-\d+-)*v\d+\.\d+\.\d+-alpha/
if: tag =~ /^holochain-nodejs-v\d+\.\d+\.\d+-alpha\d+/

_env_node_8_deploy_template: &_env_node_8_deploy_template
env:
Expand Down Expand Up @@ -136,7 +134,7 @@ _cli_deploy_template: &_cli_deploy_template
dist: bionic
language: rust
rust: nightly-2019-01-24
if: tag =~ /^(test-\d+-)*v\d+\.\d+\.\d+-alpha/
if: tag =~ /^v\d+\.\d+\.\d+-alpha\d+/
before_script:
- . ./scripts/install/auto.sh
script:
Expand All @@ -160,7 +158,7 @@ _conductor_deploy_template: &_conductor_deploy_template
dist: bionic
language: rust
rust: nightly-2019-01-24
if: tag =~ /^(test-\d+-)*v\d+\.\d+\.\d+-alpha/
if: tag =~ /^v\d+\.\d+\.\d+-alpha\d+/
before_script:
- . ./scripts/install/auto.sh
script:
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

### Changed

### Deprecated

### Removed

### Fixed

### Security

## [0.0.10-alpha1] - 2019-04-04

### Added

- Adds conductor handling of agent key creation in the context of DPKI [#1182](https://github.com/holochain/holochain-rust/pull/1182)
- Adds a `--path` option to `hc keygen` to specify the location of the generated keybundle. [#1194](https://github.com/holochain/holochain-rust/pull/1194)
- Adds pickle db for cas and eav [#1178](https://github.com/holochain/holochain-rust/pull/1178)
- Adds a `--quiet` option to `hc keygen` for machine-readable output, intended for use in scripts. [#1197](https://github.com/holochain/holochain-rust/pull/1197)
- Adds logging output for every failed WASM execution showing the call that caused this error. [#1200](https://github.com/holochain/holochain-rust/pull/1200) This helps with debugging "Arguement Deserialization failed" errors.
- Adds DNA hash to `hc package` output [#1212](https://github.com/holochain/holochain-rust/pull/1212)

### Changed

- `add_agent()` admin function now creates keystore file instead of just recording file in config [#1182](https://github.com/holochain/holochain-rust/pull/1182)
- One-time-signing now takes a vector of payloads, and returns a vector of signatures.
- One-time-signing now takes a vector of payloads, and returns a vector of signatures. [#1193](https://github.com/holochain/holochain-rust/pull/1193)
- Pins nixpkgs to Holo-Host channel in shell and CI [#1162](https://github.com/holochain/holochain-rust/pull/1162)

### Deprecated

### Removed

- Removes deprecated zome calling route [#1147](https://github.com/holochain/holochain-rust/pull/1147). This is a breaking change for users of hc-web-client prior to version 0.1.3. Please upgrade to 0.1.3 or later and use the callZome syntax.
- Removes JsonString::From<String> and replaces it with JsonString::from_json(&str). This makes conversions more explicit and allows for validating that the string is actually valid json [#1184](https://github.com/holochain/holochain-rust/pull/1184)

### Fixed

-This pull request fixes the various issues with the pickledb implementation. Better guards and directory fixes [#1202]
(https://github.com/holochain/holochain-rust/pull/1202)

### Security

## [0.0.9-alpha] - 2019-03-31
Expand Down
2 changes: 0 additions & 2 deletions app_spec/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ scenario2.runTape('sign_and_verify_message', async (t, { alice, bob }) => {
const message = "Hello everyone! Time to start the secret meeting";

const SignResult = bob.call("converse", "sign_message", { key_id:"", message: message });

t.deepEqual(SignResult, { Ok: 'YVystBCmNEJGW/91bg43cUUybbtiElex0B+QWYy+PlB+nE3W8TThYGE4QzuUexvzkGqSutV04dSN8oyZxTJiBg==' });

const provenance = [bob.agentId, SignResult.Ok];

const VerificationResult = alice.call("converse", "verify_message", { message, provenance });

t.deepEqual(VerificationResult, { Ok: true });
})

Expand Down
2 changes: 1 addition & 1 deletion app_spec/zomes/blog/code/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "code"
version = "0.0.9-alpha"
version = "0.0.10-alpha1"
authors = ["Holochain Core Dev Team <devcore@holochain.org>"]

[dependencies]
Expand Down
5 changes: 3 additions & 2 deletions app_spec/zomes/blog/code/src/blog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ pub fn handle_check_sum(num1: u32, num2: u32) -> ZomeApiResult<JsonString> {
)
}

pub fn handle_check_send(to_agent: Address, message: String) -> ZomeApiResult<String> {
hdk::send(to_agent, message, 10000.into())
pub fn handle_check_send(to_agent: Address, message: String) -> ZomeApiResult<JsonString> {
let received_str = hdk::send(to_agent, message, 10000.into())?;
Ok(JsonString::from_json(&received_str))
}

fn post_entry(content: String) -> Entry {
Expand Down
2 changes: 1 addition & 1 deletion app_spec/zomes/blog/code/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ define_zome! {

check_send: {
inputs: |to_agent: Address, message: String|,
outputs: |response: ZomeApiResult<String>|,
outputs: |response: ZomeApiResult<JsonString>|,
handler: blog::handle_check_send
}

Expand Down
9 changes: 5 additions & 4 deletions app_spec/zomes/converse/code/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use hdk::{
error::ZomeApiResult,
holochain_core_types::{
error::HolochainError,
json::JsonString,
json::{JsonString},
signature::{Provenance, Signature},
},
holochain_wasm_utils::api_serialization::keystore::KeyType,
Expand All @@ -27,8 +27,9 @@ pub fn handle_verify_message(message: String, provenance: Provenance) -> ZomeApi
hdk::verify_signature(provenance, message)
}

pub fn handle_add_key(src_id: String, dst_id: String) -> ZomeApiResult<String> {
hdk::keystore_derive_key(src_id, dst_id, KeyType::Signing)
pub fn handle_add_key(src_id: String, dst_id: String) -> ZomeApiResult<JsonString> {
let key_str = hdk::keystore_derive_key(src_id, dst_id, KeyType::Signing)?;
Ok(JsonString::from_json(&key_str))
}

pub fn handle_add_seed(src_id: String, dst_id: String, index: u64) -> ZomeApiResult<()> {
Expand Down Expand Up @@ -72,7 +73,7 @@ define_zome! {

add_key: {
inputs: |src_id: String, dst_id: String|,
outputs: |result: ZomeApiResult<String>|,
outputs: |result: ZomeApiResult<JsonString>|,
handler: handle_add_key
}

Expand Down
2 changes: 1 addition & 1 deletion app_spec/zomes/summer/code/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "code"
version = "0.0.9-alpha"
version = "0.0.10-alpha1"
authors = ["Holochain Core Dev Team <devcore@holochain.org>"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "benchmarks"
version = "0.0.9-alpha"
version = "0.0.10-alpha1"
authors = ["Holochain Core Dev Team <devcore@holochain.org>"]

[dependencies]
Expand Down
24 changes: 23 additions & 1 deletion benchmarks/benches/my_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,28 @@ extern crate tempfile;

use self::tempfile::tempdir;
use bencher::Bencher;
use holochain_cas_implementations::eav::{file::EavFileStorage, pickle::EavPickleStorage};
use holochain_cas_implementations::eav::{
file::EavFileStorage, memory::EavMemoryStorage, pickle::EavPickleStorage,
};
use holochain_core_types::cas::{content::ExampleAddressableContent, storage::EavTestSuite};

fn bench_memory_eav_one_to_many(b: &mut Bencher) {
b.iter(|| {
let eav_storage = EavMemoryStorage::new();
EavTestSuite::test_one_to_many::<ExampleAddressableContent, EavMemoryStorage>(
eav_storage.clone(),
)
})
}

fn bench_memory_eav_many_to_one(b: &mut Bencher) {
b.iter(|| {
let eav_storage = EavMemoryStorage::new();
EavTestSuite::test_one_to_many::<ExampleAddressableContent, EavMemoryStorage>(
eav_storage.clone(),
)
})
}
fn bench_file_eav_one_to_many(b: &mut Bencher) {
b.iter(|| {
let temp = tempdir().expect("test was supposed to create temp dir");
Expand Down Expand Up @@ -54,6 +74,8 @@ fn bench_pickle_eav_many_to_one(b: &mut Bencher) {

benchmark_group!(
benches,
bench_memory_eav_many_to_one,
bench_memory_eav_one_to_many,
bench_file_eav_one_to_many,
bench_file_eav_many_to_one,
bench_pickle_eav_many_to_one,
Expand Down
2 changes: 1 addition & 1 deletion cas_implementations/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "holochain_cas_implementations"
version = "0.0.9-alpha"
version = "0.0.10-alpha1"
authors = ["Holochain Core Dev Team <devcore@holochain.org>"]
edition = "2018"

Expand Down
5 changes: 4 additions & 1 deletion cas_implementations/src/cas/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use holochain_core_types::{
storage::ContentAddressableStorage,
},
error::HolochainError,
json::JsonString,
};
use std::{
fs::{create_dir_all, read_to_string, write},
Expand Down Expand Up @@ -71,7 +72,9 @@ impl ContentAddressableStorage for FilesystemStorage {
fn fetch(&self, address: &Address) -> Result<Option<Content>, HolochainError> {
let _guard = self.lock.read()?;
if self.contains(&address)? {
Ok(Some(read_to_string(self.address_to_path(address))?.into()))
Ok(Some(JsonString::from_json(&read_to_string(
self.address_to_path(address),
)?)))
} else {
Ok(None)
}
Expand Down
28 changes: 19 additions & 9 deletions cas_implementations/src/cas/pickle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,31 @@ impl Debug for PickleStorage {
}

impl PickleStorage {
pub fn new<P: AsRef<Path>>(db_path: P) -> PickleStorage {
pub fn new<P: AsRef<Path> + Clone>(db_path: P) -> PickleStorage {
let cas_db = db_path.as_ref().join("cas").with_extension("db");
PickleStorage {
id: Uuid::new_v4(),
db: Arc::new(RwLock::new(PickleDb::new(
db_path,
PickleDbDumpPolicy::PeriodicDump(PERSISTENCE_INTERVAL),
SerializationMethod::Cbor,
))),
db: Arc::new(RwLock::new(
PickleDb::load(
cas_db.clone(),
PickleDbDumpPolicy::PeriodicDump(PERSISTENCE_INTERVAL),
SerializationMethod::Cbor,
)
.unwrap_or_else(|_| {
PickleDb::new(
cas_db,
PickleDbDumpPolicy::PeriodicDump(PERSISTENCE_INTERVAL),
SerializationMethod::Cbor,
)
}),
)),
}
}
}

impl ContentAddressableStorage for PickleStorage {
fn add(&mut self, content: &AddressableContent) -> Result<(), HolochainError> {
let mut inner = self.db.write()?;
let mut inner = self.db.write().unwrap();

inner
.set(&content.address().to_string(), &content.content())
Expand All @@ -55,13 +65,13 @@ impl ContentAddressableStorage for PickleStorage {
}

fn contains(&self, address: &Address) -> Result<bool, HolochainError> {
let inner = self.db.read()?;
let inner = self.db.read().unwrap();

Ok(inner.exists(&address.to_string()))
}

fn fetch(&self, address: &Address) -> Result<Option<Content>, HolochainError> {
let inner = self.db.read()?;
let inner = self.db.read().unwrap();

Ok(inner.get(&address.to_string()))
}
Expand Down
4 changes: 3 additions & 1 deletion cas_implementations/src/eav/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ impl EntityAttributeValueStorage for EavFileStorage {
let (eavis, errors): (BTreeSet<_>, BTreeSet<_>) = entity_attribute_value_inter
.clone()
.into_iter()
.map(|content| EntityAttributeValueIndex::try_from_content(&JsonString::from(content)))
.map(|content| {
EntityAttributeValueIndex::try_from_content(&JsonString::from_json(&content))
})
.partition(Result::is_ok);
if !errors.is_empty() {
// not all EAVs were converted
Expand Down
Loading

0 comments on commit 7951e54

Please sign in to comment.