Skip to content

Commit 81fa11a

Browse files
committed
Provide sync committee slots in chain status.
1 parent f5c4551 commit 81fa11a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dev:
2+
- provide sync committee slots in "chain status"
23
- clarify that --connection should be a URL
34

45
1.15.0:

cmd/chainstatus.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ In quiet mode this will return 0 if the chain status can be obtained, otherwise
119119
if epoch >= chainTime.AltairInitialEpoch() {
120120
period := chainTime.SlotToSyncCommitteePeriod(slot)
121121
periodStartEpoch := chainTime.FirstEpochOfSyncPeriod(period)
122+
periodStartSlot := chainTime.FirstSlotOfEpoch(periodStartEpoch)
122123
nextPeriod := period + 1
123124
nextPeriodStartEpoch := chainTime.FirstEpochOfSyncPeriod(nextPeriod)
124125
periodEndEpoch := nextPeriodStartEpoch - 1
126+
periodEndSlot := chainTime.FirstSlotOfEpoch(periodEndEpoch+1) - 1
125127
nextPeriodTimestamp := chainTime.StartOfEpoch(nextPeriodStartEpoch)
126128

127129
res.WriteString("Sync committee period: ")
@@ -135,6 +137,12 @@ In quiet mode this will return 0 if the chain status can be obtained, otherwise
135137
res.WriteString(fmt.Sprintf("%d", periodEndEpoch))
136138
res.WriteString("\n")
137139

140+
res.WriteString("Sync committee slots: ")
141+
res.WriteString(fmt.Sprintf("%d", periodStartSlot))
142+
res.WriteString("-")
143+
res.WriteString(fmt.Sprintf("%d", periodEndSlot))
144+
res.WriteString("\n")
145+
138146
res.WriteString("Time until next sync committee period: ")
139147
res.WriteString(time.Until(nextPeriodTimestamp).Round(time.Second).String())
140148
res.WriteString("\n")

0 commit comments

Comments
 (0)