Skip to content

Commit 3a738e7

Browse files
authored
fix: avoid incrementing memory size for record overrides from db (#789)
* change max db size to 1M in stage * do not increment memory size if the record is duplicate * bump stage img
1 parent 356f638 commit 3a738e7

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

deploy/stage/common-values-iris-mpc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: "ghcr.io/worldcoin/iris-mpc:v0.12.4"
1+
image: "ghcr.io/worldcoin/iris-mpc:v0.12.5"
22

33
environment: stage
44
replicaCount: 1

deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ env:
8787
value: "800000"
8888

8989
- name: SMPC__MAX_DB_SIZE
90-
value: "1100000"
90+
value: "1000000"
9191

9292
- name: SMPC__MAX_BATCH_SIZE
9393
value: "64"

deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ env:
8787
value: "800000"
8888

8989
- name: SMPC__MAX_DB_SIZE
90-
value: "1100000"
90+
value: "1000000"
9191

9292
- name: SMPC__MAX_BATCH_SIZE
9393
value: "64"

deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ env:
8787
value: "800000"
8888

8989
- name: SMPC__MAX_DB_SIZE
90-
value: "1100000"
90+
value: "1000000"
9191

9292
- name: SMPC__MAX_BATCH_SIZE
9393
value: "64"

iris-mpc-gpu/src/dot/share_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl ShareDB {
281281
n_shards: usize,
282282
code_length: usize,
283283
) {
284-
assert!(record.len() == code_length);
284+
assert_eq!(record.len(), code_length);
285285

286286
let a0_host = record
287287
.iter()

iris-mpc-gpu/src/server/actor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ impl ServerActor {
461461
self.device_manager.device_count(),
462462
MASK_CODE_LENGTH,
463463
);
464+
}
465+
466+
pub fn increment_db_size(&mut self, index: usize) {
464467
self.current_db_sizes[index % self.device_manager.device_count()] += 1;
465468
}
466469

iris-mpc/src/bin/server.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,12 @@ async fn server_main(config: Config) -> eyre::Result<()> {
10871087
iris.right_code(),
10881088
iris.right_mask(),
10891089
);
1090+
1091+
// if the serial id hasn't been loaded before, count is as unique record
1092+
if all_serial_ids.contains(&(iris.index() as i64)) {
1093+
actor.increment_db_size(iris.index() - 1);
1094+
}
1095+
10901096
time_loading_into_memory += now_load_summary.elapsed();
10911097
now_load_summary = Instant::now();
10921098

0 commit comments

Comments
 (0)