Skip to content

Commit

Permalink
ENG-578: Fix port range formula
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Feb 26, 2024
1 parent 1fe1595 commit 369f1f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fendermint/testing/materializer/src/docker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))?;
Expand Down

0 comments on commit 369f1f1

Please sign in to comment.