fix order of current/previous dependent root in REST SSE (#4141)

This commit is contained in:
tersec 2022-09-19 12:28:52 +02:00 committed by GitHub
parent 174292b7e4
commit e3750e96e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -1832,8 +1832,8 @@ proc updateHead*(
# TODO (cheatfate): Proper implementation required
data = HeadChangeInfoObject.init(dag.head.slot, dag.head.root,
getStateRoot(dag.headState),
epochTransition, depRoot,
prevDepRoot)
epochTransition, prevDepRoot,
depRoot)
dag.onHeadChanged(data)
withState(dag.headState):

View File

@ -1023,8 +1023,7 @@ func proposer_dependent_root*(state: ForkyHashedBeaconState): Eth2Digest =
state.dependent_root(state.data.slot.epoch)
func attester_dependent_root*(state: ForkyHashedBeaconState): Eth2Digest =
let epoch = state.data.slot.epoch
state.dependent_root(if epoch == Epoch(0): epoch else: epoch - 1)
state.dependent_root(state.data.slot.epoch.get_previous_epoch)
func latest_block_id*(state: ForkyHashedBeaconState): BlockId =
## Block id of the latest block applied to this state