You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the dot/digest package we listen for finalized headers and when a new finalized header arrives we execute the function persistBABEDigestsForNextEpoch(finalizedHeader *types.Header). This function retrieves the epoch for the finalized header add 1 and uses the result as the nextEpoch and then call the h.epochState.FinalizeBABENextEpochData(nextEpoch) and h.epochState.FinalizeBABENextConfigData(nextEpoch) in order to persist the next epoch BABE data and config and remove the in memory data.
The problem is that when another header is finalized in the same epoch we call the same functions again but this time they will fail as there is no data to persist in the database.
A possible solution is to check if the nextEpoch already has defined some data in the database and if so we skip the respective persistency step
The text was updated successfully, but these errors were encountered:
EclesioMeloJunior
changed the title
(dot/digest): Check if the BABE next epoch is already persisted
Check if the BABE next epoch is already persisted
Apr 6, 2022
EclesioMeloJunior
changed the title
Check if the BABE next epoch is already persisted
check if the BABE next epoch is already persisted
Apr 6, 2022
Describe the bug
In the
dot/digest
package we listen for finalized headers and when a new finalized header arrives we execute the functionpersistBABEDigestsForNextEpoch(finalizedHeader *types.Header)
. This function retrieves the epoch for the finalized header add1
and uses the result as thenextEpoch
and then call theh.epochState.FinalizeBABENextEpochData(nextEpoch)
andh.epochState.FinalizeBABENextConfigData(nextEpoch)
in order to persist the next epoch BABE data and config and remove the in memory data.The problem is that when another header is finalized in the same epoch we call the same functions again but this time they will fail as there is no data to persist in the database.
A possible solution is to check if the
nextEpoch
already has defined some data in the database and if so we skip the respective persistency stepThe text was updated successfully, but these errors were encountered: