Skip to content

Commit

Permalink
reverting disabling of governance features (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkosecki authored Feb 28, 2022
1 parent 531bfa5 commit 611ee8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,11 @@ class TezosIndexer private (
.processBlocksPage(fetchingResults)
.flatTap(_ =>
accountsProcessor.processTezosAccountsCheckpoint() >>
(if (featureFlags.bakerFeaturesAreOn) bakersProcessor.processTezosBakersCheckpoint()
else Future.successful(Done)) >>
(if (featureFlags.bakerFeaturesAreOn)
accountsProcessor.markBakerAccounts(extractProcessedHashes(fetchingResults))
else Future.successful(Done)) >>
bakersProcessor.processTezosBakersCheckpoint() >>
accountsProcessor.markBakerAccounts(extractProcessedHashes(fetchingResults)) >>
(if (featureFlags.rightsProcessingIsOn)
rightsProcessor.processBakingAndEndorsingRights(fetchingResults)
else Future.successful(Done))
rightsProcessor.processBakingAndEndorsingRights(fetchingResults)
else Future.successful(Done))
)
}
.runFold(0) { (processed, justDone) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,14 @@ class BlocksProcessor(
block -> accountIds.taggedWithBlockData(block.data)
}.unzip

val bakerOps = if (featureFlags.bakerFeaturesAreOn) {
for {
bakersCheckpoints <- accountsProcessor.processAccountsForBlocks(
accountUpdates
) // should this fail, we still recover data from the checkpoint
_ <- db.run(TezosDb.writeBlocksAndCheckpointAccounts(blocks, accountUpdates)) andThen logBlockOutcome
_ <- tnsOperations.processNamesRegistrations(blocks).flatMap(db.run)
bakersCheckpoints <- accountsProcessor.processAccountsForBlocks(accountUpdates) // should this fail, we still recover data from the checkpoint
_ <- bakersProcessor.processBakersForBlocks(bakersCheckpoints)
_ <- bakersProcessor.updateBakersBalances(blocks)
rollsData <- nodeOperator.getBakerRollsForBlocks(blocks)
_ <- processBlocksForGovernance(rollsData.toMap)
} yield ()
} else Future.successful(())

for {
_ <- db.run(TezosDb.writeBlocksAndCheckpointAccounts(blocks, accountUpdates)) andThen logBlockOutcome
_ <- tnsOperations.processNamesRegistrations(blocks).flatMap(db.run)
_ <- bakerOps
} yield results.size

}
Expand Down

0 comments on commit 611ee8b

Please sign in to comment.