Skip to content

Commit 5626cec

Browse files
committed
monorepo@9be9671
1 parent 9e4c9c3 commit 5626cec

File tree

9 files changed

+119
-58
lines changed

9 files changed

+119
-58
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ license = "MIT OR Apache-2.0"
1515
[workspace.dependencies]
1616
alto-client = { version = "0.0.14", path = "client" }
1717
alto-types = { version = "0.0.14", path = "types" }
18-
commonware-broadcast = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
19-
commonware-codec = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
20-
commonware-consensus = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
21-
commonware-cryptography = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
22-
commonware-deployer = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7", default-features = false }
23-
commonware-macros = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
24-
commonware-p2p = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
25-
commonware-resolver = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
26-
commonware-runtime = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
27-
commonware-storage = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
28-
commonware-stream = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
29-
commonware-utils = { git = "https://github.com/commonwarexyz/monorepo.git", rev="11034a27faa9c9159ee209898c52242f89a941c7" }
18+
commonware-broadcast = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
19+
commonware-codec = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
20+
commonware-consensus = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
21+
commonware-cryptography = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
22+
commonware-deployer = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289", default-features = false }
23+
commonware-macros = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
24+
commonware-p2p = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
25+
commonware-resolver = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
26+
commonware-runtime = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
27+
commonware-storage = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
28+
commonware-stream = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
29+
commonware-utils = { git = "https://github.com/commonwarexyz/monorepo.git", rev = "9be96719befb3fc68515daa2718aa6997d308289" }
3030
thiserror = "2.0.12"
3131
bytes = "1.7.1"
3232
rand = "0.8.5"

chain/src/bin/validator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn main() {
202202
authenticated::Network::new(context.with_label("network"), p2p_cfg);
203203

204204
// Provide authorized peers
205-
oracle.register(0, peers.clone()).await;
205+
oracle.register(0, peers.clone().into()).await;
206206

207207
// Register pending channel
208208
let pending_limit = Quota::per_second(NonZeroU32::new(128).unwrap());
@@ -274,7 +274,7 @@ fn main() {
274274
coordinator: StaticCoordinator::from(peers),
275275
mailbox_size: config.mailbox_size,
276276
requester_config: requester::Config {
277-
public_key: public_key.clone(),
277+
me: Some(public_key.clone()),
278278
rate_limit: Quota::per_second(NonZeroU32::new(5).unwrap()),
279279
initial: Duration::from_secs(1),
280280
timeout: Duration::from_secs(2),

chain/src/engine.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use commonware_resolver::Resolver;
1616
use commonware_runtime::{
1717
buffer::PoolRef, spawn_cell, Clock, ContextCell, Handle, Metrics, Spawner, Storage,
1818
};
19-
use commonware_utils::set::Set;
19+
use commonware_utils::set::Ordered;
2020
use commonware_utils::{NZUsize, NZU64};
2121
use futures::{channel::mpsc, future::try_join_all};
2222
use governor::clock::Clock as GClock;
@@ -54,7 +54,7 @@ pub struct Config<B: Blocker<PublicKey = PublicKey>, I: Indexer> {
5454
pub me: PublicKey,
5555
pub polynomial: Poly<Evaluation>,
5656
pub share: group::Share,
57-
pub participants: Set<PublicKey>,
57+
pub participants: Ordered<PublicKey>,
5858
pub mailbox_size: usize,
5959
pub backfill_quota: Quota,
6060
pub deque_size: usize,
@@ -132,7 +132,7 @@ impl<
132132
let buffer_pool = PoolRef::new(BUFFER_POOL_PAGE_SIZE, BUFFER_POOL_CAPACITY);
133133

134134
// Create the signing scheme
135-
let scheme = Scheme::new(cfg.participants.as_ref(), &cfg.polynomial, cfg.share);
135+
let scheme = Scheme::new(cfg.participants, &cfg.polynomial, cfg.share);
136136

137137
// Create marshal
138138
let (marshal, marshal_mailbox) = marshal::Actor::init(
@@ -182,8 +182,6 @@ impl<
182182
simplex::Config {
183183
epoch: EPOCH,
184184
namespace: NAMESPACE.to_vec(),
185-
me: cfg.me,
186-
participants: cfg.participants,
187185
scheme,
188186
automaton: application_mailbox.clone(),
189187
relay: application_mailbox.clone(),

chain/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ mod tests {
278278
coordinator: StaticCoordinator::from(validators.clone()),
279279
mailbox_size: 1024,
280280
requester_config: requester::Config {
281-
public_key: public_key.clone(),
281+
me: Some(public_key.clone()),
282282
rate_limit: Quota::per_second(NonZeroU32::new(5).unwrap()),
283283
initial: Duration::from_secs(1),
284284
timeout: Duration::from_secs(2),
@@ -472,7 +472,7 @@ mod tests {
472472
coordinator: StaticCoordinator::from(validators.clone()),
473473
mailbox_size: 1024,
474474
requester_config: requester::Config {
475-
public_key: public_key.clone(),
475+
me: Some(public_key.clone()),
476476
rate_limit: Quota::per_second(NonZeroU32::new(5).unwrap()),
477477
initial: Duration::from_secs(1),
478478
timeout: Duration::from_secs(2),
@@ -579,7 +579,7 @@ mod tests {
579579
coordinator: StaticCoordinator::from(validators.clone()),
580580
mailbox_size: 1024,
581581
requester_config: requester::Config {
582-
public_key: public_key.clone(),
582+
me: Some(public_key.clone()),
583583
rate_limit: Quota::per_second(NonZeroU32::new(5).unwrap()),
584584
initial: Duration::from_secs(1),
585585
timeout: Duration::from_secs(2),
@@ -734,7 +734,7 @@ mod tests {
734734
coordinator: StaticCoordinator::from(validators.clone()),
735735
mailbox_size: 1024,
736736
requester_config: requester::Config {
737-
public_key: public_key.clone(),
737+
me: Some(public_key.clone()),
738738
rate_limit: Quota::per_second(NonZeroU32::new(5).unwrap()),
739739
initial: Duration::from_secs(1),
740740
timeout: Duration::from_secs(2),
@@ -927,7 +927,7 @@ mod tests {
927927
coordinator: StaticCoordinator::from(validators.clone()),
928928
mailbox_size: 1024,
929929
requester_config: requester::Config {
930-
public_key: public_key.clone(),
930+
me: Some(public_key.clone()),
931931
rate_limit: Quota::per_second(NonZeroU32::new(5).unwrap()),
932932
initial: Duration::from_secs(1),
933933
timeout: Duration::from_secs(2),

explorer/src/alto_types/alto_types.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,6 @@ function getStringFromWasm0(ptr, len) {
166166
ptr = ptr >>> 0;
167167
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
168168
}
169-
/**
170-
* @param {any} seed
171-
* @param {number} participants
172-
* @returns {number}
173-
*/
174-
export function leader_index(seed, participants) {
175-
const ret = wasm.leader_index(seed, participants);
176-
return ret >>> 0;
177-
}
178169

179170
function passArray8ToWasm0(arg, malloc) {
180171
const ptr = malloc(arg.length * 1, 1) >>> 0;
@@ -187,12 +178,12 @@ function passArray8ToWasm0(arg, malloc) {
187178
* @param {Uint8Array} bytes
188179
* @returns {any}
189180
*/
190-
export function parse_notarized(identity, bytes) {
181+
export function parse_seed(identity, bytes) {
191182
const ptr0 = passArray8ToWasm0(identity, wasm.__wbindgen_malloc);
192183
const len0 = WASM_VECTOR_LEN;
193184
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
194185
const len1 = WASM_VECTOR_LEN;
195-
const ret = wasm.parse_notarized(ptr0, len0, ptr1, len1);
186+
const ret = wasm.parse_seed(ptr0, len0, ptr1, len1);
196187
return ret;
197188
}
198189

@@ -201,12 +192,12 @@ export function parse_notarized(identity, bytes) {
201192
* @param {Uint8Array} bytes
202193
* @returns {any}
203194
*/
204-
export function parse_finalized(identity, bytes) {
195+
export function parse_notarized(identity, bytes) {
205196
const ptr0 = passArray8ToWasm0(identity, wasm.__wbindgen_malloc);
206197
const len0 = WASM_VECTOR_LEN;
207198
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
208199
const len1 = WASM_VECTOR_LEN;
209-
const ret = wasm.parse_finalized(ptr0, len0, ptr1, len1);
200+
const ret = wasm.parse_notarized(ptr0, len0, ptr1, len1);
210201
return ret;
211202
}
212203

@@ -215,12 +206,12 @@ export function parse_finalized(identity, bytes) {
215206
* @param {Uint8Array} bytes
216207
* @returns {any}
217208
*/
218-
export function parse_seed(identity, bytes) {
209+
export function parse_finalized(identity, bytes) {
219210
const ptr0 = passArray8ToWasm0(identity, wasm.__wbindgen_malloc);
220211
const len0 = WASM_VECTOR_LEN;
221212
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
222213
const len1 = WASM_VECTOR_LEN;
223-
const ret = wasm.parse_seed(ptr0, len0, ptr1, len1);
214+
const ret = wasm.parse_finalized(ptr0, len0, ptr1, len1);
224215
return ret;
225216
}
226217

@@ -235,6 +226,16 @@ export function parse_block(bytes) {
235226
return ret;
236227
}
237228

229+
/**
230+
* @param {any} seed
231+
* @param {number} participants
232+
* @returns {number}
233+
*/
234+
export function leader_index(seed, participants) {
235+
const ret = wasm.leader_index(seed, participants);
236+
return ret >>> 0;
237+
}
238+
238239
async function __wbg_load(module, imports) {
239240
if (typeof Response === 'function' && module instanceof Response) {
240241
if (typeof WebAssembly.instantiateStreaming === 'function') {
750 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)