Skip to content

Commit db2043b

Browse files
committed
WIP
1 parent 090f0dd commit db2043b

File tree

28 files changed

+724
-75
lines changed

28 files changed

+724
-75
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ ethereum_ssz = "0.9.0"
6969
futures = { version = "0.3", default-features = false, features = ["alloc"] }
7070
generic-array = { version = "0.14.7", features = ["serde", "zeroize"] }
7171
http = "1.3.1"
72+
ipnet = { version = "2.11.0", features = ["serde"] }
7273
jiff = { version = "0.2", default-features = false, features = ["serde", "std"] }
7374
minicbor = { version = "2.1.1", features = ["full"] }
7475
nohash-hasher = "0.2"

justfile

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ build-port-alloc:
3232

3333
[private]
3434
build-test-utils:
35-
cargo build --release -p test-utils
35+
cargo build --release -p test-utils --all-features
3636

3737
####################
3838
###CHECK COMMANDS###
@@ -171,17 +171,42 @@ test-contract-deploy *ARGS:
171171
scripts/test-contract-deploy {{ARGS}}
172172

173173
test-all: build_release build-test-utils
174-
env RUST_LOG=timeboost_builder::submit=debug,block_checker=info,warn target/release/run \
174+
env RUST_LOG=timeboost_builder::submit=debug,block_checker=info,warn \
175+
target/release/run \
175176
--verbose \
176177
--timeout 120 \
177178
--spawn "1:anvil --port 8545" \
178179
--run "2:sleep 3" \
179-
--run "3:scripts/deploy-test-contract" \
180-
--spawn "4:target/release/block-maker --port 55000 --committee test-configs/local/committee.toml" \
181-
--spawn "4:target/release/yapper --keyset-file test-configs/local/committee.toml" \
182-
--spawn "5:target/release/run-committee --configs test-configs/local/ --committee 0 --timeboost target/release/timeboost" \
183-
target/release/block-checker -- \
184-
--config test-configs/local/node_0.toml \
185-
--committee test-configs/local/committee.toml \
186-
--committee-id 0 \
187-
--blocks 1000
180+
--run "3:scripts/deploy-test-contract test-configs/local/committee.toml http://localhost:8545" \
181+
--spawn "4:target/release/block-maker --bind 127.0.0.1:55000 -c test-configs/local/committee.toml" \
182+
--spawn "4:target/release/yapper -c test-configs/local/committee.toml" \
183+
--spawn "5:target/release/run-committee -c test-configs/local/ -t target/release/timeboost" \
184+
target/release/block-checker -- -c test-configs/local -b 1000
185+
186+
forward-ipv4 val: build-test-utils
187+
run0 target/release/net-setup system --forward-ipv4 {{val}}
188+
189+
create-net: build-test-utils
190+
run0 target/release/net-setup create -c test-configs/linux/net.toml
191+
192+
delete-net: build-test-utils
193+
run0 target/release/net-setup delete -c test-configs/linux/net.toml
194+
195+
netsim: build_release build-test-utils
196+
env RUST_LOG=timeboost_builder::submit=debug,block_checker=info,warn \
197+
run0 --setenv=PATH --setenv=HOME --setenv=RUST_LOG target/release/run \
198+
--verbose \
199+
--timeout 120 \
200+
--clear-env \
201+
--env PATH \
202+
--env HOME \
203+
--env RUST_LOG \
204+
--uid `id -u` \
205+
--gid `id -g` \
206+
--spawn "1:anvil --host 10.0.1.0 --port 8545" \
207+
--run "2:sleep 3" \
208+
--run "3:scripts/deploy-test-contract test-configs/linux/committee.toml http://10.0.1.0:8545" \
209+
--spawn "4:target/release/block-maker --bind 10.0.1.0:55000 -c test-configs/linux/committee.toml" \
210+
--spawn "4:target/release/yapper -c test-configs/linux/committee.toml" \
211+
--spawn-as-root "5:target/release/run-committee -u `id -u` -g `id -g` -c test-configs/linux/ -t target/release/timeboost" \
212+
target/release/block-checker -- -c test-configs/linux -b 200

scripts/deploy-test-contract

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
set -euo pipefail
44

5+
COMMITTEE="$1"
6+
URL="$2"
7+
58
MANAGER_MNEMONIC="attend year erase basket blind adapt stove broccoli isolate unveil acquire category"
69
MANAGER_ACCOUNT_INDEX=0
710
MANAGER_ADDRESS="0x36561082951eed7ffD59cFD82D70570C57072d02"
811
FAUCET_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
9-
URL="http://localhost:8545"
1012
DEPLOYMENT_FILE=$(mktemp -t timeboost-deployment-XXXXX)
1113

1214
# Fund manager account && create deployment file
13-
cast send --value 1ether --private-key "$FAUCET_PRIVATE_KEY" "$MANAGER_ADDRESS"
15+
cast send --value 1ether -r "$URL" --private-key "$FAUCET_PRIVATE_KEY" "$MANAGER_ADDRESS"
1416
env RUST_LOG=info cargo run --release --bin deploy -- \
1517
-m "$MANAGER_MNEMONIC" \
1618
-i "$MANAGER_ACCOUNT_INDEX" \
@@ -26,7 +28,7 @@ env RUST_LOG=info cargo run --release --bin register -- \
2628
-i "$MANAGER_ACCOUNT_INDEX" \
2729
-u "$URL" \
2830
-k "$km_addr" \
29-
-c "test-configs/c0/committee.toml"
31+
-c "$COMMITTEE"
3032

3133
# Clean up the temporary deployment file
3234
rm -f "$DEPLOYMENT_FILE"

test-configs/c0/committee.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
id = 0
12
effective_timestamp = "2025-09-01T02:00:00Z"
23

34
[[members]]

test-configs/docker/committee.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
id = 0
12
effective_timestamp = "2025-09-01T20:00:00Z"
23

34
[[members]]

test-configs/linux/committee.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
id = 0
2+
effective_timestamp = "2025-09-01T02:00:00Z"
3+
4+
[[members]]
5+
signing_key = "eiwaGN1NNaQdbnR9FsjKzUeLghQZsTLPjiL4RcQgfLoX"
6+
dh_key = "AZrLbV37HAGhBWh49JHzup6Wfpu2AAGWGJJnxCDJibiY"
7+
dkg_enc_key = "7PdmfTS45d2hTXB8NcrTmvDwUVBimpYBbrBaGnu3i5Ne65krVfUpbe7bYRHS3AEg7H"
8+
public_address = "10.0.0.1:8000"
9+
internal_api = "10.0.0.1:8003"
10+
http_api = "10.0.0.1:8004"
11+
12+
[[members]]
13+
signing_key = "vGKKAxVNfkSCdn8qh36nXdSZqyhPq644sQBoeZtcEUCR"
14+
dh_key = "FHTJAk6oyt3jefEp1ZrPEn2MkqRt2LibEFd57AnEUZdb"
15+
dkg_enc_key = "7p1BtEz7WnFMt6Hr28X3Rngqza6i8hRoswhzZRFd6GzgkspLKHBfDocHP8DwzXiNiZ"
16+
public_address = "10.0.0.10:8010"
17+
internal_api = "10.0.0.10:8013"
18+
http_api = "10.0.0.10:8014"
19+
20+
[[members]]
21+
signing_key = "264jMLf85hfufg4ck97Hw2jiL6i1PHNoGUqxUqfhtssaE"
22+
dh_key = "63eYNKoW2PsWZFhHHj3eZwHTdPE7gEjEDM7gGeDf9Uaj"
23+
dkg_enc_key = "62bnAAbU58zZUcGqy9JKGZRZHkm3g7JZB2DtJGQyChXQBPGvXSS6fF21yoxiVuD1eb"
24+
public_address = "10.0.0.20:8020"
25+
internal_api = "10.0.0.20:8023"
26+
http_api = "10.0.0.20:8024"
27+
28+
[[members]]
29+
signing_key = "v6UBdLT5BvMhLW7iKv7M2xYeaW2SCAsnZ5PiSg6AaKfA"
30+
dh_key = "Do2GmAexW5MUdD8nToDiBWGbDgk1AwXoxtLTyirDtKQh"
31+
dkg_enc_key = "7aZBFZUEbXxFH9SiGJeUyjzas4mYJ1R13mTPsPeawVU7JFuocfvX9XsRT8qgr17RCe"
32+
public_address = "10.0.0.30:8030"
33+
internal_api = "10.0.0.30:8033"
34+
http_api = "10.0.0.30:8034"
35+
36+
[[members]]
37+
signing_key = "tV66KknkDH47hRSNzwJtt7Q7EZtxVxQsNnUGoAJdDn6J"
38+
dh_key = "HXaesvEGFiDgrVTix1fKzSLTarFexTZSJD6ymSrF7vPL"
39+
dkg_enc_key = "6R69TzDg3jo1MTex9Uter9XQud458YPpSvXirkYdS295PV81CRvgz5jVWQbkCpZnYV"
40+
public_address = "10.0.0.40:8040"
41+
internal_api = "10.0.0.40:8043"
42+
http_api = "10.0.0.40:8044"

test-configs/linux/net.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[bridge]
2+
name = "bridge"
3+
cidr = "10.0.1.0/16"
4+
5+
[[device]]
6+
node = "node_0"
7+
name = "dev1"
8+
cidr = "10.0.0.1/16"
9+
delay = "50ms"
10+
jitter = "50ms"
11+
12+
[[device]]
13+
node = "node_1"
14+
name = "dev2"
15+
cidr = "10.0.0.10/16"
16+
delay = "50ms"
17+
jitter = "50ms"
18+
19+
[[device]]
20+
node = "node_2"
21+
name = "dev3"
22+
cidr = "10.0.0.20/16"
23+
delay = "50ms"
24+
jitter = "50ms"
25+
26+
[[device]]
27+
node = "node_3"
28+
name = "dev4"
29+
cidr = "10.0.0.30/16"
30+
delay = "50ms"
31+
jitter = "50ms"
32+
33+
[[device]]
34+
node = "node_4"
35+
name = "dev5"
36+
cidr = "10.0.0.40/16"
37+
delay = "50ms"
38+
jitter = "50ms"

test-configs/linux/node_0.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
stamp = "/tmp/timeboost.0.stamp"
2+
3+
[net.public]
4+
address = "10.0.0.1:8000"
5+
http-api = "10.0.0.1:8004"
6+
7+
[net.internal]
8+
address = "10.0.0.1:8003"
9+
nitro = "10.0.1.0:55000"
10+
11+
[keys.signing]
12+
secret = "3hzb3bRzn3dXSV1iEVE6mU4BF2aS725s8AboRxLwULPp"
13+
public = "eiwaGN1NNaQdbnR9FsjKzUeLghQZsTLPjiL4RcQgfLoX"
14+
15+
[keys.dh]
16+
secret = "BB3zUfFQGfw3sL6bpp1JH1HozK6ehEDmRGoiCpQH62rZ"
17+
public = "AZrLbV37HAGhBWh49JHzup6Wfpu2AAGWGJJnxCDJibiY"
18+
19+
[keys.dkg]
20+
secret = "BW8gq8MARtDkSJL6daobPtGQm22TKkXdbLNrNGngNGTB"
21+
public = "7PdmfTS45d2hTXB8NcrTmvDwUVBimpYBbrBaGnu3i5Ne65krVfUpbe7bYRHS3AEg7H"
22+
23+
[chain]
24+
namespace = 10101
25+
26+
[chain.parent]
27+
id = 31337
28+
rpc-url = "http://10.0.1.0:8545/"
29+
ibox-contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
30+
block-tag = "finalized"
31+
key-manager-contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
32+
33+
[espresso]
34+
base-url = "https://query.decaf.testnet.espresso.network/v1/"
35+
websockets-base-url = "wss://query.decaf.testnet.espresso.network/v1/"
36+
max-transaction-size = 1048576

test-configs/linux/node_1.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
stamp = "/tmp/timeboost.1.stamp"
2+
3+
[net.public]
4+
address = "10.0.0.10:8010"
5+
http-api = "10.0.0.10:8014"
6+
7+
[net.internal]
8+
address = "10.0.0.10:8013"
9+
nitro = "10.0.1.0:55000"
10+
11+
[keys.signing]
12+
secret = "FWJzNGvEjFS3h1N1sSMkcvvroWwjT5LQuGkGHu9JMAYs"
13+
public = "vGKKAxVNfkSCdn8qh36nXdSZqyhPq644sQBoeZtcEUCR"
14+
15+
[keys.dh]
16+
secret = "4hjtciEvuoFVT55nAzvdP9E76r18QwntWwFoeginCGnP"
17+
public = "FHTJAk6oyt3jefEp1ZrPEn2MkqRt2LibEFd57AnEUZdb"
18+
19+
[keys.dkg]
20+
secret = "ARtqWGmRWrBqZUr4MmiLaPgzjsiKp5USsC9iQNRMZYy4"
21+
public = "7p1BtEz7WnFMt6Hr28X3Rngqza6i8hRoswhzZRFd6GzgkspLKHBfDocHP8DwzXiNiZ"
22+
23+
[chain]
24+
namespace = 10101
25+
26+
[chain.parent]
27+
id = 31337
28+
rpc-url = "http://10.0.1.0:8545/"
29+
ibox-contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
30+
block-tag = "finalized"
31+
key-manager-contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
32+
33+
[espresso]
34+
base-url = "https://query.decaf.testnet.espresso.network/v1/"
35+
websockets-base-url = "wss://query.decaf.testnet.espresso.network/v1/"
36+
max-transaction-size = 1048576

0 commit comments

Comments
 (0)