Skip to content

Commit

Permalink
Update epoch sync participation
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Sep 23, 2022
1 parent 924b051 commit b2e5529
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/cli/test/utils/simulation/SimulationTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {toHexString} from "@lodestar/utils";
import {EpochClock} from "./EpochClock.js";
import {BeaconNodeProcess, SimulationParams} from "./types.js";
import {
avg,
computeAttestation,
computeAttestationParticipation,
computeInclusionDelay,
Expand Down Expand Up @@ -227,11 +228,11 @@ export class SimulationTracker {
: "";
record[participationHeading(node.id)] = participationStr;

let syncParticipation = 0;
const syncParticipation: number[] = [];
for (let i = firstSlot; i <= lastSlot; i++) {
syncParticipation += this.syncCommitteeParticipation.get(node.id)?.get(i) ?? 0;
syncParticipation.push(this.syncCommitteeParticipation.get(node.id)?.get(i) ?? 0);
}
record[syncCommitteeHeading(node.id)] = syncParticipation / (lastSlot - firstSlot + 1);
record[syncCommitteeHeading(node.id)] = avg(syncParticipation).toFixed(2);
}
records.push(record);
}
Expand Down

0 comments on commit b2e5529

Please sign in to comment.