Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Nov 30, 2021
1 parent 9611754 commit bddcdfe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion beacon_chain/rpc/rest_validator_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
res

# We use a local proc in order to:
# * avoid code duplicates and
# * avoid code duplication
# * reduce code bloat from `withState`
proc produceResponse(requestedValidatorIndices: openArray[ValidatorIndex],
syncCommittee: openArray[ValidatorPubKey],
Expand Down Expand Up @@ -254,6 +254,11 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
let earliestSlotInQSyncPeriod =
Slot(qSyncPeriod * SLOTS_PER_SYNC_COMMITTEE_PERIOD)

# TODO
# The DAG can offer a short-cut for getting just the information we need
# in order to compute the sync committee for the epoch. See the following
# discussion for more details:
# https://github.com/status-im/nimbus-eth2/pull/3133#pullrequestreview-817184693
node.withStateForBlockSlot(node.dag.head.atSlot(earliestSlotInQSyncPeriod)):
let res = withState(stateData().data):
when stateFork >= BeaconStateFork.Altair:
Expand Down

0 comments on commit bddcdfe

Please sign in to comment.