put correct sync committee branch version into DB
This commit is contained in:
parent
c0d07e1b24
commit
e7349be3e5
|
@ -329,8 +329,7 @@ proc getCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch](
|
||||||
func putCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch](
|
func putCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch](
|
||||||
db: LightClientDataDB, slot: Slot, branch: T) =
|
db: LightClientDataDB, slot: Slot, branch: T) =
|
||||||
doAssert not db.backend.readOnly # All `stmt` are non-nil
|
doAssert not db.backend.readOnly # All `stmt` are non-nil
|
||||||
if not slot.isSupportedBySQLite or
|
if not slot.isSupportedBySQLite:
|
||||||
distinctBase(db.currentBranches[T.kind].getStmt) == nil:
|
|
||||||
return
|
return
|
||||||
let res = db.currentBranches[T.kind].putStmt.exec(
|
let res = db.currentBranches[T.kind].putStmt.exec(
|
||||||
(slot.int64, SSZ.encode(branch)))
|
(slot.int64, SSZ.encode(branch)))
|
||||||
|
|
|
@ -723,9 +723,11 @@ proc createLightClientBootstrap(
|
||||||
const lcDataFork = lcDataForkAtConsensusFork(consensusFork)
|
const lcDataFork = lcDataForkAtConsensusFork(consensusFork)
|
||||||
dag.lcDataStore.db.putHeader(
|
dag.lcDataStore.db.putHeader(
|
||||||
forkyBlck.toLightClientHeader(lcDataFork))
|
forkyBlck.toLightClientHeader(lcDataFork))
|
||||||
|
dag.lcDataStore.db.putCurrentSyncCommitteeBranch(
|
||||||
|
bid.slot, normalize_merkle_branch(
|
||||||
|
dag.getLightClientData(bid).current_sync_committee_branch,
|
||||||
|
lcDataFork.CURRENT_SYNC_COMMITTEE_GINDEX))
|
||||||
else: raiseAssert "Unreachable"
|
else: raiseAssert "Unreachable"
|
||||||
dag.lcDataStore.db.putCurrentSyncCommitteeBranch(
|
|
||||||
bid.slot, dag.getLightClientData(bid).current_sync_committee_branch)
|
|
||||||
ok()
|
ok()
|
||||||
|
|
||||||
proc initLightClientDataCache*(dag: ChainDAGRef) =
|
proc initLightClientDataCache*(dag: ChainDAGRef) =
|
||||||
|
|
Loading…
Reference in New Issue