Holochain 0.7.1, released on 14 October, has had all its tools, libraries, and documentation updated and tested, and is now deemed ready for developing on. The two big highlights are capabilities for direct signals and source chain restoration from the DHT.
As with some of the 0.6.x releases, we’ve broken SemVer compatibility between 0.7.0 and 0.7.1.
Capabilities for direct signals
I have to confess that I completely missed talking about direct signals in the last Dev Pulse. They were introduced in 0.7.0 but didn’t get onto the changelog.
A direct signal is a way for a hApp’s front end to send a signal directly to another agent’s front end without you having to write a zome function to handle the sending and receiving. (On the receiving end, it gets emitted directly to the front end as a local signal — see the new signal variant, type, and payload wrapper in the JS client documentation.) Its purpose is to bypass the WASM engine and speed up real-time interactions. You call it from your app via the AppRequest::SendDirectSignal endpoint (in the JS client, that’s the app.sendDirectSignal method).
In 0.7.0 any agent could send direct signals to any other agent. Now they’re secured by capabilities, just like in-zome remote calls and signals. The recipient opens up their direct signal channel with the AppRequest::GrantDirectSignalCapability endpoint (that’s app.grantDirectSignalCapability in the JS client) or by writing a grant normally in a zome function.
This required breaking changes to types related to capabilities, which you can read about in the 0.7.1 upgrade guide. This’ll probably require updates to your zome code, plus a recompile if your 0.7.0 code touched signals or capabilities.
Source chain restore
This is a useful tool for anyone who has ever experienced data loss, which really is everyone who’s ever touched a computer. AdminRequest::InstallApp now has a restore_from_dht flag that tries to rebuild the agent’s data by getting it from DHT peers. This requires the agent to have the private key for their old agent ID in their Lair keystore, and only works with public data, not private data.
When you use this flag, the app will wait in AppStatus::AwaitingRestore state until the chains for all cells are restored; then you must call enable_app.
Breaking changes and bug fixes
In addition to the breaking change mentioned above:
- Fix/breaking: A DHT peer is no longer able to forge a
CloseChainaction for another peer. This required one breaking change: Action::signer is now gone, as an action can have no signer other than its author. - Breaking: Entry convenience methods
Entry::app_fancyandEntry::entry_typehave been removed. For the latter, deduce the entry type from the action that wrote it. - Fix: Direct signals can now take a 1 MB payload as the docs promise, rather than failing over 8 KB.
- Fix: Entries from the network are checked against the entry hash in their accompanying action.
- Fix: Validation receipt signatures are verified before storing.
- Fix: Invalid hashes no longer panic or over-allocate.
- Fix: Grant and revoke admin calls are self-validated.
- Fix: Authored ops are no longer marked as published when no eligible storage peers are available.
- Fix: New database indexes speed up reads on many tables; link and chain queries will likely see the biggest performance improvements in your app.
- Fix: kitsune2 0.5.1 brings a few fixes involving mapping the right configs and credentials to the right relay servers. This manifests as better security, more correct connection establishment, and better success at holepunching. Read the changelog for more details.
Dev tools
hc client call install-app --membrane-proofandhc client provide-memproofssupport deferred installs.hc dna hashaccepts--network-seed/-sand--role-settings <yaml>, so you can compute a role's final DNA hash before installing.- Rust:
RoleSettingsYamlbyte fields useOpaqueBytesSource, andFrom<RoleSettingsYaml>forRoleSettingsis gone. UseRoleSettingsYaml::resolve(base_dir). ListCapabilityGrantswithinclude_revoked: falseno longer returns an empty list.
Upgrade now!
Follow the 0.6→0.7 upgrade guide, which now targets 0.7.1, and its 0.7.0→0.7.1 section. And as always, if you hit any snags, find us in the DEV.HC Discord.
