From 369f1f1716da0320e9e97bca15b714fc36308dd0 Mon Sep 17 00:00:00 2001 From: Akosh Farkash Date: Mon, 26 Feb 2024 10:41:33 +0000 Subject: [PATCH] ENG-578: Fix port range formula --- fendermint/testing/materializer/src/docker/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fendermint/testing/materializer/src/docker/mod.rs b/fendermint/testing/materializer/src/docker/mod.rs index 2d1631a27..97c8f4ea9 100644 --- a/fendermint/testing/materializer/src/docker/mod.rs +++ b/fendermint/testing/materializer/src/docker/mod.rs @@ -259,8 +259,8 @@ impl DockerMaterializer { // Currently the range allocations are not dropped from the materializer, // so the length can be used to derive the next available port. Otherwise // we could loop through to find an unused slot. - let node_count = self.state.port_ranges.len(); - let from = PORT_RANGE_START * node_count as u32; + let node_count = self.state.port_ranges.len() as u32; + let from = PORT_RANGE_START + PORT_RANGE_SIZE * node_count; let to = from + PORT_RANGE_SIZE; let range = DockerPortRange { from, to }; self.update_state(|s| s.port_ranges.insert(node_name.clone(), range.clone()))?;