Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0e51cb5
fix: correct sync proto
iamquang95 Mar 31, 2026
0526b92
feat: add read/write fixed size proto
iamquang95 Mar 31, 2026
9693e9a
feat: initial implementation of sync
iamquang95 Apr 1, 2026
dfcb872
fix: skip relay connection handler
iamquang95 Apr 1, 2026
638d134
refactor: simplify sync client
iamquang95 Apr 1, 2026
522ab55
refactor: inline functions
iamquang95 Apr 1, 2026
5535675
fix: don't need to self-manage pending dial
iamquang95 Apr 1, 2026
481a776
fix: simplify code write/read proto
iamquang95 Apr 1, 2026
25e2294
feat: add events
iamquang95 Apr 3, 2026
d4d5c8d
feat: implement example sync
iamquang95 Apr 3, 2026
29013bf
fix: clear server connected state
iamquang95 Apr 3, 2026
6de0bda
fix: simplify code
iamquang95 Apr 3, 2026
4249e14
fix: sync example allow a peer is disconnected
iamquang95 Apr 3, 2026
bafbd0a
fix: clippy
iamquang95 Apr 3, 2026
04f1a93
fix: retry connect when dial fail
iamquang95 Apr 6, 2026
75df4b5
fix: Client cancel will stop outbound stream
iamquang95 Apr 6, 2026
51acdbc
fix: remove decode and encode error
iamquang95 Apr 6, 2026
509dc02
Merge remote-tracking branch 'origin/main' into iamquang95/dkg/sync
iamquang95 Apr 6, 2026
17b3372
fix: check stop_rx when return canceled
iamquang95 Apr 15, 2026
698b117
fix: drop duplicated inbound sync
iamquang95 Apr 15, 2026
e09b6d7
fix: initial backoff on retry
iamquang95 Apr 15, 2026
5fb457d
fix: don't retry on NegotiationFailed
iamquang95 Apr 15, 2026
1d2f085
fix: check server error on await_all_Shutdown
iamquang95 Apr 15, 2026
d683a58
fix: add comments
iamquang95 Apr 15, 2026
d596c1a
refactor: avoid double hash
iamquang95 Apr 15, 2026
b8ba097
Merge remote-tracking branch 'origin/main' into iamquang95/dkg/sync
iamquang95 Apr 15, 2026
5274bfe
fix: fmt
iamquang95 Apr 15, 2026
5be6187
fix: address comments
iamquang95 Apr 16, 2026
b5fbffc
Merge remote-tracking branch 'origin/main' into iamquang95/dkg/sync
iamquang95 Apr 16, 2026
c9556f1
fix: set max msg size to 32MB for sync msg
iamquang95 Apr 17, 2026
b25cc75
Merge remote-tracking branch 'origin/main' into iamquang95/dkg/sync
iamquang95 Apr 17, 2026
b329b14
fix: update sync example
iamquang95 Apr 17, 2026
22df26a
feat: golang code for sync interop example
iamquang95 Apr 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions crates/dkg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ license.workspace = true
publish.workspace = true

[dependencies]
bon.workspace = true
prost.workspace = true
prost-types.workspace = true
thiserror.workspace = true
libp2p.workspace = true
futures.workspace = true
tokio.workspace = true
tokio-util.workspace = true
sha2.workspace = true
tracing.workspace = true
either.workspace = true
k256.workspace = true
pluto-k1util.workspace = true
pluto-p2p.workspace = true
pluto-cluster.workspace = true
pluto-core.workspace = true
pluto-crypto.workspace = true
pluto-eth1wrap.workspace = true
pluto-eth2util.workspace = true
Expand All @@ -38,11 +41,9 @@ anyhow.workspace = true
clap.workspace = true
hex.workspace = true
pluto-cluster = { workspace = true, features = ["test-cluster"] }
pluto-core.workspace = true
pluto-testutil.workspace = true
pluto-tracing.workspace = true
serde_json.workspace = true
tokio-util.workspace = true
tempfile.workspace = true

[lints]
Expand Down
136 changes: 136 additions & 0 deletions crates/dkg/examples/interop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Pluto + Charon Sync Interop Demo

Manual 5-terminal interop demo for `dkg/sync`.

Pre-step:
- generate shared fixture once

Runtime topology:
- terminal 1: Pluto relay
- terminal 2: Pluto node 0
- terminal 3: Pluto node 1
- terminal 4: Charon node 2
- terminal 5: Charon node 3

Assumptions:
- relay URL: `http://127.0.0.1:8888`
- shared fixture dir: `/tmp/pluto-sync-interop`

Set these once in every terminal:

```bash
PLUTO_CODE_DIR=/path/to/charon-rs
CHARON_CODE_DIR=/path/to/charon
```

## Pre-step: Build Charon And Create Shared Fixture

Run:

```bash
cd "$CHARON_CODE_DIR"
go build -o /tmp/charon .
/tmp/charon create cluster \
--cluster-dir /tmp/pluto-sync-interop \
--nodes 4 \
--num-validators 1 \
--network holesky \
--insecure-keys \
--fee-recipient-addresses 0x000000000000000000000000000000000000dEaD \
--withdrawal-addresses 0x000000000000000000000000000000000000dEaD
```

This creates:
- `/tmp/pluto-sync-interop/node0`
- `/tmp/pluto-sync-interop/node1`
- `/tmp/pluto-sync-interop/node2`
- `/tmp/pluto-sync-interop/node3`

After this finishes, close that terminal. The runtime demo uses 5 terminals total.

## Terminal 1: Start Relay

Run from Pluto repo root:

```bash
cd "$PLUTO_CODE_DIR"
cargo run -p pluto-relay-server --example relay_server
```

Leave it running.

## Terminal 2: Start Pluto Node 0

Run from Pluto repo root:

```bash
cd "$PLUTO_CODE_DIR"
cargo run -p pluto-dkg --example sync -- \
--relays http://127.0.0.1:8888 \
--data-dir /tmp/pluto-sync-interop/node0
```

## Terminal 3: Start Pluto Node 1

Run from Pluto repo root:

```bash
cd "$PLUTO_CODE_DIR"
cargo run -p pluto-dkg --example sync -- \
--relays http://127.0.0.1:8888 \
--data-dir /tmp/pluto-sync-interop/node1
```

## Terminal 4: Start Charon Node 2

Run from Pluto repo root:

```bash
cd "$PLUTO_CODE_DIR"
CHARON_DIR="$CHARON_CODE_DIR" \
bash ./crates/dkg/examples/interop/charon_sync_demo.sh \
--data-dir /tmp/pluto-sync-interop/node2 \
--relay-url http://127.0.0.1:8888
```

## Terminal 5: Start Charon Node 3

Run from Pluto repo root:

```bash
cd "$PLUTO_CODE_DIR"
CHARON_DIR="$CHARON_CODE_DIR" \
bash ./crates/dkg/examples/interop/charon_sync_demo.sh \
--data-dir /tmp/pluto-sync-interop/node3 \
--relay-url http://127.0.0.1:8888
```

## Recommended Startup Order

1. Run the pre-step once to create the fixture.
2. Start relay in terminal 1.
3. Start Pluto node 0 in terminal 2.
4. Start Pluto node 1 in terminal 3.
5. Start Charon node 2 in terminal 4.
6. Start Charon node 3 in terminal 5.

## Success Signals

On Pluto nodes:
- `Relay reservation accepted`
- `Connection established`
- `All sync clients connected`
- `Sync step reached`
- `Sync demo is now idling until Ctrl+C`

On Charon nodes:
- `Started charon sync demo`
- `Waiting for peers to connect`
- `All peers connected`
- `Sync step reached local_node=... step=1`
- `Sync step reached local_node=... step=2`
- `Sync demo is now idling until Ctrl+C`

## Stop The Demo

Press `Ctrl+C` in any node terminal.
Loading