repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/disseminator.rs | src/disseminator.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Fast block dissemination protocols.
//!
//! This module provides the [`Disseminator`] trait for block dissemination protocols.
//!
//! Also, this module provides implementations of three dissemination protocols:
//! - [`TrivialDisseminat... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/lib.rs | src/lib.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Alpenglow: Global High-Performance Proof-of-Stake Blockchain with Erasure Coding
//!
//! Research reference implementation of the Alpenglow consensus protocol.
#![deny(rustdoc::broken_intra_doc_links)]
pub mod all2all;
pub mod consensu... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network.rs | src/network.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! An abstraction layer for networking.
//!
//! The [`Network`] trait provides a common interface for networking operations.
//! When implementing [`Network`], the implementor determines the types:
//! - [`Network::Send`]: The type of messa... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/test_utils.rs | src/test_utils.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Utility types and functions for tests and benchmarks.
use std::sync::Arc;
use rand::RngCore;
use wincode::{SchemaRead, SchemaWrite};
use crate::all2all::TrivialAll2All;
use crate::consensus::{ConsensusMessage, EpochInfo};
use crate::c... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/types.rs | src/types.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
pub mod slice;
pub mod slice_index;
pub mod slot;
pub use self::slice::Slice;
pub(crate) use self::slice::{SliceHeader, SlicePayload};
pub use self::slice_index::SliceIndex;
pub use self::slot::{SLOTS_PER_EPOCH, SLOTS_PER_WINDOW, Slot};
| rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/all2all.rs | src/all2all.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Direct all-to-all broadcast protocols.
//!
//! The [`All2All`] trait gives a simple interface for broadcasting messages.
//! It does not impose restrictions on the guarantees that should be provided.
//! However, each implementor should ... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/shredder.rs | src/shredder.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Shredding and deshredding of blocks.
//!
//! This module defines the [`Shredder`] trait for shredding blocks into shreds.
//!
//! It also provides several shredders implementing this trait:
//! - [`RegularShredder`] augments data shreds ... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | true |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/validator.rs | src/validator.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
pub struct Validator {}
| rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/main.rs | src/main.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::borrow::Cow;
use alpenglow::{create_test_nodes, logging};
use color_eyre::Result;
use fastrace::collector::Config;
use fastrace::prelude::*;
use fastrace_opentelemetry::OpenTelemetryReporter;
use log::warn;
use opentelemetry::{Inst... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/repair.rs | src/repair.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Block repair sub-protocol.
//!
//! This module implements the double-Merkle based block repair protocol.
//! It uses the fact that the block hash is the root of a Merkle tree, where
//! the leaves of this tree are the Merkle roots of eac... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/logging.rs | src/logging.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use colored::{Color, ColoredString, Colorize};
use logforth::filter::env_filter::EnvFilterBuilder;
use logforth::record::Level;
use logforth::{Layout, append};
#[derive(Clone, Debug)]
struct MinimalLogforthLayout;
impl MinimalLogforthLayou... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/crypto.rs | src/crypto.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Cryptographic primitives.
//!
//! This module contains any cryptographic primitives used by the library.
//! These are mostly wrappers around existing libraries.
pub mod aggsig;
pub mod hash;
pub mod merkle;
pub mod signature;
pub use ... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus.rs | src/consensus.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Core consensus logic and data structures.
//!
//! The central structure of the consensus protocol is [`Alpenglow`].
//! It contains all state for a single consensus instance and also has access
//! to the different necessary network prot... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/shredder/reed_solomon.rs | src/shredder/reed_solomon.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implements Reed-Solomon shreding and deshreding.
//!
//! This is a low-level module that is used in various shredder implementations.
//! It is mostly a wrapper around the [`reed_solomon_simd`] crate.
use reed_solomon_simd::{ReedSolomon... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/shredder/validated_shreds.rs | src/shredder/validated_shreds.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Defines the [`ValidatedShreds`] type.
use crate::shredder::{TOTAL_SHREDS, ValidatedShred};
/// Validated shreds array type.
///
/// Using strong type to enforce certain constraints:
/// - Shreds are in the correct order.
/// - Shred in... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/shredder/shred_index.rs | src/shredder/shred_index.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Defines the [`ShredIndex`] type.
use std::fmt::Display;
use std::mem::MaybeUninit;
use std::ops::Deref;
use serde::de::{self, Visitor};
use serde::{Deserialize, Serialize};
use wincode::{SchemaRead, SchemaWrite};
use crate::shredder::... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/shredder/validated_shred.rs | src/shredder/validated_shred.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Defines the [`ValidatedShred`] type.
use std::collections::btree_map::Entry;
use std::ops::{Deref, DerefMut};
use crate::crypto::merkle::{SliceMerkleTree, SliceRoot};
use crate::crypto::signature::PublicKey;
use crate::shredder::Shred;... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/shredder/pool.rs | src/shredder/pool.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Pool of shredder instances.
//!
//! # Examples
//!
//! Obtain a shredder from the pool, use it, and let it return on drop.
//!
//! ```rust
//! use alpenglow::shredder::{RegularShredder, ShredderPool, Shredder};
//!
//! fn use_shredder<S:... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/disseminator/turbine.rs | src/disseminator/turbine.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implementation of Solana's Turbine block dissemination protocol.
//!
//! For each slot and shred index, a different Turbine tree is built.
//! Each tree corresponds to a stake-weighted shuffling of the validators.
//!
//! See also: <http... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/disseminator/rotor.rs | src/disseminator/rotor.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implementation of Alpenglow's new Rotor block dissemination protocol.
//!
//! This is an evolution of Solana's original Turbine block dissemination protocol.
//! Instead of a multi-layered tree, it always uses a single layer of relayers.... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/disseminator/trivial.rs | src/disseminator/trivial.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use async_trait::async_trait;
use super::Disseminator;
use crate::ValidatorInfo;
use crate::network::{Network, ShredNetwork};
use crate::shredder::Shred;
/// A trivial implementation for a block disseminator.
/// The leader just sends each... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/disseminator/rotor/sampling_strategy.rs | src/disseminator/rotor/sampling_strategy.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Different strategies for sampling validators.
//!
//! First, this module provides a trait for randomly sampling validators.
//! To implement a new sampling strategy, you need to implement [`SamplingStrategy`],
//! by implementing [`Sampl... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | true |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/disseminator/turbine/weighted_shuffle.rs | src/disseminator/turbine/weighted_shuffle.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//
// Source: https://github.com/anza-xyz/agave (with modifications)
//! The `weighted_shuffle` module provides an iterator over shuffled weights.
use std::borrow::Borrow;
use std::ops::{AddAssign, SubAssign};
use rand::distr::uniform::{Sa... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/node.rs | src/bin/node.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::borrow::Cow;
use std::fs::File;
use std::io::Read;
use std::net::SocketAddr;
use std::sync::Arc;
use alpenglow::all2all::TrivialAll2All;
use alpenglow::consensus::{Alpenglow, ConsensusMessage, EpochInfo};
use alpenglow::crypto::agg... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/performance_test.rs | src/bin/performance_test.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::collections::VecDeque;
use std::sync::Arc;
use std::time::{Duration, Instant};
use alpenglow::all2all::TrivialAll2All;
use alpenglow::consensus::{ConsensusMessage, EpochInfo};
use alpenglow::crypto::aggsig;
use alpenglow::crypto::s... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/all2all_test.rs | src/bin/all2all_test.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use core::f64;
use std::sync::Arc;
use std::sync::atomic::AtomicUsize;
use std::time::Duration;
use alpenglow::logging;
use clap::Parser;
use color_eyre::Result;
use log::{debug, info};
use time::OffsetDateTime;
use tokio::net::UdpSocket;
u... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/workload_generator.rs | src/bin/workload_generator.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::net::{SocketAddr, UdpSocket};
use std::thread::sleep;
use std::time::{Duration, Instant};
use alpenglow::{Transaction, logging};
use clap::Parser;
use color_eyre::Result;
use log::info;
use rand::RngCore;
/// Worklaod generator fo... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/alpenglow.rs | src/bin/simulations/alpenglow.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulations for the Alpenglow protocol.
//!
//! This implements the following simulations:
//! - Latency simulation for the entire happy path of the protocol.
//! - Bandwidth simulation calculating required bandwidth for voting and block... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/discrete_event_simulator.rs | src/bin/simulations/discrete_event_simulator.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! General discrete-event simulator.
//!
//! This module provides a generic discrete-event simulator.
//! It can be used to simulate different protocols and configurations.
mod resources;
mod timings;
use std::cmp::Reverse;
use std::fmt::... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/ryse.rs | src/bin/simulations/ryse.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulations for Ryse, the MCP proposal.
//!
//! Ryse is one instantiation of a multiple-concurrent proposers (MCP) consensus protocol.
//! As such, it provides the following economic properties:
//! - Selective-censorship resistance:
//!... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/pyjama.rs | src/bin/simulations/pyjama.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulations for Pyjama, the MCP protocol.
//!
//! Pyjama is one instantiation of a multiple-concurrent proposers (MCP) consensus protocol.
//! As such, it provides the following economic properties:
//! - Selective-censorship resistance:... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/rotor.rs | src/bin/simulations/rotor.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulations for the Rotor protocol.
//!
//! This implements the following simulations:
//! - Latency simulation for block dissemination via Rotor.
//! - Robustness simulation against liveness and safety failures.
pub mod latency;
pub mo... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/main.rs | src/bin/simulations/main.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulations for Rotor and Alpenglow.
//!
//! This module provides a binary for simulating Rotor and Alpenglow.
//!
//! Currently three major simulations are implemented:
//! 1. Bandwidth (Rotor, workload per node, maximum supported throu... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/quorum_robustness.rs | src/bin/simulations/quorum_robustness.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Monte-Carlo simulations to evaluate robustness of random quorums.
//!
//! This implements two main attack scenarios:
//! - Equivocation attack: Less than 20% of stake is Byzantine.
//! - Censorship attack: Up to 40% of stake is crashed.
... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/pyjama/parameters.rs | src/bin/simulations/pyjama/parameters.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Parameters for Pyjama, the MCP protocol.
//!
//!
use alpenglow::ValidatorId;
use alpenglow::disseminator::rotor::SamplingStrategy;
use log::info;
use rand::prelude::*;
use statrs::distribution::{Binomial, DiscreteCDF};
use crate::discr... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/pyjama/latency.rs | src/bin/simulations/pyjama/latency.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Latency simulation for Pyjama, the MCP protocol.
//!
//! So far, this test can only simulate the happy path.
use std::marker::PhantomData;
use alpenglow::ValidatorId;
use alpenglow::disseminator::rotor::{SamplingStrategy, StakeWeighted... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/pyjama/robustness.rs | src/bin/simulations/pyjama/robustness.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Calculations about the robustness of the Pyjama MCP protocol.
//!
//! Currently, this just runs some static calculations on the set of parameters.
//!
//! In the future, this would also simulate attack scenarios for a specific stake dist... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/alpenglow/bandwidth.rs | src/bin/simulations/alpenglow/bandwidth.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Rotor simulated workload and bandwidth testing.
//!
//! This module provides simulations about Rotor bandwidth usage.
//! It simulates the dissemination of multiple slices via Rotor.
//! It tracks the workload (number of shreds/datagrams... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/alpenglow/latency.rs | src/bin/simulations/alpenglow/latency.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulated latency test for the Alpenglow protocol.
//!
//! So far, this test can only simulate the happy path.
use std::hash::Hash;
use std::marker::PhantomData;
use alpenglow::disseminator::rotor::{SamplingStrategy, StakeWeightedSampl... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/ryse/parameters.rs | src/bin/simulations/ryse/parameters.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Parameters for Ryse, the MCP protocol.
//!
//!
use alpenglow::ValidatorId;
use alpenglow::disseminator::rotor::SamplingStrategy;
use log::info;
use rand::prelude::*;
use statrs::distribution::{Binomial, DiscreteCDF};
use crate::discret... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/ryse/latency.rs | src/bin/simulations/ryse/latency.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulated latency test for Ryse, the MCP protocol.
//!
//! So far, this test can only simulate the happy path.
// TODO: lots of shared code with `rotor/latency` and `alpenglow/latency`
use std::hash::Hash;
use std::marker::PhantomData;... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/ryse/robustness.rs | src/bin/simulations/ryse/robustness.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Calculations about the robustness of the Ryse MCP protocol.
//!
//! Currently, this just runs some static calculations on the set of parameters.
//!
//! In the future, this would also simulate attack scenarios for a specific stake distri... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/rotor/latency.rs | src/bin/simulations/rotor/latency.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Latency simulation for the Rotor block dissemination protocol.
//!
//!
use std::marker::PhantomData;
use alpenglow::ValidatorId;
use alpenglow::disseminator::rotor::SamplingStrategy;
use alpenglow::shredder::MAX_DATA_PER_SHRED;
use su... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/rotor/robustness.rs | src/bin/simulations/rotor/robustness.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Calculations about the robustness of the Rotor block dissemination protocol.
//!
//! This implements two main attack scenarios:
//! - Equivocation attack: Less than 20% of stake is Byzantine.
//! - Censorship attack: Up to 40% of stake i... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/discrete_event_simulator/timings.rs | src/bin/simulations/discrete_event_simulator/timings.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Data structures for timing measurements.
//!
//! Most importantly the [`Timings`] struct, which is a map from events to timing vectors.
//! This is what the discrete-event simulator uses to record timings of events.
//! It can be thought... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/bin/simulations/discrete_event_simulator/resources.rs | src/bin/simulations/discrete_event_simulator/resources.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Data structures for resource utilization.
//!
//! For now, all these resources exist at each validator individually.
// TODO: introduce notion of a shared resource?
use alpenglow::ValidatorId;
use crate::discrete_event_simulator::SimT... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/types/slice.rs | src/types/slice.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Defines the [`Slice`] and related data structures.
use rand::{RngCore, rng};
use wincode::{SchemaRead, SchemaWrite};
use crate::crypto::merkle::{BlockHash, SliceRoot};
use crate::shredder::{MAX_DATA_PER_SLICE, ValidatedShred};
use crat... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/types/slot.rs | src/types/slot.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Defines the [`Slot`] type.
use std::fmt::Display;
use wincode::{SchemaRead, SchemaWrite};
/// Number of slots in each leader window.
// NOTE: this is public to support testing and one additional function.
// Consider hiding it.
pub co... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/types/slice_index.rs | src/types/slice_index.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Defines the [`SliceIndex`] type.
use std::fmt::Display;
use std::mem::MaybeUninit;
use serde::de::{self, Visitor};
use serde::{Deserialize, Serialize};
use wincode::{SchemaRead, SchemaWrite};
/// Maximum number of slices a leader may ... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/all2all/robust.rs | src/all2all/robust.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! A more robust implementation of an all-to-all broadcast protocol.
//!
//! Broadcasts each message over the underlying instance of [`Network`].
//! The message may be retransmitted multiple times.
use std::iter::repeat_n;
use async_trai... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/all2all/trivial.rs | src/all2all/trivial.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! A trivial implementation of an all-to-all broadcast protocol.
//!
//! Broadcasts each message once over the underlying [`Network`].
//! After that, the message is forgotten. The protocol is completely stateless.
//! If the underlying [`N... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/epoch_info.rs | src/consensus/epoch_info.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use crate::types::SLOTS_PER_WINDOW;
use crate::{Slot, Stake, ValidatorId, ValidatorInfo};
/// Epoch-specfic validator information.
#[derive(Clone, Debug)]
pub struct EpochInfo {
pub(crate) own_id: ValidatorId,
pub(crate) validators:... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/vote.rs | src/consensus/vote.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Vote types used for the consensus protocol.
//!
//!
use wincode::{SchemaRead, SchemaWrite};
use crate::crypto::aggsig::{PublicKey, SecretKey};
use crate::crypto::merkle::BlockHash;
use crate::crypto::{IndividualSignature, Signable};
us... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/votor.rs | src/consensus/votor.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Main voting logic for the consensus protocol.
//!
//! Besides [`super::Pool`], [`Votor`] is the other main internal component Alpenglow.
//! It handles the main voting decisions for the consensus protocol. As input it
//! receives events... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/block_producer.rs | src/consensus/block_producer.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Block production, leader-side of the consensus protocol.
use std::sync::Arc;
use std::time::{Duration, Instant};
use color_eyre::Result;
use either::Either;
use fastrace::Span;
use log::{debug, info, warn};
use static_assertions::const... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/cert.rs | src/consensus/cert.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Certificate types used for the consensus protocol.
//!
//!
use thiserror::Error;
use wincode::{SchemaRead, SchemaWrite};
use super::Vote;
use super::vote::VoteKind;
use crate::crypto::merkle::BlockHash;
use crate::crypto::{AggregateSig... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/blockstore.rs | src/consensus/blockstore.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Data structure holding blocks for each slot.
mod slot_block_data;
use std::collections::BTreeMap;
use std::sync::Arc;
use async_trait::async_trait;
use log::debug;
use mockall::automock;
use tokio::sync::mpsc::Sender;
use self::slot_... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/pool.rs | src/consensus/pool.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Data structure handling votes and certificates.
//!
//! Any received votes or certificates are placed into the pool.
//! The pool then tracks status for each slot and sends notification to votor.
mod finality_tracker;
mod parent_ready_t... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | true |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/pool/slot_state.rs | src/consensus/pool/slot_state.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Data structures handling votes and certificates for a single slot.
//!
//! The main data structure defined here is [`SlotState`], which has components:
//! - [`SlotVotes`] for all votes in a single slot.
//! - [`SlotVotedStake`] for all ... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/pool/parent_ready_tracker.rs | src/consensus/pool/parent_ready_tracker.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Tracks the parent-ready condition.
//!
//! The parent-ready condition pertains to a slot `s` and a block hash `hash(b)`,
//! where `s` is the first slot of a leader window and `s > slot(b)`.
//! Specifically, it is defined as the followi... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/pool/finality_tracker.rs | src/consensus/pool/finality_tracker.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Tracks finality of blocks.
//!
//! This is used internally as part of [`PoolImpl`].
//!
//! Keeps track of:
//! - Direct finalization of blocks,
//! - resulting indirect finalizations of blocks, AND
//! - resulting implicit skipping of s... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/pool/parent_ready_tracker/parent_ready_state.rs | src/consensus/pool/parent_ready_tracker/parent_ready_state.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implements the [`ParentReadyState`] data structure.
//!
//! It holds the necessary state for a given slot to track the parent-ready condition.
//! This is used by the [`super::ParentReadyTracker`].
use either::Either;
use log::warn;
use... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/consensus/blockstore/slot_block_data.rs | src/consensus/blockstore/slot_block_data.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Data structure holding shreds, slices and blocks for a specific slot.
//!
//!
use std::collections::BTreeMap;
use std::collections::btree_map::Entry;
use log::{debug, trace, warn};
use thiserror::Error;
use super::BlockInfo;
use crate... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/udp.rs | src/network/udp.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! UDP network interface.
//!
//! This module provides an implementation of the [`Network`] trait for UDP sockets.
//! It is essentially a wrapper around [`tokio::net::UdpSocket`].
use std::marker::PhantomData;
use std::net::{Ipv4Addr, Soc... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/simulated.rs | src/network/simulated.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Simulated network interface.
//!
//! This module provides a in implementation of a simulated network interface,
//! which may be used for local testing and simulations.
//! It works by having [`SimulatedNetwork`] instances communicate wi... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/tcp.rs | src/network/tcp.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! TCP network interface.
//!
//! This module provides an implementation of the [`Network`] trait for TCP.
//! It uses [`tokio::net::TcpListener`] and [`tokio::net::TcpStream`] under the hood.
use std::marker::PhantomData;
use std::net::{I... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/simulated/token_bucket.rs | src/network/simulated/token_bucket.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use tokio::time::{Duration, Instant, sleep};
/// Token bucket for rate limiting.
pub struct TokenBucket {
/// Current number of tokens in the bucket.
bucket: usize,
/// Maximum number of tokens the bucket can hold.
capacity:... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/simulated/stake_distribution.rs | src/network/simulated/stake_distribution.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Utilities for working with the stake distribution of Solana mainnet.
//!
//! Validator data is taken from [Validators.app](https://validators.app/).
//! The data is stored in the `data/mainnet_validators_epoch860.json` file.
//! It conta... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/simulated/core.rs | src/network/simulated/core.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::collections::{BinaryHeap, HashMap};
use std::marker::PhantomData;
use std::sync::Arc;
use std::time::{Duration, Instant};
use log::warn;
use rand::Rng;
use tokio::sync::{Mutex, RwLock, mpsc};
use super::SimulatedNetwork;
use super... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/network/simulated/ping_data.rs | src/network/simulated/ping_data.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Utilities for working with a real-world ping dataset.
//!
//! The specfic dataset is from [WonderProxy](https://wonderproxy.com/blog/a-day-in-the-life-of-the-internet/).
//! It contains ping measurements between 200+ servers all around t... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/crypto/aggsig.rs | src/crypto/aggsig.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implementation of an aggregate signature scheme.
//!
//! This uses the [`blst`] implementation of BLS signatures.
//! Specifically, it uses the BLS12-381 G1 (min sig) signature scheme.
//!
//! # Examples
//!
//! ```
//! use alpenglow::cr... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/crypto/signature.rs | src/crypto/signature.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implementation of a digital signature scheme.
//!
//! This module abstratcs the digital signatures used throughout the entire library.
//! Currently, it provides Ed25519 digital signature scheme, as specified in [RFC 8032].
//! Specifica... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/crypto/merkle.rs | src/crypto/merkle.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Implementation of a Merkle tree.
//!
//! It supports non-power-of-two leaf count by adding empty leaves.
//! That is, a tree with 3 leaves is equivalent to a tree with 4 leaves,
//! where the 4th leaf has the empty byte slice `&[]` as it... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/src/crypto/hash.rs | src/crypto/hash.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Cryptographic hash function.
//!
//! This module abstratcs the hash function used throughout the entire library.
//! Currently, SHA-256, specifically the implementation from the [`sha2`] crate is used.
use sha2::{Digest, Sha256};
use wi... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/tests/liveness.rs | tests/liveness.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::time::Duration;
use alpenglow::create_test_nodes;
use alpenglow::types::Slot;
use log::debug;
use rand::prelude::*;
#[tokio::test]
#[ignore]
async fn only_correct_nodes() {
liveness_test(6, 0).await;
}
#[tokio::test]
#[ignore... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/benches/disseminator.rs | benches/disseminator.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use alpenglow::crypto::signature::SecretKey;
use alpenglow::disseminator::Turbine;
use alpenglow::network::UdpNetwork;
use alpenglow::shredder::{MAX_DATA_PER_SLICE, RegularShredder, Shredder};
use alpenglow::types::slice::create_slice_with_i... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/benches/network.rs | benches/network.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use alpenglow::consensus::{Cert, ConsensusMessage, NotarCert, Vote};
use alpenglow::crypto::aggsig::SecretKey;
use alpenglow::crypto::merkle::GENESIS_BLOCK_HASH;
use alpenglow::crypto::{aggsig, signature};
use alpenglow::network::localhost_i... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/benches/shredder.rs | benches/shredder.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use alpenglow::crypto::signature::SecretKey;
use alpenglow::shredder::{
AontShredder, CodingOnlyShredder, DATA_SHREDS, PetsShredder, RegularShredder, Shredder,
TOTAL_SHREDS, ValidatedShred,
};
use alpenglow::types::Slice;
use alpengl... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
qkniep/alpenglow | https://github.com/qkniep/alpenglow/blob/dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3/benches/crypto.rs | benches/crypto.rs | // Copyright (c) Anza Technology, Inc.
// SPDX-License-Identifier: Apache-2.0
use alpenglow::crypto::merkle::{SliceMerkleTree, SliceProof};
use alpenglow::crypto::{IndividualSignature, Signature, aggsig, hash, signature};
use alpenglow::shredder::{MAX_DATA_PER_SHRED, MAX_DATA_PER_SLICE};
use divan::counter::{BytesCoun... | rust | Apache-2.0 | dbf7f05ed359156910a5ffb6df5a0adbb2ce71d3 | 2026-01-04T20:22:21.174106Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/multi_map.rs | src/multi_map.rs | use std::{borrow::Borrow, collections::HashMap, hash::Hash};
#[derive(Clone, Debug)]
pub struct MultiMap<K: Eq + Hash, V> {
inner: HashMap<K, Vec<V>>,
}
impl<K: Eq + Hash, V> Default for MultiMap<K, V> {
fn default() -> Self {
Self::new()
}
}
impl<K: Eq + Hash, V> MultiMap<K, V> {
pub fn new(... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/tags.rs | src/tags.rs | use std::fmt::Display;
use colored::{Color, Colorize};
#[derive(Debug, Clone)]
pub enum Tag {
Err,
Dargo,
Clean,
Note,
GitHub,
Twitter,
Check,
Lexer,
Parser,
Compiler,
Git,
Build,
Run,
Docs,
Dependency,
Setup,
IO,
Go,
TypeResolve,
}
impl Dis... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/main.rs | src/main.rs | #![feature(impl_trait_in_bindings)]
#![allow(
clippy::needless_return,
clippy::match_like_matches_macro,
clippy::only_used_in_recursion,
clippy::large_enum_variant
)]
use std::{
env,
error::Error,
fs::{self, File},
io::Write,
path::{Path, PathBuf},
process,
sync::mpsc::Sende... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/value.rs | src/emit/value.rs | use std::{
collections::{HashMap, HashSet, VecDeque},
panic,
};
use crate::{
emit::{fix_ident_for_go, function::function_epilogue_2, types::escape_string_for_go},
parse::{
SS, Spanned,
duckx_component_parser::find_client_components,
failure, failure_with_occurence,
funct... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | true |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/source_file.rs | src/emit/source_file.rs | use std::collections::HashSet;
use crate::{
emit::{
ir::fix_idents_in_ir,
types::emit_type_definitions,
value::{IrInstruction, IrValue, ToIr},
},
parse::{SS, source_file_parser::SourceFile, use_statement_parser::UseStatement},
semantics::type_resolve::TypeEnv,
};
const JSON_UTI... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/function.rs | src/emit/function.rs | use crate::{
emit::value::{IrInstruction, IrValue, ToIr},
parse::{
failure_with_occurence,
function_parser::FunctionDefintion,
type_parser::TypeExpr,
value_parser::{ValueExpr, empty_range},
},
semantics::type_resolve::TypeEnv,
};
pub fn function_epilogue_2(t: &str) -> Ir... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/types.rs | src/emit/types.rs | use std::collections::HashSet;
use crate::{
emit::{
fix_ident_for_go,
value::{IrInstruction, IrValue, ToIr},
},
parse::{
Field,
source_file_parser::SourceFile,
struct_parser::StructDefinition,
type_parser::{Duck, TypeExpr},
},
semantics::{
ide... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | true |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/duckx_component.rs | src/emit/duckx_component.rs | use crate::{
emit::value::{IrInstruction, ToIr},
parse::{SS, duckx_component_parser::DuckxComponent},
semantics::type_resolve::TypeEnv,
};
impl DuckxComponent {
pub fn emit(&self, type_env: &mut TypeEnv, to_ir: &mut ToIr, span: SS) -> IrInstruction {
let (instr, _) = self.value_expr.0.emit(type... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/schema_def.rs | src/emit/schema_def.rs | use crate::{
emit::{
ir::join_ir,
value::{IrInstruction, ToIr},
},
parse::{
schema_def_parser::{SchemaDefinition, SchemaField},
type_parser::TypeExpr,
value_parser::{Assignment, ValueExpr},
},
semantics::type_resolve::TypeEnv,
};
impl SchemaDefinition {
f... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/mod.rs | src/emit/mod.rs | use std::collections::HashSet;
use crate::{
parse::{
Spanned,
function_parser::LambdaFunctionExpr,
type_parser::{Duck, TypeExpr},
value_parser::ValueExpr,
},
semantics::type_resolve::{TypeEnv, trav_type_expr, trav_value_expr},
};
pub mod duckx_component;
pub mod function;
p... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/ir.rs | src/emit/ir.rs | use std::collections::HashSet;
use crate::emit::{
fix_ident_for_go,
value::{Case, IrInstruction, IrValue},
};
impl IrInstruction {
fn emit_as_go(&self) -> String {
#![allow(clippy::format_in_format_args)]
match self {
IrInstruction::GlobalVarDecl {
name,
... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/emit/jsx_component.rs | src/emit/jsx_component.rs | use crate::{
emit::{types::escape_string_for_go, value::IrInstruction},
parse::jsx_component_parser::JsxComponent,
semantics::type_resolve::TypeEnv,
};
impl JsxComponent {
fn emit_js(&self) -> String {
format!(
"function {}(props){{{}}}",
self.name, self.javascript_sourc... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/test.rs | src/dargo/test.rs | use colored::Colorize;
use lazy_static::lazy_static;
use std::io::ErrorKind as IOErrKind;
use std::process::Command;
use crate::dargo::cli::{CompileArgs, TestArgs};
use crate::dargo::compile_test::{self, CompileTestErrKind};
use crate::{
dargo::build::{BuildErrKind, build},
tags::Tag,
};
#[derive(Debug)]
pub ... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/compile.rs | src/dargo/compile.rs | use colored::Colorize;
use duckwind::EmitEnv;
use lazy_static::lazy_static;
use std::{
ffi::OsString,
fs,
path::{Path, PathBuf},
sync::mpsc,
time::Duration,
};
use crate::{
DARGO_DOT_DIR,
cli::go_cli::{self, GoCliErrKind},
dargo::cli::CompileArgs,
emit::{ir::join_ir, types::escape_s... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/cli.rs | src/dargo/cli.rs | use clap::{Parser as CliParser, Subcommand};
use std::path::PathBuf;
use crate::{
dargo::{
self, compile::CompileErrKind, docs::DocsErrKind, init::InitErrKind, new::NewErrKind,
run::RunErrKind, test::TestErrKind,
},
tags::Tag,
};
use super::{
build::{self, BuildErrKind},
clean::Cle... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/compile_test.rs | src/dargo/compile_test.rs | use colored::Colorize;
use duckwind::EmitEnv;
use lazy_static::lazy_static;
use std::{ffi::OsString, fs, path::PathBuf, sync::mpsc, time::Duration};
use crate::{
DARGO_DOT_DIR,
cli::go_cli::{self, GoCliErrKind},
dargo::cli::CompileArgs,
emit::{ir::join_ir, types::escape_string_for_go},
lex,
par... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/build.rs | src/dargo/build.rs | use std::io::{self, ErrorKind as IOErrKind};
use std::path::{Path, PathBuf};
use std::{env, fs};
use crate::DARGO_DOT_DIR;
use crate::cli::git_cli::{self, GitCliErrKind};
use crate::dargo::cli::CompileArgs;
use crate::tags::Tag;
use super::cli::BuildArgs;
use super::compile::{self, CompileErrKind};
use super::loader:... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/mod.rs | src/dargo/mod.rs | pub mod build;
pub mod clean;
pub mod cli;
pub mod compile;
pub mod compile_test;
pub mod docs;
pub mod init;
pub mod loader;
pub mod new;
pub mod run;
pub mod test;
| rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/run.rs | src/dargo/run.rs | use colored::Colorize;
use lazy_static::lazy_static;
use std::io::ErrorKind as IOErrKind;
use std::process::Command;
use crate::dargo::cli::{CompileArgs, RunArgs};
use crate::dargo::compile::{CompileErrKind, compile};
use crate::{
dargo::build::{BuildErrKind, build},
tags::Tag,
};
#[derive(Debug)]
pub enum Ru... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/init.rs | src/dargo/init.rs | use colored::Colorize;
use lazy_static::lazy_static;
use std::{
fs::{self, create_dir},
path::{Path, PathBuf},
};
use crate::{dargo::cli::InitArgs, tags::Tag};
#[derive(Debug)]
pub enum InitErrKind {
CannotWriteFile,
DargoTomlAlreadyExists,
}
lazy_static! {
static ref INIT_TAG: String = " init ".... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
duck-compiler/duckc | https://github.com/duck-compiler/duckc/blob/03febfa849f54a237380dfed2d91a52a2df0313b/src/dargo/loader.rs | src/dargo/loader.rs | use colored::Colorize;
use serde::Deserialize;
use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
use toml;
use crate::tags::Tag;
#[derive(Debug, Clone, PartialEq, Deserialize)]
#[serde(untagged)]
pub enum Dependency {
WithVersion(String),
// WithConfig(DependencyConfig)
}
// [[bin]]... | rust | MIT | 03febfa849f54a237380dfed2d91a52a2df0313b | 2026-01-04T20:22:21.418266Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.