fix order of current/previous dependent root in REST SSE (#4141)
This commit is contained in:
parent
174292b7e4
commit
e3750e96e8
|
@ -1832,8 +1832,8 @@ proc updateHead*(
|
||||||
# TODO (cheatfate): Proper implementation required
|
# TODO (cheatfate): Proper implementation required
|
||||||
data = HeadChangeInfoObject.init(dag.head.slot, dag.head.root,
|
data = HeadChangeInfoObject.init(dag.head.slot, dag.head.root,
|
||||||
getStateRoot(dag.headState),
|
getStateRoot(dag.headState),
|
||||||
epochTransition, depRoot,
|
epochTransition, prevDepRoot,
|
||||||
prevDepRoot)
|
depRoot)
|
||||||
dag.onHeadChanged(data)
|
dag.onHeadChanged(data)
|
||||||
|
|
||||||
withState(dag.headState):
|
withState(dag.headState):
|
||||||
|
|
|
@ -1023,8 +1023,7 @@ func proposer_dependent_root*(state: ForkyHashedBeaconState): Eth2Digest =
|
||||||
state.dependent_root(state.data.slot.epoch)
|
state.dependent_root(state.data.slot.epoch)
|
||||||
|
|
||||||
func attester_dependent_root*(state: ForkyHashedBeaconState): Eth2Digest =
|
func attester_dependent_root*(state: ForkyHashedBeaconState): Eth2Digest =
|
||||||
let epoch = state.data.slot.epoch
|
state.dependent_root(state.data.slot.epoch.get_previous_epoch)
|
||||||
state.dependent_root(if epoch == Epoch(0): epoch else: epoch - 1)
|
|
||||||
|
|
||||||
func latest_block_id*(state: ForkyHashedBeaconState): BlockId =
|
func latest_block_id*(state: ForkyHashedBeaconState): BlockId =
|
||||||
## Block id of the latest block applied to this state
|
## Block id of the latest block applied to this state
|
||||||
|
|
Loading…
Reference in New Issue