-
Notifications
You must be signed in to change notification settings - Fork 12
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
Write a test showing InProcKeystore
can restart successfully
#120
Comments
Yes it's supposed to work, it's the default in Holochain if you don't configure an external Lair to connect to. @neonphog any ideas about these errors? |
It actually doesn't @ThetaSinner . The default is to run an lair-keystore server which uses StandaloneServer which uses the IpcKeystoreServer, which is not the same as the InProcKeystore. Running the server is what I've found to be really slow (5 seconds) on mobile, and I was hoping that doing away with that would makes things much faster. |
@guillemcordoba - The main difference between the ipc keystore and the in proc keystore is whether they use an ipc channel. The "Standalone" is a bit misleading, as it actually will also be run in process. I suspect the startup time has more to do with the argon password hashing algorithm, as it is designed specifically to use a lot of memory and CPU, and is using the "Moderate" settings which largely target desktops instead of mobile devices. Can you run a test where you set the mem limit and cpu/ops limit to mem min and ops min respectively? For testing, you could potentially set them here. If that makes a difference, we can figure out the best way forward for actually configuring that... |
Not sure it's more readable, but looks like LairServerConfigInner::new respects PwHashLimits::with_exec if you want to set the limits that way. |
Thanks @neonphog that helps. I'll do some testing and see if that reduces the start time. |
@guillemcordoba were you able to successfully test withe the configs that @neonphog shared? What's the experience like? |
I just did, I tried to do it with this code: pub async fn write_config(
config_path: &std::path::Path,
passphrase: BufRead,
) -> LairResult<LairServerConfig> {
let lair_root = config_path
.parent()
.ok_or_else(|| one_err::OneErr::from("InvalidLairConfigDir"))?;
tokio::fs::DirBuilder::new()
.recursive(true)
.create(&lair_root)
.await?;
let mut config = LairServerConfigInner::new(lair_root, passphrase).await?;
config.runtime_secrets_mem_limit = sodoken::hash::argon2id::MEMLIMIT_MIN;
config.runtime_secrets_ops_limit = sodoken::hash::argon2id::OPSLIMIT_MIN;
let mut config_f = tokio::fs::OpenOptions::new()
.write(true)
.create_new(true)
.open(config_path)
.await?;
config_f.write_all(config.to_string().as_bytes()).await?;
config_f.shutdown().await?;
drop(config_f);
Ok(Arc::new(config))
} Using this code, lair doesn't even start. As a matter of fact, I lose all logs and I don't know at which point it gets stuck, which is really weird. But I'm certain that the whole holochain start up process doesn't complete at all. I can't offer much more on my end, I think this needs thorough investigation on how we can make both lair-keystore and holochain run as fast as possible in mobile. |
@neonphog from Guillem's update, it looks like we might want to prioritize debugging lair startup on mobile or optimizing the process. We can discuss this internally in light of the other competing priorities. |
@guillemcordoba - can you give this a try: holochain/holochain#3391 |
Will do! Thanks @neonphog |
Hi @neonphog , sorry for taking long with this. I just tried it, and it hasn't made any difference as far as I could tell. I timed the startup times with the setting set to Any ideas on things that we could try next? |
Also ping @abe-njama about this. |
@guillemcordoba - I've split out the timing into a separate issue here: #139 -- This issue will be closed with a test that shows InProcKeystore is able to load after restart. |
InProcKeystore
fails on restart InProcKeystore
can restart successfully
I don't know how to reproduce the |
Test written with holochain/holochain#4608 |
This issue has diverged into android load timing. I've split out the load timing into a separate issue: #139
Original Issue text retained:
I've tried to use directly an
InProcKeystore
with holochain, to reduce the startup time of my Android app. It works fine when first started, but when the conductor restarts, signing zome calls fails withQuery returned no rows
. This is my code:To do that, I've needed to fork holochain and add this method.
I've tried to reproduce the issue by implementing a test in this repository, which is mostly a copy of this test, here, but that fails with another error:
Is
InProcKeystore
supposed to work? Am I doing something wrong? This would be a big improvement on the UX experience of mobile apps.The text was updated successfully, but these errors were encountered: