From 195ddfa37ea04f906e3961603a9768b329ac2855 Mon Sep 17 00:00:00 2001 From: Harry Solovay Date: Thu, 12 Sep 2024 17:32:49 -0400 Subject: [PATCH] Restore Cache --- README.md | 4 ---- server/Cargo.lock | 2 +- server/Cargo.toml | 2 +- .../2023-08-20-211633_add_initial_schema/up.sql | 15 +++++++++++++++ server/src/database/cache.rs | 10 +++++++--- server/src/main.rs | 1 + web/package.json | 2 +- 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 267031d0..56c2d8ed 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,6 @@ On-Chain Voting is a protocol developed to help with governing the Mina L1 block 1. Ensure you're on the correct network (in this case devnet). 2. Click on your address to copy it to the clipboard (we'll be using it in the next step). - -> Note: you must use an account which exists in the accounts ledger for the previous epoch. If you -> create and utilize a brand new account, your vote will not be counted. - 3. Click on "Send." ![Ouro Home](./ouro_screens/1.home.png) diff --git a/server/Cargo.lock b/server/Cargo.lock index 3ce44432..949b185b 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -1030,7 +1030,7 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mina-ocv-server" -version = "0.7.0" +version = "0.8.0" dependencies = [ "anyhow", "axum", diff --git a/server/Cargo.toml b/server/Cargo.toml index d7a204a7..6c767062 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mina-ocv-server" -version = "0.7.0" +version = "0.8.0" edition = "2021" [dependencies] diff --git a/server/migrations/2023-08-20-211633_add_initial_schema/up.sql b/server/migrations/2023-08-20-211633_add_initial_schema/up.sql index 148694a0..83cebfa7 100644 --- a/server/migrations/2023-08-20-211633_add_initial_schema/up.sql +++ b/server/migrations/2023-08-20-211633_add_initial_schema/up.sql @@ -91,3 +91,18 @@ VALUES ( 'Devnet Testing Description', 'https://github.com/MinaProtocol/MIPs/blob/main/MIPS/mip-zkapps.md' ); +INSERT INTO mina_proposals +VALUES ( + 7, + 'MIP52', + 1726170486000, + 1726789686000, + 73, + 'jwUfRQindewPk7Uep8z3YUjMvQKaq6drpKvJRTq47wGU6Dxkhqx', + 'Core', + 'V2', + 'Devnet Testing Title', + 'Devnet Testing Description', + 'https://github.com/MinaProtocol/MIPs/blob/main/MIPS/mip-zkapps.md' + ); + diff --git a/server/src/database/cache.rs b/server/src/database/cache.rs index 21f8c3b3..31313ee4 100644 --- a/server/src/database/cache.rs +++ b/server/src/database/cache.rs @@ -22,11 +22,15 @@ pub(crate) struct CacheManager { impl CacheManager { pub(crate) fn build() -> CacheManager { CacheManager { - votes: VotesCache::builder().time_to_live(std::time::Duration::ZERO).build(), + votes: VotesCache::builder() + .time_to_live(std::time::Duration::from_secs(60 * 5)) + .build(), votes_weighted: VotesWeightedCache::builder() - .time_to_live(std::time::Duration::ZERO) + .time_to_live(std::time::Duration::from_secs(60 * 5)) + .build(), + ledger: LedgerCache::builder() + .time_to_live(std::time::Duration::from_secs(60 * 60 * 12)) .build(), - ledger: LedgerCache::builder().time_to_live(std::time::Duration::ZERO).build(), } } } diff --git a/server/src/main.rs b/server/src/main.rs index df912b7a..ecbcc208 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -25,6 +25,7 @@ pub(crate) const MINA_GOVERNANCE_SERVER: &str = "mina_governance_server"; #[tokio::main] async fn main() -> Result<()> { + println!("Let's see!"); config::init_tracing(); let config = Config::parse(); diff --git a/web/package.json b/web/package.json index d219a852..747d07f8 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "mina-ocv-web", - "version": "0.7.0", + "version": "0.8.0", "private": true, "engines": { "node": ">=18.0.0",