diff --git a/beacon_chain/beacon_chain_db_light_client.nim b/beacon_chain/beacon_chain_db_light_client.nim index 2a47f7736..3ba23b022 100644 --- a/beacon_chain/beacon_chain_db_light_client.nim +++ b/beacon_chain/beacon_chain_db_light_client.nim @@ -329,8 +329,7 @@ proc getCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch]( func putCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch]( db: LightClientDataDB, slot: Slot, branch: T) = doAssert not db.backend.readOnly # All `stmt` are non-nil - if not slot.isSupportedBySQLite or - distinctBase(db.currentBranches[T.kind].getStmt) == nil: + if not slot.isSupportedBySQLite: return let res = db.currentBranches[T.kind].putStmt.exec( (slot.int64, SSZ.encode(branch))) diff --git a/beacon_chain/consensus_object_pools/blockchain_dag_light_client.nim b/beacon_chain/consensus_object_pools/blockchain_dag_light_client.nim index da8b154f9..55eebd44b 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag_light_client.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag_light_client.nim @@ -723,9 +723,11 @@ proc createLightClientBootstrap( const lcDataFork = lcDataForkAtConsensusFork(consensusFork) dag.lcDataStore.db.putHeader( 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" - dag.lcDataStore.db.putCurrentSyncCommitteeBranch( - bid.slot, dag.getLightClientData(bid).current_sync_committee_branch) ok() proc initLightClientDataCache*(dag: ChainDAGRef) =