-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move staged commit to intents (#984)
## tl;dr - Moves `staged_commits` from being handled by OpenMLS to being stored on each intent - Adds a mutex for each group's sync operations. Only one sync may happen in parallel at any time per group - Creates database columns for storing the staged commit and the epoch the commit was published - Updates a test for message conflicts to better check for forked group states - I found some cases where we were calling `publish_intents` and then immediately calling `sync`. That should not be necessary, since we call `publish_intents` from inside the sync method - Adds tests for parallel and reentrant syncs ## More Info [https://github.com/xmtp/libxmtp/issues/979](https://github.com/xmtp/libxmtp/issues/979#issuecomment-2303541848)
- Loading branch information
Showing
14 changed files
with
466 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
set -eou pipefail | ||
|
||
docker-compose -f dev/docker/docker-compose.yml -p "libxmtp" "$@" | ||
docker compose -f dev/docker/docker-compose.yml -p "libxmtp" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
xmtp_mls/migrations/2024-08-22-044745_add_staged_commit/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- This file should undo anything in `up.sql` | ||
ALTER TABLE group_intents | ||
DROP COLUMN staged_commit; | ||
|
||
ALTER TABLE group_intents | ||
DROP COLUMN published_in_epoch; | ||
|
7 changes: 7 additions & 0 deletions
7
xmtp_mls/migrations/2024-08-22-044745_add_staged_commit/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Your SQL goes here | ||
ALTER TABLE group_intents | ||
ADD COLUMN staged_commit BLOB; | ||
|
||
ALTER TABLE group_intents | ||
ADD COLUMN published_in_epoch BIGINT; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.