Skip to content

Commit bc55a98

Browse files
authored
Merge pull request #488 from EspressoSystems/tw/config-updates
Extend config file.
2 parents bb1df39 + f8ef80c commit bc55a98

File tree

28 files changed

+386
-238
lines changed

28 files changed

+386
-238
lines changed

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ jobs:
134134
- name: Install Foundry
135135
uses: foundry-rs/foundry-toolchain@v1
136136
- name: Run tests
137-
run: just run_demo -s /tmp/stamp --ignore-stamp --yapper -c test-configs/c0
137+
run: just run_demo --ignore-stamp --yapper -c test-configs/c0
138138
- name: Run tests with late-start node
139-
run: just run_demo -l -s /tmp/stamp --ignore-stamp --yapper -c test-configs/c0
139+
run: just run_demo -l --ignore-stamp --yapper -c test-configs/c0
140140
- name: Run sailfish demo
141141
run: just run_sailfish_demo
142142

@@ -195,8 +195,7 @@ jobs:
195195
--init &
196196
cd ..
197197
- name: Run test timeboost with nitro sequencer
198-
run: just run_demo -s /tmp/stamp --ignore-stamp -c test-configs/nitro-ci-committee --rounds 10000 --yapper --nitro
198+
run: just run_demo --ignore-stamp -c test-configs/nitro-ci-committee --rounds 10000 --yapper --nitro http://localhost:8547
199199
- name: Verify sequencer blocks
200200
run: |
201201
RUST_LOG=info just verify_blocks
202-

justfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fix:
5353

5454
ci_local:
5555
just build && just lint && just test_ci --release && \
56-
just run_demo -s /tmp/stamp --ignore-stamp --yapper -c test-configs/c0 && \
56+
just run_demo --ignore-stamp --yapper -c test-configs/c0 && \
5757
just run_sailfish_demo && just build_docker
5858

5959
bacon: clippy check fmt
@@ -91,38 +91,44 @@ mkconfig NUM_NODES DATETIME *ARGS:
9191
cargo run --bin mkconfig -- -n {{NUM_NODES}} \
9292
--public-addr "127.0.0.1:8000" \
9393
--internal-addr "127.0.0.1:8003" \
94+
--http-api "127.0.0.1:8004" \
9495
--chain-namespace 10101 \
9596
--parent-rpc-url "http://127.0.0.1:8545" \
9697
--parent-chain-id 31337 \
9798
--parent-ibox-contract "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1" \
9899
--key-manager-contract "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35" \
99100
--timestamp {{DATETIME}} \
101+
--stamp-dir "/tmp" \
100102
--output "test-configs/c0" {{ARGS}}
101103

102104
mkconfig_docker DATETIME *ARGS:
103105
cargo run --bin mkconfig -- -n 5 \
104106
--public-addr "172.20.0.2:8000" \
105107
--internal-addr "172.20.0.2:8003" \
108+
--http-api "172.20.0.2:8004" \
106109
--mode "increment-address" \
107110
--chain-namespace 10101 \
108111
--parent-rpc-url "http://127.0.0.1:8545" \
109112
--parent-chain-id 31337 \
110113
--parent-ibox-contract "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1" \
111114
--key-manager-contract "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35" \
112115
--timestamp {{DATETIME}} \
116+
--stamp-dir "/tmp" \
113117
--output "test-configs/docker" {{ARGS}}
114118

115119
mkconfig_nitro DATETIME *ARGS:
116120
cargo run --bin mkconfig -- -n 2 \
117121
--public-addr "127.0.0.1:8000" \
118122
--internal-addr "127.0.0.1:8003" \
123+
--http-api "127.0.0.1:8004" \
119124
--nitro-addr "localhost:55000" \
120125
--chain-namespace 412346 \
121126
--parent-rpc-url "http://127.0.0.1:8545" \
122127
--parent-chain-id 1337 \
123128
--parent-ibox-contract "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1" \
124129
--key-manager-contract "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35" \
125130
--timestamp {{DATETIME}} \
131+
--stamp-dir "/tmp" \
126132
--output "test-configs/nitro-ci-committee" {{ARGS}}
127133

128134
verify_blocks *ARGS:

scripts/run-timeboost-demo

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ rounds=300
2121
late_start=false
2222
config_dir=
2323
tps=1
24-
stamp=
2524
ignore_stamp=false
26-
nitro_enabled=false
25+
nitro_url=
2726
yapper=false
2827

2928
while [[ $# -gt 0 ]]; do
@@ -44,12 +43,8 @@ while [[ $# -gt 0 ]]; do
4443
tps="$2"
4544
shift 2
4645
;;
47-
--nitro)
48-
nitro_enabled=true
49-
shift
50-
;;
51-
-s|--stamp)
52-
stamp="$2"
46+
-n|--nitro)
47+
nitro_url="$2"
5348
shift 2
5449
;;
5550
--ignore-stamp)
@@ -78,11 +73,8 @@ Options:
7873
-t | --tps <number>
7974
number of transactions per second to generate.
8075
81-
-s | --stamp <PATH prefix>
82-
Path prefix for the stamp files.
83-
84-
--nitro
85-
Local Nitro node is running.
76+
-n | --nitro <URL>
77+
Address the local Nitro node is running.
8678
8779
--yapper
8880
Run external transaction generator.
@@ -94,20 +86,15 @@ Options:
9486
esac
9587
done
9688

97-
if [ ! $stamp ]; then
98-
echo "Missing -s | --stamp <PATH prefix>"
99-
exit 1
100-
fi
101-
10289
if [ ! $config_dir ]; then
10390
echo "Missing -c | --config-dir <PATH>"
10491
exit 1
10592
fi
10693

10794
just build_release --features="until"
10895

109-
if $nitro_enabled; then
110-
timeout 90 bash -c 'until curl -sSf http://localhost:8547 -o /dev/null; do sleep 1; done' || exit 1
96+
if [ $nitro_url ]; then
97+
timeout 90 bash -c "until curl -sSf $nitro_url -o /dev/null; do sleep 1; done" || exit 1
11198
fi
11299

113100

@@ -118,7 +105,7 @@ if [ -z "$RUST_LOG" ]; then
118105
fi
119106

120107
cmd=("test-contract-deploy" "--keep-anvil")
121-
if $nitro_enabled; then
108+
if [ $nitro_url ]; then
122109
cmd+=("--nitro-enabled")
123110
fi
124111
just "${cmd[@]}"
@@ -129,18 +116,21 @@ i=0
129116
for f in "$config_dir"/node_*.toml; do
130117
cmd=(target/release/timeboost
131118
--committee-id 0
119+
--committee "$config_dir/committee.toml"
132120
--config "$f"
133-
--http-port $((8800 + 10 * $i))
134121
--until $rounds
135-
--stamp "${stamp}-$i.sf"
136122
--watchdog-timeout 120)
137123

138124
if $ignore_stamp; then
139125
cmd+=(--ignore-stamp)
140126
fi
141127

142-
if $late_start; then
143-
cmd+=(--late-start --late-start-node-id 0)
128+
if $late_start && (( $i == 0 )); then
129+
cmd+=(--start-delay 5)
130+
fi
131+
132+
if $yapper; then
133+
cmd+=(--required-decrypt-rounds 3)
144134
fi
145135

146136
echo "${cmd[@]}"
@@ -154,8 +144,8 @@ if $yapper; then
154144
cmd=(target/release/yapper
155145
--tps $tps
156146
--keyset-file "$config_dir/committee.toml")
157-
if $nitro_enabled; then
158-
cmd+=(--nitro-integration)
147+
if [ $nitro_url ]; then
148+
cmd+=(--nitro-url "$nitro_url")
159149
fi
160150
"${cmd[@]}" &
161151
fi

scripts/test-contract-deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ cast send --value 1ether --private-key "$FAUCET_PRIVATE_KEY" "$MANAGER_ADDRESS"
8080
RUST_LOG=info cargo run --bin deploy -- -m "$MANAGER_MNEMONIC" -i "$MANAGER_ACCOUNT_INDEX" -u "$URL" -o "$DEPLOYMENT_FILE"
8181

8282
# Extract the deployed KeyManager address
83-
km_addr=$(yq -r ".deployments.key_manager" "$DEPLOYMENT_FILE")
83+
km_addr=$(sed -nr 's/^key_manager.*=.*"(.+)"/\1/p' "$DEPLOYMENT_FILE")
8484

8585
# Update the contract
8686
committee_config="test-configs/$COMMITTEE_PATH/committee.toml"

test-configs/c0/committee.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,32 @@ signing_key = "eiwaGN1NNaQdbnR9FsjKzUeLghQZsTLPjiL4RcQgfLoX"
55
dh_key = "AZrLbV37HAGhBWh49JHzup6Wfpu2AAGWGJJnxCDJibiY"
66
dkg_enc_key = "7PdmfTS45d2hTXB8NcrTmvDwUVBimpYBbrBaGnu3i5Ne65krVfUpbe7bYRHS3AEg7H"
77
public_address = "127.0.0.1:8000"
8+
http_api = "127.0.0.1:8004"
89

910
[[members]]
1011
signing_key = "vGKKAxVNfkSCdn8qh36nXdSZqyhPq644sQBoeZtcEUCR"
1112
dh_key = "FHTJAk6oyt3jefEp1ZrPEn2MkqRt2LibEFd57AnEUZdb"
1213
dkg_enc_key = "7p1BtEz7WnFMt6Hr28X3Rngqza6i8hRoswhzZRFd6GzgkspLKHBfDocHP8DwzXiNiZ"
1314
public_address = "127.0.0.1:8010"
15+
http_api = "127.0.0.1:8014"
1416

1517
[[members]]
1618
signing_key = "264jMLf85hfufg4ck97Hw2jiL6i1PHNoGUqxUqfhtssaE"
1719
dh_key = "63eYNKoW2PsWZFhHHj3eZwHTdPE7gEjEDM7gGeDf9Uaj"
1820
dkg_enc_key = "62bnAAbU58zZUcGqy9JKGZRZHkm3g7JZB2DtJGQyChXQBPGvXSS6fF21yoxiVuD1eb"
1921
public_address = "127.0.0.1:8020"
22+
http_api = "127.0.0.1:8024"
2023

2124
[[members]]
2225
signing_key = "v6UBdLT5BvMhLW7iKv7M2xYeaW2SCAsnZ5PiSg6AaKfA"
2326
dh_key = "Do2GmAexW5MUdD8nToDiBWGbDgk1AwXoxtLTyirDtKQh"
2427
dkg_enc_key = "7aZBFZUEbXxFH9SiGJeUyjzas4mYJ1R13mTPsPeawVU7JFuocfvX9XsRT8qgr17RCe"
2528
public_address = "127.0.0.1:8030"
29+
http_api = "127.0.0.1:8034"
2630

2731
[[members]]
2832
signing_key = "tV66KknkDH47hRSNzwJtt7Q7EZtxVxQsNnUGoAJdDn6J"
2933
dh_key = "HXaesvEGFiDgrVTix1fKzSLTarFexTZSJD6ymSrF7vPL"
3034
dkg_enc_key = "6R69TzDg3jo1MTex9Uter9XQud458YPpSvXirkYdS295PV81CRvgz5jVWQbkCpZnYV"
3135
public_address = "127.0.0.1:8040"
36+
http_api = "127.0.0.1:8044"

test-configs/c0/node_0.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
stamp = "/tmp/timeboost.0.stamp"
2+
13
[net.public]
24
address = "127.0.0.1:8000"
5+
http_api = "127.0.0.1:8004"
36

47
[net.internal]
58
address = "127.0.0.1:8003"
@@ -25,3 +28,7 @@ rpc_url = "http://127.0.0.1:8545/"
2528
ibox_contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
2629
block_tag = "finalized"
2730
key_manager_contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
31+
32+
[espresso]
33+
base_url = "https://query.decaf.testnet.espresso.network/v1/"
34+
websockets_base_url = "wss://query.decaf.testnet.espresso.network/v1/"

test-configs/c0/node_1.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
stamp = "/tmp/timeboost.1.stamp"
2+
13
[net.public]
24
address = "127.0.0.1:8010"
5+
http_api = "127.0.0.1:8014"
36

47
[net.internal]
58
address = "127.0.0.1:8013"
@@ -25,3 +28,7 @@ rpc_url = "http://127.0.0.1:8545/"
2528
ibox_contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
2629
block_tag = "finalized"
2730
key_manager_contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
31+
32+
[espresso]
33+
base_url = "https://query.decaf.testnet.espresso.network/v1/"
34+
websockets_base_url = "wss://query.decaf.testnet.espresso.network/v1/"

test-configs/c0/node_2.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
stamp = "/tmp/timeboost.2.stamp"
2+
13
[net.public]
24
address = "127.0.0.1:8020"
5+
http_api = "127.0.0.1:8024"
36

47
[net.internal]
58
address = "127.0.0.1:8023"
@@ -25,3 +28,7 @@ rpc_url = "http://127.0.0.1:8545/"
2528
ibox_contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
2629
block_tag = "finalized"
2730
key_manager_contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
31+
32+
[espresso]
33+
base_url = "https://query.decaf.testnet.espresso.network/v1/"
34+
websockets_base_url = "wss://query.decaf.testnet.espresso.network/v1/"

test-configs/c0/node_3.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
stamp = "/tmp/timeboost.3.stamp"
2+
13
[net.public]
24
address = "127.0.0.1:8030"
5+
http_api = "127.0.0.1:8034"
36

47
[net.internal]
58
address = "127.0.0.1:8033"
@@ -25,3 +28,7 @@ rpc_url = "http://127.0.0.1:8545/"
2528
ibox_contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
2629
block_tag = "finalized"
2730
key_manager_contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
31+
32+
[espresso]
33+
base_url = "https://query.decaf.testnet.espresso.network/v1/"
34+
websockets_base_url = "wss://query.decaf.testnet.espresso.network/v1/"

test-configs/c0/node_4.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
stamp = "/tmp/timeboost.4.stamp"
2+
13
[net.public]
24
address = "127.0.0.1:8040"
5+
http_api = "127.0.0.1:8044"
36

47
[net.internal]
58
address = "127.0.0.1:8043"
@@ -25,3 +28,7 @@ rpc_url = "http://127.0.0.1:8545/"
2528
ibox_contract = "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1"
2629
block_tag = "finalized"
2730
key_manager_contract = "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35"
31+
32+
[espresso]
33+
base_url = "https://query.decaf.testnet.espresso.network/v1/"
34+
websockets_base_url = "wss://query.decaf.testnet.espresso.network/v1/"

0 commit comments

Comments
 (0)