Closed orthecreedence closed 3 years ago
Some possible fixes:
Had another idea for this.
When building the idntity from the DAG, have a final identity, and a branch-specific identity.
Each time the DAG branches, you create a copy of the pre-fork's branch-specific identity. Then you follow the transactions in that branch, using the branch-specific identity to validate the transactions (and only apply transactions from that branch tot he branch-specific id), but apply all transactions to the final identity on each transaction.
This way, the final ends up getting all the updates in order, but doesn't rely on the primary keys being in order for validation.
This won't fix other conflicts (like setting a name to two different values on different branches) but for those we can use a really naive last-write-wins automated merge until someone bitches about it.
When a DAG has two trees, and one of the trees changes, say, the root key, applying the changes in chronological order fails, because one branch of the tree uses the old root key and the other uses the new key.
Note that we test for this in
dag::tests::transactions_merge_reset
.