Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Holochain 0.4 upgrade guide #499

Merged
merged 45 commits into from
Dec 20, 2024
Merged

Conversation

pdaoust
Copy link
Collaborator

@pdaoust pdaoust commented Nov 22, 2024

Incorporates all the breaking changes in 0.4 and peripheral tooling.

@pdaoust pdaoust marked this pull request as ready for review December 9, 2024 23:38
Copy link
Collaborator Author

@pdaoust pdaoust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't deploy until 0.4 is live and recommended.

@@ -0,0 +1,111 @@
---
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URLs in this document need to be updated once the Rustdoc is published to docs.rs

Copy link
Member

@zippy zippy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great apart from suggestions others have left.

Copy link
Member

@ThetaSinner ThetaSinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't know how to upgrade my Holonix, or NPM and Rust dependencies based on this guide. I'd also like some more details on Rust code changes required please.

@pdaoust
Copy link
Collaborator Author

pdaoust commented Dec 12, 2024

I wouldn't know how to upgrade my Holonix, or NPM and Rust dependencies based on this guide. I'd also like some more details on Rust code changes required please.

@ThetaSinner I've rewritten the guide; is this more what you're thinking now?


Edit any coordinator zome code that uses functions from `hdk::clone`:

```diff:rust
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code compiles, functions not tested.


Edit any client code that manipulates cloned cells:

```diff:typescript
Copy link
Collaborator Author

@pdaoust pdaoust Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsc can compile this too -- again not tested beyond "will it build".

@pdaoust pdaoust force-pushed the 2024-11-19-holochain-0.4-upgrade-guide branch from e2aa445 to 99a00ac Compare December 19, 2024 01:14
* **[Countersigning](/concepts/10_countersigning/) `unstable-countersigning`**: Allows agents to temporarily lock their chains in order to agree to write the same entry to their respective chains.
* **DPKI / DeepKey `unstable-dpki`**: Implements a distributed public key infrastructure, allowing agents to manage their keys and confirm continuity of their identity across devices and source chains. Read the [DeepKey readme](https://github.com/holochain/deepkey) for more info.
* **[DHT sharding](/concepts/4_dht/) `unstable-sharding`**: Lessens the load of each peer in large network, allowing them to take responsibility for validating and storing only a subset of a DHT's entire data set.
* **[Warrants](/concepts/7_validation#remembering-validation-results) `unstable-warrants`**: Spreads news of validation failure around the network, allowing peers to recognize bad actors and take action against them, even if they haven't directly interacted with them.
Copy link
Member

@ThetaSinner ThetaSinner Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is new and we know there are bugs which can result in Holochain writing data to your source chain that then prevent some data queries, use with caution


### JavaScript client now receives system signals

For JavaScript front ends and Tryorama tests, the signal handler callback for `AppWebsocket.prototype.on("signal", cb)` should now take a [`Signal`](https://github.com/holochain/holochain-client-js/blob/main-0.4/docs/client.signal.md). Update your code to look like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can note here that system signals are currently only used for countersigning, which is disabled. So you can filter out system signals for now.

We are planning to use these for other things so it's probably worth making it clear that this is explicitly filtering them out.

### `InstallApp` agent key is optional

!!! info
This change is only relevant if you're building a runtime that can install hApp bundles.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're doing that, you might just as well be using Holochain as a library and need a whole other list of changes. I'd just say "using the Rust client to install apps on Holochain" or something like that here


This feature needs more performance and correctness testing before it's production-ready, but it can be turned on by [compiling Holochain with the `unstable-sharding` flag enabled](#unstable-features-removed-by-default).

It's unknown exactly what might happen if nodes with DHT sharding disabled try to gossip in the same network as nodes without DHT sharding. Presumably this is still possible, but it might cause unexpected behaviors!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that is known. Because we've run with gossip_arc_clamping = "full" in the same network are peers with dynamic arcs before. It will work fine but the peers who have chosen to enable unstable-sharding and left their gossip_arc_clamping = "none" might run into bugs with arc sizing. That's the reason we disabled it and until we integrate Kitsune2 and re-enable sharding, we're not going to provide support for people who run into bugs with this. At least not beyond helping diagnose that this was indeed the issue.


### Dynamic database encryption, folder structure changes

Previous conductor and keystore SQLite databases used a hardcoded encryption key; v0.4 now uses a dynamic key. Additionally, the database paths have changed. These two things mean you won't be able to import data from v0.3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an automatic migration of paths. If databases are detected at the old paths then Holochain will move them. We didn't provide a "re-encrypt" migration from the hard-coded key to dynamic keys though. It can be done, it's not impossible but we didn't think the value was high enough to justify the time.

So I'd word this to say that it's the encryption that prevents data being imported and if people want to keep their data they either need to export it through their app's UI and re-import on 0.4 or they need to provide their users with tooling to migrate the encryption keys.

Maybe that's a bit too much detail really, but conductor migration is something I'd like us to be getting better at over time :)

@ThetaSinner ThetaSinner dismissed their stale review December 20, 2024 15:00

now able to update an app and have get it back to a running state

@pdaoust pdaoust merged commit b2301b0 into main Dec 20, 2024
6 checks passed
@pdaoust pdaoust deleted the 2024-11-19-holochain-0.4-upgrade-guide branch December 20, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants