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

fix: the system.args not restored correctly #307

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cestory/src/expert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct CesealExpertStub {
impl CesealExpertStub {
pub fn new(ceseal_props: CesealProperties) -> (Self, ExpertCmdReceiver) {
let (tx, rx) = mpsc::channel(16);
let thread_pool_cap = std::cmp::max(ceseal_props.cores - 1, 1);
let thread_pool_cap = ceseal_props.cores.saturating_sub(1).max(1);
let thread_pool = threadpool::ThreadPool::new(thread_pool_cap as usize);
info!("PODR2 compute thread pool capacity: {}", thread_pool.max_count());
let role = ceseal_props.role.clone();
Expand Down
16 changes: 7 additions & 9 deletions crates/cestory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use serde::{
Deserialize, Deserializer, Serialize, Serializer,
};

use crate::{light_validation::LightValidation, system::System};
use crate::light_validation::LightValidation;
use anyhow::{anyhow, Context as _, Result};
use ces_crypto::{
aead,
Expand Down Expand Up @@ -314,6 +314,7 @@ impl<Platform: pal::Platform> Ceseal<Platform> {
if let Some(system) = &mut self.system {
system.sealing_path = self.args.sealing_path.clone();
system.storage_path = self.args.storage_path.clone();
system.args = self.args.clone();
}
}

Expand Down Expand Up @@ -599,14 +600,11 @@ impl<Platform: Serialize + DeserializeOwned> Ceseal<Platform> {
let recv_mq = &mut runtime_state.recv_mq;
let send_mq = &mut runtime_state.send_mq;
let seq = &mut seq;
let mut system: System<Platform> =
ces_mq::checkpoint_helper::using_dispatcher(recv_mq, move || {
ces_mq::checkpoint_helper::using_send_mq(send_mq, || {
seq.next_element()?.ok_or_else(|| de::Error::custom("Missing System"))
})
})?;
system.args = factory.args.clone();
Some(system)
ces_mq::checkpoint_helper::using_dispatcher(recv_mq, move || {
ces_mq::checkpoint_helper::using_send_mq(send_mq, || {
seq.next_element()?.ok_or_else(|| de::Error::custom("Missing System"))
})
})?
};
} else {
let _: Option<serde::de::IgnoredAny> = seq.next_element()?;
Expand Down
Loading