Use signature slot instead of attested header slot (#1811)
Use signature slot instead of attested header slot in the OptimisticUpdate content key.
This commit is contained in:
parent
f72f02c88b
commit
7b313ec1ac
|
@ -330,7 +330,7 @@ proc loop(self: LightClientManager) {.async.} =
|
|||
let finalizedSlot = start_slot(epoch(wallTime.slotOrZero()) - 2)
|
||||
await self.query(FinalityUpdate, finalizedSlot)
|
||||
of LcSyncKind.OptimisticUpdate:
|
||||
let optimisticSlot = wallTime.slotOrZero() - 1
|
||||
let optimisticSlot = wallTime.slotOrZero()
|
||||
await self.query(OptimisticUpdate, optimisticSlot)
|
||||
|
||||
nextSyncTaskTime = wallTime + self.rng.nextLcSyncTaskDelay(
|
||||
|
|
|
@ -170,7 +170,7 @@ suite "Beacon Light Client Content Encodings - Mainnet":
|
|||
let key = contentKey.value()
|
||||
withForkyObject(update):
|
||||
when lcDataFork > LightClientDataFork.None:
|
||||
check forkyObject.attested_header.beacon.slot ==
|
||||
check forkyObject.signature_slot ==
|
||||
key.lightClientOptimisticUpdateKey.optimisticSlot
|
||||
|
||||
# re-encode content and content key
|
||||
|
|
|
@ -90,7 +90,7 @@ procSuite "Beacon Light Client Content Network":
|
|||
lightClientOptimisticUpdateBytes, altair.LightClientOptimisticUpdate)
|
||||
optimisticUpdate = ForkedLightClientOptimisticUpdate(
|
||||
kind: LightClientDataFork.Altair, altairData: optimisticUpdateData)
|
||||
optimisticHeaderSlot = optimisticUpdateData.attested_header.beacon.slot
|
||||
optimisticHeaderSlot = optimisticUpdateData.signature_slot
|
||||
|
||||
finalityUpdateKey = finalityUpdateContentKey(
|
||||
distinctBase(finalizedHeaderSlot)
|
||||
|
|
|
@ -231,7 +231,7 @@ proc gossipLCOptimisticUpdate*(
|
|||
withForkyObject(update):
|
||||
when lcDataFork > LightClientDataFork.None:
|
||||
let
|
||||
slot = forkyObject.attested_header.beacon.slot
|
||||
slot = forkyObject.signature_slot
|
||||
contentKey = encode(optimisticUpdateContentKey(slot.uint64))
|
||||
forkDigest = forkDigestAtEpoch(
|
||||
forkDigests[], epoch(forkyObject.attested_header.beacon.slot), cfg)
|
||||
|
|
|
@ -615,7 +615,7 @@ proc run(config: BeaconBridgeConf) {.raises: [CatchableError].} =
|
|||
update, slot = forkyObject.attested_header.beacon.slot
|
||||
|
||||
let
|
||||
slot = forkyObject.attested_header.beacon.slot
|
||||
slot = forkyObject.signature_slot
|
||||
contentKey = encode(optimisticUpdateContentKey(slot.uint64))
|
||||
contentId = beacon_light_client_content.toContentId(contentKey)
|
||||
forkDigest = forkDigestAtEpoch(
|
||||
|
|
|
@ -264,7 +264,7 @@ proc exportLCOptimisticUpdate*(
|
|||
withForkyObject(update):
|
||||
when lcDataFork > LightClientDataFork.None:
|
||||
let
|
||||
slot = forkyObject.attested_header.beacon.slot
|
||||
slot = forkyObject.signature_slot
|
||||
contentKey = encode(optimisticUpdateContentKey(slot.uint64))
|
||||
contentId = beacon_light_client_content.toContentId(contentKey)
|
||||
forkDigest = forkDigestAtEpoch(
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 26edde52b942020ef38aba3795400d713072cf21
|
||||
Subproject commit cecc8767654e0b19d2bc55ae3a693d428774565c
|
Loading…
Reference in New Issue