diff --git a/.github/workflows/temp-branch-build-and-push.yaml b/.github/workflows/temp-branch-build-and-push.yaml index 00cee77d4..34f0979ae 100644 --- a/.github/workflows/temp-branch-build-and-push.yaml +++ b/.github/workflows/temp-branch-build-and-push.yaml @@ -3,7 +3,7 @@ name: Branch - Build and push docker image on: push: branches: - - "feat/even-odd-import-from-s3" + - "staging-fill-db-size" concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' diff --git a/iris-mpc-store/src/lib.rs b/iris-mpc-store/src/lib.rs index 46841ee16..433253f97 100644 --- a/iris-mpc-store/src/lib.rs +++ b/iris-mpc-store/src/lib.rs @@ -445,6 +445,7 @@ DO UPDATE SET right_code = EXCLUDED.right_code, right_mask = EXCLUDED.right_mask rng_seed: u64, party_id: usize, db_size: usize, + store_len: usize, clear_db_before_init: bool, ) -> Result<()> { let mut rng = StdRng::seed_from_u64(rng_seed); @@ -461,7 +462,7 @@ DO UPDATE SET right_code = EXCLUDED.right_code, right_mask = EXCLUDED.right_mask "DB size before initialization: {}", self.count_irises().await? ); - for i in 0..db_size { + for i in store_len..db_size { if (i % 1000) == 0 { tracing::info!("Initializing iris db: Generated {} entries", i); } @@ -700,7 +701,7 @@ mod tests { let expected_generated_irises_num = 10; store - .init_db_with_random_shares(0, 0, expected_generated_irises_num, true) + .init_db_with_random_shares(0, 0, expected_generated_irises_num, 0, true) .await?; let generated_irises_count = store.count_irises().await?; diff --git a/iris-mpc/src/bin/server.rs b/iris-mpc/src/bin/server.rs index 2ba9c657c..6410f20e5 100644 --- a/iris-mpc/src/bin/server.rs +++ b/iris-mpc/src/bin/server.rs @@ -726,7 +726,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { // Seed the persistent storage with random shares if configured and db is still // empty. - if store_len == 0 && config.init_db_size > 0 { + if config.init_db_size > 0 && store_len < config.init_db_size { tracing::info!( "Initialize persistent iris DB with {} randomly generated shares", config.init_db_size @@ -737,6 +737,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { RNG_SEED_INIT_DB, party_id, config.init_db_size, + store_len, config.clear_db_before_init, ) .await?;