Skip to content

Commit

Permalink
[temp] stage increase DB size in staging
Browse files Browse the repository at this point in the history
  • Loading branch information
danielle-tfh committed Jan 14, 2025
1 parent ec14a0c commit 601fe6c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/temp-branch-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
5 changes: 3 additions & 2 deletions iris-mpc-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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?;
Expand Down
3 changes: 2 additions & 1 deletion iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?;
Expand Down

0 comments on commit 601fe6c

Please sign in to comment.