Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

### Additions and Improvements
- Added `--p2p-static-peers-url` option to read static peers from a URL or file
- Added node epoch and computed slot to the sync committee duties failure message for more context about the failure condition.

### Bug Fixes
Original file line number Diff line number Diff line change
Expand Up @@ -802,15 +802,17 @@ private SafeFuture<Optional<BeaconState>> getStateForCommitteeDuties(
return SafeFuture.completedFuture(Optional.of(bestState));
}

final UInt64 lastQueryableEpoch =
final UInt64 maxQueryableEpoch =
syncCommitteeUtil.computeLastEpochOfNextSyncCommitteePeriod(
combinedChainDataClient.getCurrentEpoch());
if (lastQueryableEpoch.isLessThan(epoch)) {
if (maxQueryableEpoch.isLessThan(epoch)) {
final Optional<UInt64> networkCurrentSlot =
chainDataProvider.getNetworkCurrentSlot();
return SafeFuture.failedFuture(
new IllegalArgumentException(
"Cannot calculate sync committee duties for epoch "
+ epoch
+ " because it is not within the current or next sync committee periods"));
String.format(
"Cannot calculate sync committee duties for epoch %s because it is not within the current or next sync committee periods (node current epoch %s, computed current slot %s)",
epoch, combinedChainDataClient.getCurrentEpoch(), networkCurrentSlot)));
}

final UInt64 requiredEpoch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public GenesisData getGenesisData() {
spec.atEpoch(ZERO).getConfig().getGenesisForkVersion());
}

public Optional<UInt64> getNetworkCurrentSlot() {
return recentChainData.getCurrentSlot();
}

public tech.pegasys.teku.spec.datastructures.genesis.GenesisData getGenesisStateData() {
if (!isStoreAvailable()) {
throw new ChainDataUnavailableException();
Expand Down