Skip to content

Commit ada85a8

Browse files
committed
merge hell
2 parents f545966 + 1d6f3ae commit ada85a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+540
-583
lines changed

Cargo.lock

Lines changed: 118 additions & 101 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ thiserror = "2.0"
9797
tokio = { version = "1", default-features = false, features = ["full"] }
9898
tokio-stream = "0.1.17"
9999
tokio-tungstenite = { version = "0.28.0", features = ["rustls-tls-webpki-roots", "url"] }
100-
tokio-util = { version = "0.7.15", features = ["compat", "rt"] }
100+
tokio-util = { version = "0.7.17", features = ["compat", "rt"] }
101101
toml = "0.9"
102102
tonic = "0.14.1"
103103
tonic-prost = "0.14.1"

cliquenet/src/error.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::io;
22
use thiserror::Error;
33

4-
use crate::frame::InvalidHeader;
4+
use crate::{Address, frame::InvalidHeader};
55

66
/// The empty type has no values.
77
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -14,6 +14,10 @@ pub enum NetworkError {
1414
#[error("i/o error: {0}")]
1515
Io(#[from] io::Error),
1616

17+
/// Bind error.
18+
#[error("error binding to address {0}: {1}")]
19+
Bind(Address, #[source] io::Error),
20+
1721
/// The received frame header is not valid.
1822
#[error("invalid frame header: {0}")]
1923
InvalidFrameHeader(#[from] InvalidHeader),

cliquenet/src/net.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ impl Network {
269269
T: tcp::Listener + Send + 'static,
270270
T::Stream: Unpin + Send,
271271
{
272-
let listener = T::bind(&bind_to.into()).await?;
272+
let bind_addr = bind_to.into();
273+
let listener = T::bind(&bind_addr)
274+
.await
275+
.map_err(|e| NetworkError::Bind(bind_addr, e))?;
273276

274277
debug!(%name, node = %label, addr = %listener.local_addr()?, "listening");
275278

docker-compose.block-maker.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ services:
8484
- -c
8585
- >
8686
/app/mkconfig -n 4 --committee-id 0 \
87-
--public-addr "node:8000" \
88-
--internal-addr "node:8003" \
89-
--http-api "node:8004" \
87+
--bind "node:8000" \
9088
--nitro-addr "block-maker:55000" \
9189
--public-mode "docker-dns" \
9290
--nitro-mode "unchanged" \

docker-compose.nitro.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,13 @@ services:
9999
entrypoint:
100100
- sh
101101
- -c
102-
- >
103-
/app/mkconfig -n 4 --committee-id 0 --seed 42 \
104-
--public-addr "node:8000" \
102+
- >
103+
/app/mkconfig -n 4 --committee-id 0 \
104+
--bind "node:8000" \
105105
--public-mode "docker-dns" \
106-
--internal-addr "node:8003" \
107-
--http-api "node:8004" \
108-
--batch-poster-api "http://host.docker.internal:8547" \
109106
--nitro-addr "nitro:55000" \
110107
--nitro-mode "docker-dns" \
108+
--batch-poster-api "http://host.docker.internal:8547" \
111109
--chain-namespace 412346 \
112110
--parent-rpc-url "http://demo-l1-network:8545" \
113111
--parent-ws-url "ws://demo-l1-network:8546" \

justfile

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ bench *ARGS:
101101
cargo bench --benches {{ARGS}} -- --nocapture
102102

103103
mkconfig NUM_NODES DATETIME *ARGS:
104-
cargo run --release --bin mkconfig -- -n {{NUM_NODES}} \
104+
cargo run --release --bin mkconfig -- \
105+
-n {{NUM_NODES}} \
105106
--committee-id 0 \
106-
--public-addr "127.0.0.1:8000" \
107-
--internal-addr "127.0.0.1:8003" \
108-
--http-api "127.0.0.1:8004" \
107+
--bind "127.0.0.1:8000" \
109108
--chain-namespace 10101 \
110109
--parent-rpc-url "http://127.0.0.1:8545" \
111110
--parent-ws-url "ws://127.0.0.1:8545" \
112-
--batch-poster-api "http://127.0.0.1:8547" \
111+
--batch-poster-api "127.0.0.1:8547" \
113112
--parent-chain-id 31337 \
114113
--parent-ibox-contract "0xa0f3a1a4e2b2bcb7b48c8527c28098f207572ec1" \
115114
--key-manager-contract "0x2bbf15bc655c4cc157b769cfcb1ea9924b9e1a35" \
@@ -118,13 +117,13 @@ mkconfig NUM_NODES DATETIME *ARGS:
118117
--output "test-configs/c0" {{ARGS}}
119118

120119
mkconfig-docker DATETIME *ARGS:
121-
cargo run --release --bin mkconfig -- -n 5 \
120+
cargo run --release --bin mkconfig -- \
121+
-n 5 \
122122
--committee-id 0 \
123-
--public-addr "node:8000" \
124-
--public-mode "docker-dns" \
125-
--internal-addr "node:8003" \
126-
--http-api "node:8004" \
127-
--nitro-addr "nitro:55000" \
123+
--bind "0.0.0.0:8000" \
124+
--external-base "node:8000" \
125+
--external-mode "docker-dns" \
126+
--nitro "nitro:55000" \
128127
--nitro-mode "docker-dns" \
129128
--parent-rpc-url "http://demo-l1-network:8545" \
130129
--parent-ws-url "ws://demo-l1-network:8546" \
@@ -139,13 +138,13 @@ mkconfig-docker DATETIME *ARGS:
139138
--output "test-configs/docker" {{ARGS}}
140139

141140
mkconfig-nitro-ci DATETIME *ARGS:
142-
cargo run --release --bin mkconfig -- -n 2 \
141+
cargo run --release --bin mkconfig -- \
142+
-n 2 \
143143
--committee-id 0 \
144-
--public-addr "127.0.0.1:8000" \
145-
--internal-addr "0.0.0.0:8003" \
146-
--http-api "127.0.0.1:8004" \
147-
--nitro-addr "localhost:55000" \
148-
--batch-poster-api "http://host.docker.internal:8547" \
144+
--bind "0.0.0.0:8000" \
145+
--batch-poster-api "127.0.0.1:8547" \
146+
--external-base "127.0.0.1:8000" \
147+
--nitro "localhost:55000" \
149148
--chain-namespace 412346 \
150149
--parent-rpc-url "http://127.0.0.1:8545" \
151150
--parent-ws-url "ws://127.0.0.1:8546" \
@@ -159,13 +158,12 @@ mkconfig-nitro-ci DATETIME *ARGS:
159158
--output "test-configs/nitro-ci" {{ARGS}}
160159

161160
mkconfig-local DATETIME *ARGS:
162-
cargo run --release --bin mkconfig -- -n 5 \
161+
cargo run --release --bin mkconfig -- \
162+
-n 5 \
163163
--committee-id 0 \
164-
--public-addr "127.0.0.1:8000" \
165-
--internal-addr "127.0.0.1:8003" \
166-
--http-api "127.0.0.1:8004" \
167-
--nitro-addr "127.0.0.1:55000" \
168-
--batch-poster-api "http://127.0.0.1:8547" \
164+
--bind "127.0.0.1:8000" \
165+
--nitro "127.0.0.1:55000" \
166+
--batch-poster-api "127.0.0.1:8547" \
169167
--nitro-mode "unchanged" \
170168
--chain-namespace 10101 \
171169
--parent-rpc-url "http://127.0.0.1:8545" \
@@ -178,14 +176,13 @@ mkconfig-local DATETIME *ARGS:
178176
--output "test-configs/local" {{ARGS}}
179177

180178
mkconfig-linux NUM_NODES DATETIME *ARGS:
181-
cargo run --release --bin mkconfig -- -n {{NUM_NODES}} \
179+
cargo run --release --bin mkconfig -- \
180+
-n {{NUM_NODES}} \
182181
--committee-id 0 \
183-
--public-addr "11.0.0.1:8000" \
184-
--public-mode "increment-address" \
185-
--internal-addr "11.0.0.1:8003" \
186-
--http-api "11.0.0.1:8004" \
187-
--nitro-addr "11.0.1.0:55000" \
188-
--batch-poster-api "11.0.0.1:8547" \
182+
--bind "11.0.0.1:8000" \
183+
--batch-poster-api "127.0.0.1:8547" \
184+
--bind-mode "increment-address" \
185+
--nitro "11.0.1.0:55000" \
189186
--nitro-mode "unchanged" \
190187
--chain-namespace 10101 \
191188
--parent-rpc-url "http://11.0.1.0:8545" \
@@ -255,10 +252,8 @@ test-dyn-comm: build-release-until build-test-utils
255252
--until 2000" \
256253
--run "5:target/release/mkconfig -n 4 \
257254
--committee-id 1 \
258-
--public-addr 127.0.0.1:9000 \
259-
--internal-addr 127.0.0.1:9003 \
260-
--http-api 127.0.0.1:9004 \
261-
--batch-poster-api 127.0.0.1:9004 \
255+
--bind 127.0.0.1:9000 \
256+
--batch-poster-api "127.0.0.1:8547" \
262257
--chain-namespace 10101 \
263258
--parent-rpc-url http://127.0.0.1:8545 \
264259
--parent-ws-url ws://127.0.0.1:8545 \

scripts/run-timeboost-demo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ if [ ! $config_dir ]; then
107107
exit 1
108108
fi
109109

110-
just build-release --features="until"
110+
just build-release --features="until" || exit 1
111111

112112
if [ $nitro_url ]; then
113113
timeout 90 bash -c "until curl -sSf $nitro_url -o /dev/null; do sleep 1; done" || exit 1

test-configs/c0/committee.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,47 @@ node = "node_0"
66
signing_key = "eiwaGN1NNaQdbnR9FsjKzUeLghQZsTLPjiL4RcQgfLoX"
77
dh_key = "AZrLbV37HAGhBWh49JHzup6Wfpu2AAGWGJJnxCDJibiY"
88
dkg_enc_key = "7PdmfTS45d2hTXB8NcrTmvDwUVBimpYBbrBaGnu3i5Ne65krVfUpbe7bYRHS3AEg7H"
9-
public_address = "127.0.0.1:8000"
9+
address = "127.0.0.1:8000"
1010
http_api = "127.0.0.1:8004"
11-
internal_api = "127.0.0.1:8003"
12-
batch_poster_api = "http://127.0.0.1:8547"
11+
grpc_api = "127.0.0.1:8003"
12+
batch_poster_api = "127.0.0.1:8547"
1313

1414
[[members]]
1515
node = "node_1"
1616
signing_key = "vGKKAxVNfkSCdn8qh36nXdSZqyhPq644sQBoeZtcEUCR"
1717
dh_key = "FHTJAk6oyt3jefEp1ZrPEn2MkqRt2LibEFd57AnEUZdb"
1818
dkg_enc_key = "7p1BtEz7WnFMt6Hr28X3Rngqza6i8hRoswhzZRFd6GzgkspLKHBfDocHP8DwzXiNiZ"
19-
public_address = "127.0.0.1:8010"
19+
address = "127.0.0.1:8010"
2020
http_api = "127.0.0.1:8014"
21-
internal_api = "127.0.0.1:8013"
22-
batch_poster_api = "http://127.0.0.1:8557"
21+
grpc_api = "127.0.0.1:8013"
22+
batch_poster_api = "127.0.0.1:8557"
2323

2424
[[members]]
2525
node = "node_2"
2626
signing_key = "264jMLf85hfufg4ck97Hw2jiL6i1PHNoGUqxUqfhtssaE"
2727
dh_key = "63eYNKoW2PsWZFhHHj3eZwHTdPE7gEjEDM7gGeDf9Uaj"
2828
dkg_enc_key = "62bnAAbU58zZUcGqy9JKGZRZHkm3g7JZB2DtJGQyChXQBPGvXSS6fF21yoxiVuD1eb"
29-
public_address = "127.0.0.1:8020"
29+
address = "127.0.0.1:8020"
3030
http_api = "127.0.0.1:8024"
31-
internal_api = "127.0.0.1:8023"
32-
batch_poster_api = "http://127.0.0.1:8567"
31+
grpc_api = "127.0.0.1:8023"
32+
batch_poster_api = "127.0.0.1:8567"
3333

3434
[[members]]
3535
node = "node_3"
3636
signing_key = "v6UBdLT5BvMhLW7iKv7M2xYeaW2SCAsnZ5PiSg6AaKfA"
3737
dh_key = "Do2GmAexW5MUdD8nToDiBWGbDgk1AwXoxtLTyirDtKQh"
3838
dkg_enc_key = "7aZBFZUEbXxFH9SiGJeUyjzas4mYJ1R13mTPsPeawVU7JFuocfvX9XsRT8qgr17RCe"
39-
public_address = "127.0.0.1:8030"
39+
address = "127.0.0.1:8030"
4040
http_api = "127.0.0.1:8034"
41-
internal_api = "127.0.0.1:8033"
42-
batch_poster_api = "http://127.0.0.1:8577"
41+
grpc_api = "127.0.0.1:8033"
42+
batch_poster_api = "127.0.0.1:8577"
4343

4444
[[members]]
4545
node = "node_4"
4646
signing_key = "tV66KknkDH47hRSNzwJtt7Q7EZtxVxQsNnUGoAJdDn6J"
4747
dh_key = "HXaesvEGFiDgrVTix1fKzSLTarFexTZSJD6ymSrF7vPL"
4848
dkg_enc_key = "6R69TzDg3jo1MTex9Uter9XQud458YPpSvXirkYdS295PV81CRvgz5jVWQbkCpZnYV"
49-
public_address = "127.0.0.1:8040"
49+
address = "127.0.0.1:8040"
5050
http_api = "127.0.0.1:8044"
51-
internal_api = "127.0.0.1:8043"
52-
batch_poster_api = "http://127.0.0.1:8587"
51+
grpc_api = "127.0.0.1:8043"
52+
batch_poster_api = "127.0.0.1:8587"

0 commit comments

Comments
 (0)