Use INDEX mechanism
I've thought about a solution to express in a more formal way the protocol rules (local + global).
I call this new way the INDEX mechanism.
You can follow this issue to see the progress. I am planning to implement it in 13 steps:
- Create a function(block) => local index.
- Test 1. with few simple blocks.
- Remplace local_rules.js code by local index checkings + rewrite the local rules in the protocol accordingly.
- Split the local unit tests into separate files, instead of current big file which is not clear + add a file which tests the chaining of all the local rules.
- Create the SQL tables of MISC index (Membership, Identity, Source, Certification).
- Feed the index tables with local index as a new block is added to the blockchain.
- Create a function(block) => global index.
- Test 7. with few simple blocks.
- Feed the index tables with global index as a new block is added to the blockchain.
- Remplace the global_rules.js code by global index checkings + rewrite global rules in the protocol accordingly.
- Handle the new revert algorithm, relying on indexes.
- Remove deprecated fields + Remove deprecated functions (
getCurrentExcludingOrExpiring
, ...) - Handle index windowing (index becomes a flow, we don't need to store it fully, just a window)