digitalbazaar / bedrock-ledger-consensus-continuity

Web Ledger Continuity Consensus Protocol
Other
3 stars 2 forks source link

Ensure `localChildlessHashes` is updated on work session start/as needed #228

Closed dlongley closed 3 years ago

dlongley commented 3 years ago

We have a FIXME here that needs to be addressed:

https://github.com/digitalbazaar/bedrock-ledger-consensus-continuity/blob/aa57ff6692561edd01c0b90a1269e773252ed1dd/lib/events.js#L530-L538

If a local regular event is added but the cache isn't updated, then when we make a merge event, we may omit a regular event that is pending. This would be a serious failure (as we cannot include it later because it is a protocol violation to do so) -- we'd have to regenerate the event and assign it the appropriate (new) merge event parent. That would be a mess, so instead, we should guarantee that localChildlessHashes (or whatever we use to select all pending regular events to create parent hashes for the next merge event) must not get corrupted/must be repaired.

dlongley commented 3 years ago

This no longer applies, using the redis cache for events has been removed.