Skip to content

Commit 0c438e2

Browse files
authored
Merge pull request #914 from hyperware-ai/release-candidate
v1.9.2-rc
2 parents 2358a7a + c3d62b2 commit 0c438e2

11 files changed

Lines changed: 633 additions & 224 deletions

File tree

Cargo.lock

Lines changed: 331 additions & 141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "hyperdrive_lib"
33
authors = ["Sybil Technologies AG"]
4-
version = "1.9.1"
4+
version = "1.9.2"
55
edition = "2021"
66
description = "A general-purpose sovereign cloud computing platform"
77
homepage = "https://hyperware.ai"

hyperdrive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "hyperdrive"
33
authors = ["Sybil Technologies AG"]
4-
version = "1.9.1"
4+
version = "1.9.2"
55
edition = "2021"
66
description = "A general-purpose sovereign cloud computing platform"
77
homepage = "https://hyperware.ai"

hyperdrive/packages/app-store/chain/src/lib.rs

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -733,43 +733,45 @@ fn handle_message(our: &Address, state: &mut State, message: &Message) -> anyhow
733733
} else {
734734
if message.source().process == "eth:distro:sys" {
735735
let eth_result = serde_json::from_slice::<eth::EthSubResult>(message.body())?;
736-
if let Ok(eth::EthSub { id, result }) = eth_result {
737-
if let Ok(eth::SubscriptionResult::Log(ref log)) =
738-
serde_json::from_value::<eth::SubscriptionResult>(result)
739-
{
740-
// Determine which subscription this is from
741-
// Note: log is Box<eth::Log>, we need to dereference it
742-
let log_ref: &eth::Log = &**log;
743-
let context = if id == SUBSCRIPTION_NUMBER {
744-
LogContext::Hypermap(log_ref.clone())
745-
} else if id == BINDINGS_SUBSCRIPTION {
746-
LogContext::Bindings(log_ref.clone())
747-
} else {
748-
return Ok(false); // Unknown subscription
749-
};
750-
// delay handling of ETH RPC subscriptions by DELAY_MS
751-
// to allow hns to have a chance to process block
752-
timer::set_timer(DELAY_MS, Some(serde_json::to_vec(&context)?));
736+
match eth_result {
737+
Ok(eth::EthSub { id, result }) => {
738+
if let Ok(eth::SubscriptionResult::Log(ref log)) =
739+
serde_json::from_value::<eth::SubscriptionResult>(result)
740+
{
741+
// Determine which subscription this is from
742+
// Note: log is Box<eth::Log>, we need to dereference it
743+
let log_ref: &eth::Log = &**log;
744+
let context = if id == SUBSCRIPTION_NUMBER {
745+
LogContext::Hypermap(log_ref.clone())
746+
} else if id == BINDINGS_SUBSCRIPTION {
747+
LogContext::Bindings(log_ref.clone())
748+
} else {
749+
return Ok(false); // Unknown subscription
750+
};
751+
// delay handling of ETH RPC subscriptions by DELAY_MS
752+
// to allow hns to have a chance to process block
753+
timer::set_timer(DELAY_MS, Some(serde_json::to_vec(&context)?));
754+
}
755+
}
756+
Err(err) => {
757+
if err.id == SUBSCRIPTION_NUMBER {
758+
let _ = state.hypermap.provider.unsubscribe(SUBSCRIPTION_NUMBER);
759+
state.hypermap.provider.subscribe_loop(
760+
SUBSCRIPTION_NUMBER,
761+
app_store_filter(state),
762+
1,
763+
0,
764+
);
765+
} else if err.id == BINDINGS_SUBSCRIPTION {
766+
let _ = state.bindings.provider.unsubscribe(BINDINGS_SUBSCRIPTION);
767+
state.bindings.provider.subscribe_loop(
768+
BINDINGS_SUBSCRIPTION,
769+
bindings_filter(&state.bindings),
770+
1,
771+
0,
772+
);
773+
}
753774
}
754-
} else {
755-
// unsubscribe to make sure we have cleaned up after ourselves;
756-
// drop Result since we don't care if no subscription exists,
757-
// just being diligent in case it does!
758-
let _ = state.hypermap.provider.unsubscribe(SUBSCRIPTION_NUMBER);
759-
let _ = state.bindings.provider.unsubscribe(BINDINGS_SUBSCRIPTION);
760-
// re-subscribe if error
761-
state.hypermap.provider.subscribe_loop(
762-
SUBSCRIPTION_NUMBER,
763-
app_store_filter(state),
764-
1,
765-
0,
766-
);
767-
state.bindings.provider.subscribe_loop(
768-
BINDINGS_SUBSCRIPTION,
769-
bindings_filter(&state.bindings),
770-
1,
771-
0,
772-
);
773775
}
774776
} else {
775777
let req = serde_json::from_slice::<ChainRequest>(message.body())?;

hyperdrive/packages/app-store/downloads/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ type ManualDownloads = HashMap<(PackageId, String), ManualDownloadStatus>;
105105
#[derive(Debug, Serialize, Deserialize)]
106106
pub struct State {
107107
// persisted metadata about which packages we are mirroring
108+
#[serde(default)]
108109
mirroring: HashSet<PackageId>,
109110
// note, pending auto_updates are not persisted.
110111
}

hyperdrive/packages/hypermap-cacher/binding-cacher/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const DEFAULT_NODES: &[&str] = &[
4949
#[cfg(feature = "simulation-mode")]
5050
const DEFAULT_NODES: &[&str] = &["fake.os"];
5151

52+
fn default_nodes() -> Vec<String> {
53+
DEFAULT_NODES.iter().map(|s| s.to_string()).collect()
54+
}
55+
5256
// Internal representation of LogsMetadata, similar to WIT but for Rust logic.
5357
#[derive(Serialize, Deserialize, Debug, Clone)]
5458
struct LogsMetadataInternal {
@@ -105,7 +109,9 @@ struct State {
105109
block_batch_size: u64,
106110
is_cache_timer_live: bool,
107111
drive_path: String,
112+
#[serde(default)]
108113
is_providing: bool,
114+
#[serde(default = "default_nodes")]
109115
nodes: Vec<String>,
110116
#[serde(skip)]
111117
is_starting: bool,

hyperdrive/packages/hypermap-cacher/hypermap-cacher/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ const DEFAULT_NODES: &[&str] = &[
4646
#[cfg(feature = "simulation-mode")]
4747
const DEFAULT_NODES: &[&str] = &["fake.os"];
4848

49+
fn default_nodes() -> Vec<String> {
50+
DEFAULT_NODES.iter().map(|s| s.to_string()).collect()
51+
}
52+
4953
// Internal representation of LogsMetadata, similar to WIT but for Rust logic.
5054
#[derive(Serialize, Deserialize, Debug, Clone)]
5155
struct LogsMetadataInternal {
@@ -102,7 +106,9 @@ struct State {
102106
block_batch_size: u64,
103107
is_cache_timer_live: bool,
104108
drive_path: String,
109+
#[serde(default)]
105110
is_providing: bool,
111+
#[serde(default = "default_nodes")]
106112
nodes: Vec<String>,
107113
#[serde(skip)]
108114
is_starting: bool,

0 commit comments

Comments
 (0)