Skip to content

Commit 4277bee

Browse files
apollo_propeller: rename did_broadcast_my_shard to did_broadcast_my_unit (#13499)
1 parent 8982951 commit 4277bee

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

crates/apollo_propeller/src/message_processor.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ enum AddUnitAction {
5757
enum ReconstructionState {
5858
PreConstruction {
5959
received_units: Vec<PropellerUnit>,
60-
did_broadcast_my_shard: bool,
60+
did_broadcast_my_unit: bool,
6161
verified_fields: Option<VerifiedFields>,
6262
},
6363
/// Message was reconstructed but not yet delivered to the application. We keep collecting
@@ -70,14 +70,14 @@ impl ReconstructionState {
7070
fn new() -> Self {
7171
Self::PreConstruction {
7272
received_units: Vec::new(),
73-
did_broadcast_my_shard: false,
73+
did_broadcast_my_unit: false,
7474
verified_fields: None,
7575
}
7676
}
7777

78-
fn did_broadcast_my_shard(&self) -> bool {
78+
fn did_broadcast_my_unit(&self) -> bool {
7979
match self {
80-
Self::PreConstruction { did_broadcast_my_shard, .. } => *did_broadcast_my_shard,
80+
Self::PreConstruction { did_broadcast_my_unit, .. } => *did_broadcast_my_unit,
8181
Self::PostConstruction { .. } => true,
8282
}
8383
}
@@ -92,9 +92,9 @@ impl ReconstructionState {
9292
let is_my_shard = unit.index() == my_shard_index;
9393

9494
match self {
95-
Self::PreConstruction { received_units, did_broadcast_my_shard, verified_fields } => {
95+
Self::PreConstruction { received_units, did_broadcast_my_unit, verified_fields } => {
9696
if is_my_shard {
97-
*did_broadcast_my_shard = true;
97+
*did_broadcast_my_unit = true;
9898
}
9999
if verified_fields.is_none() {
100100
*verified_fields = Some(VerifiedFields {
@@ -243,7 +243,7 @@ impl MessageProcessor {
243243
/// Broadcasts our unit to peers the first time we see it. In PostConstruction this is a no-op
244244
/// because reconstruction already triggered the broadcast.
245245
fn maybe_broadcast_my_shard(&self, unit: &PropellerUnit, state: &ReconstructionState) {
246-
if unit.index() == self.my_shard_index && !state.did_broadcast_my_shard() {
246+
if unit.index() == self.my_shard_index && !state.did_broadcast_my_unit() {
247247
self.broadcast_unit(unit);
248248
}
249249
}
@@ -328,7 +328,7 @@ impl MessageProcessor {
328328
) -> ControlFlow<()> {
329329
let ReconstructionOutput { message, my_shards, my_shard_proof } = output;
330330

331-
let should_broadcast = !state.did_broadcast_my_shard();
331+
let should_broadcast = !state.did_broadcast_my_unit();
332332
if should_broadcast {
333333
let (signature, nonce) = match state {
334334
ReconstructionState::PreConstruction { verified_fields, .. } => {

0 commit comments

Comments
 (0)