Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Feb 24, 2025
1 parent f7b5dc7 commit aa68a70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ public Function<BeaconBlockBodyBuilder, SafeFuture<Void>> createSelector(
final Eth1Data eth1Data = eth1DataCache.getEth1Vote(blockSlotState);

SafeFuture.of(
SafeFuture.runAsync(
() -> attestationPool.dumpAttestations(blockSlotState.getSlot())))
.finish(() -> LOG.info("Attestation pool dumped."), err -> LOG.error("Failed to dump.", err));
SafeFuture.runAsync(() -> attestationPool.dumpAttestations(blockSlotState.getSlot())))
.finish(
() -> LOG.info("Attestation pool dumped."), err -> LOG.error("Failed to dump.", err));

final long start = System.currentTimeMillis();
final SszList<Attestation> attestations =
Expand All @@ -156,7 +156,8 @@ public Function<BeaconBlockBodyBuilder, SafeFuture<Void>> createSelector(
throw new UncheckedIOException(e);
}
}))
.finish(() -> LOG.info("State dump completed."), err -> LOG.error("Failed to dump.", err));
.finish(
() -> LOG.info("State dump completed."), err -> LOG.error("Failed to dump.", err));
}

// Collect slashings to include
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ public synchronized void onReorg(final UInt64 commonAncestorSlot) {
}

public synchronized void dumpAttestations(final UInt64 slot) {
try (FileWriter fos =
new FileWriter("/tmp/attestations_" + slot + ".multi_ssz", UTF_8)) {
try (FileWriter fos = new FileWriter("/tmp/attestations_" + slot + ".multi_ssz", UTF_8)) {
dataHashBySlot.descendingMap().values().stream()
.flatMap(Collection::stream)
.map(attestationGroupByDataHash::get)
Expand All @@ -353,10 +352,7 @@ public synchronized void dumpAttestations(final UInt64 slot) {
}
});
} catch (final IOException e) {
LOG.error(
"An error occurred while dumping pool at slot {}: {}",
slot,
e.getMessage());
LOG.error("An error occurred while dumping pool at slot {}: {}", slot, e.getMessage());
}
}
}

0 comments on commit aa68a70

Please sign in to comment.