Closed troggy closed 4 years ago
upsizing to M
what if a node starts a lot later, when the preserved period has no relevance any more. is that case covered?
has no relevance any more
how is that? If it wasn't submitted, it is still relevant, no? If it was submitted by someone else it will be handled during event replay (see Submission handler in bridgeState)
it will be handled during event replay (see Submission handler in bridgeState)
that is what i wanted to know :)
Bounty
leap-node keeps track of the current period object: new one is created every 32 blocks and filled with mined plasma blocks. When it is time to create a new period, we save the current one into
bridgeState.previousPeriod
so that later we can check if it is landed on the root chain or not. We do this check in a period handler aka checkBridge. If the check fails, we stop the consensus engine until the period is on the root chain.The problem is that
bridgeState.previousPeriod
is created only in a block handler. If we restart the node,bridgeState.previousPeriod
will be lost as block handler for that particular height won't be executed anymore (unless we rollback the local data or resync the chain). NopreviousPeriod
— no ability to check if it is landed on the root chain. Essentially, in this situation period handler will just skip the check withok
and we lost the period.Scope
previousPeriod
andpendingPeriod
in the db (seebridgeState.saveSubmissions
for example, no need to do it every block though, only once created). It should be enough to store only period merkle root and prevHash.Deliverables
Gain for the project
reliable node restarts, no lost submissions
Publicly visible delivery
Roles
bounty gardener: @troggy / 70 DAI bounty worker: @troggy / share bounty reviewer: name / share
Funded by
Dev Circle