diff --git a/contracts/rust/src/bin/gen-vk-libraries.rs b/contracts/rust/src/bin/gen-vk-libraries.rs index d12ca7c3..f6c5f37d 100644 --- a/contracts/rust/src/bin/gen-vk-libraries.rs +++ b/contracts/rust/src/bin/gen-vk-libraries.rs @@ -18,7 +18,7 @@ use std::{fs::OpenOptions, io::prelude::*, path::PathBuf}; // depth of the record merkle tree const TREE_DEPTH: u8 = 24; -// list of supported tranaction types, each would result in a different verifying key +// list of supported transaction types, each would result in a different verifying key const SUPPORTED_VKS: [(NoteType, u8, u8, u8); 7] = [ (NoteType::Transfer, 1, 2, TREE_DEPTH), (NoteType::Transfer, 2, 2, TREE_DEPTH), diff --git a/faucet/src/faucet.rs b/faucet/src/faucet.rs index 9609a365..74f7a740 100644 --- a/faucet/src/faucet.rs +++ b/faucet/src/faucet.rs @@ -478,6 +478,28 @@ pub struct HealthCheck { /// normally, a response with status 503 and payload {"status": /// "unavailable"} should be added. async fn healthcheck(req: tide::Request) -> Result { + // Ensure we can write to storage. + let mut index = req.state().queue.index.lock().await; + let default_user_pub_key = UserPubKey::default(); + let res = index.insert(default_user_pub_key.clone()); + if res.is_err() { + tracing::error!( + "Insertion of dummy public key into faucet queue index failed. {:?}", + res + ); + return Err(faucet_server_error(res.err().unwrap())); + } + + let res = index.remove(&default_user_pub_key); + if res.is_err() { + tracing::error!( + "Removal of dummy public key from faucet queue index failed. {:?}", + res + ); + return Err(faucet_server_error(res.err().unwrap())); + } + + // Return healthcheck response response( &req, &HealthCheck {