diff --git a/.env.example b/.env.example
deleted file mode 100644
index b3ba34e..0000000
--- a/.env.example
+++ /dev/null
@@ -1,37 +0,0 @@
-# PolyTorus Development Environment Variables
-# Copy this file to .env and customize as needed
-
-# Database Configuration
-DB_PASSWORD=polytorus_dev_2024
-REDIS_PASSWORD=redis_dev_2024
-
-# Node Configuration
-LOG_LEVEL=DEBUG
-
-# Node 0 (Bootstrap)
-NODE_0_HTTP_PORT=9000
-NODE_0_P2P_PORT=8000
-NODE_0_WS_PORT=9944
-
-# Node 1 (Validator)
-NODE_1_HTTP_PORT=9001
-NODE_1_P2P_PORT=8001
-NODE_1_WS_PORT=9945
-
-# Node 2 (Full Node)
-NODE_2_HTTP_PORT=9002
-NODE_2_P2P_PORT=8002
-NODE_2_WS_PORT=9946
-
-# Monitoring
-PROMETHEUS_PORT=9090
-GRAFANA_PORT=3000
-GRAFANA_PASSWORD=polytorus_admin
-
-# Load Balancer
-NGINX_PORT=80
-NGINX_SSL_PORT=443
-
-# Development Features
-RUST_LOG=debug
-RUST_BACKTRACE=1
diff --git a/.env.secrets.example b/.env.secrets.example
deleted file mode 100644
index 5d68447..0000000
--- a/.env.secrets.example
+++ /dev/null
@@ -1,21 +0,0 @@
-# Docker Secrets support for production
-# Place sensitive values in separate files and mount them as secrets
-
-# Database password (for production use Docker secrets)
-# echo "your_secure_password" | docker secret create db_password -
-
-# Redis password
-# echo "your_redis_password" | docker secret create redis_password -
-
-# For development, use environment variables
-DB_PASSWORD_FILE=/run/secrets/db_password
-REDIS_PASSWORD_FILE=/run/secrets/redis_password
-
-# Connection pool settings
-DB_MAX_CONNECTIONS=10
-DB_MIN_CONNECTIONS=1
-DB_CONNECTION_TIMEOUT=30
-
-# Redis settings
-REDIS_MAX_CONNECTIONS=10
-REDIS_CONNECTION_TIMEOUT=5
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..46019c9
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,48 @@
+name: Build
+
+on:
+ push:
+ branches: [ main ]
+ workflow_dispatch:
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ build:
+ name: Build Release
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: x86_64-unknown-linux-gnu
+
+ - name: Cache dependencies
+ uses: actions/cache@v3
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/
+ key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Build release
+ run: cargo build --release --target x86_64-unknown-linux-gnu
+
+ - name: Package binary
+ run: |
+ cd target/x86_64-unknown-linux-gnu/release
+ tar czf ../../../polytorus-linux-amd64.tar.gz polytorus
+
+ - name: Upload artifact
+ uses: actions/upload-artifact@v3
+ with:
+ name: polytorus-linux-amd64
+ path: polytorus-linux-amd64.tar.gz
+
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..1596af6
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,81 @@
+name: CI
+
+on:
+ push:
+ branches: [ main, develop ]
+ pull_request:
+ branches: [ main, develop ]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ format:
+ name: Auto Format
+ runs-on: ubuntu-latest
+ if: github.event_name == 'pull_request'
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ ref: ${{ github.head_ref }}
+
+ - name: Install Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ components: rustfmt
+
+ - name: Run cargo fmt
+ run: cargo fmt
+
+ - name: Commit changes
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ git add -A
+ if git diff --staged --quiet; then
+ echo "No formatting changes needed"
+ else
+ git commit -m "Auto-format code with cargo fmt"
+ git push
+ fi
+
+ test:
+ name: Test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Rust
+ uses: dtolnay/rust-toolchain@stable
+
+ - name: Cache dependencies
+ uses: actions/cache@v3
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Build
+ run: cargo build --verbose
+
+ - name: Run tests
+ run: cargo test --verbose
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ components: clippy
+
+ - name: Run clippy
+ run: cargo clippy
\ No newline at end of file
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index 065de90..0000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,390 +0,0 @@
----
-name: CI/CD Pipeline
-
-"on":
- push:
- branches: [main, develop]
- tags: ['v*']
- pull_request:
- branches: [main, develop]
-
-permissions:
- contents: read
-
-env:
- CARGO_TERM_COLOR: always
- RUST_BACKTRACE: 1
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
-
-jobs:
- # 高速フィードバック用の基本チェック
- quick-checks:
- name: Quick Checks
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@nightly
- with:
- components: rustfmt, clippy
-
- - name: Setup Rust cache
- uses: Swatinem/rust-cache@v2
- with:
- cache-on-failure: true
-
- - name: Install system dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential cmake libssl-dev pkg-config \
- libgmp-dev libntl-dev libboost-all-dev libgmp3-dev libmpfr-dev \
- libfftw3-dev autoconf automake libtool
-
- - name: Setup OpenFHE
- run: |
- echo "=== Installing OpenFHE from source ==="
- git clone \
- https://github.com/MachinaIO/openfhe-development.git \
- /tmp/openfhe
- cd /tmp/openfhe
- git checkout feat/improve_determinant
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr/local \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_UNITTESTS=OFF \
- -DBUILD_EXAMPLES=OFF \
- -DBUILD_BENCHMARKS=OFF \
- -DWITH_OPENMP=ON \
- -DCMAKE_CXX_STANDARD=17 \
- -DCMAKE_CXX_FLAGS="-O2 -DNDEBUG -Wno-unused-parameter \
- -Wno-unused-function -Wno-missing-field-initializers" \
- ..
- make -j$(nproc)
- sudo make install
- sudo ldconfig
-
- echo "=== Verifying OpenFHE installation ==="
- echo "Headers in /usr/local/include:"
- find /usr/local/include -name "*openfhe*" -type d || \
- echo "No OpenFHE headers found"
- echo "Libraries in /usr/local/lib:"
- ls -la /usr/local/lib/libOPENFHE* || \
- echo "No OpenFHE libraries found"
-
- # Create symlinks for easier header discovery
- if [ -d "/usr/local/include/openfhe" ]; then
- sudo ln -sf /usr/local/include/openfhe \
- /usr/include/openfhe || true
- fi
- # Set environment variables
- echo "OPENFHE_ROOT=/usr/local" >> $GITHUB_ENV
- echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" \
- >> $GITHUB_ENV
- echo "CPATH=/usr/local/include:/usr/local/include/openfhe:$CPATH" \
- >> $GITHUB_ENV
- echo "LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH" >> $GITHUB_ENV
- echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" \
- >> $GITHUB_ENV
-
- # Uncomment the following line to force OpenFHE testing in CI
- # echo "FORCE_OPENFHE_CI=1" >> $GITHUB_ENV
-
- - name: Check formatting
- run: cargo fmt --all -- --check
-
- - name: Run clippy
- run: make clippy-strict
-
- - name: Check for security vulnerabilities
- run: |
- cargo install cargo-audit
- cargo audit
-
- # 基本テストスイート
- test:
- name: Test Suite
- runs-on: ubuntu-latest
- needs: quick-checks
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@nightly
-
- - name: Setup Rust cache
- uses: Swatinem/rust-cache@v2
-
- - name: Install system dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential cmake libssl-dev pkg-config \
- libgmp-dev libntl-dev libboost-all-dev libgmp3-dev libmpfr-dev \
- libfftw3-dev autoconf automake libtool
-
- - name: Setup OpenFHE
- run: |
- git clone \
- https://github.com/MachinaIO/openfhe-development.git \
- /tmp/openfhe
- cd /tmp/openfhe
- git checkout feat/improve_determinant
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr/local \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_UNITTESTS=OFF \
- -DBUILD_EXAMPLES=OFF \
- -DBUILD_BENCHMARKS=OFF \
- -DWITH_OPENMP=ON \
- -DCMAKE_CXX_STANDARD=17 \
- -DCMAKE_CXX_FLAGS="-O2 -DNDEBUG -Wno-unused-parameter \
- -Wno-unused-function -Wno-missing-field-initializers" \
- ..
- make -j$(nproc)
- sudo make install
- sudo ldconfig
- sudo mkdir -p /usr/local/lib/pkgconfig
- echo "OPENFHE_ROOT=/usr/local" >> $GITHUB_ENV
- echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" \
- >> $GITHUB_ENV
- echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" \
- >> $GITHUB_ENV
-
- - name: Verify OpenFHE installation
- run: |
- echo "=== OpenFHE Installation Verification ==="
- echo "OPENFHE_ROOT: $OPENFHE_ROOT"
- echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
- echo ""
- echo "--- Library files ---"
- ls -la /usr/local/lib/libOPENFHE* || \
- echo "No OpenFHE libraries found in /usr/local/lib"
- echo ""
- echo "--- Header files ---"
- find /usr/local/include -name "*openfhe*" -type d || \
- echo "No OpenFHE headers found"
- echo "" echo "--- Environment check ---"
- ldconfig -p | grep -i openfhe || \
- echo "OpenFHE libraries not in ldconfig cache"
- echo ""
- echo "--- PKG_CONFIG check ---"
- pkg-config --exists openfhe && \
- echo "OpenFHE pkg-config found" || \
- echo "OpenFHE pkg-config not found"
-
- - name: Run tests
- env:
- RUST_LOG: info
- RUST_BACKTRACE: full
- run: cargo test --verbose
-
- - name: Run integration tests
- env:
- RUST_LOG: info
- RUST_BACKTRACE: full
- run: cargo test --test '*' --verbose
-
- # カバレッジレポート(Linuxのみ)
- coverage:
- name: Coverage Report
- runs-on: ubuntu-latest
- needs: quick-checks
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@nightly
- with:
- components: rustfmt, clippy
-
- - name: Setup Rust cache
- uses: Swatinem/rust-cache@v2
-
- - name: Install system dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential cmake libssl-dev \
- pkg-config libgmp-dev libntl-dev libboost-all-dev \
- libgmp3-dev libmpfr-dev libfftw3-dev autoconf automake \
- libtool
-
- - name: Setup OpenFHE
- run: |
- git clone \
- https://github.com/MachinaIO/openfhe-development.git \
- /tmp/openfhe
- cd /tmp/openfhe
- git checkout feat/improve_determinant
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr/local \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_UNITTESTS=OFF \
- -DBUILD_EXAMPLES=OFF \
- -DBUILD_BENCHMARKS=OFF \
- -DWITH_OPENMP=ON \
- -DCMAKE_CXX_STANDARD=17 \
- -DCMAKE_CXX_FLAGS="-O2 -DNDEBUG \
- -Wno-unused-parameter -Wno-unused-function \
- -Wno-missing-field-initializers" \
- ..
- make -j$(nproc)
- sudo make install
- sudo ldconfig
- sudo mkdir -p /usr/local/lib/pkgconfig
- echo "OPENFHE_ROOT=/usr/local" >> $GITHUB_ENV
- echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" \
- >> $GITHUB_ENV
- echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" \
- >> $GITHUB_ENV
-
- - name: Verify OpenFHE installation for coverage
- run: |
- echo "=== OpenFHE Installation Verification for Coverage ==="
- echo "OPENFHE_ROOT: /usr/local"
- echo "LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH"
- echo ""
- echo "--- Library files ---"
- ls -la /usr/local/lib/libOPENFHE* || \
- echo "No OpenFHE libraries found in /usr/local/lib"
- echo ""
- echo "--- ldconfig check ---"
- ldconfig -p | grep -i openfhe || \
- echo "OpenFHE libraries not in ldconfig cache"
- echo ""
- echo "--- Test simple linking ---"
- cd /tmp && echo 'int main() { return 0; }' > test.c
- gcc -o test test.c -L/usr/local/lib -lOPENFHEcore \
- -lOPENFHEpke -lOPENFHEbinfhe || \
- echo "Direct linking test failed"
- echo ""
-
- - name: Install cargo-tarpaulin
- run: cargo install cargo-tarpaulin
-
- - name: Generate coverage report
- env:
- OPENFHE_ROOT: /usr/local
- LD_LIBRARY_PATH: >-
- /usr/local/lib:/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu
- PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
- RUST_BACKTRACE: full
- run: |
- echo "=== Environment for tarpaulin ==="
- echo "OPENFHE_ROOT: $OPENFHE_ROOT"
- echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
- echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"
- echo ""
-
- # First try a simple compilation test
- echo "=== Testing compilation without tarpaulin ==="
- cargo build --all-features --workspace || {
- echo "Build failed, cannot proceed with coverage"
- exit 1
- }
-
- # Try running a basic test first
- echo "=== Testing basic test execution ==="
- cargo test --test diamond_io_integration_tests --verbose || {
- echo "Basic integration test failed"
- }
-
- echo "=== Running tarpaulin ==="
- CARGO_TARPAULIN=1 cargo tarpaulin \
- --verbose \
- --all-features \
- --workspace \
- --timeout 300 \
- --out xml \
- --exclude-files "target/*" \
- --exclude-files "*/build.rs" \
- --exclude-files "kani-verification/*" \
- --skip-clean || {
- echo "Tarpaulin failed, generating fallback coverage"
- # Generate a minimal coverage report
- echo '
-
-
- .
-
-
-
-
-
-
- ' > cobertura.xml
- }
-
- - name: Upload coverage reports to Codecov
- uses: codecov/codecov-action@v4
- with:
- file: cobertura.xml
- fail_ci_if_error: false
- continue-on-error: true
-
-
- # セキュリティスキャン
- security:
- name: Security Scan
- runs-on: ubuntu-latest
- needs: quick-checks
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@nightly
- with:
- components: rustfmt, clippy
-
- - name: Setup Rust cache
- uses: Swatinem/rust-cache@v2
-
- - name: Install system dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential cmake libssl-dev pkg-config \
- libgmp-dev libntl-dev libboost-all-dev libgmp3-dev libmpfr-dev \
- libfftw3-dev autoconf automake libtool
-
- - name: Setup OpenFHE
- run: |
- git clone \
- https://github.com/MachinaIO/openfhe-development.git \
- /tmp/openfhe
- cd /tmp/openfhe
- git checkout feat/improve_determinant
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr/local \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_UNITTESTS=OFF \
- -DBUILD_EXAMPLES=OFF \
- -DBUILD_BENCHMARKS=OFF \
- -DWITH_OPENMP=ON \ -DCMAKE_CXX_STANDARD=17 \
- -DCMAKE_CXX_FLAGS="-O2 -DNDEBUG \
- -Wno-unused-parameter -Wno-unused-function \
- -Wno-missing-field-initializers" \
- ..
- make -j$(nproc)
- sudo make install
- sudo ldconfig
- sudo mkdir -p /usr/local/lib/pkgconfig
- echo "OPENFHE_ROOT=/usr/local" >> $GITHUB_ENV
- echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" \
- >> $GITHUB_ENV
- echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" \
- >> $GITHUB_ENV
-
- - name: Run security audit
- run: |
- cargo install cargo-audit
- cargo audit
-
- - name: Run dependency check
- run: |
- cargo install cargo-deny
- cargo deny check
diff --git a/.gitignore b/.gitignore
index a25fbbf..954baa0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,4 @@ test_simple_circuit_operations_obfuscation/
.claude
logs
:memory:
+blockchain_data
diff --git a/CLAUDE.md b/CLAUDE.md
index 9cb3d65..594c0cc 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -4,311 +4,223 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview
-PolyTorus is a cutting-edge modular blockchain platform designed for the post-quantum era. It features a revolutionary modular architecture with separate layers for consensus, execution, settlement, and data availability, along with Diamond IO integration for indistinguishability obfuscation.
+PolyTorus is a cutting-edge modular blockchain platform designed for the post-quantum era. It features a **4-layer modular architecture** with separate crates for execution, settlement, consensus, and data availability, providing unprecedented customization and optimization capabilities.
## Essential Commands
### Build & Development
```bash
-# Standard build (requires OpenFHE)
-cargo build --release
-
# Development build
cargo build
-# Run comprehensive tests
+# Release build
+cargo build --release
+
+# Run all tests
cargo test
-# Run library-only tests (recommended during development)
-cargo test --lib
+# Run individual layer tests
+cargo test -p execution
+cargo test -p settlement
+cargo test -p consensus
+cargo test -p data-availability
-# Run specific test modules
-cargo test diamond_io --nocapture # Diamond IO tests
-cargo test modular --lib # Modular architecture tests
-cargo test cli_tests # CLI functionality tests
+# Run specific test by name
+cargo test test_block_creation -- --nocapture
```
### Code Quality & Linting
```bash
-# Zero dead code policy enforcement
-cargo check --lib
-cargo clippy --lib -- -D warnings -D clippy::all
+# Check for compilation errors
+cargo check
-# Complete quality check pipeline
-./scripts/quality_check.sh
+# Run clippy linter
+cargo clippy -- -D warnings
# Format code
cargo fmt
-# Security audit
-cargo audit
-```
-
-### Diamond IO Integration
-```bash
-# Test Diamond IO functionality
-cargo test diamond -- --nocapture
-
-# Run Diamond IO demo with all configurations
-cargo run --example diamond_io_demo
-
-# Performance benchmarks
-cargo run --example diamond_io_performance_test
-```
-
-### Modular Architecture
-```bash
-# Start modular blockchain with default config
-./target/release/polytorus modular start
-
-# Start with custom configuration
-./target/release/polytorus modular start config/modular.toml
-
-# Check modular system status
-./target/release/polytorus modular state
-./target/release/polytorus modular layers
+# Build without warnings (zero tolerance policy)
+cargo build 2>&1 | grep -i warning && echo "Warnings found!" || echo "Clean build!"
```
-### Wallet & Mining Operations
+### Running the Application
```bash
-# Create quantum-resistant wallet
-./target/release/polytorus createwallet FNDSA
+# Start the blockchain node
+cargo run start
-# Create traditional ECDSA wallet
-./target/release/polytorus createwallet ECDSA
+# Show help for available commands
+cargo run -- --help
-# Mine blocks using modular architecture
-./target/release/polytorus modular mine
+# Process a transaction
+cargo run send --from alice --to bob --amount 100
-# List wallet addresses
-./target/release/polytorus listaddresses
+# Check blockchain status
+cargo run status
```
-### Multi-Node Simulation
-```bash
-# Start 4-node simulation
-./scripts/simulate.sh local --nodes 4 --duration 300
-
-# Test transaction propagation
-./scripts/test_complete_propagation.sh
-
-# Monitor transactions in real-time
-cargo run --example transaction_monitor
-```
-
-### Kani Verification
-```bash
-# Install and setup Kani
-make kani-install
-make kani-setup
-
-# Run verification suite
-make kani-verify
-
-# Quick verification for development
-make kani-quick
+## Architecture Overview
-# Specific verification categories
-make kani-crypto # Cryptographic verification
-make kani-blockchain # Blockchain verification
-make kani-modular # Modular architecture verification
-```
+### 4-Layer Modular Architecture
+The project is organized as a Rust workspace with separate crates for each layer:
-## Architecture Overview
+1. **`crates/execution/`** - Transaction processing and WASM smart contracts
+ - WASM-based contract execution with gas metering
+ - Account-based state management with rollback capabilities
+ - Host functions for blockchain operations (balance queries, transfers)
+ - **Tests**: 4 comprehensive test functions
-### Core Modular Architecture Implementation Status
-The project features a sophisticated modular design with the following layers and their current implementation status:
+2. **`crates/settlement/`** - Dispute resolution and finalization
+ - Optimistic rollup processing with fraud proof verification
+ - Challenge submission and processing with time-based expiration
+ - Settlement history tracking and penalty system
+ - **Tests**: 6 comprehensive test functions
-1. **Consensus Layer** (`src/modular/consensus.rs`) - **✅ FULLY IMPLEMENTED**
- - Complete Proof-of-Work consensus mechanism
- - Comprehensive block validation (structure, PoW, timestamps, transactions)
- - Transaction validation with signature verification
+3. **`crates/consensus/`** - Block ordering and validation
+ - Proof-of-Work consensus with configurable difficulty
+ - Block validation (structure, PoW, timestamps, transactions)
- Validator management and mining capabilities
- - **Test Coverage**: 6 comprehensive test functions
- - **Status**: Production-ready with robust validation
+ - **Tests**: 8 comprehensive test functions
-2. **Data Availability Layer** (`src/modular/data_availability.rs`) - **✅ FULLY IMPLEMENTED**
- - Real Merkle tree construction and proof verification
+4. **`crates/data-availability/`** - Data storage and distribution
+ - Merkle tree construction and proof verification
- Data storage with metadata and integrity checks
- Network-aware data distribution simulation
- - Comprehensive verification with caching and replication tracking
- - **Test Coverage**: 15 extensive test functions (best coverage)
- - **Status**: Most sophisticated implementation with real cryptographic proofs
-
-3. **Settlement Layer** (`src/modular/settlement.rs`) - **✅ FULLY IMPLEMENTED**
- - Optimistic rollup processing with real fraud proof verification
- - Batch transaction settlement with integrity verification
- - Challenge processing with time-based expiration
- - Settlement history tracking and penalty system
- - **Test Coverage**: 13 comprehensive test functions
- - **Status**: Working optimistic rollup settlement with re-execution
-
-4. **Execution Layer** (`src/modular/execution.rs`) - **⚠️ PARTIALLY IMPLEMENTED**
- - Dual transaction processing (account-based + eUTXO)
- - Smart contract execution engine integration
- - State management with rollback capabilities
- - Gas metering and resource management
- - **Test Coverage**: ❌ No dedicated unit tests (major gap)
- - **Status**: Good architecture but lacks direct validation
-
-5. **Unified Orchestrator** (`src/modular/unified_orchestrator.rs`) - **⚠️ BASIC IMPLEMENTATION**
- - Event-driven architecture with 17 event types
- - Layer coordination and message passing framework
- - Performance metrics and health monitoring
- - Network integration capabilities
- - **Test Coverage**: ❌ No dedicated tests (significant gap)
- - **Status**: Well-designed architecture but needs integration validation
-
-### Diamond IO Privacy Layer - **✅ IMPLEMENTED**
-Advanced indistinguishability obfuscation integrated throughout the modular architecture:
-
-- **Circuit Obfuscation**: Transform smart contracts into indistinguishable programs
-- **Homomorphic Evaluation**: Execute obfuscated circuits on encrypted data
-- **Multiple Security Modes**: Dummy (testing), Testing (development), Production (maximum security)
-- **E2E Privacy**: Complete obfuscation from contract creation to execution
-- **Integration Status**: Working Diamond IO demos and performance tests available
-- **Test Coverage**: Multiple integration test files and examples
-
-### Network Architecture - **✅ IMPLEMENTED**
-Sophisticated P2P networking with modern protocols:
-
-- **Priority Message Queue**: Advanced message prioritization with rate limiting
-- **Peer Management**: Comprehensive peer tracking, health monitoring, and blacklisting
-- **Network Topology**: Real-time network health and topology analysis
-- **Bootstrap Node Support**: Automated peer discovery and connection management
-- **Integration Status**: Working multi-node simulation and P2P examples
-- **Test Coverage**: P2P tests and simulation scripts available
+ - **Tests**: 9 comprehensive test functions
+
+5. **`crates/traits/`** - Shared interfaces and types
+ - Common traits for all layers (ExecutionLayer, SettlementLayer, etc.)
+ - Shared data structures (Transaction, Block, Hash, etc.)
+ - Result types and error handling
+
+6. **External Wallet** - Cryptographic wallet functionality
+ - **Repository**: https://github.com/PolyTorus/wallet
+ - HD wallet implementation with BIP32/BIP44 support
+ - Address generation and key pair management
+ - Digital signature creation and verification
+ - Multi-signature wallet capabilities
+ - **Integration**: Available as `wallet` crate dependency
+
+### Main Orchestrator (`src/main.rs`)
+The `PolyTorusBlockchain` struct coordinates all layers:
+- Manages layer lifecycle (initialization, coordination)
+- Processes transactions through all layers sequentially
+- Provides CLI interface with clap for command handling
+- Supports both default and custom layer configurations
+
+### Configuration System
+Configuration is managed through:
+- **`config/modular.toml`** - Layer-specific settings (gas limits, difficulty, retention periods)
+- **Layer configs** - Each layer has its own configuration struct with sensible defaults
+- **Test configurations** - Special configurations for testing (e.g., difficulty=0 for fast mining)
## Development Guidelines
### Code Quality Standards
-The project maintains a **zero dead code policy**:
-
-- All code must be actively used (no `#[allow(dead_code)]`)
-- Zero compiler warnings allowed
-- Comprehensive test coverage (100+ tests)
-- Strict Clippy compliance
-
-### Testing Architecture - **Current Status**
-- **Unit Tests**: Located alongside source files (`*_tests.rs`)
- - ✅ **Data Availability**: 15 comprehensive tests
- - ✅ **Settlement Layer**: 13 comprehensive tests
- - ✅ **Consensus Layer**: 6 comprehensive tests
- - ❌ **Execution Layer**: No dedicated unit tests (needs improvement)
- - ❌ **Unified Orchestrator**: No integration tests (needs improvement)
-- **Integration Tests**: In `/tests` directory (Diamond IO, ERC20, EUTXO)
-- **CLI Tests**: Comprehensive 25+ test functions in `src/command/cli_tests.rs`
-- **Kani Verification**: Formal verification in `/kani-verification`
-- **Property-Based Tests**: Using criterion for benchmarks
-
-### Critical Testing Gaps
-1. **Execution Layer**: Needs unit tests for transaction processing and state management
-2. **Unified Orchestrator**: Needs integration tests showing layer coordination
-3. **End-to-End**: Missing full system integration tests
+- **Zero dead code policy**: All variables and functions must be used
+- **Zero compiler warnings**: No warnings allowed in builds
+- **Comprehensive testing**: Each layer has extensive unit tests
+- **Proper error handling**: Use `anyhow::Result` consistently
+
+### Testing Architecture
+Tests are distributed across the crates:
+- **Unit tests**: Located in each crate's `src/lib.rs`
+- **Integration tests**: Located in `src/main.rs` for full blockchain functionality
+- **Layer isolation**: Each layer can be tested independently
+- **Configuration testing**: Tests use difficulty=0 for fast mining where appropriate
-### Configuration Management
-Configuration files are in `/config`:
-- `modular.toml` - Modular architecture settings
-- `diamond_io.toml` - Diamond IO configuration
-- `polytorus.toml` - General blockchain settings
-- `docker-node.toml` - Docker deployment configuration
-
-### Dependencies & Build Requirements
-
-**Essential Dependencies:**
-- **Rust**: 1.82+ (not 1.87 - that was incorrect)
-- **OpenFHE**: MachinaIO fork with `exp/reimpl_trapdoor` branch (must be at `/usr/local`)
-- **System Libraries**: `cmake`, `libgmp-dev`, `libntl-dev`, `libboost-all-dev`
-
-**OpenFHE Installation:**
+### Testing Best Practices
```bash
-# Automated installation
-sudo ./scripts/install_openfhe.sh
+# Test individual layers during development
+cargo test -p execution
+cargo test -p consensus
-# Set required environment variables
-export OPENFHE_ROOT=/usr/local
-export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
-export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
-```
+# Run full integration tests
+cargo test
-### Directory Structure
-```
-src/
-├── modular/ # Primary modular architecture - CORE IMPLEMENTATION
-│ ├── consensus.rs # ✅ FULLY IMPLEMENTED - PoW consensus with validation
-│ ├── execution.rs # ⚠️ PARTIALLY IMPLEMENTED - missing unit tests
-│ ├── settlement.rs # ✅ FULLY IMPLEMENTED - optimistic rollups with fraud proofs
-│ ├── data_availability.rs # ✅ FULLY IMPLEMENTED - Merkle proofs & verification
-│ ├── unified_orchestrator.rs # ⚠️ BASIC - needs integration tests
-│ ├── traits.rs # ✅ COMPLETE - well-defined interfaces
-│ ├── storage.rs # ✅ IMPLEMENTED - modular storage layer
-│ ├── message_bus.rs # ✅ IMPLEMENTED - inter-layer communication
-│ └── network.rs # ✅ IMPLEMENTED - modular network integration
-├── diamond_io_integration.rs # ✅ IMPLEMENTED - privacy layer integration
-├── blockchain/ # ✅ LEGACY - maintained for compatibility
-├── crypto/ # ✅ IMPLEMENTED - ECDSA, FN-DSA, Verkle trees
-├── network/ # ✅ IMPLEMENTED - P2P with priority queues & health monitoring
-├── smart_contract/ # ✅ IMPLEMENTED - WASM engine with ERC20 support
-├── command/ # ✅ IMPLEMENTED - comprehensive CLI with 25+ tests
-└── webserver/ # ✅ IMPLEMENTED - HTTP API endpoints
+# Test with output for debugging
+cargo test test_name -- --nocapture
```
-### Testing Best Practices
-Always run tests in this order during development:
-1. `cargo test --lib` - Fast library tests
-2. `cargo clippy --lib -- -D warnings` - Code quality
-3. `cargo test` - Full test suite
-4. `./scripts/quality_check.sh` - Complete quality pipeline
-
-### Diamond IO Integration Notes
-Diamond IO has three operational modes:
-- **Dummy Mode**: Safe for development, no real obfuscation
-- **Testing Mode**: Real parameters with medium security
-- **Production Mode**: High-security parameters for live deployment
-
-Always test Diamond IO functionality with:
-```bash
-cargo test diamond_io_with_production_params -- --nocapture
+### Layer Implementation Patterns
+Each layer follows a consistent pattern:
+1. **Configuration struct** with `Default` implementation
+2. **Main implementation struct** (e.g., `PolyTorusExecutionLayer`)
+3. **Trait implementation** for the layer interface
+4. **Comprehensive unit tests** in `#[cfg(test)]` module
+5. **Error handling** using `anyhow::Result`
+
+### Common Development Tasks
+
+#### Adding New Layer Functionality
+1. Define the interface in `crates/traits/src/lib.rs`
+2. Implement in the appropriate layer crate
+3. Add comprehensive tests
+4. Update the main orchestrator if needed
+5. Update configuration if new settings are required
+
+#### Integrating Wallet Functionality
+The external wallet crate provides comprehensive cryptographic capabilities:
+
+```rust
+// Import wallet functionality
+use wallet::{
+ HDWallet, Wallet, Address, KeyPair, Signature,
+ AddressFormat, WalletError
+};
+
+// Create a new HD wallet
+let mnemonic = HDWallet::generate_mnemonic()?;
+let wallet = HDWallet::from_mnemonic(&mnemonic, None)?;
+
+// Generate addresses
+let address = wallet.derive_address(0, false)?; // First receiving address
+let change_address = wallet.derive_address(0, true)?; // First change address
+
+// Create key pairs for signing
+let keypair = wallet.derive_keypair(0, false)?;
+let signature = keypair.sign(message_hash)?;
+
+// Verify signatures
+let is_valid = keypair.verify(message_hash, &signature)?;
```
-### Current Development Priorities
-
-**Immediate Actions Needed:**
-1. **Add Unit Tests for Execution Layer** (`src/modular/execution.rs`)
- - Test transaction processing functionality
- - Test state management and rollback capabilities
- - Test gas metering and resource management
-
-2. **Add Integration Tests for Unified Orchestrator** (`src/modular/unified_orchestrator.rs`)
- - Test layer coordination and message passing
- - Test event-driven architecture with real layers
- - Test performance metrics and health monitoring
+**Wallet Features:**
+- **HD Wallet**: BIP32/BIP44 hierarchical deterministic wallet support
+- **Address Generation**: Multiple address formats (Legacy, SegWit, Native SegWit)
+- **Key Management**: Secure key pair generation and management
+- **Digital Signatures**: ECDSA signature creation and verification
+- **Multi-signature**: Multi-signature wallet creation and transaction signing
+- **Mnemonic**: BIP39 mnemonic phrase generation and recovery
+
+#### Debugging Layer Interactions
+The orchestrator processes transactions through layers in this order:
+1. **Execution**: Process and validate transaction
+2. **Data Availability**: Store transaction data
+3. **Consensus**: Add to pending transactions for block creation
+4. **Settlement**: Handle any disputes or challenges
+
+#### Mining and Block Creation
+- Default difficulty is configured for reasonable mining times
+- Tests use `difficulty=0` for instant mining
+- Custom configurations can be passed to `PolyTorusBlockchain::new_with_configs()`
-3. **End-to-End Integration Tests**
- - Test all modular layers working together
- - Test complete transaction flow through all layers
- - Test error handling and recovery scenarios
-
-### Common Pitfalls to Avoid
-1. **OpenFHE Dependencies**: Ensure OpenFHE is properly installed at system level
-2. **Dead Code**: Never use `#[allow(dead_code)]` - create methods that use all fields
-3. **Test Isolation**: Use proper cleanup in tests, especially for file system operations
-4. **Async Safety**: Be careful with shared state in async contexts
-5. **Configuration Validation**: Always validate TOML configurations before use
-6. **Testing Gaps**: Don't assume implementation works without comprehensive tests
+### Configuration Management
+Layer configurations are defined in:
+- `ExecutionConfig`: Gas limits, WASM settings
+- `SettlementConfig`: Challenge periods, batch sizes
+- `ConsensusConfig`: Block time, difficulty, block size limits
+- `DataAvailabilityConfig`: Retention periods, network settings
### Performance Considerations
-- Modular architecture allows independent optimization of each layer
-- Diamond IO operations scale with security parameters (ring dimension)
-- P2P networking includes bandwidth management and rate limiting
+- Each layer runs independently and can be optimized separately
- WASM execution includes gas metering for resource control
-
-### Documentation Standards
-- All public APIs must have rustdoc comments with examples
-- Integration tests should include detailed comments explaining scenarios
-- Configuration files should be well-documented with examples
-- CLI help text should be comprehensive and user-friendly
-
-
-You have to write tests for the code you've written.
-TEST when you think you're done, and make a sound when you're really done.
+- Data availability includes configurable retention and replication
+- Consensus supports configurable difficulty for different deployment scenarios
+
+### Current Development Status
+All layers are **fully implemented and tested**:
+- **31 total tests** across all layers and main orchestrator
+- **Zero compiler warnings** across the entire codebase
+- **Production-ready** modular architecture
+- **Clean separation of concerns** between layers
\ No newline at end of file
diff --git a/CONTAINERLAB_ANALYSIS.md b/CONTAINERLAB_ANALYSIS.md
deleted file mode 100644
index 4651f35..0000000
--- a/CONTAINERLAB_ANALYSIS.md
+++ /dev/null
@@ -1,290 +0,0 @@
-# ContainerLab Network Simulation Analysis & Recommendations
-
-## Current State Analysis
-
-### Existing Configuration Limitations
-
-The current ContainerLab topology (`containerlab-topology.yml`) has several limitations for realistic testnet simulation:
-
-1. **Basic Network Topology**: Simple full-mesh connectivity without AS separation
-2. **No Network Impairments**: Missing latency, jitter, packet loss, and bandwidth constraints
-3. **Lack of Geographic Simulation**: No geographic distribution modeling
-4. **No BGP Simulation**: No autonomous system separation or routing protocol simulation
-5. **Simple Node Roles**: Only basic miner/validator roles without network diversity
-6. **No Network Partitioning**: No scenarios for testing network splits or healing
-
-### Current Strengths
-
-1. **Modular Architecture Integration**: Well-integrated with PolyTorus modular blockchain
-2. **Container Orchestration**: Good use of ContainerLab for container management
-3. **API Endpoints**: HTTP API access for monitoring and interaction
-4. **Mining Simulation**: Functional mining and transaction generation
-5. **Configuration Management**: Environment variable-based configuration
-
-## Recommended Improvements for Realistic Testnet
-
-### 1. Autonomous System (AS) Separation
-
-#### Current: Simple Full-Mesh
-```yaml
-links:
- - endpoints: ["node-0:eth1", "node-1:eth1"]
- - endpoints: ["node-0:eth2", "node-2:eth1"]
- # ... simple direct connections
-```
-
-#### Recommended: Multi-AS Architecture
-```yaml
-# AS65001 - North America (Bootstrap + Miners)
-# AS65002 - Europe (Validators + Light clients)
-# AS65003 - Asia-Pacific (Miners + Full nodes)
-# AS65004 - Edge/Mobile (Light clients)
-```
-
-### 2. Network Impairment Simulation
-
-#### Geographic Latency Matrix
-- NA ↔ EU: 80-120ms base latency
-- NA ↔ APAC: 150-200ms base latency
-- EU ↔ APAC: 200-250ms base latency
-- Intra-region: 10-50ms latency
-
-#### Bandwidth Constraints
-- Tier-1 ISPs: 1Gbps+ links
-- Regional ISPs: 100-500Mbps
-- Mobile/Edge: 10-50Mbps with higher jitter
-- Residential: 25-100Mbps with variable performance
-
-#### Packet Loss & Jitter
-- Fiber links: 0.01-0.1% loss, 1-5ms jitter
-- Wireless links: 0.1-1% loss, 5-20ms jitter
-- Congested links: 1-5% loss, 10-50ms jitter
-
-### 3. BGP-like Routing Simulation
-
-Using FRRouting (FRR) containers for realistic routing:
-
-```yaml
-routers:
- # Core Internet Routers
- internet-router-na:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.100.10
-
- internet-router-eu:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.100.11
-```
-
-### 4. Network Partitioning Scenarios
-
-#### Partition Types
-1. **Geographic Partitions**: Isolate entire regions
-2. **ISP-level Partitions**: Simulate provider outages
-3. **Partial Partitions**: Some nodes lose connectivity
-4. **Healing Scenarios**: Gradual reconnection patterns
-
-#### Implementation via Traffic Control
-```bash
-# Simulate partition between AS65001 and AS65002
-tc qdisc add dev eth0 root netem loss 100%
-
-# Simulate healing with gradual improvement
-tc qdisc change dev eth0 root netem loss 50%
-tc qdisc change dev eth0 root netem loss 10%
-tc qdisc del dev eth0 root
-```
-
-### 5. Enhanced Node Diversity
-
-#### Node Types by Geographic Region
-
-**North America (AS65001)**
-- Bootstrap node (high uptime, good connectivity)
-- Mining pools (high bandwidth, low latency)
-- Exchange nodes (financial infrastructure)
-
-**Europe (AS65002)**
-- Institutional validators (compliance-focused)
-- Academic research nodes (experimental features)
-- Regulatory monitoring nodes (compliance)
-
-**Asia-Pacific (AS65003)**
-- Mobile wallet backends (variable connectivity)
-- IoT/embedded nodes (resource constraints)
-- High-frequency trading nodes (ultra-low latency)
-
-**Edge/Mobile (AS65004)**
-- Light clients (bandwidth constraints)
-- Mobile nodes (intermittent connectivity)
-- Rural/satellite connections (high latency)
-
-### 6. Realistic Traffic Patterns
-
-#### Transaction Generation Patterns
-- **Business Hours**: Higher activity in respective timezones
-- **Cross-border Payments**: Delayed settlement patterns
-- **DeFi Activity**: Burst patterns around market events
-- **Microtransactions**: Consistent low-value flows
-
-#### Block Propagation Simulation
-- **Sequential Propagation**: Region-by-region spread
-- **Hub-and-Spoke**: Through major exchanges/pools
-- **Gossip Networks**: P2P propagation with delays
-
-## Implementation Recommendations
-
-### Phase 1: Enhanced Network Topology
-
-1. **Multi-AS Container Setup**
- - 4 autonomous systems with realistic ASN assignment
- - FRR routers for BGP route exchange
- - Geographic IP address allocation
-
-2. **Traffic Control Integration**
- - Linux TC (Traffic Control) for network impairments
- - Geographic latency matrix implementation
- - Bandwidth limiting per connection type
-
-3. **Monitoring & Observability**
- - Real-time network performance metrics
- - AS-level routing table monitoring
- - Partition detection and alerting
-
-### Phase 2: Advanced Simulation Features
-
-1. **Dynamic Network Conditions**
- - Time-based traffic pattern changes
- - Simulated network outages/maintenance
- - DDoS attack simulation and mitigation
-
-2. **Economic Network Modeling**
- - Transaction fee propagation across regions
- - Cross-border compliance delays
- - Economic incentive modeling
-
-3. **Consensus Algorithm Testing**
- - Partition tolerance testing
- - Fork resolution across AS boundaries
- - Finality guarantees under network stress
-
-### Phase 3: Production-Ready Testing
-
-1. **Chaos Engineering Integration**
- - Automated fault injection
- - Recovery pattern validation
- - SLA compliance testing
-
-2. **Performance Benchmarking**
- - TPS under realistic network conditions
- - Latency distribution analysis
- - Scalability limits identification
-
-## Recommended Tools & Technologies
-
-### Core Infrastructure
-- **ContainerLab**: Container orchestration (current)
-- **FRRouting**: BGP routing simulation
-- **Linux TC**: Network impairment injection
-- **Bird/Quagga**: Alternative routing options
-
-### Monitoring & Analysis
-- **Prometheus + Grafana**: Metrics collection
-- **Jaeger**: Distributed tracing
-- **ELK Stack**: Log aggregation and analysis
-- **Custom Dashboard**: Blockchain-specific metrics
-
-### Testing & Validation
-- **Pumba**: Chaos engineering for containers
-- **Comcast**: Network impairment testing
-- **WonderShaper**: Bandwidth limiting
-- **Mininet**: Alternative network emulation
-
-## Configuration Examples
-
-### Geographic Network Matrix
-
-```yaml
-# North America - Low latency cluster
-na_cluster:
- base_latency: 10ms
- jitter: 2ms
- bandwidth: 1Gbps
- packet_loss: 0.01%
-
-# Trans-Atlantic link
-na_to_eu:
- base_latency: 100ms
- jitter: 5ms
- bandwidth: 100Mbps
- packet_loss: 0.1%
-
-# Trans-Pacific link
-na_to_apac:
- base_latency: 180ms
- jitter: 10ms
- bandwidth: 50Mbps
- packet_loss: 0.2%
-```
-
-### Node Role Definitions
-
-```yaml
-node_roles:
- bootstrap:
- connectivity: tier1_isp
- uptime: 99.9%
- resources: high
-
- miner:
- connectivity: business_isp
- uptime: 99.5%
- resources: high
- mining_pool_connection: true
-
- validator:
- connectivity: datacenter
- uptime: 99.8%
- resources: medium
- compliance_monitoring: true
-
- light_client:
- connectivity: residential
- uptime: 95%
- resources: low
- mobile_optimization: true
-```
-
-## Expected Benefits
-
-### Testing Capabilities
-1. **Realistic Performance**: Accurate TPS and latency under real network conditions
-2. **Partition Tolerance**: Validate consensus during network splits
-3. **Geographic Distribution**: Test global deployment scenarios
-4. **Economic Modeling**: Understand fee markets across regions
-
-### Development Insights
-1. **Protocol Optimization**: Identify bottlenecks in distributed consensus
-2. **Network Layer Tuning**: Optimize P2P protocols for WAN conditions
-3. **Security Analysis**: Test attack vectors across AS boundaries
-4. **Scalability Planning**: Understand growth limitations
-
-### Production Readiness
-1. **Deployment Validation**: Test real-world deployment scenarios
-2. **Incident Response**: Practice partition recovery procedures
-3. **Performance SLA**: Establish realistic performance expectations
-4. **Monitoring Setup**: Validate production monitoring systems
-
-## Next Steps
-
-1. **Review Current Topology**: Analyze existing setup limitations
-2. **Design AS Architecture**: Define autonomous system boundaries
-3. **Implement Network Impairments**: Add latency/bandwidth controls
-4. **Create BGP Configuration**: Set up routing simulation
-5. **Develop Monitoring**: Add network performance metrics
-6. **Test Partition Scenarios**: Validate fault tolerance
-7. **Document Procedures**: Create runbook for operations
-
-This enhanced testnet will provide a much more realistic environment for validating PolyTorus performance, security, and scalability under real-world network conditions.
diff --git a/Cargo.lock b/Cargo.lock
index 8ae0b53..80c3a8f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,204 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 4
-
-[[package]]
-name = "actix-codec"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a"
-dependencies = [
- "bitflags 2.9.1",
- "bytes",
- "futures-core",
- "futures-sink",
- "memchr",
- "pin-project-lite",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "actix-cors"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "daa239b93927be1ff123eebada5a3ff23e89f0124ccb8609234e5103d5a5ae6d"
-dependencies = [
- "actix-utils",
- "actix-web",
- "derive_more",
- "futures-util",
- "log",
- "once_cell",
- "smallvec",
-]
-
-[[package]]
-name = "actix-http"
-version = "3.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44dfe5c9e0004c623edc65391dfd51daa201e7e30ebd9c9bedf873048ec32bc2"
-dependencies = [
- "actix-codec",
- "actix-rt",
- "actix-service",
- "actix-utils",
- "base64 0.22.1",
- "bitflags 2.9.1",
- "brotli",
- "bytes",
- "bytestring",
- "derive_more",
- "encoding_rs",
- "flate2",
- "foldhash",
- "futures-core",
- "h2 0.3.26",
- "http 0.2.12",
- "httparse",
- "httpdate",
- "itoa",
- "language-tags",
- "local-channel",
- "mime",
- "percent-encoding",
- "pin-project-lite",
- "rand 0.9.1",
- "sha1",
- "smallvec",
- "tokio",
- "tokio-util",
- "tracing",
- "zstd",
-]
-
-[[package]]
-name = "actix-macros"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
-dependencies = [
- "quote",
- "syn",
-]
-
-[[package]]
-name = "actix-router"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8"
-dependencies = [
- "bytestring",
- "cfg-if 1.0.1",
- "http 0.2.12",
- "regex",
- "regex-lite",
- "serde",
- "tracing",
-]
-
-[[package]]
-name = "actix-rt"
-version = "2.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208"
-dependencies = [
- "futures-core",
- "tokio",
-]
-
-[[package]]
-name = "actix-server"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a65064ea4a457eaf07f2fba30b4c695bf43b721790e9530d26cb6f9019ff7502"
-dependencies = [
- "actix-rt",
- "actix-service",
- "actix-utils",
- "futures-core",
- "futures-util",
- "mio",
- "socket2 0.5.10",
- "tokio",
- "tracing",
-]
-
-[[package]]
-name = "actix-service"
-version = "2.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e46f36bf0e5af44bdc4bdb36fbbd421aa98c79a9bce724e1edeb3894e10dc7f"
-dependencies = [
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "actix-utils"
-version = "3.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8"
-dependencies = [
- "local-waker",
- "pin-project-lite",
-]
-
-[[package]]
-name = "actix-web"
-version = "4.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea"
-dependencies = [
- "actix-codec",
- "actix-http",
- "actix-macros",
- "actix-router",
- "actix-rt",
- "actix-server",
- "actix-service",
- "actix-utils",
- "actix-web-codegen",
- "bytes",
- "bytestring",
- "cfg-if 1.0.1",
- "cookie",
- "derive_more",
- "encoding_rs",
- "foldhash",
- "futures-core",
- "futures-util",
- "impl-more",
- "itoa",
- "language-tags",
- "log",
- "mime",
- "once_cell",
- "pin-project-lite",
- "regex",
- "regex-lite",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "smallvec",
- "socket2 0.5.10",
- "time",
- "tracing",
- "url",
-]
-
-[[package]]
-name = "actix-web-codegen"
-version = "4.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8"
-dependencies = [
- "actix-router",
- "proc-macro2",
- "quote",
- "syn",
-]
+version = 3
[[package]]
name = "addr2line"
@@ -231,7 +33,7 @@ version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"cipher",
"cpufeatures",
]
@@ -250,18 +52,6 @@ dependencies = [
"subtle",
]
-[[package]]
-name = "ahash"
-version = "0.8.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
-dependencies = [
- "cfg-if 1.0.1",
- "once_cell",
- "version_check",
- "zerocopy",
-]
-
[[package]]
name = "aho-corasick"
version = "1.1.3"
@@ -271,21 +61,6 @@ dependencies = [
"memchr",
]
-[[package]]
-name = "alloc-no-stdlib"
-version = "2.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
-
-[[package]]
-name = "alloc-stdlib"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
-dependencies = [
- "alloc-no-stdlib",
-]
-
[[package]]
name = "allocator-api2"
version = "0.2.21"
@@ -307,12 +82,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "anes"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
-
[[package]]
name = "anstream"
version = "0.6.19"
@@ -382,154 +151,94 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
[[package]]
-name = "ark-bls12-381"
-version = "0.5.0"
+name = "arrayref"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5"
-dependencies = [
- "ark-ec",
- "ark-ff",
- "ark-serialize",
- "ark-std",
-]
+checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
[[package]]
-name = "ark-ec"
-version = "0.5.0"
+name = "arrayvec"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce"
-dependencies = [
- "ahash",
- "ark-ff",
- "ark-poly",
- "ark-serialize",
- "ark-std",
- "educe",
- "fnv",
- "hashbrown 0.15.4",
- "itertools 0.13.0",
- "num-bigint",
- "num-integer",
- "num-traits",
- "zeroize",
-]
+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
-name = "ark-ed-on-bls12-381"
-version = "0.5.0"
+name = "asn1-rs"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba93ca6e75e5f589c139e5a41ebd783ebf2153de0025cd2b00da2963929c92ec"
+checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0"
dependencies = [
- "ark-bls12-381",
- "ark-ec",
- "ark-ff",
- "ark-std",
+ "asn1-rs-derive 0.4.0",
+ "asn1-rs-impl 0.1.0",
+ "displaydoc",
+ "nom",
+ "num-traits",
+ "rusticata-macros",
+ "thiserror 1.0.69",
]
[[package]]
-name = "ark-ff"
-version = "0.5.0"
+name = "asn1-rs"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70"
+checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048"
dependencies = [
- "ark-ff-asm",
- "ark-ff-macros",
- "ark-serialize",
- "ark-std",
- "arrayvec",
- "digest",
- "educe",
- "itertools 0.13.0",
- "num-bigint",
+ "asn1-rs-derive 0.5.1",
+ "asn1-rs-impl 0.2.0",
+ "displaydoc",
+ "nom",
"num-traits",
- "paste",
- "zeroize",
+ "rusticata-macros",
+ "thiserror 1.0.69",
+ "time",
]
[[package]]
-name = "ark-ff-asm"
-version = "0.5.0"
+name = "asn1-rs-derive"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60"
+checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c"
dependencies = [
+ "proc-macro2",
"quote",
- "syn",
+ "syn 1.0.109",
+ "synstructure 0.12.6",
]
[[package]]
-name = "ark-ff-macros"
-version = "0.5.0"
+name = "asn1-rs-derive"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3"
+checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490"
dependencies = [
- "num-bigint",
- "num-traits",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
+ "synstructure 0.13.2",
]
[[package]]
-name = "ark-poly"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27"
-dependencies = [
- "ahash",
- "ark-ff",
- "ark-serialize",
- "ark-std",
- "educe",
- "fnv",
- "hashbrown 0.15.4",
-]
-
-[[package]]
-name = "ark-serialize"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7"
-dependencies = [
- "ark-serialize-derive",
- "ark-std",
- "arrayvec",
- "digest",
- "num-bigint",
-]
-
-[[package]]
-name = "ark-serialize-derive"
-version = "0.5.0"
+name = "asn1-rs-impl"
+version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d"
+checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 1.0.109",
]
[[package]]
-name = "ark-std"
-version = "0.5.0"
+name = "asn1-rs-impl"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a"
+checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7"
dependencies = [
- "num-traits",
- "rand 0.8.5",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.104",
]
-[[package]]
-name = "arrayref"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-
[[package]]
name = "async-trait"
version = "0.1.88"
@@ -538,16 +247,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5"
dependencies = [
"proc-macro2",
"quote",
- "syn",
-]
-
-[[package]]
-name = "atoi"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528"
-dependencies = [
- "num-traits",
+ "syn 2.0.104",
]
[[package]]
@@ -569,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
dependencies = [
"addr2line",
- "cfg-if 1.0.1",
+ "cfg-if",
"libc",
"miniz_oxide",
"object",
@@ -577,6 +277,18 @@ dependencies = [
"windows-targets 0.52.6",
]
+[[package]]
+name = "base16ct"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
+
+[[package]]
+name = "base58"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581"
+
[[package]]
name = "base64"
version = "0.21.7"
@@ -591,9 +303,15 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "base64ct"
-version = "1.8.0"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
+
+[[package]]
+name = "bech32"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba"
+checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
[[package]]
name = "bincode"
@@ -605,106 +323,48 @@ dependencies = [
]
[[package]]
-name = "bitcoin-io"
-version = "0.1.3"
+name = "bitflags"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
-name = "bitcoin_hashes"
-version = "0.7.6"
+name = "bitflags"
+version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b375d62f341cef9cd9e77793ec8f1db3fc9ce2e4d57e982c8fe697a2c16af3b6"
+checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
[[package]]
-name = "bitcoin_hashes"
-version = "0.14.0"
+name = "blake3"
+version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
+checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0"
dependencies = [
- "bitcoin-io",
- "hex-conservative",
+ "arrayref",
+ "arrayvec",
+ "cc",
+ "cfg-if",
+ "constant_time_eq",
]
[[package]]
-name = "bitcoincash-addr"
-version = "0.5.2"
+name = "block-buffer"
+version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad79afbfd27efc52fc928b198a365a7ee9da8d881a18c16d88764880b675e543"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
- "bitcoin_hashes 0.7.6",
+ "generic-array",
]
[[package]]
-name = "bitflags"
-version = "1.3.2"
+name = "block-padding"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitflags"
-version = "2.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitvec"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
-dependencies = [
- "funty",
- "radium",
- "tap",
- "wyz",
-]
-
-[[package]]
-name = "blake3"
-version = "1.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0"
-dependencies = [
- "arrayref",
- "arrayvec",
- "cc",
- "cfg-if 1.0.1",
- "constant_time_eq",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
dependencies = [
"generic-array",
]
-[[package]]
-name = "brotli"
-version = "8.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9991eea70ea4f293524138648e41ee89b0b2b12ddef3b255effa43c8056e0e0d"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
- "brotli-decompressor",
-]
-
-[[package]]
-name = "brotli-decompressor"
-version = "5.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03"
-dependencies = [
- "alloc-no-stdlib",
- "alloc-stdlib",
-]
-
[[package]]
name = "bumpalo"
version = "3.19.0"
@@ -727,40 +387,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]]
-name = "bytestring"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e465647ae23b2823b0753f50decb2d5a86d2bb2cac04788fafd1f80e45378e5f"
-dependencies = [
- "bytes",
-]
-
-[[package]]
-name = "cassowary"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
-
-[[package]]
-name = "cast"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
-
-[[package]]
-name = "castaway"
-version = "0.2.3"
+name = "cbc"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5"
+checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"
dependencies = [
- "rustversion",
+ "cipher",
]
[[package]]
name = "cc"
-version = "1.2.27"
+version = "1.2.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc"
+checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7"
dependencies = [
"jobserver",
"libc",
@@ -768,40 +407,22 @@ dependencies = [
]
[[package]]
-name = "cfg-if"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
-
-[[package]]
-name = "chacha20"
-version = "0.9.1"
+name = "ccm"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
+checksum = "9ae3c82e4355234767756212c570e29833699ab63e6ffd161887314cc5b43847"
dependencies = [
- "cfg-if 1.0.1",
+ "aead",
"cipher",
- "cpufeatures",
+ "ctr",
+ "subtle",
]
[[package]]
-name = "chacha20poly1305"
-version = "0.10.1"
+name = "cfg-if"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35"
-dependencies = [
- "aead",
- "chacha20",
- "cipher",
- "poly1305",
- "zeroize",
-]
+checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
[[package]]
name = "chrono"
@@ -818,33 +439,6 @@ dependencies = [
"windows-link",
]
-[[package]]
-name = "ciborium"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
-dependencies = [
- "ciborium-io",
- "ciborium-ll",
- "serde",
-]
-
-[[package]]
-name = "ciborium-io"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
-
-[[package]]
-name = "ciborium-ll"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
-dependencies = [
- "ciborium-io",
- "half",
-]
-
[[package]]
name = "cipher"
version = "0.4.4"
@@ -853,23 +447,22 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
dependencies = [
"crypto-common",
"inout",
- "zeroize",
]
[[package]]
name = "clap"
-version = "4.5.40"
+version = "4.5.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f"
+checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
-version = "4.5.40"
+version = "4.5.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e"
+checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
dependencies = [
"anstream",
"anstyle",
@@ -892,17 +485,6 @@ dependencies = [
"thiserror 2.0.12",
]
-[[package]]
-name = "codespan-reporting"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
-dependencies = [
- "serde",
- "termcolor",
- "unicode-width 0.2.0",
-]
-
[[package]]
name = "colorchoice"
version = "1.0.4"
@@ -910,40 +492,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
[[package]]
-name = "combine"
-version = "4.6.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd"
+name = "consensus"
+version = "0.1.0"
dependencies = [
- "bytes",
- "futures-core",
- "memchr",
- "pin-project-lite",
+ "anyhow",
+ "async-trait",
+ "chrono",
+ "hex",
+ "log",
+ "rand",
+ "serde",
+ "serde_json",
+ "sha2",
+ "sled",
"tokio",
- "tokio-util",
-]
-
-[[package]]
-name = "compact_str"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32"
-dependencies = [
- "castaway",
- "cfg-if 1.0.1",
- "itoa",
- "rustversion",
- "ryu",
- "static_assertions",
-]
-
-[[package]]
-name = "concurrent-queue"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
-dependencies = [
- "crossbeam-utils",
+ "traits",
+ "uuid",
]
[[package]]
@@ -958,27 +522,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6"
-[[package]]
-name = "cookie"
-version = "0.16.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
-dependencies = [
- "percent-encoding",
- "time",
- "version_check",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
@@ -991,7 +534,7 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
]
[[package]]
@@ -1005,36 +548,36 @@ dependencies = [
[[package]]
name = "cranelift-assembler-x64"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93cf506bed25cb8ba3ec4430f26702863aa6329750aa65a480dceae8bdb76809"
+checksum = "a5023e06632d8f351c2891793ccccfe4aef957954904392434038745fb6f1f68"
dependencies = [
"cranelift-assembler-x64-meta",
]
[[package]]
name = "cranelift-assembler-x64-meta"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b27f02eed9b27eb0385b5997c05084917d48194137c21f334735c5d76eec117a"
+checksum = "b1c4012b4c8c1f6eb05c0a0a540e3e1ee992631af51aa2bbb3e712903ce4fd65"
dependencies = [
"cranelift-srcgen",
]
[[package]]
name = "cranelift-bforest"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe6ad4b4488859c4811aa9142170d3b065bdafea7075cd4143056c046f7c72ae"
+checksum = "4d6d883b4942ef3a7104096b8bc6f2d1a41393f159ac8de12aed27b25d67f895"
dependencies = [
"cranelift-entity",
]
[[package]]
name = "cranelift-bitset"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c06cd918f49011c7ceb6f8757c8f9bd32f9045e58f71b97fbe3d63892f6cf83"
+checksum = "db7b2ee9eec6ca8a716d900d5264d678fb2c290c58c46c8da7f94ee268175d17"
dependencies = [
"serde",
"serde_derive",
@@ -1042,9 +585,9 @@ dependencies = [
[[package]]
name = "cranelift-codegen"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cdebfb6e36cb7d48f0ab297d5796b97b2b04b9b5c21a450912a211a7102da26"
+checksum = "aeda0892577afdce1ac2e9a983a55f8c5b87a59334e1f79d8f735a2d7ba4f4b4"
dependencies = [
"bumpalo",
"cranelift-assembler-x64",
@@ -1056,11 +599,11 @@ dependencies = [
"cranelift-entity",
"cranelift-isle",
"gimli",
- "hashbrown 0.15.4",
+ "hashbrown",
"log",
"pulley-interpreter",
"regalloc2",
- "rustc-hash",
+ "rustc-hash 2.1.1",
"serde",
"smallvec",
"target-lexicon",
@@ -1068,9 +611,9 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e605c5c2eb617ad757c75c4fbed1f0d2b1cd571db5f3da53f219efb394545493"
+checksum = "e461480d87f920c2787422463313326f67664e68108c14788ba1676f5edfcd15"
dependencies = [
"cranelift-assembler-x64-meta",
"cranelift-codegen-shared",
@@ -1080,24 +623,24 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "955ce5cf12c08ebaf8c4850e2121de30bc6d9ff33fb27ce4a0ffe5d7746692a4"
+checksum = "976584d09f200c6c84c4b9ff7af64fc9ad0cb64dffa5780991edd3fe143a30a1"
[[package]]
name = "cranelift-control"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46964bda6b3a6ba94727f6d0805387c1e8e5a6baf6108a52109d8e63a182e1c0"
+checksum = "46d43d70f4e17c545aa88dbf4c84d4200755d27c6e3272ebe4de65802fa6a955"
dependencies = [
"arbitrary",
]
[[package]]
name = "cranelift-entity"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3a03bd7c094dcc97617632f0cea6c6972b06f224c2b76ac27a70fae8193000e"
+checksum = "d75418674520cb400c8772bfd6e11a62736c78fc1b6e418195696841d1bf91f1"
dependencies = [
"cranelift-bitset",
"serde",
@@ -1106,9 +649,9 @@ dependencies = [
[[package]]
name = "cranelift-frontend"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac9c7067435f3a8b56934a8cd9e7c60383188cde7d6d748b54f5809d05c657db"
+checksum = "3c8b1a91c86687a344f3c52dd6dfb6e50db0dfa7f2e9c7711b060b3623e1fdeb"
dependencies = [
"cranelift-codegen",
"log",
@@ -1118,15 +661,15 @@ dependencies = [
[[package]]
name = "cranelift-isle"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12f26b56a561336d972e453d172883a82aff66a5a69d0796848c4c7cd1298555"
+checksum = "711baa4e3432d4129295b39ec2b4040cc1b558874ba0a37d08e832e857db7285"
[[package]]
name = "cranelift-native"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac25071ffd31769ac4d19ddb7d6913c4132fe5d7a28b4e0c4fc739011e18cfa9"
+checksum = "41c83e8666e3bcc5ffeaf6f01f356f0e1f9dcd69ce5511a1efd7ca5722001a3f"
dependencies = [
"cranelift-codegen",
"libc",
@@ -1135,9 +678,9 @@ dependencies = [
[[package]]
name = "cranelift-srcgen"
-version = "0.120.1"
+version = "0.120.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92276fa85f9aad4204cb27b2d753b4e7bf34443e8446d650383234bb84d4d48a"
+checksum = "02e3f4d783a55c64266d17dc67d2708852235732a100fc40dd9f1051adc64d7b"
[[package]]
name = "crc"
@@ -1156,47 +699,11 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
[[package]]
name = "crc32fast"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
-dependencies = [
- "cfg-if 1.0.1",
-]
-
-[[package]]
-name = "criterion"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f"
-dependencies = [
- "anes",
- "cast",
- "ciborium",
- "clap",
- "criterion-plot",
- "is-terminal",
- "itertools 0.10.5",
- "num-traits",
- "once_cell",
- "oorandom",
- "plotters",
- "rayon",
- "regex",
- "serde",
- "serde_derive",
- "serde_json",
- "tinytemplate",
- "walkdir",
-]
-
-[[package]]
-name = "criterion-plot"
-version = "0.5.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1"
+checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
dependencies = [
- "cast",
- "itertools 0.10.5",
+ "cfg-if",
]
[[package]]
@@ -1218,15 +725,6 @@ dependencies = [
"crossbeam-utils",
]
-[[package]]
-name = "crossbeam-queue"
-version = "0.3.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115"
-dependencies = [
- "crossbeam-utils",
-]
-
[[package]]
name = "crossbeam-utils"
version = "0.8.21"
@@ -1234,36 +732,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
-name = "crossterm"
-version = "0.28.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"
-dependencies = [
- "bitflags 2.9.1",
- "crossterm_winapi",
- "mio",
- "parking_lot 0.12.4",
- "rustix 0.38.44",
- "signal-hook",
- "signal-hook-mio",
- "winapi",
-]
-
-[[package]]
-name = "crossterm_winapi"
-version = "0.9.1"
+name = "crypto-bigint"
+version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"
+checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76"
dependencies = [
- "winapi",
+ "generic-array",
+ "rand_core",
+ "subtle",
+ "zeroize",
]
-[[package]]
-name = "crunchy"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
-
[[package]]
name = "crypto-common"
version = "0.1.6"
@@ -1271,7 +750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
- "rand_core 0.6.4",
+ "rand_core",
"typenum",
]
@@ -1285,191 +764,112 @@ dependencies = [
]
[[package]]
-name = "cxx"
-version = "1.0.158"
+name = "curve25519-dalek"
+version = "4.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a71ea7f29c73f7ffa64c50b83c9fe4d3a6d4be89a86b009eb80d5a6d3429d741"
+checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
dependencies = [
- "cc",
- "cxxbridge-cmd",
- "cxxbridge-flags",
- "cxxbridge-macro",
- "foldhash",
- "link-cplusplus",
+ "cfg-if",
+ "cpufeatures",
+ "curve25519-dalek-derive",
+ "digest",
+ "fiat-crypto",
+ "rustc_version",
+ "subtle",
+ "zeroize",
]
[[package]]
-name = "cxx-build"
-version = "1.0.158"
+name = "curve25519-dalek-derive"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36a8232661d66dcf713394726157d3cfe0a89bfc85f52d6e9f9bbc2306797fe7"
+checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
- "cc",
- "codespan-reporting",
"proc-macro2",
"quote",
- "scratch",
- "syn",
+ "syn 2.0.104",
]
[[package]]
-name = "cxxbridge-cmd"
-version = "1.0.158"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f44296c8693e9ea226a48f6a122727f77aa9e9e338380cb021accaeeb7ee279"
+name = "data-availability"
+version = "0.1.0"
dependencies = [
- "clap",
- "codespan-reporting",
- "proc-macro2",
- "quote",
- "syn",
+ "anyhow",
+ "async-trait",
+ "chrono",
+ "hex",
+ "log",
+ "serde",
+ "serde_json",
+ "sha2",
+ "sled",
+ "tokio",
+ "traits",
+ "uuid",
]
[[package]]
-name = "cxxbridge-flags"
-version = "1.0.158"
+name = "data-encoding"
+version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42f69c181c176981ae44ba9876e2ea41ce8e574c296b38d06925ce9214fb8e4"
+checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
[[package]]
-name = "cxxbridge-macro"
-version = "1.0.158"
+name = "debugid"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8faff5d4467e0709448187df29ccbf3b0982cc426ee444a193f87b11afb565a8"
+checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
dependencies = [
- "proc-macro2",
- "quote",
- "rustversion",
- "syn",
+ "uuid",
]
[[package]]
-name = "darling"
-version = "0.20.11"
+name = "der"
+version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
+checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
dependencies = [
- "darling_core",
- "darling_macro",
+ "const-oid",
+ "pem-rfc7468",
+ "zeroize",
]
[[package]]
-name = "darling_core"
-version = "0.20.11"
+name = "der-parser"
+version = "8.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
+checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e"
dependencies = [
- "fnv",
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn",
+ "asn1-rs 0.5.2",
+ "displaydoc",
+ "nom",
+ "num-traits",
+ "rusticata-macros",
]
[[package]]
-name = "darling_macro"
-version = "0.20.11"
+name = "der-parser"
+version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
+checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553"
dependencies = [
- "darling_core",
- "quote",
- "syn",
+ "asn1-rs 0.6.2",
+ "displaydoc",
+ "nom",
+ "num-bigint",
+ "num-traits",
+ "rusticata-macros",
]
[[package]]
-name = "dashmap"
-version = "6.1.0"
+name = "deranged"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
-dependencies = [
- "cfg-if 1.0.1",
- "crossbeam-utils",
- "hashbrown 0.14.5",
- "lock_api",
- "once_cell",
- "parking_lot_core 0.9.11",
-]
-
-[[package]]
-name = "debugid"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
-dependencies = [
- "uuid",
-]
-
-[[package]]
-name = "der"
-version = "0.7.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
-dependencies = [
- "const-oid",
- "pem-rfc7468",
- "zeroize",
-]
-
-[[package]]
-name = "deranged"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
+checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
dependencies = [
"powerfmt",
]
-[[package]]
-name = "derive_more"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678"
-dependencies = [
- "derive_more-impl",
-]
-
-[[package]]
-name = "derive_more-impl"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "unicode-xid",
-]
-
-[[package]]
-name = "diamond-io"
-version = "0.1.0"
-source = "git+https://github.com/MachinaIO/diamond-io#5859d7b3a1261ec99f2baff5b791764aaf14ae79"
-dependencies = [
- "bitvec",
- "dashmap",
- "digest",
- "futures",
- "itertools 0.14.0",
- "keccak-asm",
- "memory-stats",
- "num-bigint",
- "num-traits",
- "once_cell",
- "openfhe",
- "rand 0.9.1",
- "rand_distr",
- "rayon",
- "serde",
- "serde_json",
- "sysinfo",
- "tokio",
- "tracing",
- "tracing-subscriber",
- "walkdir",
-]
-
[[package]]
name = "digest"
version = "0.10.7"
@@ -1488,7 +888,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"dirs-sys-next",
]
@@ -1511,25 +911,46 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
+]
+
+[[package]]
+name = "ecdsa"
+version = "0.16.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca"
+dependencies = [
+ "der",
+ "digest",
+ "elliptic-curve",
+ "rfc6979",
+ "signature",
+ "spki",
]
[[package]]
-name = "dotenvy"
-version = "0.15.7"
+name = "ed25519"
+version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
+checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
+dependencies = [
+ "pkcs8",
+ "signature",
+]
[[package]]
-name = "educe"
-version = "0.6.0"
+name = "ed25519-dalek"
+version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417"
+checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9"
dependencies = [
- "enum-ordinalize",
- "proc-macro2",
- "quote",
- "syn",
+ "curve25519-dalek",
+ "ed25519",
+ "rand_core",
+ "serde",
+ "sha2",
+ "subtle",
+ "zeroize",
]
[[package]]
@@ -1537,8 +958,26 @@ name = "either"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
+
+[[package]]
+name = "elliptic-curve"
+version = "0.13.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47"
dependencies = [
- "serde",
+ "base16ct",
+ "crypto-bigint",
+ "digest",
+ "ff",
+ "generic-array",
+ "group",
+ "hkdf",
+ "pem-rfc7468",
+ "pkcs8",
+ "rand_core",
+ "sec1",
+ "subtle",
+ "zeroize",
]
[[package]]
@@ -1559,27 +998,7 @@ version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
dependencies = [
- "cfg-if 1.0.1",
-]
-
-[[package]]
-name = "enum-ordinalize"
-version = "4.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5"
-dependencies = [
- "enum-ordinalize-derive",
-]
-
-[[package]]
-name = "enum-ordinalize-derive"
-version = "4.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "cfg-if",
]
[[package]]
@@ -1622,25 +1041,24 @@ dependencies = [
]
[[package]]
-name = "etcetera"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943"
-dependencies = [
- "cfg-if 1.0.1",
- "home",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "event-listener"
-version = "5.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae"
+name = "execution"
+version = "0.1.0"
dependencies = [
- "concurrent-queue",
- "parking",
- "pin-project-lite",
+ "anyhow",
+ "async-trait",
+ "bincode",
+ "chrono",
+ "hex",
+ "log",
+ "serde",
+ "serde_json",
+ "sha2",
+ "sled",
+ "tokio",
+ "traits",
+ "uuid",
+ "wasmtime",
+ "wat",
]
[[package]]
@@ -1650,87 +1068,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
-[[package]]
-name = "flate2"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
-dependencies = [
- "crc32fast",
- "miniz_oxide",
-]
-
-[[package]]
-name = "flume"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095"
-dependencies = [
- "futures-core",
- "futures-sink",
- "spin",
-]
-
-[[package]]
-name = "fn-dsa"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72ff5acd83e4de3bdb8b3f75e5477e65e133c5bf91ab627c5065585754d4d64a"
-dependencies = [
- "fn-dsa-comm",
- "fn-dsa-kgen",
- "fn-dsa-sign",
- "fn-dsa-vrfy",
-]
-
-[[package]]
-name = "fn-dsa-comm"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94de00e13018efad7640c383a100e140c7693f47b24d3b17da3469dac115409c"
-dependencies = [
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "fn-dsa-kgen"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a78d3bd0de5d66f1a528ff2ecfc8e346cc2fe082c7e9803f22281e6c72bb90a2"
-dependencies = [
- "fn-dsa-comm",
- "zeroize",
-]
-
-[[package]]
-name = "fn-dsa-sign"
-version = "0.2.0"
+name = "ff"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e543a0773e8ffff6577966ce12718ce07054ff5e11c80c122c22830cff2e19f"
+checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393"
dependencies = [
- "fn-dsa-comm",
- "zeroize",
-]
-
-[[package]]
-name = "fn-dsa-vrfy"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a12118347a66fd3d8a347c269514e9988f87ca768f1ce5c40a1039d6f2eb0f1e"
-dependencies = [
- "fn-dsa-comm",
+ "rand_core",
+ "subtle",
]
[[package]]
-name = "fnv"
-version = "1.0.7"
+name = "fiat-crypto"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
[[package]]
name = "foldhash"
@@ -1738,21 +1089,6 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
[[package]]
name = "form_urlencoded"
version = "1.2.1"
@@ -1772,12 +1108,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "funty"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
-
[[package]]
name = "futures"
version = "0.3.31"
@@ -1820,17 +1150,6 @@ dependencies = [
"futures-util",
]
-[[package]]
-name = "futures-intrusive"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f"
-dependencies = [
- "futures-core",
- "lock_api",
- "parking_lot 0.12.4",
-]
-
[[package]]
name = "futures-io"
version = "0.3.31"
@@ -1845,7 +1164,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -1908,6 +1227,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
+ "zeroize",
]
[[package]]
@@ -1916,7 +1236,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"libc",
"wasi 0.11.1+wasi-snapshot-preview1",
]
@@ -1927,7 +1247,7 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"libc",
"r-efi",
"wasi 0.14.2+wasi-0.2.4",
@@ -1955,107 +1275,38 @@ dependencies = [
]
[[package]]
-name = "h2"
-version = "0.3.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
-dependencies = [
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "futures-util",
- "http 0.2.12",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "h2"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5"
-dependencies = [
- "atomic-waker",
- "bytes",
- "fnv",
- "futures-core",
- "futures-sink",
- "http 1.3.1",
- "indexmap",
- "slab",
- "tokio",
- "tokio-util",
- "tracing",
-]
-
-[[package]]
-name = "half"
-version = "2.6.0"
+name = "group"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
+checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
dependencies = [
- "cfg-if 1.0.1",
- "crunchy",
+ "ff",
+ "rand_core",
+ "subtle",
]
-[[package]]
-name = "hashbrown"
-version = "0.14.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
-
[[package]]
name = "hashbrown"
version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
dependencies = [
- "allocator-api2",
- "equivalent",
"foldhash",
"serde",
]
-[[package]]
-name = "hashlink"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
-dependencies = [
- "hashbrown 0.15.4",
-]
-
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
-[[package]]
-name = "hermit-abi"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
-
[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-[[package]]
-name = "hex-conservative"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd"
-dependencies = [
- "arrayvec",
-]
-
[[package]]
name = "hkdf"
version = "0.12.4"
@@ -2075,200 +1326,8 @@ dependencies = [
]
[[package]]
-name = "home"
-version = "0.5.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf"
-dependencies = [
- "windows-sys 0.59.0",
-]
-
-[[package]]
-name = "http"
-version = "0.2.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
-dependencies = [
- "bytes",
- "fnv",
- "itoa",
-]
-
-[[package]]
-name = "http"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
-dependencies = [
- "bytes",
- "fnv",
- "itoa",
-]
-
-[[package]]
-name = "http-body"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
-dependencies = [
- "bytes",
- "http 0.2.12",
- "pin-project-lite",
-]
-
-[[package]]
-name = "http-body"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
-dependencies = [
- "bytes",
- "http 1.3.1",
-]
-
-[[package]]
-name = "http-body-util"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
-dependencies = [
- "bytes",
- "futures-core",
- "http 1.3.1",
- "http-body 1.0.1",
- "pin-project-lite",
-]
-
-[[package]]
-name = "httparse"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
-
-[[package]]
-name = "httpdate"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
-
-[[package]]
-name = "hyper"
-version = "0.14.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2 0.3.26",
- "http 0.2.12",
- "http-body 0.4.6",
- "httparse",
- "httpdate",
- "itoa",
- "pin-project-lite",
- "socket2 0.5.10",
- "tokio",
- "tower-service",
- "tracing",
- "want",
-]
-
-[[package]]
-name = "hyper"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80"
-dependencies = [
- "bytes",
- "futures-channel",
- "futures-util",
- "h2 0.4.10",
- "http 1.3.1",
- "http-body 1.0.1",
- "httparse",
- "itoa",
- "pin-project-lite",
- "smallvec",
- "tokio",
- "want",
-]
-
-[[package]]
-name = "hyper-rustls"
-version = "0.27.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
-dependencies = [
- "http 1.3.1",
- "hyper 1.6.0",
- "hyper-util",
- "rustls",
- "rustls-pki-types",
- "tokio",
- "tokio-rustls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-tls"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
-dependencies = [
- "bytes",
- "hyper 0.14.32",
- "native-tls",
- "tokio",
- "tokio-native-tls",
-]
-
-[[package]]
-name = "hyper-tls"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
-dependencies = [
- "bytes",
- "http-body-util",
- "hyper 1.6.0",
- "hyper-util",
- "native-tls",
- "tokio",
- "tokio-native-tls",
- "tower-service",
-]
-
-[[package]]
-name = "hyper-util"
-version = "0.1.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb"
-dependencies = [
- "base64 0.22.1",
- "bytes",
- "futures-channel",
- "futures-core",
- "futures-util",
- "http 1.3.1",
- "http-body 1.0.1",
- "hyper 1.6.0",
- "ipnet",
- "libc",
- "percent-encoding",
- "pin-project-lite",
- "socket2 0.5.10",
- "system-configuration 0.6.1",
- "tokio",
- "tower-service",
- "tracing",
- "windows-registry",
-]
-
-[[package]]
-name = "iana-time-zone"
-version = "0.1.63"
+name = "iana-time-zone"
+version = "0.1.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
dependencies = [
@@ -2278,7 +1337,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
- "windows-core 0.61.2",
+ "windows-core",
]
[[package]]
@@ -2382,12 +1441,6 @@ version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005"
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
-
[[package]]
name = "idna"
version = "1.0.3"
@@ -2409,110 +1462,78 @@ dependencies = [
"icu_properties",
]
-[[package]]
-name = "impl-more"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2"
-
[[package]]
name = "indexmap"
-version = "2.9.0"
+version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
+checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
dependencies = [
"equivalent",
- "hashbrown 0.15.4",
+ "hashbrown",
"serde",
]
-[[package]]
-name = "indoc"
-version = "2.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
-
[[package]]
name = "inout"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
dependencies = [
+ "block-padding",
"generic-array",
]
-[[package]]
-name = "instability"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d"
-dependencies = [
- "darling",
- "indoc",
- "proc-macro2",
- "quote",
- "syn",
-]
-
[[package]]
name = "instant"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
]
[[package]]
-name = "ipnet"
-version = "2.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
-
-[[package]]
-name = "iri-string"
-version = "0.7.8"
+name = "interceptor"
+version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
+checksum = "4705c00485029e738bea8c9505b5ddb1486a8f3627a953e1e77e6abdf5eef90c"
dependencies = [
- "memchr",
- "serde",
+ "async-trait",
+ "bytes",
+ "log",
+ "portable-atomic",
+ "rand",
+ "rtcp",
+ "rtp",
+ "thiserror 1.0.69",
+ "tokio",
+ "waitgroup",
+ "webrtc-srtp",
+ "webrtc-util",
]
[[package]]
-name = "is-terminal"
-version = "0.4.16"
+name = "io-uring"
+version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9"
+checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
dependencies = [
- "hermit-abi",
+ "bitflags 2.9.1",
+ "cfg-if",
"libc",
- "windows-sys 0.59.0",
]
[[package]]
-name = "is_terminal_polyfill"
-version = "1.70.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
-
-[[package]]
-name = "itertools"
-version = "0.10.5"
+name = "ipnet"
+version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
-dependencies = [
- "either",
-]
+checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
[[package]]
-name = "itertools"
-version = "0.13.0"
+name = "is_terminal_polyfill"
+version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
-dependencies = [
- "either",
-]
+checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "itertools"
@@ -2570,7 +1591,7 @@ checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -2593,50 +1614,11 @@ dependencies = [
"wasm-bindgen",
]
-[[package]]
-name = "kani-verifier"
-version = "0.56.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5c62ff9aa4abb9d8dbf4df00d078fe474dce90385eeb600933c55d05d89c0bc"
-dependencies = [
- "anyhow",
- "home",
- "os_info",
-]
-
-[[package]]
-name = "keccak"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654"
-dependencies = [
- "cpufeatures",
-]
-
-[[package]]
-name = "keccak-asm"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6"
-dependencies = [
- "digest",
- "sha3-asm",
-]
-
-[[package]]
-name = "language-tags"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
-
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
-dependencies = [
- "spin",
-]
[[package]]
name = "leb128fmt"
@@ -2658,33 +1640,14 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
[[package]]
name = "libredox"
-version = "0.1.4"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638"
+checksum = "4488594b9328dee448adb906d8b126d9b7deb7cf5c22161ee591610bb1be83c0"
dependencies = [
"bitflags 2.9.1",
"libc",
]
-[[package]]
-name = "libsqlite3-sys"
-version = "0.30.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
-dependencies = [
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "link-cplusplus"
-version = "1.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212"
-dependencies = [
- "cc",
-]
-
[[package]]
name = "linux-raw-sys"
version = "0.4.15"
@@ -2703,23 +1666,6 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
-[[package]]
-name = "local-channel"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8"
-dependencies = [
- "futures-core",
- "futures-sink",
- "local-waker",
-]
-
-[[package]]
-name = "local-waker"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487"
-
[[package]]
name = "lock_api"
version = "0.4.13"
@@ -2736,15 +1682,6 @@ version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
-[[package]]
-name = "lru"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
-dependencies = [
- "hashbrown 0.15.4",
-]
-
[[package]]
name = "mach2"
version = "0.4.3"
@@ -2760,7 +1697,7 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"digest",
]
@@ -2780,29 +1717,19 @@ dependencies = [
]
[[package]]
-name = "memory-stats"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c73f5c649995a115e1a0220b35e4df0a1294500477f97a91d0660fb5abeb574a"
-dependencies = [
- "libc",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "merkle-cbt"
-version = "0.2.2"
+name = "memoffset"
+version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c95c71a8dc57c7ad9b7623cf05711bb4e3daef44f1931c91e7d49c60de693ca"
+checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
dependencies = [
- "cfg-if 0.1.10",
+ "autocfg",
]
[[package]]
-name = "mime"
-version = "0.3.17"
+name = "minimal-lexical"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
@@ -2820,35 +1747,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
dependencies = [
"libc",
- "log",
"wasi 0.11.1+wasi-snapshot-preview1",
"windows-sys 0.59.0",
]
[[package]]
-name = "native-tls"
-version = "0.2.14"
+name = "nix"
+version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
+checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
dependencies = [
+ "bitflags 1.3.2",
+ "cfg-if",
"libc",
- "log",
- "openssl",
- "openssl-probe",
- "openssl-sys",
- "schannel",
- "security-framework",
- "security-framework-sys",
- "tempfile",
+ "memoffset",
+ "pin-utils",
]
[[package]]
-name = "ntapi"
-version = "0.4.1"
+name = "nom"
+version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
- "winapi",
+ "memchr",
+ "minimal-lexical",
]
[[package]]
@@ -2869,24 +1792,6 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
- "serde",
-]
-
-[[package]]
-name = "num-bigint-dig"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151"
-dependencies = [
- "byteorder",
- "lazy_static",
- "libm",
- "num-integer",
- "num-iter",
- "num-traits",
- "rand 0.8.5",
- "smallvec",
- "zeroize",
]
[[package]]
@@ -2904,17 +1809,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "num-iter"
-version = "0.1.45"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
[[package]]
name = "num-traits"
version = "0.2.19"
@@ -2922,16 +1816,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
- "libm",
-]
-
-[[package]]
-name = "objc2-core-foundation"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166"
-dependencies = [
- "bitflags 2.9.1",
]
[[package]]
@@ -2941,11 +1825,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
dependencies = [
"crc32fast",
- "hashbrown 0.15.4",
+ "hashbrown",
"indexmap",
"memchr",
]
+[[package]]
+name = "oid-registry"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9"
+dependencies = [
+ "asn1-rs 0.6.2",
+]
+
[[package]]
name = "once_cell"
version = "1.21.3"
@@ -2958,12 +1851,6 @@ version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
-[[package]]
-name = "oorandom"
-version = "11.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
-
[[package]]
name = "opaque-debug"
version = "0.3.1"
@@ -2971,82 +1858,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
[[package]]
-name = "openfhe"
-version = "0.3.2"
-source = "git+https://github.com/MachinaIO/openfhe-rs.git?branch=exp%2Freimpl_trapdoor#17cb69e65dcaf66742673c3a2125807d102e58cd"
-dependencies = [
- "cxx",
- "cxx-build",
- "num-bigint",
- "num-traits",
-]
-
-[[package]]
-name = "openssl"
-version = "0.10.73"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
-dependencies = [
- "bitflags 2.9.1",
- "cfg-if 1.0.1",
- "foreign-types",
- "libc",
- "once_cell",
- "openssl-macros",
- "openssl-sys",
-]
-
-[[package]]
-name = "openssl-macros"
+name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "openssl-probe"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
+checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
-name = "openssl-sys"
-version = "0.9.109"
+name = "p256"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
+checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b"
dependencies = [
- "cc",
- "libc",
- "pkg-config",
- "vcpkg",
+ "ecdsa",
+ "elliptic-curve",
+ "primeorder",
+ "sha2",
]
[[package]]
-name = "os_info"
-version = "3.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0e1ac5fde8d43c34139135df8ea9ee9465394b2d8d20f032d38998f64afffc3"
+name = "p2p-network"
+version = "0.1.0"
dependencies = [
+ "anyhow",
+ "async-trait",
+ "bincode",
+ "bytes",
+ "chrono",
+ "env_logger",
+ "futures",
"log",
- "plist",
- "windows-sys 0.52.0",
+ "rand",
+ "serde",
+ "serde_bytes",
+ "serde_json",
+ "tokio",
+ "tracing",
+ "tracing-subscriber",
+ "traits",
+ "uuid",
+ "webrtc",
]
[[package]]
-name = "overload"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
-
-[[package]]
-name = "parking"
-version = "2.2.1"
+name = "p384"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
+checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6"
+dependencies = [
+ "ecdsa",
+ "elliptic-curve",
+ "primeorder",
+ "sha2",
+]
[[package]]
name = "parking_lot"
@@ -3075,7 +1938,7 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"instant",
"libc",
"redox_syscall 0.2.16",
@@ -3089,53 +1952,56 @@ version = "0.9.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"libc",
- "redox_syscall 0.5.13",
+ "redox_syscall 0.5.15",
"smallvec",
"windows-targets 0.52.6",
]
[[package]]
-name = "paste"
-version = "1.0.15"
+name = "pbkdf2"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
+checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
+dependencies = [
+ "digest",
+]
[[package]]
-name = "pem-rfc7468"
-version = "0.7.0"
+name = "pbkdf2"
+version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
+checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
dependencies = [
- "base64ct",
+ "digest",
+ "hmac",
]
[[package]]
-name = "percent-encoding"
-version = "2.3.1"
+name = "pem"
+version = "3.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
+checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3"
+dependencies = [
+ "base64 0.22.1",
+ "serde",
+]
[[package]]
-name = "pin-project"
-version = "1.1.10"
+name = "pem-rfc7468"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
+checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
dependencies = [
- "pin-project-internal",
+ "base64ct",
]
[[package]]
-name = "pin-project-internal"
-version = "1.1.10"
+name = "percent-encoding"
+version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
+checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pin-project-lite"
@@ -3149,17 +2015,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "pkcs1"
-version = "0.7.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
-dependencies = [
- "der",
- "pkcs8",
- "spki",
-]
-
[[package]]
name = "pkcs8"
version = "0.10.2"
@@ -3176,127 +2031,28 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
-[[package]]
-name = "plist"
-version = "1.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d77244ce2d584cd84f6a15f86195b8c9b2a0dfbfd817c09e0464244091a58ed"
-dependencies = [
- "base64 0.22.1",
- "indexmap",
- "quick-xml",
- "serde",
- "time",
-]
-
-[[package]]
-name = "plotters"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747"
-dependencies = [
- "num-traits",
- "plotters-backend",
- "plotters-svg",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "plotters-backend"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a"
-
-[[package]]
-name = "plotters-svg"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670"
-dependencies = [
- "plotters-backend",
-]
-
-[[package]]
-name = "poly1305"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf"
-dependencies = [
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
[[package]]
name = "polytorus"
version = "0.1.0"
dependencies = [
- "actix-cors",
- "actix-web",
- "aes-gcm",
"anyhow",
- "ark-ec",
- "ark-ed-on-bls12-381",
- "ark-ff",
- "ark-serialize",
- "ark-std",
"async-trait",
- "bincode",
- "bitcoincash-addr",
- "bitvec",
- "blake3",
- "chacha20poly1305",
+ "base64ct",
"chrono",
"clap",
- "criterion",
- "crossterm",
- "dashmap",
- "diamond-io",
- "digest",
+ "consensus",
+ "data-availability",
"env_logger",
- "fn-dsa",
- "futures",
- "hex",
- "itertools 0.14.0",
- "kani-verifier",
- "keccak-asm",
- "libc",
+ "execution",
"log",
- "memory-stats",
- "merkle-cbt",
- "num-bigint",
- "num-traits",
- "once_cell",
- "openfhe",
- "rand 0.8.5",
- "rand_chacha 0.3.1",
- "rand_core 0.6.4",
- "rand_distr",
- "ratatui",
- "rayon",
- "redis",
- "reqwest 0.11.27",
- "reqwest 0.12.20",
- "ring",
- "ripemd",
- "secp256k1",
+ "p2p-network",
"serde",
"serde_json",
- "sha2",
- "sled",
- "sqlx",
- "tempfile",
- "tiny-keccak",
+ "settlement",
"tokio",
- "toml",
- "tracing",
- "tracing-subscriber",
+ "traits",
"uuid",
- "walkdir",
- "wasmtime",
- "wat",
- "winterfell",
+ "wallet",
]
[[package]]
@@ -3305,7 +2061,7 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"cpufeatures",
"opaque-debug",
"universal-hash",
@@ -3328,9 +2084,9 @@ dependencies = [
[[package]]
name = "postcard"
-version = "1.1.2"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c1de96e20f51df24ca73cafcc4690e044854d803259db27a00a461cb3b9d17a"
+checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
dependencies = [
"cobs",
"embedded-io 0.4.0",
@@ -3362,6 +2118,15 @@ dependencies = [
"zerocopy",
]
+[[package]]
+name = "primeorder"
+version = "0.13.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6"
+dependencies = [
+ "elliptic-curve",
+]
+
[[package]]
name = "proc-macro2"
version = "1.0.95"
@@ -3382,24 +2147,15 @@ dependencies = [
[[package]]
name = "pulley-interpreter"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0531b1a4dd06959c59da0af3693d703f3ce3c7b8790a342eebd461a4c5aee94b"
+checksum = "986beaef947a51d17b42b0ea18ceaa88450d35b6994737065ed505c39172db71"
dependencies = [
"cranelift-bitset",
"log",
"wasmtime-math",
]
-[[package]]
-name = "quick-xml"
-version = "0.37.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb"
-dependencies = [
- "memchr",
-]
-
[[package]]
name = "quote"
version = "1.0.40"
@@ -3415,12 +2171,6 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-[[package]]
-name = "radium"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-
[[package]]
name = "rand"
version = "0.8.5"
@@ -3428,18 +2178,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
- "rand_chacha 0.3.1",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
-dependencies = [
- "rand_chacha 0.9.0",
- "rand_core 0.9.3",
+ "rand_chacha",
+ "rand_core",
]
[[package]]
@@ -3449,17 +2189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.9.3",
+ "rand_core",
]
[[package]]
@@ -3471,46 +2201,6 @@ dependencies = [
"getrandom 0.2.16",
]
-[[package]]
-name = "rand_core"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
-dependencies = [
- "getrandom 0.3.3",
-]
-
-[[package]]
-name = "rand_distr"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463"
-dependencies = [
- "num-traits",
- "rand 0.9.1",
-]
-
-[[package]]
-name = "ratatui"
-version = "0.29.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
-dependencies = [
- "bitflags 2.9.1",
- "cassowary",
- "compact_str",
- "crossterm",
- "indoc",
- "instability",
- "itertools 0.13.0",
- "lru",
- "paste",
- "strum",
- "unicode-segmentation",
- "unicode-truncate",
- "unicode-width 0.2.0",
-]
-
[[package]]
name = "rayon"
version = "1.10.0"
@@ -3532,27 +2222,17 @@ dependencies = [
]
[[package]]
-name = "redis"
-version = "0.24.0"
+name = "rcgen"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd"
+checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2"
dependencies = [
- "arc-swap",
- "async-trait",
- "bytes",
- "combine",
- "futures",
- "futures-util",
- "itoa",
- "percent-encoding",
- "pin-project-lite",
- "ryu",
- "sha1_smol",
- "socket2 0.4.10",
- "tokio",
- "tokio-retry",
- "tokio-util",
- "url",
+ "pem",
+ "ring",
+ "rustls-pki-types",
+ "time",
+ "x509-parser",
+ "yasna",
]
[[package]]
@@ -3566,9 +2246,9 @@ dependencies = [
[[package]]
name = "redox_syscall"
-version = "0.5.13"
+version = "0.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6"
+checksum = "7e8af0dde094006011e6a740d4879319439489813bd0bcdc7d821beaeeff48ec"
dependencies = [
"bitflags 2.9.1",
]
@@ -3592,9 +2272,9 @@ checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734"
dependencies = [
"allocator-api2",
"bumpalo",
- "hashbrown 0.15.4",
+ "hashbrown",
"log",
- "rustc-hash",
+ "rustc-hash 2.1.1",
"smallvec",
]
@@ -3621,12 +2301,6 @@ dependencies = [
"regex-syntax",
]
-[[package]]
-name = "regex-lite"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
-
[[package]]
name = "regex-syntax"
version = "0.8.5"
@@ -3634,85 +2308,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
-name = "reqwest"
-version = "0.11.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
-dependencies = [
- "base64 0.21.7",
- "bytes",
- "encoding_rs",
- "futures-core",
- "futures-util",
- "h2 0.3.26",
- "http 0.2.12",
- "http-body 0.4.6",
- "hyper 0.14.32",
- "hyper-tls 0.5.0",
- "ipnet",
- "js-sys",
- "log",
- "mime",
- "native-tls",
- "once_cell",
- "percent-encoding",
- "pin-project-lite",
- "rustls-pemfile",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper 0.1.2",
- "system-configuration 0.5.1",
- "tokio",
- "tokio-native-tls",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "winreg",
-]
-
-[[package]]
-name = "reqwest"
-version = "0.12.20"
+name = "rfc6979"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813"
+checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
dependencies = [
- "base64 0.22.1",
- "bytes",
- "encoding_rs",
- "futures-channel",
- "futures-core",
- "futures-util",
- "h2 0.4.10",
- "http 1.3.1",
- "http-body 1.0.1",
- "http-body-util",
- "hyper 1.6.0",
- "hyper-rustls",
- "hyper-tls 0.6.0",
- "hyper-util",
- "js-sys",
- "log",
- "mime",
- "native-tls",
- "percent-encoding",
- "pin-project-lite",
- "rustls-pki-types",
- "serde",
- "serde_json",
- "serde_urlencoded",
- "sync_wrapper 1.0.2",
- "tokio",
- "tokio-native-tls",
- "tower",
- "tower-http",
- "tower-service",
- "url",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
+ "hmac",
+ "subtle",
]
[[package]]
@@ -3722,7 +2324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
dependencies = [
"cc",
- "cfg-if 1.0.1",
+ "cfg-if",
"getrandom 0.2.16",
"libc",
"untrusted",
@@ -3739,23 +2341,28 @@ dependencies = [
]
[[package]]
-name = "rsa"
-version = "0.9.8"
+name = "rtcp"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b"
+checksum = "fc9f775ff89c5fe7f0cc0abafb7c57688ae25ce688f1a52dd88e277616c76ab2"
dependencies = [
- "const-oid",
- "digest",
- "num-bigint-dig",
- "num-integer",
- "num-traits",
- "pkcs1",
- "pkcs8",
- "rand_core 0.6.4",
- "signature",
- "spki",
- "subtle",
- "zeroize",
+ "bytes",
+ "thiserror 1.0.69",
+ "webrtc-util",
+]
+
+[[package]]
+name = "rtp"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6870f09b5db96f8b9e7290324673259fd15519ebb7d55acf8e7eb044a9ead6af"
+dependencies = [
+ "bytes",
+ "portable-atomic",
+ "rand",
+ "serde",
+ "thiserror 1.0.69",
+ "webrtc-util",
]
[[package]]
@@ -3764,12 +2371,36 @@ version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
+[[package]]
+name = "rustc-hash"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+
[[package]]
name = "rustc-hash"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
+[[package]]
+name = "rustc_version"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "rusticata-macros"
+version = "4.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
+dependencies = [
+ "nom",
+]
+
[[package]]
name = "rustix"
version = "0.38.44"
@@ -3785,22 +2416,22 @@ dependencies = [
[[package]]
name = "rustix"
-version = "1.0.7"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
+checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
dependencies = [
"bitflags 2.9.1",
"errno",
"libc",
"linux-raw-sys 0.9.4",
- "windows-sys 0.59.0",
+ "windows-sys 0.60.2",
]
[[package]]
name = "rustls"
-version = "0.23.28"
+version = "0.23.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643"
+checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1"
dependencies = [
"once_cell",
"ring",
@@ -3810,15 +2441,6 @@ dependencies = [
"zeroize",
]
-[[package]]
-name = "rustls-pemfile"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
-dependencies = [
- "base64 0.21.7",
-]
-
[[package]]
name = "rustls-pki-types"
version = "1.12.0"
@@ -3830,9 +2452,9 @@ dependencies = [
[[package]]
name = "rustls-webpki"
-version = "0.103.3"
+version = "0.103.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435"
+checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
dependencies = [
"ring",
"rustls-pki-types",
@@ -3851,24 +2473,6 @@ version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "schannel"
-version = "0.1.27"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d"
-dependencies = [
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "scopeguard"
version = "1.2.0"
@@ -3876,52 +2480,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
-name = "scratch"
-version = "1.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52"
-
-[[package]]
-name = "secp256k1"
-version = "0.30.0"
+name = "sdp"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252"
+checksum = "13254db766b17451aced321e7397ebf0a446ef0c8d2942b6e67a95815421093f"
dependencies = [
- "bitcoin_hashes 0.14.0",
- "rand 0.8.5",
- "secp256k1-sys",
+ "rand",
+ "substring",
+ "thiserror 1.0.69",
+ "url",
]
[[package]]
-name = "secp256k1-sys"
-version = "0.10.1"
+name = "sec1"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9"
+checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
dependencies = [
- "cc",
+ "base16ct",
+ "der",
+ "generic-array",
+ "pkcs8",
+ "subtle",
+ "zeroize",
]
[[package]]
-name = "security-framework"
-version = "2.11.1"
+name = "secp256k1"
+version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10"
dependencies = [
- "bitflags 2.9.1",
- "core-foundation",
- "core-foundation-sys",
- "libc",
- "security-framework-sys",
+ "rand",
+ "secp256k1-sys",
]
[[package]]
-name = "security-framework-sys"
-version = "2.14.0"
+name = "secp256k1-sys"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32"
+checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb"
dependencies = [
- "core-foundation-sys",
- "libc",
+ "cc",
]
[[package]]
@@ -3942,6 +2542,15 @@ dependencies = [
"serde_derive",
]
+[[package]]
+name = "serde_bytes"
+version = "0.11.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "serde_derive"
version = "1.0.219"
@@ -3950,14 +2559,14 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
name = "serde_json"
-version = "1.0.140"
+version = "1.0.141"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
+checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
dependencies = [
"itoa",
"memchr",
@@ -3975,15 +2584,21 @@ dependencies = [
]
[[package]]
-name = "serde_urlencoded"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+name = "settlement"
+version = "0.1.0"
dependencies = [
- "form_urlencoded",
- "itoa",
- "ryu",
+ "anyhow",
+ "async-trait",
+ "chrono",
+ "hex",
+ "log",
"serde",
+ "serde_json",
+ "sha2",
+ "sled",
+ "tokio",
+ "traits",
+ "uuid",
]
[[package]]
@@ -3992,48 +2607,22 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"cpufeatures",
"digest",
]
-[[package]]
-name = "sha1_smol"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d"
-
[[package]]
name = "sha2"
version = "0.10.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"cpufeatures",
"digest",
]
-[[package]]
-name = "sha3"
-version = "0.10.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60"
-dependencies = [
- "digest",
- "keccak",
-]
-
-[[package]]
-name = "sha3-asm"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46"
-dependencies = [
- "cc",
- "cfg-if 1.0.1",
-]
-
[[package]]
name = "sharded-slab"
version = "0.1.7"
@@ -4049,27 +2638,6 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
-[[package]]
-name = "signal-hook"
-version = "0.3.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
-dependencies = [
- "libc",
- "signal-hook-registry",
-]
-
-[[package]]
-name = "signal-hook-mio"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
-dependencies = [
- "libc",
- "mio",
- "signal-hook",
-]
-
[[package]]
name = "signal-hook-registry"
version = "1.4.5"
@@ -4086,7 +2654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
dependencies = [
"digest",
- "rand_core 0.6.4",
+ "rand_core",
]
[[package]]
@@ -4121,13 +2689,12 @@ dependencies = [
]
[[package]]
-name = "socket2"
-version = "0.4.10"
+name = "smol_str"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
+checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead"
dependencies = [
- "libc",
- "winapi",
+ "serde",
]
[[package]]
@@ -4140,15 +2707,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "spin"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
-dependencies = [
- "lock_api",
-]
-
[[package]]
name = "spki"
version = "0.7.3"
@@ -4165,227 +2723,12 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a"
-[[package]]
-name = "sqlx"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc"
-dependencies = [
- "sqlx-core",
- "sqlx-macros",
- "sqlx-mysql",
- "sqlx-postgres",
- "sqlx-sqlite",
-]
-
-[[package]]
-name = "sqlx-core"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6"
-dependencies = [
- "base64 0.22.1",
- "bytes",
- "chrono",
- "crc",
- "crossbeam-queue",
- "either",
- "event-listener",
- "futures-core",
- "futures-intrusive",
- "futures-io",
- "futures-util",
- "hashbrown 0.15.4",
- "hashlink",
- "indexmap",
- "log",
- "memchr",
- "once_cell",
- "percent-encoding",
- "rustls",
- "serde",
- "serde_json",
- "sha2",
- "smallvec",
- "thiserror 2.0.12",
- "tokio",
- "tokio-stream",
- "tracing",
- "url",
- "uuid",
- "webpki-roots 0.26.11",
-]
-
-[[package]]
-name = "sqlx-macros"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d"
-dependencies = [
- "proc-macro2",
- "quote",
- "sqlx-core",
- "sqlx-macros-core",
- "syn",
-]
-
-[[package]]
-name = "sqlx-macros-core"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b"
-dependencies = [
- "dotenvy",
- "either",
- "heck",
- "hex",
- "once_cell",
- "proc-macro2",
- "quote",
- "serde",
- "serde_json",
- "sha2",
- "sqlx-core",
- "sqlx-mysql",
- "sqlx-postgres",
- "sqlx-sqlite",
- "syn",
- "tokio",
- "url",
-]
-
-[[package]]
-name = "sqlx-mysql"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526"
-dependencies = [
- "atoi",
- "base64 0.22.1",
- "bitflags 2.9.1",
- "byteorder",
- "bytes",
- "chrono",
- "crc",
- "digest",
- "dotenvy",
- "either",
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-util",
- "generic-array",
- "hex",
- "hkdf",
- "hmac",
- "itoa",
- "log",
- "md-5",
- "memchr",
- "once_cell",
- "percent-encoding",
- "rand 0.8.5",
- "rsa",
- "serde",
- "sha1",
- "sha2",
- "smallvec",
- "sqlx-core",
- "stringprep",
- "thiserror 2.0.12",
- "tracing",
- "uuid",
- "whoami",
-]
-
-[[package]]
-name = "sqlx-postgres"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46"
-dependencies = [
- "atoi",
- "base64 0.22.1",
- "bitflags 2.9.1",
- "byteorder",
- "chrono",
- "crc",
- "dotenvy",
- "etcetera",
- "futures-channel",
- "futures-core",
- "futures-util",
- "hex",
- "hkdf",
- "hmac",
- "home",
- "itoa",
- "log",
- "md-5",
- "memchr",
- "once_cell",
- "rand 0.8.5",
- "serde",
- "serde_json",
- "sha2",
- "smallvec",
- "sqlx-core",
- "stringprep",
- "thiserror 2.0.12",
- "tracing",
- "uuid",
- "whoami",
-]
-
-[[package]]
-name = "sqlx-sqlite"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea"
-dependencies = [
- "atoi",
- "chrono",
- "flume",
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-intrusive",
- "futures-util",
- "libsqlite3-sys",
- "log",
- "percent-encoding",
- "serde",
- "serde_urlencoded",
- "sqlx-core",
- "thiserror 2.0.12",
- "tracing",
- "url",
- "uuid",
-]
-
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "stringprep"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1"
-dependencies = [
- "unicode-bidi",
- "unicode-normalization",
- "unicode-properties",
-]
-
[[package]]
name = "strsim"
version = "0.11.1"
@@ -4393,25 +2736,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
-name = "strum"
-version = "0.26.3"
+name = "stun"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
+checksum = "28fad383a1cc63ae141e84e48eaef44a1063e9d9e55bcb8f51a99b886486e01b"
dependencies = [
- "strum_macros",
+ "base64 0.21.7",
+ "crc",
+ "lazy_static",
+ "md-5",
+ "rand",
+ "ring",
+ "subtle",
+ "thiserror 1.0.69",
+ "tokio",
+ "url",
+ "webrtc-util",
]
[[package]]
-name = "strum_macros"
-version = "0.26.4"
+name = "substring"
+version = "1.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
+checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86"
dependencies = [
- "heck",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn",
+ "autocfg",
]
[[package]]
@@ -4422,101 +2771,48 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "syn"
-version = "2.0.104"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "sync_wrapper"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
-
-[[package]]
-name = "sync_wrapper"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
-dependencies = [
- "futures-core",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "sysinfo"
-version = "0.34.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4b93974b3d3aeaa036504b8eefd4c039dced109171c1ae973f1dc63b2c7e4b2"
-dependencies = [
- "libc",
- "memchr",
- "ntapi",
- "objc2-core-foundation",
- "windows",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
-dependencies = [
- "bitflags 1.3.2",
- "core-foundation",
- "system-configuration-sys 0.5.0",
-]
-
-[[package]]
-name = "system-configuration"
-version = "0.6.1"
+version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
- "bitflags 2.9.1",
- "core-foundation",
- "system-configuration-sys 0.6.0",
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
]
[[package]]
-name = "system-configuration-sys"
-version = "0.5.0"
+name = "syn"
+version = "2.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
+checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
dependencies = [
- "core-foundation-sys",
- "libc",
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
]
[[package]]
-name = "system-configuration-sys"
-version = "0.6.0"
+name = "synstructure"
+version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
+checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
- "core-foundation-sys",
- "libc",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+ "unicode-xid",
]
[[package]]
-name = "tap"
-version = "1.0.1"
+name = "synstructure"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
+checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.104",
+]
[[package]]
name = "target-lexicon"
@@ -4524,19 +2820,6 @@ version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
-[[package]]
-name = "tempfile"
-version = "3.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
-dependencies = [
- "fastrand",
- "getrandom 0.3.3",
- "once_cell",
- "rustix 1.0.7",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "termcolor"
version = "1.4.1"
@@ -4572,7 +2855,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -4583,7 +2866,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -4592,7 +2875,7 @@ version = "1.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
]
[[package]]
@@ -4627,12 +2910,22 @@ dependencies = [
]
[[package]]
-name = "tiny-keccak"
-version = "2.0.2"
+name = "tiny-bip39"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
+checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861"
dependencies = [
- "crunchy",
+ "anyhow",
+ "hmac",
+ "once_cell",
+ "pbkdf2 0.11.0",
+ "rand",
+ "rustc-hash 1.1.0",
+ "sha2",
+ "thiserror 1.0.69",
+ "unicode-normalization",
+ "wasm-bindgen",
+ "zeroize",
]
[[package]]
@@ -4645,16 +2938,6 @@ dependencies = [
"zerovec",
]
-[[package]]
-name = "tinytemplate"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
-dependencies = [
- "serde",
- "serde_json",
-]
-
[[package]]
name = "tinyvec"
version = "1.9.0"
@@ -4672,18 +2955,20 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.45.1"
+version = "1.46.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
+checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
dependencies = [
"backtrace",
"bytes",
+ "io-uring",
"libc",
"mio",
"parking_lot 0.12.4",
"pin-project-lite",
"signal-hook-registry",
- "socket2 0.5.10",
+ "slab",
+ "socket2",
"tokio-macros",
"windows-sys 0.52.0",
]
@@ -4696,49 +2981,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
- "syn",
-]
-
-[[package]]
-name = "tokio-native-tls"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
-dependencies = [
- "native-tls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-retry"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f"
-dependencies = [
- "pin-project",
- "rand 0.8.5",
- "tokio",
-]
-
-[[package]]
-name = "tokio-rustls"
-version = "0.26.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b"
-dependencies = [
- "rustls",
- "tokio",
-]
-
-[[package]]
-name = "tokio-stream"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047"
-dependencies = [
- "futures-core",
- "pin-project-lite",
- "tokio",
+ "syn 2.0.104",
]
[[package]]
@@ -4795,58 +3038,12 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
-[[package]]
-name = "tower"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
-dependencies = [
- "futures-core",
- "futures-util",
- "pin-project-lite",
- "sync_wrapper 1.0.2",
- "tokio",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-http"
-version = "0.6.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
-dependencies = [
- "bitflags 2.9.1",
- "bytes",
- "futures-util",
- "http 1.3.1",
- "http-body 1.0.1",
- "iri-string",
- "pin-project-lite",
- "tower",
- "tower-layer",
- "tower-service",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
-
-[[package]]
-name = "tower-service"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
-
[[package]]
name = "tracing"
version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [
- "log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@@ -4860,7 +3057,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -4906,14 +3103,42 @@ checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
-name = "try-lock"
-version = "0.2.5"
+name = "traits"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "async-trait",
+ "chrono",
+ "hex",
+ "serde",
+ "serde_json",
+ "sha2",
+]
+
+[[package]]
+name = "turn"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+checksum = "8b000cebd930420ac1ed842c8128e3b3412512dfd5b82657eab035a3f5126acc"
+dependencies = [
+ "async-trait",
+ "base64 0.21.7",
+ "futures",
+ "log",
+ "md-5",
+ "portable-atomic",
+ "rand",
+ "ring",
+ "stun",
+ "thiserror 1.0.69",
+ "tokio",
+ "tokio-util",
+ "webrtc-util",
+]
[[package]]
name = "typenum"
@@ -4921,12 +3146,6 @@ version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
-[[package]]
-name = "unicode-bidi"
-version = "0.3.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
-
[[package]]
name = "unicode-ident"
version = "1.0.18"
@@ -4942,40 +3161,11 @@ dependencies = [
"tinyvec",
]
-[[package]]
-name = "unicode-properties"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0"
-
-[[package]]
-name = "unicode-segmentation"
-version = "1.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
-
-[[package]]
-name = "unicode-truncate"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf"
-dependencies = [
- "itertools 0.13.0",
- "unicode-segmentation",
- "unicode-width 0.1.14",
-]
-
-[[package]]
-name = "unicode-width"
-version = "0.1.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
-
[[package]]
name = "unicode-width"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
+checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c"
[[package]]
name = "unicode-xid"
@@ -5040,12 +3230,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
-[[package]]
-name = "vcpkg"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
-
[[package]]
name = "version_check"
version = "0.9.5"
@@ -5053,22 +3237,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
-name = "walkdir"
-version = "2.5.0"
+name = "waitgroup"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
+checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292"
dependencies = [
- "same-file",
- "winapi-util",
+ "atomic-waker",
]
[[package]]
-name = "want"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
+name = "wallet"
+version = "0.1.0"
+source = "git+https://github.com/PolyTorus/wallet.git#a6642df7b46fe10ce2d8397760fe6966da16f14c"
dependencies = [
- "try-lock",
+ "anyhow",
+ "base58",
+ "bech32",
+ "blake3",
+ "ed25519-dalek",
+ "hex",
+ "hkdf",
+ "pbkdf2 0.12.2",
+ "rand",
+ "rand_core",
+ "ripemd",
+ "secp256k1",
+ "serde",
+ "serde_json",
+ "sha2",
+ "thiserror 1.0.69",
+ "tiny-bip39",
+ "zeroize",
]
[[package]]
@@ -5086,19 +3285,13 @@ dependencies = [
"wit-bindgen-rt",
]
-[[package]]
-name = "wasite"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
-
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
@@ -5114,23 +3307,10 @@ dependencies = [
"log",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
"wasm-bindgen-shared",
]
-[[package]]
-name = "wasm-bindgen-futures"
-version = "0.4.50"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
-dependencies = [
- "cfg-if 1.0.1",
- "js-sys",
- "once_cell",
- "wasm-bindgen",
- "web-sys",
-]
-
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
@@ -5149,7 +3329,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -5190,7 +3370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cc3b1f053f5d41aa55640a1fa9b6d1b8a9e4418d118ce308d20e24ff3575a8c"
dependencies = [
"bitflags 2.9.1",
- "hashbrown 0.15.4",
+ "hashbrown",
"indexmap",
"semver",
"serde",
@@ -5220,9 +3400,9 @@ dependencies = [
[[package]]
name = "wasmtime"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5e50911df1941fa31da04a392ec49416974c687b9fb2980c1e87211b8433021"
+checksum = "57373e1d8699662fb791270ac5dfac9da5c14f618ecf940cdb29dc3ad9472a3c"
dependencies = [
"addr2line",
"anyhow",
@@ -5230,11 +3410,11 @@ dependencies = [
"bitflags 2.9.1",
"bumpalo",
"cc",
- "cfg-if 1.0.1",
+ "cfg-if",
"encoding_rs",
"fxprof-processed-profile",
"gimli",
- "hashbrown 0.15.4",
+ "hashbrown",
"indexmap",
"ittapi",
"libc",
@@ -5247,7 +3427,7 @@ dependencies = [
"psm",
"pulley-interpreter",
"rayon",
- "rustix 1.0.7",
+ "rustix 1.0.8",
"semver",
"serde",
"serde_derive",
@@ -5277,25 +3457,25 @@ dependencies = [
[[package]]
name = "wasmtime-asm-macros"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57bcb6b3819239cc787f016592029c8a582b3832a715cd8c0102dfc8c7d37db0"
+checksum = "bd0fc91372865167a695dc98d0d6771799a388a7541d3f34e939d0539d6583de"
dependencies = [
- "cfg-if 1.0.1",
+ "cfg-if",
]
[[package]]
name = "wasmtime-cache"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a3ac25c71ee170577b6861db875faaad04318221a4902682dd6bc02824a82d0"
+checksum = "e8c90a5ce3e570f1d2bfd037d0b57d06460ee980eab6ffe138bcb734bb72b312"
dependencies = [
"anyhow",
"base64 0.22.1",
"directories-next",
"log",
"postcard",
- "rustix 1.0.7",
+ "rustix 1.0.8",
"serde",
"serde_derive",
"sha2",
@@ -5306,14 +3486,14 @@ dependencies = [
[[package]]
name = "wasmtime-component-macro"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "627d9c3925d48f61696d290bd01d8794bdf4d738249d83bf0fce913f6f3a8913"
+checksum = "25c9c7526675ff9a9794b115023c4af5128e3eb21389bfc3dc1fd344d549258f"
dependencies = [
"anyhow",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
"wasmtime-component-util",
"wasmtime-wit-bindgen",
"wit-parser",
@@ -5321,25 +3501,25 @@ dependencies = [
[[package]]
name = "wasmtime-component-util"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eeadb4103d781d0aa0c570f8ca15e40789570585d7c2df54f9256449fc012ecf"
+checksum = "cc42ec8b078875804908d797cb4950fec781d9add9684c9026487fd8eb3f6291"
[[package]]
name = "wasmtime-cranelift"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54f624c33f66448112a0626737513289487429822d88fa23c231caad29cba894"
+checksum = "b2bd72f0a6a0ffcc6a184ec86ac35c174e48ea0e97bbae277c8f15f8bf77a566"
dependencies = [
"anyhow",
- "cfg-if 1.0.1",
+ "cfg-if",
"cranelift-codegen",
"cranelift-control",
"cranelift-entity",
"cranelift-frontend",
"cranelift-native",
"gimli",
- "itertools 0.14.0",
+ "itertools",
"log",
"object",
"pulley-interpreter",
@@ -5353,9 +3533,9 @@ dependencies = [
[[package]]
name = "wasmtime-environ"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3790ef1e43ace4edbccd8a3294d5e02d977d5eeb7653b1f4511cd8c8de599bc7"
+checksum = "e6187bb108a23eb25d2a92aa65d6c89fb5ed53433a319038a2558567f3011ff2"
dependencies = [
"anyhow",
"cpp_demangle",
@@ -5380,14 +3560,14 @@ dependencies = [
[[package]]
name = "wasmtime-fiber"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1dce39398fda00507556dae8d69b3270f37b1637f34dbb5dd63b59b69ab8d89f"
+checksum = "dc8965d2128c012329f390e24b8b2758dd93d01bf67e1a1a0dd3d8fd72f56873"
dependencies = [
"anyhow",
"cc",
- "cfg-if 1.0.1",
- "rustix 1.0.7",
+ "cfg-if",
+ "rustix 1.0.8",
"wasmtime-asm-macros",
"wasmtime-versioned-export-macros",
"windows-sys 0.59.0",
@@ -5395,59 +3575,59 @@ dependencies = [
[[package]]
name = "wasmtime-jit-debug"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb5cc977e5495e4ea2388e17a92d249e0b50fbcaf41ed3fbafba0fc781db57f3"
+checksum = "a5882706a348c266b96dd81f560c1f993c790cf3a019857a9cde5f634191cfbb"
dependencies = [
"cc",
"object",
- "rustix 1.0.7",
+ "rustix 1.0.8",
"wasmtime-versioned-export-macros",
]
[[package]]
name = "wasmtime-jit-icache-coherence"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae8181456fefe4ecaae09cc16149cf9375785b7c34bf9e3e2d43a5aec7b1a67b"
+checksum = "7af0e940cb062a45c0b3f01a926f77da5947149e99beb4e3dd9846d5b8f11619"
dependencies = [
"anyhow",
- "cfg-if 1.0.1",
+ "cfg-if",
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "wasmtime-math"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92a68a8049158a36eea1c05d3b8680873533e9578bf0979992e3b4d0cd1e2264"
+checksum = "acfca360e719dda9a27e26944f2754ff2fd5bad88e21919c42c5a5f38ddd93cb"
dependencies = [
"libm",
]
[[package]]
name = "wasmtime-slab"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50e6fc4b737c702d51b09bf5f938b67b8a7eec4d7738c3f8dc1b3e90ede99ead"
+checksum = "48e240559cada55c4b24af979d5f6c95e0029f5772f32027ec3c62b258aaff65"
[[package]]
name = "wasmtime-versioned-export-macros"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c4e1b13af5c6adc50eaaf4daadee683b9f91d962993b24d21c209db769a4649"
+checksum = "d0963c1438357a3d8c0efe152b4ef5259846c1cf8b864340270744fe5b3bae5e"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
name = "wasmtime-winch"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc0402be18d9c0c760f3b12a7cd80ee559ad1e6f70c039148d76252178cb1045"
+checksum = "cbc3b117d03d6eeabfa005a880c5c22c06503bb8820f3aa2e30f0e8d87b6752f"
dependencies = [
"anyhow",
"cranelift-codegen",
@@ -5462,74 +3642,245 @@ dependencies = [
[[package]]
name = "wasmtime-wit-bindgen"
-version = "33.0.1"
+version = "33.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1382f4f09390eab0d75d4994d0c3b0f6279f86a571807ec67a8253c87cf6a145"
+dependencies = [
+ "anyhow",
+ "heck",
+ "indexmap",
+ "wit-parser",
+]
+
+[[package]]
+name = "wast"
+version = "235.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13"
+dependencies = [
+ "bumpalo",
+ "leb128fmt",
+ "memchr",
+ "unicode-width",
+ "wasm-encoder 0.235.0",
+]
+
+[[package]]
+name = "wat"
+version = "1.235.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa"
+dependencies = [
+ "wast",
+]
+
+[[package]]
+name = "webrtc"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d8b3a840e31c969844714f93b5a87e73ee49f3bc2a4094ab9132c69497eb31db"
+dependencies = [
+ "arc-swap",
+ "async-trait",
+ "bytes",
+ "cfg-if",
+ "hex",
+ "interceptor",
+ "lazy_static",
+ "log",
+ "portable-atomic",
+ "rand",
+ "rcgen",
+ "regex",
+ "ring",
+ "rtcp",
+ "rtp",
+ "rustls",
+ "sdp",
+ "serde",
+ "serde_json",
+ "sha2",
+ "smol_str",
+ "stun",
+ "thiserror 1.0.69",
+ "time",
+ "tokio",
+ "turn",
+ "url",
+ "waitgroup",
+ "webrtc-data",
+ "webrtc-dtls",
+ "webrtc-ice",
+ "webrtc-mdns",
+ "webrtc-media",
+ "webrtc-sctp",
+ "webrtc-srtp",
+ "webrtc-util",
+]
+
+[[package]]
+name = "webrtc-data"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8b7c550f8d35867b72d511640adf5159729b9692899826fe00ba7fa74f0bf70"
+dependencies = [
+ "bytes",
+ "log",
+ "portable-atomic",
+ "thiserror 1.0.69",
+ "tokio",
+ "webrtc-sctp",
+ "webrtc-util",
+]
+
+[[package]]
+name = "webrtc-dtls"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd53881d8b39019e2bc4a301a3bca2aada25c6501518827c72f006afce776460"
+checksum = "86e5eedbb0375aa04da93fc3a189b49ed3ed9ee844b6997d5aade14fc3e2c26e"
dependencies = [
- "anyhow",
- "heck",
- "indexmap",
- "wit-parser",
+ "aes",
+ "aes-gcm",
+ "async-trait",
+ "bincode",
+ "byteorder",
+ "cbc",
+ "ccm",
+ "der-parser 8.2.0",
+ "hkdf",
+ "hmac",
+ "log",
+ "p256",
+ "p384",
+ "portable-atomic",
+ "rand",
+ "rand_core",
+ "rcgen",
+ "ring",
+ "rustls",
+ "sec1",
+ "serde",
+ "sha1",
+ "sha2",
+ "subtle",
+ "thiserror 1.0.69",
+ "tokio",
+ "webrtc-util",
+ "x25519-dalek",
+ "x509-parser",
]
[[package]]
-name = "wast"
-version = "235.0.0"
+name = "webrtc-ice"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13"
+checksum = "4d4f0ca6d4df8d1bdd34eece61b51b62540840b7a000397bcfb53a7bfcf347c8"
dependencies = [
- "bumpalo",
- "leb128fmt",
- "memchr",
- "unicode-width 0.2.0",
- "wasm-encoder 0.235.0",
+ "arc-swap",
+ "async-trait",
+ "crc",
+ "log",
+ "portable-atomic",
+ "rand",
+ "serde",
+ "serde_json",
+ "stun",
+ "thiserror 1.0.69",
+ "tokio",
+ "turn",
+ "url",
+ "uuid",
+ "waitgroup",
+ "webrtc-mdns",
+ "webrtc-util",
]
[[package]]
-name = "wat"
-version = "1.235.0"
+name = "webrtc-mdns"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa"
+checksum = "c0804694f3b2acfdff48f6df217979b13cb0a00377c63b5effd111daaee7e8c4"
dependencies = [
- "wast",
+ "log",
+ "socket2",
+ "thiserror 1.0.69",
+ "tokio",
+ "webrtc-util",
]
[[package]]
-name = "web-sys"
-version = "0.3.77"
+name = "webrtc-media"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
+checksum = "1c15b20e98167b22949abc1c20eca7c6d814307d187068fe7a48f0b87a4f6d46"
dependencies = [
- "js-sys",
- "wasm-bindgen",
+ "byteorder",
+ "bytes",
+ "rand",
+ "rtp",
+ "thiserror 1.0.69",
]
[[package]]
-name = "webpki-roots"
-version = "0.26.11"
+name = "webrtc-sctp"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
+checksum = "1d850daa68639b9d7bb16400676e97525d1e52b15b4928240ae2ba0e849817a5"
dependencies = [
- "webpki-roots 1.0.1",
+ "arc-swap",
+ "async-trait",
+ "bytes",
+ "crc",
+ "log",
+ "portable-atomic",
+ "rand",
+ "thiserror 1.0.69",
+ "tokio",
+ "webrtc-util",
]
[[package]]
-name = "webpki-roots"
-version = "1.0.1"
+name = "webrtc-srtp"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502"
+checksum = "fbec5da43a62c228d321d93fb12cc9b4d9c03c9b736b0c215be89d8bd0774cfe"
dependencies = [
- "rustls-pki-types",
+ "aead",
+ "aes",
+ "aes-gcm",
+ "byteorder",
+ "bytes",
+ "ctr",
+ "hmac",
+ "log",
+ "rtcp",
+ "rtp",
+ "sha1",
+ "subtle",
+ "thiserror 1.0.69",
+ "tokio",
+ "webrtc-util",
]
[[package]]
-name = "whoami"
-version = "1.6.0"
+name = "webrtc-util"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7"
+checksum = "dc8d9bc631768958ed97b8d68b5d301e63054ae90b09083d43e2fefb939fd77e"
dependencies = [
- "redox_syscall 0.5.13",
- "wasite",
+ "async-trait",
+ "bitflags 1.3.2",
+ "bytes",
+ "ipnet",
+ "lazy_static",
+ "libc",
+ "log",
+ "nix",
+ "portable-atomic",
+ "rand",
+ "thiserror 1.0.69",
+ "tokio",
+ "winapi",
]
[[package]]
@@ -5565,9 +3916,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "winch-codegen"
-version = "33.0.1"
+version = "33.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fe7636e694aab3e553ae60d62f3c923926d0d65d1d6e324d2dcb3b1d3b55d5a"
+checksum = "7914c296fbcef59d1b89a15e82384d34dc9669bc09763f2ef068a28dd3a64ebf"
dependencies = [
"anyhow",
"cranelift-assembler-x64",
@@ -5582,52 +3933,19 @@ dependencies = [
"wasmtime-environ",
]
-[[package]]
-name = "windows"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
-dependencies = [
- "windows-core 0.57.0",
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-core"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
-dependencies = [
- "windows-implement 0.57.0",
- "windows-interface 0.57.0",
- "windows-result 0.1.2",
- "windows-targets 0.52.6",
-]
-
[[package]]
name = "windows-core"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
dependencies = [
- "windows-implement 0.60.0",
- "windows-interface 0.59.1",
+ "windows-implement",
+ "windows-interface",
"windows-link",
- "windows-result 0.3.4",
+ "windows-result",
"windows-strings",
]
-[[package]]
-name = "windows-implement"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
[[package]]
name = "windows-implement"
version = "0.60.0"
@@ -5636,18 +3954,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
dependencies = [
"proc-macro2",
"quote",
- "syn",
-]
-
-[[package]]
-name = "windows-interface"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -5658,7 +3965,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -5667,26 +3974,6 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
-[[package]]
-name = "windows-registry"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
-dependencies = [
- "windows-link",
- "windows-result 0.3.4",
- "windows-strings",
-]
-
-[[package]]
-name = "windows-result"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
[[package]]
name = "windows-result"
version = "0.3.4"
@@ -5705,15 +3992,6 @@ dependencies = [
"windows-link",
]
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets 0.48.5",
-]
-
[[package]]
name = "windows-sys"
version = "0.52.0"
@@ -5741,21 +4019,6 @@ dependencies = [
"windows-targets 0.53.2",
]
-[[package]]
-name = "windows-targets"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
-dependencies = [
- "windows_aarch64_gnullvm 0.48.5",
- "windows_aarch64_msvc 0.48.5",
- "windows_i686_gnu 0.48.5",
- "windows_i686_msvc 0.48.5",
- "windows_x86_64_gnu 0.48.5",
- "windows_x86_64_gnullvm 0.48.5",
- "windows_x86_64_msvc 0.48.5",
-]
-
[[package]]
name = "windows-targets"
version = "0.52.6"
@@ -5788,12 +4051,6 @@ dependencies = [
"windows_x86_64_msvc 0.53.0",
]
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
@@ -5806,12 +4063,6 @@ version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
-
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
@@ -5824,12 +4075,6 @@ version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
-
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
@@ -5854,12 +4099,6 @@ version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
-
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
@@ -5872,12 +4111,6 @@ version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
-
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
@@ -5890,12 +4123,6 @@ version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
@@ -5908,12 +4135,6 @@ version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
-
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
@@ -5928,124 +4149,13 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]]
name = "winnow"
-version = "0.7.11"
+version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd"
+checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95"
dependencies = [
"memchr",
]
-[[package]]
-name = "winreg"
-version = "0.50.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
-dependencies = [
- "cfg-if 1.0.1",
- "windows-sys 0.48.0",
-]
-
-[[package]]
-name = "winter-air"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b72f12b88ebb060b52c0e9aece9bb64a9fc38daf7ba689dd5ce63271b456c883"
-dependencies = [
- "libm",
- "winter-crypto",
- "winter-fri",
- "winter-math",
- "winter-utils",
-]
-
-[[package]]
-name = "winter-crypto"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00fbb724d2d9fbfd3aa16ea27f5e461d4fe1d74b0c9e0ed1bf79e9e2a955f4d5"
-dependencies = [
- "blake3",
- "sha3",
- "winter-math",
- "winter-utils",
-]
-
-[[package]]
-name = "winter-fri"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ab6077cf4c23c0411f591f4ba29378e27f26acb8cef3c51cadd93daaf6080b3"
-dependencies = [
- "winter-crypto",
- "winter-math",
- "winter-utils",
-]
-
-[[package]]
-name = "winter-math"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b0e685b3b872d82e58a86519294a814b7bc7a4d3cd2c93570a7d80c0c5a1aba"
-dependencies = [
- "winter-utils",
-]
-
-[[package]]
-name = "winter-maybe-async"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ce0f4161cdde50de809b3869c1cb083a09e92e949428ea28f04c0d64045875c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "winter-prover"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f17e3dbae97050f58e01ed4f12906e247841575a0518632e052941a1c37468df"
-dependencies = [
- "tracing",
- "winter-air",
- "winter-crypto",
- "winter-fri",
- "winter-math",
- "winter-maybe-async",
- "winter-utils",
-]
-
-[[package]]
-name = "winter-utils"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "961e81e9388877a25db1c034ba38253de2055f569633ae6a665d857a0556391b"
-
-[[package]]
-name = "winter-verifier"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "324002ade90f21e85599d51a232a80781efc8cb46f511f8bc89f9c5a4eb9cb65"
-dependencies = [
- "winter-air",
- "winter-crypto",
- "winter-fri",
- "winter-math",
- "winter-utils",
-]
-
-[[package]]
-name = "winterfell"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01151ac5fe2d783950743e8a110e0a2f26994f888b4cbe848699142cb3ea1e5b"
-dependencies = [
- "winter-air",
- "winter-prover",
- "winter-verifier",
-]
-
[[package]]
name = "wit-bindgen-rt"
version = "0.39.0"
@@ -6080,12 +4190,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
[[package]]
-name = "wyz"
-version = "0.5.1"
+name = "x25519-dalek"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
+dependencies = [
+ "curve25519-dalek",
+ "rand_core",
+ "serde",
+ "zeroize",
+]
+
+[[package]]
+name = "x509-parser"
+version = "0.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69"
+dependencies = [
+ "asn1-rs 0.6.2",
+ "data-encoding",
+ "der-parser 9.0.0",
+ "lazy_static",
+ "nom",
+ "oid-registry",
+ "ring",
+ "rusticata-macros",
+ "thiserror 1.0.69",
+ "time",
+]
+
+[[package]]
+name = "yasna"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
+checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd"
dependencies = [
- "tap",
+ "time",
]
[[package]]
@@ -6108,8 +4248,8 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
dependencies = [
"proc-macro2",
"quote",
- "syn",
- "synstructure",
+ "syn 2.0.104",
+ "synstructure 0.13.2",
]
[[package]]
@@ -6129,7 +4269,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -6149,8 +4289,8 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
dependencies = [
"proc-macro2",
"quote",
- "syn",
- "synstructure",
+ "syn 2.0.104",
+ "synstructure 0.13.2",
]
[[package]]
@@ -6170,7 +4310,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
@@ -6203,7 +4343,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.104",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index fb9318c..91fb38d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,148 +3,91 @@ name = "polytorus"
version = "0.1.0"
edition = "2021"
rust-version = "1.82"
-description = "Post Quantum Modular Blockchain Platform"
+description = "PolyTorus - 4-Layer Modular Blockchain Platform"
authors = ["quantumshiro"]
license = "MIT"
repository = "https://github.com/quantumshiro/polytorus"
-keywords = ["blockchain", "quantum-resistant", "modular", "wasm", "post-quantum"]
+keywords = ["blockchain", "quantum-resistant", "modular", "rollups", "post-quantum"]
categories = ["cryptography", "network-programming", "wasm"]
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+[workspace]
+members = [
+ "crates/traits",
+ "crates/execution",
+ "crates/settlement",
+ "crates/consensus",
+ "crates/data-availability",
+ "crates/p2p-network",
+]
-[[example]]
-name = "simple_difficulty_test"
-path = "examples/simple_difficulty_test.rs"
+resolver = "2"
-[[example]]
-name = "modular_architecture_demo"
-path = "examples/modular_architecture_simple.rs"
+# Workspace package defaults (removed - using main package info instead)
-[[example]]
-name = "diamond_io_demo"
-path = "examples/diamond_io_demo.rs"
-
-# Removed: multi_node_simulation.rs was deleted during refactoring
-
-[[example]]
-name = "transaction_monitor"
-path = "examples/transaction_monitor.rs"
-
-[[example]]
-name = "database_storage_demo"
-path = "examples/database_storage_demo.rs"
-
-[[example]]
-name = "failover_test_app"
-path = "examples/failover_test_app.rs"
-
-[[example]]
-name = "test_database_connection"
-path = "examples/test_database_connection.rs"
-
-[dependencies]
-# Cryptography - unified versions (modern alternatives)
-sha2 = "0.10" # Modern cryptographic hash functions
-digest = "0.10"
-keccak-asm = "0.1.4"
-secp256k1 = {version="0.30.0", features = ["rand"]}
-
-# Legacy crypto (temporary - for compatibility during migration)
-# rust-crypto = "0.2" # REMOVED: unmaintained and vulnerable
-
-# Modern crypto alternatives (being integrated)
-ring = "0.17" # Modern cryptography library
-aes-gcm = "0.10" # Modern AES-GCM implementation
-chacha20poly1305 = "0.10" # Modern ChaCha20-Poly1305 implementation
-ripemd = "0.1" # RIPEMD hash functions
-
-# Random number generation - unified versions for fn-dsa compatibility
-rand = "0.8.5" # Keep 0.8 for fn-dsa compatibility
-rand_core = "0.6.4" # Keep 0.6 for fn-dsa compatibility
-rand_chacha = "0.3" # Keep 0.3 for fn-dsa compatibility
-rand_distr = "0.5.1"
-
-# Core dependencies (updated to modern versions)
-bincode = "1.3"
-anyhow = "1.0" # Modern error handling (replacing failure)
-# failure = "0.1" # REMOVED: unmaintained and vulnerable
-sled = "0.34"
-serde = {version ="1.0", features =["derive"]}
+[workspace.dependencies]
+# Core shared dependencies
+anyhow = "1.0"
+serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
-log = "0.4"
-env_logger = "0.11" # Updated to latest version
-clap = "4.0" # Updated to modern version (fixes ansi_term and atty issues)
-bitcoincash-addr = "0.5.2"
-merkle-cbt = "0.2.2"
-fn-dsa = "0.2.0"
-# Verkle Tree dependencies
-ark-ed-on-bls12-381 = "0.5.0"
-ark-ff = "0.5.0"
-ark-ec = "0.5.0"
-ark-serialize = "0.5.0"
-ark-std = "0.5.0"
-tiny-keccak = { version = "2.0", features = ["keccak"] }
-blake3 = "1.3"
-
-# Web and async
-actix-web = "4"
-actix-cors = "0.7"
tokio = { version = "1", features = ["full"] }
-futures = "0.3"
async-trait = "0.1"
-reqwest = { version = "0.11", features = ["json"] }
+log = "0.4"
+env_logger = "0.11"
-# Database dependencies
-sqlx = { version = "0.8.1", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid", "json"] }
-redis = { version = "0.24", features = ["tokio-comp", "connection-manager"] }
+# WebRTC P2P networking
+webrtc = "0.11"
+bytes = "1.5"
-# Utilities
-uuid = { version = "1.16.0", features = ["v4", "serde"] }
-wasmtime = "33.0.0" # Updated to latest version
-wat = "1.0"
+# Only essential dependencies for modular layers
+sha2 = "0.10"
hex = "0.4"
-toml = "0.8"
chrono = { version = "0.4", features = ["serde"] }
-libc = "0.2"
-
-# TUI dependencies
-ratatui = "0.29"
-crossterm = "0.28"
-
-# Diamond IO dependencies
-diamond-io = { git = "https://github.com/MachinaIO/diamond-io" }
-openfhe = { git = "https://github.com/MachinaIO/openfhe-rs.git", branch = "exp/reimpl_trapdoor" }
-num-bigint = { version = "0.4", features = ["serde"] }
-num-traits = "0.2"
-rayon = "1.5"
-tracing = "0.1"
-tracing-subscriber = "0.3"
-dashmap = "6.1.0"
-walkdir = "2"
-once_cell = "1.21.1"
-bitvec = "1"
-memory-stats = "1.2.0"
-itertools = "0.14.0"
-
-# ZK-STARKs dependencies
-winterfell = "0.9"
+uuid = { version = "1.16.0", features = ["v4", "serde"] }
+sled = "0.34"
+bincode = "1.3"
+wasmtime = "33.0.0"
+wat = "1.0"
+clap = "4.0"
+rand = "0.8.5"
-[dev-dependencies]
-tempfile = "3.0"
-criterion = { version = "0.5", features = ["html_reports"] }
-kani-verifier = "0.56.0"
-[build-dependencies]
-reqwest = { version = "0.12", features = ["blocking"] }
+# Library configuration
+[lib]
+name = "polytorus"
+path = "src/lib.rs"
-[[example]]
-name = "p2p_multi_node_simulation"
-path = "examples/p2p_multi_node_simulation.rs"
+# Binary configuration
+[[bin]]
+name = "polytorus"
+path = "src/main.rs"
-[[bench]]
-name = "blockchain_bench"
-harness = false
+[dependencies]
+# Layer crates
+traits = { path = "crates/traits" }
+execution = { path = "crates/execution" }
+settlement = { path = "crates/settlement" }
+consensus = { path = "crates/consensus" }
+data-availability = { path = "crates/data-availability" }
+p2p-network = { path = "crates/p2p-network" }
+
+# External wallet dependency
+wallet = { git = "https://github.com/PolyTorus/wallet.git" }
+
+# Core dependencies
+anyhow = { workspace = true }
+
+# Force compatible versions for Docker build
+base64ct = "=1.6.0"
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
+async-trait = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+log = { workspace = true }
+env_logger = { workspace = true }
+
+# CLI
+clap = { workspace = true }
-[[bin]]
-name = "polytorus_tui"
-path = "src/bin/polytorus_tui.rs"
+# Utilities
+chrono = { workspace = true }
+uuid = { workspace = true }
diff --git a/Dockerfile b/Dockerfile
index 54f8e44..d7e06d1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -73,10 +73,12 @@ RUN ldconfig
# Install Rust nightly
RUN apt-get update && apt-get install -y curl && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2025-01-15 && \
- rustup component add clippy && \
rm -rf /var/lib/apt/lists/*
+# Set PATH and install clippy
ENV PATH="/root/.cargo/bin:${PATH}"
+RUN rustup component add clippy
+
ENV LD_LIBRARY_PATH="/usr/local/lib"
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
ENV OPENFHE_ROOT="/usr/local"
@@ -88,29 +90,24 @@ WORKDIR /app
# Copy dependency files
COPY Cargo.toml Cargo.lock ./
-COPY build.rs ./
+COPY crates/ ./crates/
# Create dummy source to cache dependencies
-RUN mkdir src benches && \
+RUN mkdir src && \
echo "fn main() {}" > src/main.rs && \
- echo 'pub fn add(left: usize, right: usize) -> usize { left + right }' > src/lib.rs && \
- echo 'fn main() {}' > benches/blockchain_bench.rs && \
- echo 'fn main() {}' > benches/quick_tps_bench.rs
+ echo 'pub fn add(left: usize, right: usize) -> usize { left + right }' > src/lib.rs
# Build dependencies (cached layer)
RUN cargo build --release --bins && \
- rm -rf src benches
+ rm -rf src
# Copy source code
COPY src/ ./src/
COPY examples/ ./examples/
-COPY tests/ ./tests/
-COPY benches/ ./benches/
COPY config/ ./config/
-COPY contracts/ ./contracts/
# Verify source files are copied correctly
-RUN ls -la src/ && ls -la src/command/ && ls -la src/diamond_io_integration.rs
+RUN ls -la src/
# Run clippy checks before building
RUN echo "Running clippy checks..." && \
diff --git a/Dockerfile.clippy-test b/Dockerfile.clippy-test
deleted file mode 100644
index 3bd54b7..0000000
--- a/Dockerfile.clippy-test
+++ /dev/null
@@ -1,34 +0,0 @@
-# Test Dockerfile to reproduce clippy issues
-FROM rust:1.82-slim
-
-# Install system dependencies
-RUN apt-get update && apt-get install -y \
- build-essential \
- cmake \
- pkg-config \
- libssl-dev \
- curl \
- git \
- && rm -rf /var/lib/apt/lists/*
-
-# Install clippy component
-RUN rustup component add clippy
-
-# Set working directory
-WORKDIR /app
-
-# Copy project files
-COPY Cargo.toml Cargo.lock build.rs ./
-COPY src/ ./src/
-COPY benches/ ./benches/
-COPY tests/ ./tests/
-COPY examples/ ./examples/
-COPY config/ ./config/
-COPY contracts/ ./contracts/
-COPY .clippy.toml ./
-
-# Run clippy to test for issues
-RUN cargo clippy --all-targets --all-features -- -D warnings -W clippy::all
-
-# Build the project
-RUN cargo build --release
diff --git a/Dockerfile.optimized b/Dockerfile.optimized
deleted file mode 100644
index 7d622c2..0000000
--- a/Dockerfile.optimized
+++ /dev/null
@@ -1,146 +0,0 @@
-# PolyTorus Multi-stage Docker Build
-# Optimized for production with security and performance in mind
-
-# Build stage - OpenFHE dependencies
-FROM ubuntu:22.04 AS openfhe-builder
-
-LABEL maintainer="shiro@machina.io"
-LABEL description="PolyTorus - Post-Quantum Blockchain Platform"
-
-# Install system dependencies
-RUN apt-get update && apt-get install -y \
- build-essential \
- cmake \
- git \
- pkg-config \
- libssl-dev \
- autoconf \
- automake \
- libtool \
- libgmp-dev \
- libntl-dev \
- libboost-all-dev \
- libgmp3-dev \
- libmpfr-dev \
- libfftw3-dev \
- wget \
- ca-certificates \
- && rm -rf /var/lib/apt/lists/* \
- && apt-get clean
-
-# Create non-root user for security
-RUN groupadd -r openfhe && useradd -r -g openfhe openfhe
-
-# Build OpenFHE
-WORKDIR /tmp
-RUN git clone https://github.com/MachinaIO/openfhe-development.git \
- && cd openfhe-development \
- && git checkout feat/improve_determinant \
- && mkdir build \
- && cd build \
- && cmake -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_UNITTESTS=OFF \
- -DBUILD_EXAMPLES=OFF \
- -DBUILD_BENCHMARKS=OFF \
- -DCMAKE_INSTALL_PREFIX=/usr/local \
- .. \
- && make -j$(nproc) \
- && make install \
- && cd / \
- && rm -rf /tmp/openfhe-development
-
-# Rust build stage
-FROM rust:1.80-slim AS rust-builder
-
-# Install system dependencies for Rust build
-RUN apt-get update && apt-get install -y \
- build-essential \
- cmake \
- pkg-config \
- libssl-dev \
- libgmp-dev \
- libntl-dev \
- && rm -rf /var/lib/apt/lists/*
-
-# Copy OpenFHE from previous stage
-COPY --from=openfhe-builder /usr/local /usr/local
-RUN ldconfig
-
-# Create app directory
-WORKDIR /app
-
-# Copy dependency files first for better caching
-COPY Cargo.toml Cargo.lock ./
-COPY build.rs ./
-
-# Create a dummy main.rs to build dependencies
-RUN mkdir src && echo "fn main() {}" > src/main.rs
-RUN cargo build --release && rm src/main.rs
-
-# Copy source code
-COPY src ./src
-COPY examples ./examples
-COPY benches ./benches
-COPY tests ./tests
-
-# Build the application
-RUN cargo build --release --bin polytorus
-
-# Final runtime stage
-FROM ubuntu:22.04 AS runtime
-
-# Install runtime dependencies only
-RUN apt-get update && apt-get install -y \
- ca-certificates \
- libssl3 \
- libgmp10 \
- libntl43 \
- libboost-filesystem1.74.0 \
- libboost-system1.74.0 \
- libgmp3-dev \
- libmpfr6 \
- libfftw3-3 \
- && rm -rf /var/lib/apt/lists/* \
- && apt-get clean
-
-# Copy OpenFHE libraries
-COPY --from=openfhe-builder /usr/local/lib /usr/local/lib
-COPY --from=openfhe-builder /usr/local/include /usr/local/include
-RUN ldconfig
-
-# Create non-root user
-RUN groupadd -r polytorus \
- && useradd -r -g polytorus -d /app -s /sbin/nologin polytorus
-
-# Create app directory and data directories
-WORKDIR /app
-RUN mkdir -p data/blockchain data/contracts data/wallets \
- && chown -R polytorus:polytorus /app
-
-# Copy the binary from build stage
-COPY --from=rust-builder /app/target/release/polytorus /usr/local/bin/polytorus
-COPY --from=rust-builder /app/config ./config
-
-# Copy configuration files
-COPY docker-compose.yml ./
-COPY contracts ./contracts
-
-# Set ownership
-RUN chown -R polytorus:polytorus /app
-
-# Switch to non-root user
-USER polytorus
-
-# Health check
-HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
- CMD polytorus --help || exit 1
-
-# Expose ports
-EXPOSE 8080 8443 9944
-
-# Set environment variables
-ENV RUST_LOG=info
-ENV POLYTORUS_CONFIG_PATH=/app/config
-
-# Default command
-CMD ["polytorus", "--config", "/app/config/polytorus.toml"]
diff --git a/Dockerfile.simple b/Dockerfile.simple
deleted file mode 100644
index 3d2a91d..0000000
--- a/Dockerfile.simple
+++ /dev/null
@@ -1,26 +0,0 @@
-# Simple Dockerfile for PolyTorus Mining Demo
-FROM rust:1.82-slim
-
-# Install dependencies
-RUN apt-get update && apt-get install -y \
- pkg-config \
- curl \
- && rm -rf /var/lib/apt/lists/*
-
-# Set working directory
-WORKDIR /app
-
-# Copy source code
-COPY . .
-
-# Build the project
-RUN cargo build --release --bin polytorus
-
-# Create data directory
-RUN mkdir -p /data
-
-# Expose ports
-EXPOSE 8000 9000
-
-# Default command
-CMD ["./target/release/polytorus", "--help"]
diff --git a/Dockerfile.testnet b/Dockerfile.testnet
deleted file mode 100644
index bb82b3f..0000000
--- a/Dockerfile.testnet
+++ /dev/null
@@ -1,62 +0,0 @@
-# PolyTorus Testnet Docker Image
-FROM rust:1.82-bullseye as builder
-
-# Install system dependencies
-RUN apt-get update && apt-get install -y \
- pkg-config \
- libssl-dev \
- curl \
- build-essential \
- && rm -rf /var/lib/apt/lists/*
-
-# Set working directory
-WORKDIR /app
-
-# Copy source code
-COPY . .
-
-# Build the release binary
-RUN cargo build --release --bin polytorus
-
-# Runtime stage
-FROM debian:bullseye-slim
-
-# Install runtime dependencies
-RUN apt-get update && apt-get install -y \
- ca-certificates \
- curl \
- python3 \
- python3-pip \
- && rm -rf /var/lib/apt/lists/*
-
-# Create application user
-RUN useradd -m -u 1000 polytorus
-
-# Create directories
-RUN mkdir -p /app /data /config /logs \
- && chown -R polytorus:polytorus /app /data /config /logs
-
-# Copy binary from builder
-COPY --from=builder /app/target/release/polytorus /usr/local/bin/polytorus
-
-# Make binary executable
-RUN chmod +x /usr/local/bin/polytorus
-
-# Copy configuration files
-COPY --chown=polytorus:polytorus config/ /config/
-
-# Set working directory
-WORKDIR /app
-
-# Switch to application user
-USER polytorus
-
-# Expose ports
-EXPOSE 8000 9000 3000 8080 9020
-
-# Health check
-HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
- CMD curl -f http://localhost:9000/health || exit 1
-
-# Default command
-CMD ["polytorus", "--help"]
diff --git a/IMPLEMENTATION_ISSUES.md b/IMPLEMENTATION_ISSUES.md
new file mode 100644
index 0000000..5af0a54
--- /dev/null
+++ b/IMPLEMENTATION_ISSUES.md
@@ -0,0 +1,261 @@
+# PolyTorus実装の問題点と改善案
+
+## 概要
+
+PolyTorusブロックチェーンプロジェクトの各crateの実装状況を分析し、中途半端な実装や改善が必要な箇所を特定しました。
+
+## 実装状況サマリー
+
+| Crate | 実装状況 | 主な問題 |
+|-------|----------|----------|
+| `data-availability` | ✅ 完全実装 | エンタープライズグレード機能実装済み |
+| `traits` | ✅ 十分 | インターフェース定義として適切 |
+| `execution` | ⚠️ 部分実装 | スクリプト実行とセキュリティ機能が簡略化 |
+| `consensus` | ⚠️ 部分実装 | 暗号機能とバリデータ管理が不完全 |
+| `settlement` | ⚠️ 部分実装 | フラウド証明検証が簡易実装 |
+
+## 🔴 重要な問題点
+
+### 1. Execution Layer (`crates/execution/`)
+
+#### 問題1: スクリプト実行機能の簡略化
+
+**場所**: `crates/execution/src/execution_engine.rs:141-145`
+
+```rust
+/// Execute WASM script with context (simplified for testing)
+fn execute_script(&self, script: &[u8], _redeemer: &[u8], _context: &ScriptContext) -> Result {
+ // For testing purposes, use simplified script validation
+ // Empty scripts always succeed, non-empty scripts fail safe
+ Ok(script.is_empty())
+}
+```
+
+**問題点**:
+- 実際のWASMスクリプト実行が行われていない
+- テスト用の簡易実装のまま
+- スクリプトの内容に関係なく、空のスクリプトのみ成功扱い
+
+**影響**:
+- スマートコントラクトの実行ができない
+- セキュリティ検証が機能しない
+- 実用的なeUTXOシステムとして動作しない
+
+#### 問題2: 署名検証の簡略化
+
+**場所**: `crates/execution/src/execution_engine.rs:118-122`
+
+```rust
+linker.func_wrap("env", "validate_signature", |_caller: wasmtime::Caller<'_, ScriptExecutionStore>,
+ _pub_key: u32, _signature: u32, _message: u32| -> i32 {
+ // Simplified signature validation
+ 1 // Always valid for now
+})?;
+```
+
+**問題点**:
+- 全ての署名を有効として扱う
+- 実際の暗号学的検証が行われていない
+- セキュリティの根幹が機能していない
+
+**影響**:
+- 不正なトランザクションが通ってしまう
+- システム全体のセキュリティが皆無
+- 攻撃に対して脆弱
+
+### 2. Consensus Layer (`crates/consensus/`)
+
+#### 問題1: プレースホルダー公開鍵
+
+**場所**: `crates/consensus/src/lib.rs:108`
+
+```rust
+public_key: vec![1, 2, 3], // Placeholder
+```
+
+**問題点**:
+- 実際の暗号鍵ではなくダミー値
+- バリデータの識別・認証ができない
+- 鍵管理システムが存在しない
+
+**影響**:
+- バリデータの正当性を検証できない
+- 合意メカニズムが機能しない
+- ネットワークセキュリティが確保されない
+
+#### 問題2: 合意アルゴリズムの単純化
+
+**問題点**:
+- 基本的なPoWのみの実装
+- より高度な合意メカニズム(PoS、PoA)が未実装
+- ネットワーク通信レイヤーが不完全
+
+### 3. Settlement Layer (`crates/settlement/`)
+
+#### 問題1: フラウド証明検証の簡略化
+
+**場所**: `crates/settlement/src/lib.rs:107-125`
+
+```rust
+fn verify_fraud_proof(&self, proof: &FraudProof, batch: &ExecutionBatch) -> Result {
+ // In a real implementation, this would re-execute the batch
+ // and compare the state roots to validate the fraud proof
+
+ // Simulate fraud proof verification
+ if proof.expected_state_root != proof.actual_state_root {
+ // State roots differ, fraud proof might be valid
+
+ // Check if the proof data is valid (simplified check)
+ if !proof.proof_data.is_empty() && proof.batch_id == batch.batch_id {
+ // Verify the execution was actually incorrect
+ // This would involve re-executing all transactions in the batch
+ return Ok(true);
+ }
+ }
+
+ Ok(false)
+}
+```
+
+**問題点**:
+- 実際の再実行による検証が行われていない
+- 簡単な条件チェックのみ
+- 詐欺的な証明を検出できない可能性
+
+**影響**:
+- 不正なバッチが承認される可能性
+- Layer 2ソリューションとしての信頼性が低い
+- セキュリティホールとなる
+
+#### 問題2: ハードコードされたバリデータアドレス
+
+**場所**: `crates/settlement/src/lib.rs:260`
+
+```rust
+submitter: "validator_address".to_string(), // Would be actual validator
+```
+
+**問題点**:
+- 実際のバリデータ識別システムが未実装
+- 固定値でのテスト実装
+- 実用性がない
+
+**解決策**:
+- Walletクレートの実装でアドレス管理を行う
+- バリデータの公開鍵から適切なアドレスを生成
+- 署名と検証可能なアドレス体系の構築
+
+## 🟡 改善が推奨される箇所
+
+### 1. Data Availability Layer
+
+**現状**: ✅ **完全実装済み**
+- エンタープライズグレードの機能が実装済み
+- ピア管理、帯域幅監視、検証キャッシュなど包括的
+
+**簡略化コメント箇所**: `crates/data-availability/src/lib.rs:460`
+```rust
+// Simplified implementation to avoid potential deadlocks in tests
+```
+
+**状況**: テストの安定性のための簡略化であり、機能的には問題なし
+
+### 2. Traits Layer
+
+**現状**: ✅ **十分な実装**
+- インターフェース定義として適切に機能
+- 特に問題となる箇所は見つからず
+
+### 3. 🚨 Wallet Layer (未実装)
+
+**現状**: ❌ **未実装**
+
+**問題点**:
+- アドレス生成・管理システムが存在しない
+- 秘密鍵・公開鍵のペア管理機能なし
+- バリデータのアイデンティティ管理ができない
+
+**必要な機能**:
+- 暗号鍵ペア生成 (Ed25519/secp256k1)
+- アドレス導出とエンコーディング
+- 署名・検証機能
+- キーストア管理
+- HDウォレット対応
+
+**影響**:
+- 現在の実装では全てのアドレスがハードコード
+- セキュアなバリデータ管理ができない
+- 実際のユーザーが使用できない状態
+
+## 🔧 改善提案
+
+### 優先度 1: 緊急 (セキュリティ関連)
+
+1. **Walletクレートの実装**
+ - 暗号鍵ペア生成・管理システム
+ - アドレス導出とエンコーディング機能
+ - セキュアなキーストア実装
+
+2. **署名検証の実装**
+ - 実際の暗号学的署名検証アルゴリズムの実装
+ - Ed25519やsecp256k1などの標準的な署名方式のサポート
+ - Walletクレートとの統合
+
+3. **スクリプト実行エンジンの完全実装**
+ - WASMスクリプトの実際の実行機能
+ - ガス計測とリソース制限
+ - セキュリティサンドボックス
+
+### 優先度 2: 重要 (機能性)
+
+4. **フラウド証明検証の強化**
+ - トランザクション再実行による実際の検証
+ - 状態ルート比較の詳細実装
+ - エラーハンドリングの改善
+
+5. **バリデータ管理システム**
+ - Walletクレートの実装による暗号鍵とアドレス管理
+ - 実際の公開鍵生成・管理
+ - バリデータ登録・認証メカニズム
+ - ステーク管理
+
+### 優先度 3: 改善 (利便性)
+
+6. **ネットワーク通信レイヤー**
+ - P2Pネットワーク通信の実装
+ - ノード間のメッセージング
+
+7. **高度な合意メカニズム**
+ - Proof of Stakeの実装
+ - よりエネルギー効率的な合意アルゴリズム
+
+## 📊 実装完成度
+
+```
+Data Availability: ████████████████████ 100%
+Traits: ████████████████████ 95%
+Wallet: ░░░░░░░░░░░░░░░░░░░░ 0%
+Execution: ████████░░░░░░░░░░░░ 40%
+Consensus: ██████░░░░░░░░░░░░░░ 30%
+Settlement: ████████░░░░░░░░░░░░ 40%
+```
+
+## 🎯 次のステップ
+
+1. **Walletクレートの実装**(最優先)
+2. **Execution Layer**のスクリプト実行機能の完全実装
+3. **Consensus Layer**の暗号機能強化
+4. **Settlement Layer**のフラウド証明検証改善
+5. 包括的なセキュリティテストの実施
+6. 統合テストの追加
+
+## 📝 メモ
+
+- `data-availability` crateは最近の作業で完全に実装され、エンタープライズグレードの機能を持つ
+- 他のcrateは基本的な機能は動作するが、プロダクション環境での使用には重大なセキュリティ上の問題がある
+- 特にExecution LayerとSettlement Layerの改善が最優先事項
+
+---
+
+**最終更新**: 2025年7月25日
+**分析対象**: PolyTorus v0.1.0 (fix/docs branch)
diff --git a/LOCAL_TESTNET_GUIDE.md b/LOCAL_TESTNET_GUIDE.md
deleted file mode 100644
index dbfed1e..0000000
--- a/LOCAL_TESTNET_GUIDE.md
+++ /dev/null
@@ -1,438 +0,0 @@
-# 🌐 PolyTorus Local Testnet Guide
-
-Welcome to PolyTorus Local Testnet! This guide helps you set up and run a complete blockchain testnet on your local machine using ContainerLab.
-
-## 📋 Prerequisites
-
-Before you begin, ensure you have the following installed:
-
-- **Docker** - Container runtime
-- **ContainerLab** - Network topology orchestrator
-- **Python 3** - For CLI tools
-- **curl** - For API testing
-
-### Quick Installation
-
-```bash
-# Install ContainerLab
-bash -c "$(curl -sL https://get.containerlab.dev)"
-
-# Install Docker (Ubuntu/Debian)
-curl -fsSL https://get.docker.com -o get-docker.sh
-sudo sh get-docker.sh
-
-# Verify installations
-containerlab version
-docker --version
-python3 --version
-```
-
-## 🚀 Quick Start
-
-### 1. Build and Start the Testnet
-
-```bash
-# Clone the PolyTorus repository
-git clone https://github.com/PolyTorus/polytorus
-cd polytorus
-
-# Build the Docker image
-./start-local-testnet.sh build
-
-# Start the testnet
-./start-local-testnet.sh start
-```
-
-### 2. Access the Testnet
-
-Once started, you can access your testnet through multiple interfaces:
-
-| Service | URL | Description |
-|---------|-----|-------------|
-| **Web UI** | http://localhost:3000 | Interactive web interface |
-| **Block Explorer** | http://localhost:8080 | View blocks and transactions |
-| **API Gateway** | http://localhost:9020 | REST API access |
-| **Bootstrap Node** | http://localhost:9000 | Main blockchain node |
-| **Miner 1** | http://localhost:9001 | First mining node |
-| **Miner 2** | http://localhost:9002 | Second mining node |
-| **Validator** | http://localhost:9003 | Validation node |
-
-### 3. Create Your First Wallet
-
-```bash
-# Create a new wallet
-./start-local-testnet.sh wallet
-
-# Or use the interactive CLI
-./start-local-testnet.sh cli
-```
-
-### 4. Send Your First Transaction
-
-Open the Web UI at http://localhost:3000 and:
-
-1. Select a wallet from the dropdown
-2. Enter a recipient address
-3. Specify the amount to send
-4. Click "Send Transaction"
-
-## 🛠️ Management Commands
-
-The `start-local-testnet.sh` script provides comprehensive management:
-
-```bash
-# Core operations
-./start-local-testnet.sh start # Start the testnet
-./start-local-testnet.sh stop # Stop the testnet
-./start-local-testnet.sh restart # Restart the testnet
-./start-local-testnet.sh status # Check status
-
-# Development tools
-./start-local-testnet.sh build # Build Docker image
-./start-local-testnet.sh logs # View container logs
-./start-local-testnet.sh clean # Clean all data
-
-# User operations
-./start-local-testnet.sh wallet # Create new wallet
-./start-local-testnet.sh send # Send test transaction
-./start-local-testnet.sh web # Open web interface
-./start-local-testnet.sh cli # Interactive CLI
-```
-
-## 🎮 Interactive CLI
-
-The testnet includes a powerful Python-based CLI for advanced operations:
-
-```bash
-# Start interactive mode
-./start-local-testnet.sh cli
-
-# Available commands in CLI:
-polytest> help # Show all commands
-polytest> status # Network status
-polytest> wallets # List wallets
-polytest> create-wallet # Create new wallet
-polytest> balance # Check balance
-polytest> send # Send transaction
-polytest> transactions # Recent transactions
-polytest> stats # Blockchain statistics
-```
-
-## 📊 Network Architecture
-
-Your local testnet consists of 6 containers:
-
-```
-┌─────────────┐ ┌─────────────┐ ┌─────────────┐
-│ Bootstrap │────│ Miner 1 │────│ Miner 2 │
-│ :9000 │ │ :9001 │ │ :9002 │
-└─────────────┘ └─────────────┘ └─────────────┘
- │ │ │
- └───────────────────┼───────────────────┘
- │
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
- │ Validator │ │User Interface│ │ Explorer │
- │ :9003 │ │ :3000 │ │ :8080 │
- └─────────────┘ └─────────────┘ └─────────────┘
-```
-
-### Node Types
-
-- **Bootstrap**: Genesis node, network entry point
-- **Miner 1 & 2**: Active mining nodes with PoW consensus
-- **Validator**: Transaction validation and network health
-- **User Interface**: Web UI and API gateway for users
-- **Explorer**: Block explorer and network monitoring
-
-## 🌐 Web Interface Features
-
-The Web UI (http://localhost:3000) provides:
-
-### Dashboard
-- Real-time network status
-- Blockchain statistics (block height, transactions, difficulty)
-- Node health monitoring
-
-### Wallet Management
-- View all available wallets
-- Check wallet balances
-- Create new wallets
-
-### Transaction Operations
-- Send transactions between wallets
-- Real-time transaction tracking
-- Transaction history viewer
-
-### Mining Control
-- View mining status
-- Control mining operations (future feature)
-
-## 🔧 API Usage
-
-The API Gateway (http://localhost:9020) exposes REST endpoints:
-
-### Wallet Operations
-```bash
-# Create wallet
-curl -X POST http://localhost:9020/wallet/create
-
-# List wallets
-curl http://localhost:9020/wallet/list
-
-# Get balance
-curl http://localhost:9020/balance/
-```
-
-### Transaction Operations
-```bash
-# Send transaction
-curl -X POST http://localhost:9020/transaction/send \
- -H "Content-Type: application/json" \
- -d '{
- "from": "sender_address",
- "to": "recipient_address",
- "amount": 10.5,
- "gasPrice": 1
- }'
-
-# Get transaction status
-curl http://localhost:9020/transaction/status/
-
-# Recent transactions
-curl http://localhost:9020/transaction/recent
-```
-
-### Network Information
-```bash
-# Network status
-curl http://localhost:9020/network/status
-
-# Latest block
-curl http://localhost:9020/block/latest
-
-# Specific block
-curl http://localhost:9020/block/
-```
-
-## 📈 Monitoring and Debugging
-
-### Real-time Monitoring
-
-```bash
-# Check overall status
-./start-local-testnet.sh status
-
-# Watch container logs
-./start-local-testnet.sh logs
-
-# Monitor specific node
-docker logs -f clab-polytorus-local-testnet-miner-1
-```
-
-### Network Statistics
-
-The CLI provides detailed statistics:
-
-```bash
-./start-local-testnet.sh cli
-polytest> stats
-```
-
-### Block Explorer
-
-Visit http://localhost:8080 to:
-- Browse all blocks
-- View transaction details
-- Monitor network health
-- Analyze mining statistics
-
-## 🔧 Configuration
-
-### Testnet Configuration
-
-The testnet uses `config/testnet.toml` for settings:
-
-```toml
-[consensus]
-block_time = 10000 # 10 seconds
-difficulty = 2 # Low for testing
-max_block_size = 1048576 # 1MB
-
-[testnet]
-network_id = "polytorus-local-testnet"
-chain_id = 31337
-initial_supply = 1000000000 # 1B tokens
-
-[testnet.prefunded_accounts]
-"test_account_1" = 1000000 # 1M tokens
-"test_account_2" = 500000 # 500K tokens
-"test_account_3" = 100000 # 100K tokens
-```
-
-### Node-Specific Settings
-
-Each node type has optimized settings:
-
-- **Bootstrap**: High connectivity, API enabled
-- **Miners**: Mining enabled, moderate connectivity
-- **Validator**: Validation only, no mining
-- **Interface**: API gateway, web UI enabled
-- **Explorer**: Historical data, monitoring enabled
-
-## 🧪 Testing Scenarios
-
-### Basic Transaction Flow
-
-1. **Create Wallets**: Generate sender and receiver wallets
-2. **Check Balances**: Verify initial balances
-3. **Send Transaction**: Transfer tokens between wallets
-4. **Verify Transaction**: Check transaction status and balances
-5. **Monitor Blocks**: Watch new blocks being mined
-
-### Automated Testing
-
-```bash
-# Send 5 test transactions
-python3 scripts/testnet_manager.py --test-transactions 5
-
-# Interactive testing
-python3 scripts/testnet_manager.py --interactive
-```
-
-### Load Testing
-
-Create multiple wallets and generate transaction load:
-
-```python
-# Example: Generate 100 transactions
-for i in range(100):
- # Create transaction
- # Send via API
- # Monitor confirmation
-```
-
-## 🛡️ Security Considerations
-
-This testnet is designed for **local development only**:
-
-- **Low Security**: Uses test keys and simplified consensus
-- **No Persistence**: Data is lost when containers stop
-- **Network Isolation**: Runs in isolated Docker network
-- **Resource Limits**: Optimized for local resource usage
-
-**⚠️ Never use testnet wallets or keys in production!**
-
-## 🔄 Troubleshooting
-
-### Common Issues
-
-#### ContainerLab Not Starting
-```bash
-# Check ContainerLab installation
-containerlab version
-
-# Verify Docker is running
-docker ps
-
-# Check file permissions
-chmod +x start-local-testnet.sh
-```
-
-#### Nodes Not Responding
-```bash
-# Check node status
-./start-local-testnet.sh status
-
-# View container logs
-./start-local-testnet.sh logs
-
-# Restart if needed
-./start-local-testnet.sh restart
-```
-
-#### Web Interface Not Loading
-```bash
-# Check if container is running
-docker ps | grep user-interface
-
-# Check port availability
-netstat -tulpn | grep :3000
-
-# Try direct container access
-curl http://localhost:3000
-```
-
-#### API Calls Failing
-```bash
-# Test API gateway
-curl http://localhost:9020/health
-
-# Check node connectivity
-curl http://localhost:9000/status
-
-# Verify network connectivity
-docker network ls
-```
-
-### Clean Reset
-
-If you encounter persistent issues:
-
-```bash
-# Complete cleanup
-./start-local-testnet.sh clean
-
-# Rebuild everything
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-```
-
-## 📚 Advanced Usage
-
-### Custom Configuration
-
-1. Modify `config/testnet.toml` for your needs
-2. Update `testnet-local.yml` for topology changes
-3. Rebuild the Docker image
-4. Restart the testnet
-
-### Integration with External Tools
-
-The testnet exposes standard APIs that work with:
-
-- **Web3 libraries**: For dApp development
-- **Blockchain explorers**: Custom explorer integration
-- **Monitoring tools**: Prometheus/Grafana compatible
-- **Testing frameworks**: Automated test integration
-
-### Development Workflow
-
-1. **Local Development**: Code and test against local testnet
-2. **Integration Testing**: Run automated test suites
-3. **Performance Testing**: Load test with multiple nodes
-4. **Deployment Preparation**: Test production configurations
-
-## 🤝 Support and Community
-
-- **Issues**: Report bugs in the GitHub repository
-- **Documentation**: Check the main README.md
-- **Community**: Join our Discord/Telegram
-- **Updates**: Follow GitHub releases for updates
-
-## 📄 License
-
-This testnet setup is part of the PolyTorus project and follows the same license terms.
-
----
-
-## 🎯 Next Steps
-
-Now that your testnet is running:
-
-1. **Explore the Web UI**: Familiarize yourself with the interface
-2. **Try API Calls**: Test the REST API endpoints
-3. **Create a dApp**: Build your first decentralized application
-4. **Run Load Tests**: Test performance with multiple transactions
-5. **Experiment with Configuration**: Modify settings and observe changes
-
-Happy testing with PolyTorus! 🚀
diff --git a/Makefile b/Makefile
index ec47e87..537e50d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,256 +1,133 @@
-# Makefile for Polytorus Kani Verification
+# PolyTorus Blockchain Platform Makefile
-.PHONY: kani-install kani-setup kani-verify kani-clean kani-quick kani-crypto kani-blockchain kani-modular kani-security kani-performance kani-watch kani-report pre-commit ci-verify ci-verify-quick kani-dev kani-list kani-check dep-check kani-ci fmt fmt-check clippy docker docker-dev docker-clean help
-
-# Colors for output
-BLUE := \033[0;34m
-GREEN := \033[0;32m
-YELLOW := \033[1;33m
-RED := \033[0;31m
-NC := \033[0m # No Color
+.PHONY: help build test clean lint fmt docs
# Default target
-help:
- @echo "$(BLUE)Polytorus Kani Verification Makefile$(NC)"
- @echo "" @echo "Available targets:"
- @echo " $(GREEN)kani-install$(NC) - Install Kani verifier"
- @echo " $(GREEN)kani-setup$(NC) - Setup Kani for this project"
- @echo " $(GREEN)kani-verify$(NC) - Run all Kani verifications"
- @echo " $(GREEN)kani-quick$(NC) - Run quick verification subset"
- @echo " $(GREEN)kani-crypto$(NC) - Run cryptographic verifications only"
- @echo " $(GREEN)kani-blockchain$(NC) - Run blockchain verifications only"
- @echo " $(GREEN)kani-modular$(NC) - Run modular architecture verifications only"
- @echo " $(GREEN)kani-security$(NC) - Run security-focused verifications"
- @echo " $(GREEN)kani-performance$(NC) - Run performance-oriented verifications"
- @echo " $(GREEN)kani-clean$(NC) - Clean verification results"
- @echo " $(GREEN)pre-commit$(NC) - Run pre-commit checks (fmt + clippy)" @echo " $(GREEN)fmt$(NC) - Format code with rustfmt"
- @echo " $(GREEN)fmt-check$(NC) - Check code formatting"
- @echo " $(GREEN)clippy$(NC) - Run clippy linter" @echo " $(GREEN)ci-verify$(NC) - Run full CI verification pipeline"
- @echo " $(GREEN)ci-verify-quick$(NC) - Run quick CI verification (no Kani)"
- @echo " $(GREEN)docker$(NC) - Build Docker image"
- @echo " $(GREEN)docker-dev$(NC) - Start development environment"
- @echo " $(GREEN)docker-clean$(NC) - Clean Docker resources"
- @echo " $(GREEN)deps-check$(NC) - Check dependency status"
- @echo " $(GREEN)security-audit$(NC) - Run security audit"
- @echo " $(GREEN)docs$(NC) - Build and open documentation"
- @echo " $(GREEN)help$(NC) - Show this help message"
-
-# Install Kani
-kani-install:
- @echo "$(BLUE)Installing Kani verifier...$(NC)"
- cargo install --locked kani-verifier
- cargo kani setup
-
-# Setup Kani for this project
-kani-setup:
- @echo "$(BLUE)Setting up Kani for Polytorus...$(NC)"
- @if ! command -v kani &> /dev/null; then \
- echo "$(RED)Kani not found. Installing...$(NC)"; \
- $(MAKE) kani-install; \
- fi
- @echo "$(GREEN)Kani setup complete!$(NC)"
+help: ## Show this help message
+ @echo "🚀 PolyTorus Blockchain Platform"
+ @echo ""
+ @echo "Available targets:"
+ @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
-# Run all verifications
-kani-verify: kani-setup
- @echo "$(BLUE)Running complete Kani verification suite...$(NC)"
- cd kani-verification && bash ./run_verification.sh
+# Development targets
+build: ## Build the project
+ @echo "🔨 Building PolyTorus..."
+ cargo build
-# Run quick verification (subset for development)
-kani-quick: kani-setup
- @echo "$(BLUE)Running quick Kani verification...$(NC)"
- @mkdir -p verification_results
- cd kani-verification && cargo kani --harness verify_basic_arithmetic
- cd kani-verification && cargo kani --harness verify_encryption_type_determination
- cd kani-verification && cargo kani --harness verify_block_hash_consistency
- cd kani-verification && cargo kani --harness verify_modular_architecture_structure
- @echo "$(GREEN)Quick verification complete!$(NC)"
+build-release: ## Build the project in release mode
+ @echo "🔨 Building PolyTorus (Release)..."
+ cargo build --release
-# Run cryptographic verifications only
-kani-crypto: kani-setup
- @echo "$(BLUE)Running cryptographic verifications...$(NC)"
- cd kani-verification && cargo kani --harness verify_encryption_type_determination
- cd kani-verification && cargo kani --harness verify_transaction_integrity
- cd kani-verification && cargo kani --harness verify_signature_properties
- cd kani-verification && cargo kani --harness verify_public_key_format
- cd kani-verification && cargo kani --harness verify_hash_computation
- @echo "$(GREEN)Cryptographic verification complete!$(NC)"
+test: ## Run all tests
+ @echo "🧪 Running tests..."
+ cargo test --workspace
-# Run blockchain verifications only
-kani-blockchain: kani-setup
- @echo "$(BLUE)Running blockchain verifications...$(NC)"
- cd kani-verification && cargo kani --harness verify_block_hash_consistency
- cd kani-verification && cargo kani --harness verify_blockchain_integrity
- cd kani-verification && cargo kani --harness verify_difficulty_adjustment
- cd kani-verification && cargo kani --harness verify_invalid_block_rejection
- @echo "$(GREEN)Blockchain verification complete!$(NC)"
+test-execution: ## Run execution layer tests
+ @echo "🧪 Running execution layer tests..."
+ cargo test -p execution
-# Run modular architecture verifications only
-kani-modular: kani-setup
- @echo "$(BLUE)Running modular architecture verifications...$(NC)"
- cd kani-verification && cargo kani --harness verify_modular_architecture_structure
- cd kani-verification && cargo kani --harness verify_layer_communication
- cd kani-verification && cargo kani --harness verify_invalid_communication_rejection
- cd kani-verification && cargo kani --harness verify_layer_state_update
- cd kani-verification && cargo kani --harness verify_synchronization_mechanism
- @echo "$(GREEN)Modular architecture verification complete!$(NC)"
+test-consensus: ## Run consensus layer tests
+ @echo "🧪 Running consensus layer tests..."
+ cargo test -p consensus
-# Run security-focused verifications
-kani-security: kani-setup
- @echo "$(BLUE)Running security-focused verifications...$(NC)"
- cd kani-verification && cargo kani --harness verify_array_bounds
- cd kani-verification && cargo kani --harness verify_transaction_value_bounds
- cd kani-verification && cargo kani --harness verify_invalid_block_rejection
- cd kani-verification && cargo kani --harness verify_invalid_communication_rejection
- @echo "$(GREEN)Security verification complete!$(NC)"
+test-settlement: ## Run settlement layer tests
+ @echo "🧪 Running settlement layer tests..."
+ cargo test -p settlement
-# Performance testing with Kani
-kani-performance: kani-setup
- @echo "$(BLUE)Running performance-oriented verifications...$(NC)"
- cd kani-verification && timeout 120 cargo kani --harness verify_queue_operations
- cd kani-verification && timeout 120 cargo kani --harness verify_hash_determinism
- cd kani-verification && timeout 120 cargo kani --harness verify_synchronization_mechanism
- @echo "$(GREEN)Performance verification complete!$(NC)"
+test-data-availability: ## Run data availability layer tests
+ @echo "🧪 Running data availability layer tests..."
+ cargo test -p data-availability
-# Watch mode for continuous verification during development
-kani-watch: kani-setup
- @echo "$(BLUE)Starting Kani watch mode...$(NC)"
- @echo "Will re-run verification when files change..."
- @while true; do \
- $(MAKE) kani-quick; \
- echo "$(YELLOW)Waiting for file changes... (Ctrl+C to stop)$(NC)"; \
- sleep 10; \
- done
+test-p2p: ## Run P2P network tests
+ @echo "🧪 Running P2P network tests..."
+ cargo test -p p2p-network
-# Generate verification report
-kani-report: kani-verify
- @echo "$(BLUE)Generating verification report...$(NC)"
- @mkdir -p docs/verification
- @if [ -f kani-verification/kani_results/summary.md ]; then \
- cp kani-verification/kani_results/summary.md docs/verification/latest-report.md; \
- echo "$(GREEN)Verification report generated at docs/verification/latest-report.md$(NC)"; \
- else \
- echo "$(RED)No verification results found. Run 'make kani-verify' first.$(NC)"; \
- fi
+test-wallet: ## Run wallet tests
+ @echo "🧪 Running wallet tests..."
+ cargo test -p polytorus-wallet
-# Development workflow - quick check before commit
-pre-commit: fmt clippy
- @echo "$(GREEN)Pre-commit verification passed!$(NC)"
+# Code quality targets
+lint: ## Run clippy linter
+ @echo "🔍 Running clippy..."
+ cargo clippy --all-targets --all-features -- -D warnings
-# Format code
-fmt:
- @echo "$(BLUE)Running cargo fmt...$(NC)"
+fmt: ## Format code
+ @echo "🎨 Formatting code..."
cargo fmt --all
- @echo "$(GREEN)Code formatting completed!$(NC)"
-# Check formatting
-fmt-check:
- @echo "$(BLUE)Checking code formatting...$(NC)"
+fmt-check: ## Check if code is formatted
+ @echo "🎨 Checking code formatting..."
cargo fmt --all -- --check
-# Run clippy
-clippy:
- @echo "$(BLUE)Running cargo clippy...$(NC)"
- cargo clippy --all-targets --all-features -- -W clippy::all
- @echo "$(GREEN)Clippy checks passed!$(NC)"
-
-# Run clippy with strict rules (for CI)
-clippy-strict:
- @echo "$(BLUE)Running strict cargo clippy...$(NC)"
- cargo clippy --all-targets --all-features -- -D warnings -W clippy::all
- @echo "$(GREEN)Strict clippy checks passed!$(NC)"
-
-# CI workflow - comprehensive verification
-ci-verify: fmt-check clippy kani-verify kani-report
- @echo "$(GREEN)CI verification workflow complete!$(NC)"
-
-# CI workflow without Kani (faster)
-ci-verify-quick: fmt-check clippy
- @echo "$(GREEN)Quick CI verification workflow complete!$(NC)"
-
-# Docker management
-docker:
- @echo "$(BLUE)Building Docker image...$(NC)"
- docker build -f Dockerfile.optimized -t polytorus:latest .
-
-docker-dev:
- @echo "$(BLUE)Starting development environment...$(NC)"
- docker-compose -f docker-compose.dev.yml up -d
-
-docker-clean:
- @echo "$(BLUE)Cleaning Docker resources...$(NC)"
- docker-compose -f docker-compose.dev.yml down -v
- docker system prune -f
-
-# Dependency management
-deps-check:
- @echo "$(BLUE)Checking dependencies...$(NC)"
- cargo outdated
- cargo audit
-
-deps-update:
- @echo "$(BLUE)Updating dependencies...$(NC)"
- cargo update
-
-# Security checks
-security-audit:
- @echo "$(BLUE)Running security audit...$(NC)"
- cargo audit
- cargo deny check
-
-# Documentation
-docs:
- @echo "$(BLUE)Building documentation...$(NC)"
- cargo doc --all-features --no-deps --open
-
-docs-serve:
- @echo "$(BLUE)Serving documentation...$(NC)"
- cargo doc --all-features --no-deps
- python3 -m http.server 8080 -d target/doc
-
-# Development targets
-.PHONY: kani-dev kani-list kani-check
-
-# Development verification (faster, smaller bounds)
-kani-dev: kani-setup
- @echo "$(BLUE)Running development verification (fast)...$(NC)"
- @mkdir -p verification_results
- cargo kani --harness verify_encryption_type_determination --solver-option="--bounds-check=off"
- cargo kani --harness verify_layer_state_transitions --solver-option="--bounds-check=off"
- @echo "$(GREEN)Development verification complete!$(NC)"
-
-# List all available harnesses
-kani-list:
- @echo "$(BLUE)Available Kani verification harnesses:$(NC)"
- @grep -r "#\[kani::proof\]" src/ -A 1 | grep "fn " | sed 's/.*fn \([^(]*\).*/ - \1/' | sort | uniq
-
-# Check Kani configuration
-kani-check:
- @echo "$(BLUE)Checking Kani configuration...$(NC)"
- @if command -v kani &> /dev/null; then \
- echo "$(GREEN)✅ Kani is installed$(NC)"; \
- kani --version; \
- else \
- echo "$(RED)❌ Kani is not installed$(NC)"; \
- fi
- @if [ -f "kani-config.toml" ]; then \
- echo "$(GREEN)✅ Kani config file exists$(NC)"; \
- else \
- echo "$(YELLOW)⚠️ Kani config file not found$(NC)"; \
- fi
-
-# Check dependency resolution
-dep-check:
- @echo "$(BLUE)Checking dependency resolution...$(NC)"
- @cargo check --workspace
- @cargo test --no-run --workspace
- @echo "$(GREEN)All dependencies resolved successfully!$(NC)"
-
-# Continuous integration target
-kani-ci: kani-setup
- @echo "$(BLUE)Running CI verification suite...$(NC)"
- @mkdir -p verification_results
- # Run only fast, deterministic verifications for CI
- cargo kani --harness verify_encryption_type_determination --timeout=60
- cargo kani --harness verify_layer_state_transitions --timeout=60
- cargo kani --harness verify_mining_stats --timeout=90
- @echo "$(GREEN)CI verification complete!$(NC)"
+check: ## Run cargo check
+ @echo "🔍 Running cargo check..."
+ cargo check --workspace
+
+clean: ## Clean build artifacts
+ @echo "🧹 Cleaning build artifacts..."
+ cargo clean
+ rm -rf target/
+ rm -rf logs/
+
+# Documentation targets
+docs: ## Generate documentation
+ @echo "📚 Generating documentation..."
+ cargo doc --no-deps --open
+
+docs-all: ## Generate documentation for all dependencies
+ @echo "📚 Generating documentation (with dependencies)..."
+ cargo doc --open
+
+# Docker targets
+docker-build: ## Build Docker image
+ @echo "🐳 Building Docker image..."
+ docker build -t polytorus:latest .
+
+# Development environment
+dev-setup: ## Setup development environment
+ @echo "🛠️ Setting up development environment..."
+ rustup update
+ rustup component add clippy rustfmt
+ cargo install cargo-watch cargo-edit
+
+dev-watch: ## Watch for changes and rebuild
+ @echo "👀 Watching for changes..."
+ cargo watch -x check -x test
+
+# Release targets
+release-check: fmt-check lint test ## Run all checks for release
+ @echo "✅ Release checks passed!"
+
+release-build: clean release-check build-release docs ## Build release version
+ @echo "🎉 Release build completed!"
+
+# Installation target
+install: build-release ## Install PolyTorus binary
+ @echo "📦 Installing PolyTorus..."
+ cargo install --path .
+
+# All-in-one targets
+all: clean build test lint fmt docs ## Run all development tasks
+
+ci: fmt-check lint test ## Run CI checks
+
+# Version and info
+version: ## Show version information
+ @echo "PolyTorus Blockchain Platform"
+ @echo "Version: $(shell cargo pkgid | cut -d'#' -f2 | cut -d':' -f2)"
+ @echo "Rust: $(shell rustc --version)"
+ @echo "Cargo: $(shell cargo --version)"
+
+info: version ## Show project information
+ @echo ""
+ @echo "🏗️ Architecture: 4-Layer Modular Blockchain"
+ @echo " - Execution Layer: WASM smart contracts"
+ @echo " - Settlement Layer: Optimistic rollups"
+ @echo " - Consensus Layer: Pluggable consensus"
+ @echo " - Data Availability: Distributed storage"
+ @echo ""
+ @echo "🔐 Security: Quantum-resistant cryptography"
+ @echo "🌐 Network: WebRTC P2P with advanced features"
+ @echo "💼 Wallets: HD wallets with multiple crypto backends"
+ @echo ""
+ @echo "📊 Test Coverage: $(shell cargo test --workspace 2>&1 | grep -o '[0-9]\+ passed' | head -1 || echo 'Run tests first') tests"
\ No newline at end of file
diff --git a/NETWORK_ERROR_ANALYSIS.md b/NETWORK_ERROR_ANALYSIS.md
deleted file mode 100644
index 9e18269..0000000
--- a/NETWORK_ERROR_ANALYSIS.md
+++ /dev/null
@@ -1,181 +0,0 @@
-# PolyTorus Network Error Analysis Report
-
-## 概要
-
-PolyTorusブロックチェーンのネットワーク層におけるエラーハンドリングの包括的な分析を実施しました。TESTNETを手元で動かした状態でのネットワークエラーの発生状況と対処状況を確認しました。
-
-## 実行環境
-
-- **プロジェクト**: PolyTorus v0.1.0
-- **Rust版**: nightly-2025-06-15
-- **テスト日時**: 2025年1月25日
-- **環境**: Linux x86_64
-
-## テスト結果サマリー
-
-### ✅ 正常に動作している項目
-
-1. **設定ファイル検証**
- - 全ての設定ファイル(modular-node1.toml, modular-node2.toml, modular-node3.toml)が適切に作成されている
- - 必要なネットワーク設定セクションが含まれている
- - ポート設定とブートストラップピア設定が正しく構成されている
-
-2. **基本的なネットワークエラーハンドリング**
- - 存在しないポートへの接続試行が適切に失敗する
- - 接続タイムアウトが正常に動作する
- - 到達不可能なホストへの接続が適切に処理される
-
-3. **ネットワークインターフェース**
- - localhost (127.0.0.1) への バインドが可能
- - 全インターフェース (0.0.0.0) へのバインドが可能
- - 必要なポート(8001-8003, 9001-9003)が利用可能
-
-4. **データ構造とディレクトリ**
- - データディレクトリ(data/node1, data/node2, data/node3)が正常に作成されている
- - ログディレクトリが準備されている
-
-### ⚠️ 制限事項・課題
-
-1. **GLIBC互換性問題**
- - バイナリ実行時にGLIBC_2.36エラーが発生
- - 実際のノード起動テストが実行できない状況
-
-2. **同期プリミティブの問題**
- - `std::sync::MutexGuard`がSendトレイトを実装していないため、一部のテストが実行できない
- - 非同期環境でのMutex使用に関する設計上の課題
-
-## ネットワークエラーハンドリングの実装状況
-
-### 🔧 実装済みのエラーハンドリング機能
-
-#### 1. 接続エラーハンドリング
-```rust
-// 接続タイムアウトの実装
-let stream = match timeout(Duration::from_secs(10), TcpStream::connect(addr)).await {
- Ok(Ok(stream)) => stream,
- Ok(Err(e)) => {
- // 接続失敗の記録
- Self::record_connection_failure(connection_pool.clone(), addr, format!("TCP connection failed: {}", e)).await;
- return Err(anyhow::anyhow!("TCP connection failed: {}", e));
- }
- Err(_) => {
- // タイムアウトの記録
- Self::record_connection_failure(connection_pool.clone(), addr, "Connection timeout".to_string()).await;
- return Err(anyhow::anyhow!("Connection timeout"));
- }
-};
-```
-
-#### 2. メッセージサイズ制限
-```rust
-const MAX_MESSAGE_SIZE: usize = 10 * 1024 * 1024; // 10MB
-
-if len > MAX_MESSAGE_SIZE {
- return Err(anyhow::anyhow!("Message too large: {}", len));
-}
-```
-
-#### 3. ピア管理とブラックリスト
-```rust
-// ピアの健全性チェック
-fn is_stale(&self) -> bool {
- let is_stale = self.last_pong.elapsed() > Duration::from_secs(PEER_TIMEOUT);
- if is_stale {
- log::debug!("Peer {} is stale (last pong: {:?} ago)", self.peer_id, self.last_pong.elapsed());
- }
- is_stale
-}
-
-// ブラックリスト機能
-struct BlacklistEntry {
- reason: String,
- blacklisted_at: Instant,
- duration: Option,
-}
-```
-
-#### 4. 接続プール管理
-```rust
-struct ConnectionPool {
- active_connections: HashMap,
- pending_connections: HashMap,
- failed_connections: HashMap,
-}
-```
-
-#### 5. 再試行メカニズム
-```rust
-// ブートストラップ接続の再試行
-while retry_count < MAX_RETRIES {
- match Self::connect_to_peer(...).await {
- Ok(()) => break,
- Err(e) => {
- retry_count += 1;
- if retry_count < MAX_RETRIES {
- tokio::time::sleep(Duration::from_secs(RETRY_DELAY)).await;
- }
- }
- }
-}
-```
-
-### 📊 ネットワーク統計とモニタリング
-
-```rust
-struct NetworkStats {
- pub total_connections: u64,
- pub active_connections: u64,
- pub messages_sent: u64,
- pub messages_received: u64,
- pub bytes_sent: u64,
- pub bytes_received: u64,
- pub blocks_propagated: u64,
- pub transactions_propagated: u64,
-}
-```
-
-### 🛡️ エラー回復機能
-
-1. **自動ピア発見**: 接続が失われた場合の自動再接続
-2. **メッセージキューイング**: 一時的な接続問題時のメッセージ保持
-3. **接続検証**: 論理的接続と物理的接続の整合性チェック
-4. **ネットワークヘルス監視**: ネットワーク全体の健全性追跡
-
-## テスト実行結果
-
-### 基本ネットワークエラーテスト
-- ✅ 存在しないピアへの接続: 適切に失敗
-- ✅ 接続タイムアウト: 正常に動作
-- ✅ ポートバインディング競合: 検出可能
-- ✅ 無効なアドレス: 適切に処理
-- ✅ メッセージシリアライゼーション: 正常に動作
-
-### ネットワーク回復力テスト
-- ✅ 複数の同時接続試行: 適切に処理
-- ✅ 急速な接続試行: エラー率が期待通り
-- ✅ 大容量メッセージ: サイズ制限が機能
-
-## 推奨事項
-
-### 短期的改善
-1. **GLIBC互換性の解決**: 実行環境の依存関係を修正
-2. **同期プリミティブの改善**: `tokio::sync::Mutex`の使用を検討
-3. **テストカバレッジの拡充**: 実際のノード間通信テストの追加
-
-### 長期的改善
-1. **ネットワーク分断耐性**: より高度な分断検出と回復機能
-2. **動的ピア発見**: DHT(分散ハッシュテーブル)の実装
-3. **QoS機能**: ネットワーク品質に基づく動的調整
-
-## 結論
-
-PolyTorusのネットワーク層は包括的なエラーハンドリング機能を実装しており、以下の点で優秀です:
-
-1. **堅牢性**: 様々なネットワークエラーシナリオに対応
-2. **回復力**: 自動再接続と接続プール管理
-3. **監視機能**: 詳細なネットワーク統計とヘルス監視
-4. **スケーラビリティ**: 大規模ネットワークに対応する設計
-
-現在の実装は本格的なブロックチェーンネットワークの要件を満たしており、実際のTESTNET運用においても信頼性の高いネットワーク通信が期待できます。
-
-GLIBC互換性問題が解決されれば、実際のマルチノードテストネットでの動作確認が可能となり、より詳細なネットワークエラーハンドリングの検証が実施できます。
diff --git a/NETWORK_TEST_COMPLETION_REPORT.md b/NETWORK_TEST_COMPLETION_REPORT.md
deleted file mode 100644
index 20ef896..0000000
--- a/NETWORK_TEST_COMPLETION_REPORT.md
+++ /dev/null
@@ -1,200 +0,0 @@
-# PolyTorus Network Error Testing - 完了報告書
-
-## 🎉 テスト完了サマリー
-
-**日時**: 2025年1月25日
-**テスト対象**: PolyTorus Blockchain Network Layer
-**テスト環境**: Linux x86_64, GLIBC 2.35
-**テスト期間**: 約1時間
-
-## ✅ 主要な成果
-
-### 1. GLIBC互換性問題の解決
-- **問題**: バイナリ実行時にGLIBC_2.36エラーが発生
-- **解決策**: 環境変数`LD_LIBRARY_PATH`の調整により解決
-- **結果**: 全てのPolyTorusバイナリが正常に実行可能
-
-```bash
-export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/lib:$LD_LIBRARY_PATH
-```
-
-### 2. マルチノードテストネットワークの成功
-- **3ノード同時起動**: ✅ 成功
-- **HTTP API通信**: ✅ 全ノードで正常応答
-- **トランザクション処理**: ✅ ノード間で正常に処理
-- **ネットワーク統計**: ✅ リアルタイム統計情報取得
-
-### 3. ネットワークエラーハンドリングの検証
-
-#### 接続エラー処理
-- ✅ 存在しないポートへの接続: 適切に失敗
-- ✅ 接続タイムアウト: 正常に動作
-- ✅ 到達不可能ホスト: 適切に処理
-
-#### API エラーハンドリング
-- ✅ 無効なJSON: 適切に拒否
-- ✅ 不正なリクエスト: グレースフルに処理
-- ✅ 存在しないエンドポイント: 適切なエラーレスポンス
-
-#### ネットワーク回復力
-- ✅ ノード障害時の継続動作: 正常
-- ✅ 部分的ネットワーク分断: 適切に処理
-- ✅ 高負荷時の安定性: 良好
-
-## 📊 実行したテストケース
-
-### 基本機能テスト
-1. **シングルノード起動テスト**
- - ノード起動: ✅
- - HTTP API: ✅
- - トランザクション処理: ✅
-
-2. **マルチノードネットワークテスト**
- - 3ノード同時起動: ✅
- - ノード間通信: ✅
- - トランザクション伝播: ✅
-
-3. **P2P通信テスト**
- - 2ノード間通信: ✅
- - 双方向トランザクション: ✅
- - ノード障害時の回復: ✅
-
-### エラーシナリオテスト
-1. **ポート競合テスト**
- - 競合検出: ✅
- - グレースフル失敗: ✅
-
-2. **無効リクエストテスト**
- - 不正JSON: ✅ 適切に処理
- - 欠損フィールド: ✅ 適切に処理
- - 無効エンドポイント: ✅ 適切に処理
-
-3. **ネットワーク障害テスト**
- - 接続失敗: ✅ 適切に検出
- - タイムアウト: ✅ 正常に動作
- - ノード停止: ✅ 他ノードは継続動作
-
-## 🔍 ログ分析結果
-
-### エラー発生状況
-- **重大エラー**: 0件
-- **警告**: 最小限
-- **ネットワークイベント**: 正常に記録
-- **トランザクション処理**: 全て成功
-
-### パフォーマンス指標
-- **ノード起動時間**: 3-5秒
-- **API応答時間**: <1秒
-- **トランザクション処理時間**: <1秒
-- **ネットワーク接続時間**: <3秒
-
-## 🛡️ 確認されたネットワークエラーハンドリング機能
-
-### 1. 接続管理
-```rust
-// タイムアウト付き接続
-let stream = match timeout(Duration::from_secs(10), TcpStream::connect(addr)).await {
- Ok(Ok(stream)) => stream,
- Ok(Err(e)) => {
- Self::record_connection_failure(connection_pool.clone(), addr, format!("TCP connection failed: {}", e)).await;
- return Err(anyhow::anyhow!("TCP connection failed: {}", e));
- }
- Err(_) => {
- Self::record_connection_failure(connection_pool.clone(), addr, "Connection timeout".to_string()).await;
- return Err(anyhow::anyhow!("Connection timeout"));
- }
-};
-```
-
-### 2. メッセージサイズ制限
-```rust
-const MAX_MESSAGE_SIZE: usize = 10 * 1024 * 1024; // 10MB
-
-if len > MAX_MESSAGE_SIZE {
- return Err(anyhow::anyhow!("Message too large: {}", len));
-}
-```
-
-### 3. ピア健全性監視
-```rust
-fn is_stale(&self) -> bool {
- let is_stale = self.last_pong.elapsed() > Duration::from_secs(PEER_TIMEOUT);
- if is_stale {
- log::debug!("Peer {} is stale (last pong: {:?} ago)", self.peer_id, self.last_pong.elapsed());
- }
- is_stale
-}
-```
-
-### 4. 接続プール管理
-- **アクティブ接続**: リアルタイム追跡
-- **保留中接続**: タイムアウト管理
-- **失敗接続**: 再試行ロジック
-- **ブラックリスト**: 悪意のあるピアの排除
-
-## 📈 ネットワーク統計
-
-### 実行されたテスト統計
-- **総テスト実行回数**: 15回
-- **成功率**: 100%
-- **平均実行時間**: 25秒/テスト
-- **検出されたネットワークエラー**: 0件(期待通り)
-
-### ノード統計例
-```json
-{
- "transactions_sent": 1,
- "transactions_received": 0,
- "timestamp": "2025-06-23T19:10:33.307936206+00:00",
- "node_id": "node-701"
-}
-```
-
-## 🎯 結論
-
-### ✅ 成功した項目
-1. **GLIBC互換性問題の完全解決**
-2. **マルチノードネットワークの安定動作**
-3. **包括的なエラーハンドリングの確認**
-4. **ネットワーク回復力の実証**
-5. **リアルタイム監視機能の動作確認**
-
-### 🔧 技術的ハイライト
-- **ゼロダウンタイム**: ノード障害時も他ノードは継続動作
-- **グレースフルエラーハンドリング**: 全てのエラーシナリオで適切な処理
-- **包括的ログ**: デバッグに十分な情報を提供
-- **高いパフォーマンス**: 低レイテンシでの応答
-
-### 🚀 本番環境への準備状況
-PolyTorusネットワーク層は以下の点で本番環境に対応可能:
-
-1. **堅牢性**: 様々な障害シナリオに対応
-2. **スケーラビリティ**: マルチノード環境で安定動作
-3. **監視可能性**: 包括的なログとメトリクス
-4. **保守性**: 明確なエラーメッセージと診断情報
-
-## 📝 推奨事項
-
-### 短期的改善
-1. **CI/CDパイプライン**: 自動化されたネットワークテストの統合
-2. **メトリクス強化**: Prometheusなどの監視システム統合
-3. **ドキュメント**: 運用手順書の作成
-
-### 長期的改善
-1. **分散テスト**: より大規模なネットワークでのテスト
-2. **負荷テスト**: 高トラフィック環境でのストレステスト
-3. **セキュリティテスト**: ペネトレーションテストの実施
-
-## 🎉 最終評価
-
-**総合評価: A+ (優秀)**
-
-PolyTorusのネットワーク層は、包括的なエラーハンドリング、優れた回復力、そして堅牢な設計を示しています。GLIBC互換性問題の解決により、実際のマルチノードテストネットワークでの動作が確認され、本格的なブロックチェーンネットワークとしての要件を満たしていることが実証されました。
-
-**✅ PolyTorus Network Layer は本番環境での使用に適している**
-
----
-
-*テスト実行者: AI Assistant*
-*テスト完了日時: 2025年1月25日*
-*次回テスト推奨: 3ヶ月後(機能追加時)*
diff --git a/README.ja.md b/README.ja.md
index a7f7e41..aa33aca 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -39,6 +39,169 @@ WASMスマートコントラクトサポート
マルチノードシミュレーションとネットワーク監視機能
+## 🧪 Container Lab E2Eテスト環境
+
+PolyTorusは、リアルなWebRTC P2Pネットワーキングとトランザクション伝播テストのための**完全なContainer Lab環境**を提供します。
+
+### 🚀 Container Labクイックスタート
+
+#### 前提条件
+- **Docker**: コンテナランタイム
+- **Container Lab**: ネットワークシミュレーションツール(オプション、手動Dockerアプローチも利用可能)
+- **Rust 1.84+**: WASMおよびWebRTCサポート用
+
+#### 1. テストネット用Dockerイメージのビルド
+```bash
+# Rust 1.84とWASMサポートを含む最適化Dockerイメージをビルド
+docker build -f Dockerfile.testnet -t polytorus:testnet .
+```
+
+#### 2. 3ノードテストネットのデプロイ
+```bash
+# Dockerネットワークの作成
+docker network create polytorus-net
+
+# ブートストラップノード(エントリーポイント)の起動
+docker run -d --name polytorus-bootstrap \
+ --network polytorus-net -p 18080:8080 \
+ -e NODE_ID=bootstrap-node \
+ -e LISTEN_PORT=8080 \
+ -e RUST_LOG=info \
+ polytorus:testnet
+
+# バリデータノード1の起動
+docker run -d --name polytorus-validator1 \
+ --network polytorus-net -p 18081:8080 \
+ -e NODE_ID=validator-1 \
+ -e LISTEN_PORT=8080 \
+ -e BOOTSTRAP_PEERS=polytorus-bootstrap:8080 \
+ -e RUST_LOG=info \
+ polytorus:testnet
+
+# バリデータノード2の起動
+docker run -d --name polytorus-validator2 \
+ --network polytorus-net -p 18082:8080 \
+ -e NODE_ID=validator-2 \
+ -e LISTEN_PORT=8080 \
+ -e BOOTSTRAP_PEERS=polytorus-bootstrap:8080,polytorus-validator1:8080 \
+ -e RUST_LOG=info \
+ polytorus:testnet
+```
+
+#### 3. ネットワークデプロイの確認
+```bash
+# 実行中のコンテナの確認
+docker ps --filter "name=polytorus-"
+
+# ネットワーク接続のテスト
+docker exec polytorus-validator1 ping -c 3 polytorus-bootstrap
+
+# ノードログの確認
+docker logs polytorus-bootstrap --tail 20
+```
+
+### 🎯 手動テストコマンド
+
+#### ブロックチェーンの初期化
+```bash
+# ブートストラップノードでブロックチェーンを初期化
+docker exec polytorus-bootstrap polytorus start
+
+# ブロックチェーンステータスの確認
+docker exec polytorus-bootstrap polytorus status
+```
+
+#### トランザクションの送信
+```bash
+# テストトランザクションの送信
+docker exec polytorus-bootstrap polytorus send \
+ --from alice --to bob --amount 1000
+
+# バリデータノードからの送信
+docker exec polytorus-validator1 polytorus send \
+ --from validator1 --to alice --amount 500
+```
+
+#### P2Pネットワーキングのテスト
+```bash
+# ブートストラップノードでP2Pネットワーキングを開始
+docker exec -d polytorus-bootstrap polytorus start-p2p \
+ --node-id bootstrap-node --listen-port 8080
+
+# ブートストラップピアを使用してバリデータでP2Pを開始
+docker exec -d polytorus-validator1 polytorus start-p2p \
+ --node-id validator-1 --listen-port 8080 \
+ --bootstrap-peers polytorus-bootstrap:8080
+```
+
+#### インタラクティブなノードアクセス
+```bash
+# ブートストラップノードシェルへのアクセス
+docker exec -it polytorus-bootstrap bash
+
+# バリデータノードシェルへのアクセス
+docker exec -it polytorus-validator1 bash
+
+# コンテナ内で直接コマンドを実行
+polytorus status
+polytorus send --from alice --to bob --amount 1000
+```
+
+### 🔧 自動テストスクリプト
+
+#### ヘルパースクリプト
+```bash
+# 手動テストヘルパー
+./scripts/manual-test.sh start # テストネットの構築と開始
+./scripts/manual-test.sh status # ネットワークステータスの表示
+./scripts/manual-test.sh test-tx # テストトランザクションの送信
+./scripts/manual-test.sh logs bootstrap # ノードログの表示
+./scripts/manual-test.sh exec bootstrap # ノードシェルへのアクセス
+./scripts/manual-test.sh stop # 停止とクリーンアップ
+
+# E2Eテストスイート(Container Lab必須)
+./scripts/run-e2e-tests.sh
+```
+
+### 🌐 ネットワーク設定
+
+#### ノード設定
+| ノード | コンテナ名 | ホストポート | ノードID | 役割 | ブートストラップピア |
+|--------|------------|--------------|----------|------|---------------------|
+| ブートストラップ | polytorus-bootstrap | 18080 | bootstrap-node | エントリーポイント | - |
+| バリデータ1 | polytorus-validator1 | 18081 | validator-1 | バリデータ | bootstrap:8080 |
+| バリデータ2 | polytorus-validator2 | 18082 | validator-2 | バリデータ | bootstrap:8080,validator1:8080 |
+
+#### 環境変数
+```bash
+NODE_ID=<固有ノード識別子> # ノード識別
+LISTEN_PORT=8080 # P2Pリスニングポート
+BOOTSTRAP_PEERS=<カンマ区切り> # ブートストラップピアのリスト
+RUST_LOG=info # ログレベル
+DEBUG_MODE=true # デバッグモードの有効化
+```
+
+### 🧪 テスト結果と検証
+
+Container Lab環境は以下を提供します:
+
+✅ **ネットワーク基盤**
+- 適切なノード間通信を持つ3ノードテストネット
+- リアルデータチャネルを使用したWebRTC P2Pネットワーキング
+- 環境ベースの設定システム
+
+✅ **ブロックチェーン操作**
+- ノード初期化とブロックチェーン起動
+- トランザクション作成と伝播
+- マルチノード協調
+
+✅ **プロダクション対応**
+- コンテナ化されたデプロイメント
+- リソース監視とヘルスチェック
+- 追加ノード用のスケーラブルアーキテクチャ
+
+詳細なテスト手順と結果については、[E2Eテストレポート](e2e-test-report.md)を参照してください。
+
📚 ドキュメントリンク
導入ガイド (Getting Started)
diff --git a/README.md b/README.md
index 845f58f..10fff7f 100644
--- a/README.md
+++ b/README.md
@@ -11,50 +11,8 @@
PolyTorus is a revolutionary **modular blockchain platform** designed for the post-quantum era, offering unparalleled cryptographic flexibility and adaptability. Built on a cutting-edge modular architecture, it cleanly separates consensus, execution, settlement, and data availability layers, enabling unprecedented customization and optimization for diverse use cases in the quantum computing age.
-## 🚀 **Latest Updates: CI/CD Integration & Pre-commit Automation** (June 2025)
-
-🎯 **PolyTorus achieves production-ready CI/CD pipeline with automated code quality enforcement:**
-
-- ✅ **Automated Pre-commit Checks** - cargo fmt, clippy, and tests run before every commit
-- ✅ **Unified CI/CD Pipeline** - GitHub Actions with multi-platform support, coverage, and security
-- ✅ **Docker Production Ready** - Multi-stage builds, security scanning, and compose orchestration
-- ✅ **Environment Management** - Secure secrets handling and flexible configuration
-- ✅ **Code Quality Enforcement** - Zero warnings policy with automated formatting
-- ✅ **Security Integration** - cargo-audit, Dependabot, and vulnerability scanning
-- ✅ **Kani Verification** - Formal verification integrated into CI pipeline
-
-## 🚀 **Major Achievement: Diamond IO E2E Obfuscation Integration** (June 2025)
-
-🎉 **PolyTorus now features complete Diamond IO integration:**
-
-- ✅ **End-to-End Obfuscation** - Real Diamond IO circuit obfuscation and evaluation
-- ✅ **Indistinguishability Obfuscation** - State-of-the-art cryptographic privacy
-- ✅ **Smart Contract Privacy** - Contracts execute without revealing logic or data
-- ✅ **Modular Architecture Support** - Diamond IO integrated across all layers
-- ✅ **Performance Optimized** - Multiple modes from testing to production security
-- ✅ **Full API Compatibility** - Seamless integration with existing PolyTorus systems
-
-## 🚀 **Previous Achievement: Code Quality & Network Enhancements** (December 2024)
-
-🎯 **PolyTorus achieves zero dead code and enhanced network reliability:**
-
-- ✅ **Zero Dead Code** - Complete elimination of unused code and warnings
-- ✅ **Enhanced Network Priority Queue** - Advanced message prioritization with rate limiting
-- ✅ **Improved P2P Networking** - Robust peer management and blacklisting system
-- ✅ **Network Health Monitoring** - Comprehensive network topology and health tracking
-- ✅ **Strict Code Quality** - All code actively used, no suppressions allowed
-- ✅ **Async Performance** - Optimized async networking with bandwidth management
-- ✅ **Production Ready** - Battle-tested with comprehensive test coverage
-
## 🚀 Features
-### 🔐 **Diamond IO Privacy Layer (Latest)**
-- **Circuit Obfuscation**: Transform smart contracts into indistinguishable programs
-- **Homomorphic Evaluation**: Execute obfuscated circuits on encrypted data
-- **Multiple Security Modes**: Dummy (testing), Testing (development), Production (maximum security)
-- **E2E Privacy**: Complete obfuscation from contract creation to execution
-- **Performance Scaling**: Optimized for different security vs speed requirements
-
### 🏗️ **Modular Architecture (Primary System)**
- **🔄 Execution Layer**: High-performance WASM smart contract execution with gas metering
- **⚖️ Settlement Layer**: Optimistic rollups with challenge mechanisms and batch processing
@@ -69,13 +27,6 @@ PolyTorus is a revolutionary **modular blockchain platform** designed for the po
- **Flexible Wallet System**: Users choose their preferred cryptographic backend
- **Seamless Migration**: Easy transition between cryptographic methods
-### 🧮 **Diamond IO Integration**
-- **Indistinguishability Obfuscation**: State-of-the-art iO implementation for smart contracts
-- **Homomorphic Encryption**: RLWE-based encryption for private computation
-- **Circuit Obfuscation**: Transform smart contracts into indistinguishable programs
-- **Zero-Knowledge Privacy**: Execute contracts without revealing logic or data
-- **Modular Integration**: Seamlessly integrated into the PolyTorus modular architecture
-
### 🔧 **Advanced Capabilities**
- **Smart Contracts**: High-performance WebAssembly (WASM) based execution engine
- **P2P Networking**: Robust peer-to-peer communication with modern protocols
@@ -638,4 +589,265 @@ make security # All security checks
make docs # Generate documentation
```
+## 🧪 Container Lab E2E Testing Environment
+
+PolyTorus provides a complete **Container Lab environment** for realistic multi-node testing with real WebRTC P2P networking and transaction propagation testing.
+
+### 🚀 Quick Start with Container Lab
+
+#### Prerequisites
+- **Docker**: Container runtime
+- **Container Lab**: Network simulation tool (optional, manual Docker approach available)
+- **Rust 1.84+**: For WASM and WebRTC support
+
+#### 1. Build Testnet Docker Image
+```bash
+# Build optimized Docker image with Rust 1.84 and WASM support
+docker build -f Dockerfile.testnet -t polytorus:testnet .
+```
+
+#### 2. Deploy 3-Node Testnet
+```bash
+# Create Docker network
+docker network create polytorus-net
+
+# Start Bootstrap Node (Entry point)
+docker run -d --name polytorus-bootstrap \
+ --network polytorus-net -p 18080:8080 \
+ -e NODE_ID=bootstrap-node \
+ -e LISTEN_PORT=8080 \
+ -e RUST_LOG=info \
+ polytorus:testnet
+
+# Start Validator Node 1
+docker run -d --name polytorus-validator1 \
+ --network polytorus-net -p 18081:8080 \
+ -e NODE_ID=validator-1 \
+ -e LISTEN_PORT=8080 \
+ -e BOOTSTRAP_PEERS=polytorus-bootstrap:8080 \
+ -e RUST_LOG=info \
+ polytorus:testnet
+
+# Start Validator Node 2
+docker run -d --name polytorus-validator2 \
+ --network polytorus-net -p 18082:8080 \
+ -e NODE_ID=validator-2 \
+ -e LISTEN_PORT=8080 \
+ -e BOOTSTRAP_PEERS=polytorus-bootstrap:8080,polytorus-validator1:8080 \
+ -e RUST_LOG=info \
+ polytorus:testnet
+```
+
+#### 3. Verify Network Deployment
+```bash
+# Check running containers
+docker ps --filter "name=polytorus-"
+
+# Test network connectivity
+docker exec polytorus-validator1 ping -c 3 polytorus-bootstrap
+
+# Check node logs
+docker logs polytorus-bootstrap --tail 20
+```
+
+### 🎯 Manual Testing Commands
+
+#### Initialize Blockchain
+```bash
+# Initialize blockchain on bootstrap node
+docker exec polytorus-bootstrap polytorus start
+
+# Check blockchain status
+docker exec polytorus-bootstrap polytorus status
+```
+
+#### Send Transactions
+```bash
+# Send test transaction
+docker exec polytorus-bootstrap polytorus send \
+ --from alice --to bob --amount 1000
+
+# Send from validator node
+docker exec polytorus-validator1 polytorus send \
+ --from validator1 --to alice --amount 500
+```
+
+#### Test P2P Networking
+```bash
+# Start P2P networking on bootstrap node
+docker exec -d polytorus-bootstrap polytorus start-p2p \
+ --node-id bootstrap-node --listen-port 8080
+
+# Start P2P on validator with bootstrap peer
+docker exec -d polytorus-validator1 polytorus start-p2p \
+ --node-id validator-1 --listen-port 8080 \
+ --bootstrap-peers polytorus-bootstrap:8080
+```
+
+#### Interactive Node Access
+```bash
+# Access bootstrap node shell
+docker exec -it polytorus-bootstrap bash
+
+# Access validator node shell
+docker exec -it polytorus-validator1 bash
+
+# Inside container - run commands directly
+polytorus status
+polytorus send --from alice --to bob --amount 1000
+```
+
+### 🔧 Automated Testing Scripts
+
+#### Helper Scripts
+```bash
+# Manual testing helper
+./scripts/manual-test.sh start # Build and start testnet
+./scripts/manual-test.sh status # Show network status
+./scripts/manual-test.sh test-tx # Send test transaction
+./scripts/manual-test.sh logs bootstrap # Show node logs
+./scripts/manual-test.sh exec bootstrap # Access node shell
+./scripts/manual-test.sh stop # Stop and cleanup
+
+# E2E test suite (requires Container Lab)
+./scripts/run-e2e-tests.sh
+```
+
+### 🌐 Network Configuration
+
+#### Node Configuration
+| Node | Container Name | Host Port | Node ID | Role | Bootstrap Peers |
+|------|----------------|-----------|---------|------|-----------------|
+| Bootstrap | polytorus-bootstrap | 18080 | bootstrap-node | Entry Point | - |
+| Validator 1 | polytorus-validator1 | 18081 | validator-1 | Validator | bootstrap:8080 |
+| Validator 2 | polytorus-validator2 | 18082 | validator-2 | Validator | bootstrap:8080,validator1:8080 |
+
+#### Environment Variables
+```bash
+NODE_ID= # Node identification
+LISTEN_PORT=8080 # P2P listening port
+BOOTSTRAP_PEERS= # List of bootstrap peers
+RUST_LOG=info # Logging level
+DEBUG_MODE=true # Enable debug mode
+```
+
+### 📊 Network Testing & Monitoring
+
+#### Connection Testing
+```bash
+# Test inter-node connectivity
+docker exec polytorus-validator1 ping polytorus-bootstrap
+docker exec polytorus-validator2 ping polytorus-validator1
+
+# Check P2P port connectivity
+docker exec polytorus-bootstrap netstat -tlnp | grep 8080
+```
+
+#### Transaction Flow Testing
+```bash
+# Multi-node transaction propagation test
+for node in bootstrap validator1 validator2; do
+ echo "Testing $node..."
+ docker exec polytorus-$node polytorus send \
+ --from $node --to other --amount 100
+done
+```
+
+#### Performance Monitoring
+```bash
+# Container resource usage
+docker stats polytorus-bootstrap polytorus-validator1 polytorus-validator2
+
+# Network traffic monitoring
+docker exec polytorus-bootstrap netstat -i
+```
+
+### 🔄 Container Lab Integration (Optional)
+
+For users with Container Lab access:
+
+#### Container Lab Topology
+```yaml
+# testnet.yml - Full Container Lab topology
+name: polytorus-testnet
+topology:
+ nodes:
+ bootstrap:
+ kind: linux
+ image: polytorus:testnet
+ env:
+ NODE_ID: "bootstrap-node"
+ LISTEN_PORT: "8080"
+ validator1:
+ kind: linux
+ image: polytorus:testnet
+ env:
+ NODE_ID: "validator-1"
+ BOOTSTRAP_PEERS: "bootstrap:8080"
+ links:
+ - endpoints: ["bootstrap:eth0", "validator1:eth0"]
+```
+
+#### Deploy with Container Lab
+```bash
+# Deploy complete topology
+sudo containerlab deploy -t testnet.yml
+
+# Access nodes
+sudo containerlab exec -t testnet.yml bootstrap bash
+
+# Cleanup
+sudo containerlab destroy -t testnet.yml
+```
+
+### 🧪 Test Results & Validation
+
+The Container Lab environment provides:
+
+✅ **Network Foundation**
+- 3-node testnet with proper inter-node communication
+- WebRTC P2P networking with real data channels
+- Environment-based configuration system
+
+✅ **Blockchain Operations**
+- Node initialization and blockchain startup
+- Transaction creation and propagation
+- Multi-node coordination
+
+✅ **Production Readiness**
+- Containerized deployment
+- Resource monitoring and health checks
+- Scalable architecture for additional nodes
+
+### 🔍 Troubleshooting
+
+#### Common Issues
+```bash
+# Container startup issues
+docker logs polytorus-bootstrap
+
+# Network connectivity problems
+docker network inspect polytorus-net
+
+# Port conflicts
+docker port polytorus-bootstrap
+
+# Resource issues
+docker system df
+docker system prune
+```
+
+#### Debug Mode
+```bash
+# Start containers with debug mode
+docker run -d --name polytorus-debug \
+ --network polytorus-net \
+ -e NODE_ID=debug-node \
+ -e DEBUG_MODE=true \
+ -e RUST_LOG=debug \
+ polytorus:testnet
+```
+
+For detailed testing procedures and results, see [E2E Test Report](e2e-test-report.md).
+
## 🔧 OpenFHE Library Installation
diff --git a/README_TESTNET.md b/README_TESTNET.md
deleted file mode 100644
index 3ef2c93..0000000
--- a/README_TESTNET.md
+++ /dev/null
@@ -1,304 +0,0 @@
-# 🏠 PolyTorus Local Testnet
-
-**Your personal blockchain development environment**
-
-The PolyTorus Local Testnet allows developers and users to run a complete blockchain network on their local machine using ContainerLab. Perfect for development, testing, and learning blockchain technology.
-
-## ⚡ Quick Start
-
-```bash
-# 1. Start your testnet
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-
-# 2. Open web interface
-./start-local-testnet.sh web
-
-# 3. Create your first wallet
-./start-local-testnet.sh wallet
-
-# 4. Send transactions via CLI
-./start-local-testnet.sh cli
-```
-
-## 🎯 What You Get
-
-### 🌐 **Complete Blockchain Network**
-- **6 Node Architecture**: Bootstrap, 2 Miners, Validator, User Interface, Explorer
-- **Real Mining**: Actual Proof-of-Work consensus with configurable difficulty
-- **Network Topology**: Realistic P2P connections using ContainerLab
-
-### 💻 **User-Friendly Interfaces**
-- **Web UI** (`:3000`): Beautiful interface for wallet management and transactions
-- **Block Explorer** (`:8080`): View blocks, transactions, and network stats
-- **REST API** (`:9020`): Full API access for dApp development
-- **Interactive CLI**: Python-based command-line interface
-
-### 🔧 **Developer Tools**
-- **Hot Reloading**: Changes reflected immediately
-- **Comprehensive Logging**: Debug with detailed container logs
-- **API Testing**: curl-friendly REST endpoints
-- **Load Testing**: Built-in transaction generation tools
-
-## 📋 Prerequisites
-
-- **Docker** - Container runtime
-- **ContainerLab** - Network orchestration
-- **Python 3** - CLI tools
-- **curl** - API testing
-
-```bash
-# Quick install (Ubuntu/Debian)
-bash -c "$(curl -sL https://get.containerlab.dev)" # ContainerLab
-curl -fsSL https://get.docker.com | sh # Docker
-```
-
-## 🚀 Usage Examples
-
-### Basic Operations
-
-```bash
-# Management
-./start-local-testnet.sh start # Start testnet
-./start-local-testnet.sh stop # Stop testnet
-./start-local-testnet.sh status # Check status
-./start-local-testnet.sh logs # View logs
-
-# User operations
-./start-local-testnet.sh wallet # Create wallet
-./start-local-testnet.sh send # Send test transaction
-./start-local-testnet.sh web # Open web UI
-./start-local-testnet.sh cli # Interactive CLI
-```
-
-### Interactive CLI
-
-```bash
-./start-local-testnet.sh cli
-
-polytest> create-wallet # Create new wallet
-polytest> wallets # List all wallets
-polytest> balance # Check balance
-polytest> send # Send transaction
-polytest> transactions # Recent transactions
-polytest> stats # Network statistics
-```
-
-### API Examples
-
-```bash
-# Create wallet
-curl -X POST http://localhost:9020/wallet/create
-
-# Send transaction
-curl -X POST http://localhost:9020/transaction/send \
- -H "Content-Type: application/json" \
- -d '{
- "from": "sender_address",
- "to": "recipient_address",
- "amount": 10.5,
- "gasPrice": 1
- }'
-
-# Check balance
-curl http://localhost:9020/balance/your_address
-
-# Network status
-curl http://localhost:9020/network/status
-```
-
-## 🏗️ Architecture
-
-```
-┌─────────────┐ ┌─────────────┐ ┌─────────────┐
-│ Bootstrap │────│ Miner 1 │────│ Miner 2 │
-│ :9000 │ │ :9001 │ │ :9002 │
-│ (Genesis) │ │ (Mining) │ │ (Mining) │
-└─────────────┘ └─────────────┘ └─────────────┘
- │ │ │
- └───────────────────┼───────────────────┘
- │
-┌─────────────┐ ┌─────────────┐ ┌─────────────┐
-│ Validator │ │User Interface│ │ Explorer │
-│ :9003 │ │ :3000 │ │ :8080 │
-│(Validation) │ │ (Web UI) │ │(Monitoring) │
-└─────────────┘ └─────────────┘ └─────────────┘
-```
-
-### Node Functions
-
-| Node | Port | Function |
-|------|------|----------|
-| **Bootstrap** | 9000 | Genesis node, network entry point |
-| **Miner 1** | 9001 | Active mining, transaction processing |
-| **Miner 2** | 9002 | Active mining, network redundancy |
-| **Validator** | 9003 | Transaction validation, consensus |
-| **User Interface** | 3000 | Web UI, API gateway |
-| **Explorer** | 8080 | Block explorer, network monitoring |
-
-## 🌐 Access Points
-
-| Service | URL | Description |
-|---------|-----|-------------|
-| **Web UI** | http://localhost:3000 | Main user interface |
-| **Block Explorer** | http://localhost:8080 | Blockchain explorer |
-| **API Gateway** | http://localhost:9020 | REST API access |
-| **Bootstrap API** | http://localhost:9000 | Core node API |
-| **Miner 1 API** | http://localhost:9001 | Mining node API |
-| **Miner 2 API** | http://localhost:9002 | Mining node API |
-| **Validator API** | http://localhost:9003 | Validation node API |
-
-## 🎮 Features
-
-### Web Interface Features
-- 👛 **Wallet Management**: Create, view, manage wallets
-- 💸 **Send Transactions**: User-friendly transaction interface
-- 📊 **Real-time Stats**: Block height, transactions, difficulty
-- 🔍 **Network Status**: Live node health monitoring
-- 📋 **Transaction History**: View all network transactions
-
-### CLI Features
-- 🖥️ **Interactive Mode**: Full-featured command-line interface
-- 🔄 **Automated Testing**: Send bulk test transactions
-- 📈 **Statistics**: Comprehensive network analytics
-- 🛠️ **Development Tools**: Wallet creation, balance checking
-
-### API Features
-- 🔗 **REST Endpoints**: Full blockchain functionality via HTTP
-- 📝 **JSON Responses**: Machine-readable data format
-- 🔐 **Wallet Operations**: Create, list, check balances
-- 💰 **Transaction Management**: Send, track, verify transactions
-- 📊 **Network Information**: Status, blocks, statistics
-
-## ⚙️ Configuration
-
-The testnet is pre-configured for immediate use, but can be customized:
-
-### Quick Settings (`config/testnet.toml`)
-```toml
-[consensus]
-block_time = 10000 # 10 seconds
-difficulty = 2 # Low for testing
-
-[testnet]
-chain_id = 31337
-initial_supply = 1000000000 # 1B tokens
-```
-
-### Network Topology (`testnet-local.yml`)
-- Modify node count
-- Adjust resource limits
-- Change network configuration
-- Add custom containers
-
-## 🧪 Testing Scenarios
-
-### Basic Workflow
-1. **Setup**: `./start-local-testnet.sh start`
-2. **Create Wallets**: Use Web UI or CLI
-3. **Fund Wallets**: Initial balances from genesis
-4. **Send Transactions**: Between wallets
-5. **Monitor**: Watch blocks being mined
-
-### Load Testing
-```bash
-# Generate 100 test transactions
-python3 scripts/testnet_manager.py --test-transactions 100
-
-# Monitor performance
-./start-local-testnet.sh status
-```
-
-### API Integration Testing
-```bash
-# Test all endpoints
-curl http://localhost:9020/wallet/list
-curl http://localhost:9020/network/status
-curl http://localhost:9020/block/latest
-```
-
-## 🔧 Troubleshooting
-
-### Common Issues
-
-**Containers not starting?**
-```bash
-# Check dependencies
-containerlab version
-docker --version
-
-# Check logs
-./start-local-testnet.sh logs
-```
-
-**Web UI not loading?**
-```bash
-# Check container status
-./start-local-testnet.sh status
-
-# Restart if needed
-./start-local-testnet.sh restart
-```
-
-**API calls failing?**
-```bash
-# Test connectivity
-curl http://localhost:9020/health
-
-# Check network
-docker network ls
-```
-
-### Clean Reset
-```bash
-# Complete cleanup and restart
-./start-local-testnet.sh clean
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-```
-
-## 📚 Documentation
-
-- **[Complete Guide](LOCAL_TESTNET_GUIDE.md)** - Detailed setup and usage
-- **[API Reference](docs/API_REFERENCE.md)** - Full API documentation
-- **[Configuration](docs/CONFIGURATION.md)** - Advanced configuration options
-- **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions
-
-## 🚀 Advanced Usage
-
-### Custom Development
-- **dApp Development**: Build against local testnet
-- **Smart Contracts**: Deploy and test contracts
-- **Performance Testing**: Load test your applications
-- **Network Simulation**: Test network conditions
-
-### Integration
-- **CI/CD Integration**: Automated testing in pipelines
-- **External Tools**: Connect monitoring and analytics
-- **Custom Nodes**: Add specialized node types
-- **Network Extensions**: Expand topology
-
-## 🤝 Support
-
-- **Issues**: [GitHub Issues](https://github.com/PolyTorus/polytorus/issues)
-- **Discussions**: [GitHub Discussions](https://github.com/PolyTorus/polytorus/discussions)
-- **Documentation**: [Full Documentation](https://docs.polytorus.org)
-- **Community**: [Discord](https://discord.gg/polytorus)
-
-## 📄 License
-
-Licensed under the same terms as the main PolyTorus project.
-
----
-
-## 🎯 Get Started Now!
-
-```bash
-git clone https://github.com/PolyTorus/polytorus
-cd polytorus
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-./start-local-testnet.sh web
-```
-
-Your personal blockchain awaits! 🚀
diff --git a/README_TESTNET_SIMPLE.md b/README_TESTNET_SIMPLE.md
deleted file mode 100644
index 2d6f048..0000000
--- a/README_TESTNET_SIMPLE.md
+++ /dev/null
@@ -1,353 +0,0 @@
-# 🏠 PolyTorus Local Testnet (CLI版)
-
-**シンプルで実用的なローカルブロックチェーン開発環境**
-
-PolyTorus Local Testnetは、開発者がローカルマシンでContainerLabを使用して完全なブロックチェーンネットワークを実行できるツールです。Web UIなしのシンプルな構成で、CLI/APIベースの開発に最適化されています。
-
-## ⚡ クイックスタート
-
-```bash
-# 1. テストネットをビルド・開始
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-
-# 2. 対話型CLIを使用
-./start-local-testnet.sh cli
-
-# 3. ウォレット作成とトランザクション送信
-polytest> create-wallet
-polytest> wallets
-polytest> send
-```
-
-## 🎯 環境構成
-
-### 🌐 **5ノード構成**
-- **Bootstrap** (`:9000`): ジェネシスノード、ネットワークエントリーポイント
-- **Miner 1** (`:9001`): アクティブマイニングノード
-- **Miner 2** (`:9002`): セカンドマイニングノード
-- **Validator** (`:9003`): トランザクション検証ノード
-- **API Gateway** (`:9020`): REST APIアクセスポイント
-
-### 🔧 **開発者向け機能**
-- **REST API**: 完全なブロックチェーン機能をHTTP経由で提供
-- **対話型CLI**: Pythonベースの高機能コマンドラインインターフェース
-- **リアルタイムマイニング**: 実際のProof-of-Workコンセンサス
-- **ホットリロード**: 変更が即座に反映
-
-## 📋 前提条件
-
-```bash
-# 必要なツール
-- Docker (コンテナランタイム)
-- ContainerLab (ネットワークオーケストレーション)
-- Python 3 (CLIツール用)
-- curl (APIテスト用)
-
-# クイックインストール (Ubuntu/Debian)
-bash -c "$(curl -sL https://get.containerlab.dev)" # ContainerLab
-curl -fsSL https://get.docker.com | sh # Docker
-```
-
-## 🚀 基本操作
-
-### 管理コマンド
-
-```bash
-# テストネット管理
-./start-local-testnet.sh start # テストネット開始
-./start-local-testnet.sh stop # テストネット停止
-./start-local-testnet.sh restart # テストネット再起動
-./start-local-testnet.sh status # ステータス確認
-./start-local-testnet.sh logs # ログ表示
-
-# 開発ツール
-./start-local-testnet.sh build # Dockerイメージビルド
-./start-local-testnet.sh clean # 全データクリーンアップ
-./start-local-testnet.sh api # APIエンドポイントテスト
-```
-
-### ユーザー操作
-
-```bash
-# ウォレット・トランザクション
-./start-local-testnet.sh wallet # 新しいウォレット作成
-./start-local-testnet.sh send # テストトランザクション送信
-./start-local-testnet.sh cli # 対話型CLI起動
-```
-
-## 🎮 対話型CLI
-
-最も強力な機能は対話型CLIです:
-
-```bash
-./start-local-testnet.sh cli
-
-# 基本操作
-polytest> help # 全コマンド表示
-polytest> status # ネットワーク状況
-polytest> stats # ブロックチェーン統計
-
-# ウォレット操作
-polytest> create-wallet # 新しいウォレット作成
-polytest> wallets # 全ウォレット一覧
-polytest> balance # 残高確認
-
-# トランザクション操作
-polytest> send # トランザクション送信
-polytest> transactions # 最近のトランザクション表示
-
-# 終了
-polytest> quit
-```
-
-## 🔗 API エンドポイント
-
-REST API (http://localhost:9020) で全機能にアクセス:
-
-### ウォレット操作
-```bash
-# ウォレット作成
-curl -X POST http://localhost:9020/wallet/create
-
-# ウォレット一覧
-curl http://localhost:9020/wallet/list
-
-# 残高確認
-curl http://localhost:9020/balance/
-```
-
-### トランザクション操作
-```bash
-# トランザクション送信
-curl -X POST http://localhost:9020/transaction/send \
- -H "Content-Type: application/json" \
- -d '{
- "from": "sender_address",
- "to": "recipient_address",
- "amount": 10.5,
- "gasPrice": 1
- }'
-
-# トランザクション状況確認
-curl http://localhost:9020/transaction/status/
-
-# 最近のトランザクション
-curl http://localhost:9020/transaction/recent
-```
-
-### ネットワーク情報
-```bash
-# ネットワーク状況
-curl http://localhost:9020/network/status
-
-# 最新ブロック
-curl http://localhost:9020/block/latest
-
-# 特定ブロック
-curl http://localhost:9020/block/
-```
-
-## 📊 ネットワーク構成
-
-```
-┌─────────────┐ ┌─────────────┐ ┌─────────────┐
-│ Bootstrap │────│ Miner 1 │────│ Miner 2 │
-│ :9000 │ │ :9001 │ │ :9002 │
-│ (Genesis) │ │ (Mining) │ │ (Mining) │
-└─────────────┘ └─────────────┘ └─────────────┘
- │ │ │
- └───────────────────┼───────────────────┘
- │
- ┌─────────────┐ ┌─────────────┐
- │ Validator │ │API Gateway │
- │ :9003 │ │ :9020 │
- │(Validation) │ │(REST API) │
- └─────────────┘ └─────────────┘
-```
-
-## 🧪 開発ワークフロー
-
-### 1. 基本的な開発フロー
-```bash
-# 環境起動
-./start-local-testnet.sh start
-
-# ウォレット作成
-./start-local-testnet.sh cli
-polytest> create-wallet
-polytest> create-wallet
-
-# トランザクション実行
-polytest> wallets
-polytest> send 100
-
-# 状況確認
-polytest> transactions
-polytest> stats
-```
-
-### 2. API統合テスト
-```bash
-# APIエンドポイントテスト
-./start-local-testnet.sh api
-
-# 個別API呼び出し
-curl http://localhost:9020/network/status
-curl http://localhost:9020/wallet/list
-```
-
-### 3. dApp開発
-```javascript
-// JavaScript例
-const API_BASE = 'http://localhost:9020';
-
-// ウォレット作成
-const response = await fetch(`${API_BASE}/wallet/create`, {
- method: 'POST'
-});
-const wallet = await response.json();
-
-// トランザクション送信
-const txResponse = await fetch(`${API_BASE}/transaction/send`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- from: wallet.address,
- to: targetAddress,
- amount: 10.5
- })
-});
-```
-
-## ⚙️ 設定
-
-### テストネット設定 (`config/testnet.toml`)
-```toml
-[consensus]
-block_time = 10000 # 10秒
-difficulty = 2 # テスト用低難易度
-
-[testnet]
-chain_id = 31337
-initial_supply = 1000000000 # 10億トークン
-
-# テスト用事前資金アカウント
-[testnet.prefunded_accounts]
-"test_account_1" = 1000000 # 100万トークン
-"test_account_2" = 500000 # 50万トークン
-```
-
-### ネットワーク設定のカスタマイズ
-- `testnet-local.yml`: ノード構成とリソース制限
-- `Dockerfile.testnet`: コンテナイメージ設定
-- `config/testnet.toml`: ブロックチェーンパラメータ
-
-## 🔧 トラブルシューティング
-
-### 一般的な問題
-
-**コンテナが起動しない?**
-```bash
-# 依存関係確認
-containerlab version
-docker --version
-
-# ログ確認
-./start-local-testnet.sh logs
-```
-
-**API呼び出しが失敗する?**
-```bash
-# 接続性テスト
-curl http://localhost:9020/health
-
-# ネットワーク確認
-docker network ls
-```
-
-**ノードが応答しない?**
-```bash
-# ステータス確認
-./start-local-testnet.sh status
-
-# 必要に応じて再起動
-./start-local-testnet.sh restart
-```
-
-### 完全リセット
-```bash
-# 全データクリーンアップと再構築
-./start-local-testnet.sh clean
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-```
-
-## 📚 高度な使用法
-
-### 自動化テスト
-```bash
-# 複数トランザクションの自動送信
-python3 scripts/testnet_manager.py --test-transactions 50
-
-# スクリプト統合
-python3 scripts/testnet_manager.py --create-wallet
-python3 scripts/testnet_manager.py --list-wallets
-```
-
-### 負荷テスト
-```python
-# Python例:100トランザクション送信
-import requests
-import time
-
-api_base = "http://localhost:9020"
-
-for i in range(100):
- response = requests.post(f"{api_base}/transaction/send", json={
- "from": wallet1,
- "to": wallet2,
- "amount": 1.0 + i * 0.1
- })
- print(f"Transaction {i}: {response.status_code}")
- time.sleep(1)
-```
-
-### CI/CD統合
-```yaml
-# GitHub Actions例
-- name: Start Testnet
- run: ./start-local-testnet.sh start
-
-- name: Run Tests
- run: python3 tests/integration_tests.py
-
-- name: Stop Testnet
- run: ./start-local-testnet.sh stop
-```
-
-## 📖 関連ドキュメント
-
-- **メインドキュメント**: [README.md](README.md)
-- **設定ガイド**: [CONFIGURATION.md](docs/CONFIGURATION.md)
-- **API リファレンス**: [API_REFERENCE.md](docs/API_REFERENCE.md)
-
-## 🤝 サポート
-
-- **Issues**: [GitHub Issues](https://github.com/PolyTorus/polytorus/issues)
-- **Discussions**: [GitHub Discussions](https://github.com/PolyTorus/polytorus/discussions)
-- **Documentation**: [Full Documentation](https://docs.polytorus.org)
-
----
-
-## 🎯 今すぐ始める!
-
-```bash
-git clone https://github.com/PolyTorus/polytorus
-cd polytorus
-./start-local-testnet.sh build
-./start-local-testnet.sh start
-./start-local-testnet.sh cli
-```
-
-シンプルで強力なローカルブロックチェーン環境をお楽しみください! 🚀
diff --git a/README_TUI.md b/README_TUI.md
deleted file mode 100644
index 1b7156c..0000000
--- a/README_TUI.md
+++ /dev/null
@@ -1,195 +0,0 @@
-# Polytorus TUI - Terminal User Interface
-
-A beautiful and powerful Terminal User Interface for the Polytorus blockchain platform, built with `ratatui`.
-
-## Features
-
-### 🎨 Modern UI Design
-- **Multiple Screens**: Dashboard, Wallets, Transactions, Network
-- **Responsive Layout**: Adapts to terminal size
-- **Color-coded Interface**: Visual feedback for different states
-- **Keyboard Navigation**: Vim-style and arrow key support
-
-### 💰 Transaction Focus
-- **Interactive Transaction Form**: Step-by-step transaction creation
-- **Real-time Validation**: Address and amount validation
-- **Balance Checking**: Insufficient balance detection
-- **Transaction History**: View sent and received transactions
-- **Status Tracking**: Pending, confirmed, and failed states
-
-### 🗂️ Wallet Management
-- **Multiple Wallets**: Support for multiple wallet addresses
-- **Balance Display**: Real-time balance updates
-- **Wallet Creation**: Create new ECDSA wallets
-- **Address Management**: Easy address selection and copying
-
-### 🌐 Network Information
-- **Network Status**: Connection and sync status
-- **Peer Information**: Connected peers and network health
-- **Block Height**: Current blockchain height
-- **Hash Rate**: Network hash rate display
-
-## Quick Start
-
-### Build and Run
-```bash
-# Build the TUI binary
-cargo build --bin polytorus_tui
-
-# Run the TUI application
-./target/debug/polytorus_tui
-```
-
-### Keyboard Shortcuts
-
-#### Global Navigation
-- `1-4` - Switch between screens (Dashboard, Wallets, Transactions, Network)
-- `Tab` / `Shift+Tab` - Navigate between panels
-- `↑↓` / `j k` - Navigate lists
-- `Enter` - Select / Confirm
-- `Esc` - Close popup / Cancel
-- `q` / `Ctrl+C` - Quit application
-
-#### Wallet Actions
-- `s` - Send transaction (when wallet selected)
-- `n` - Create new wallet
-- `r` - Refresh data
-
-#### Help
-- `?` / `h` - Show help popup
-
-#### Transaction Form
-- `Tab` / `Shift+Tab` - Navigate form fields
-- `Type` - Enter address/amount
-- `Backspace` - Delete character
-- `Enter` - Send transaction (on confirm button)
-
-## Screen Overview
-
-### 📊 Dashboard Screen
-- **Overview Statistics**: Total balance, wallet count, transaction count
-- **Network Status**: Connection status and block height
-- **Quick Actions**: Common operations at a glance
-- **Recent Activity**: Latest blockchain events
-
-### 💰 Wallets Screen
-- **Wallet List**: All available wallets with balances
-- **Wallet Details**: Selected wallet information
-- **Balance Display**: BTC and satoshi amounts
-- **Address Management**: Easy wallet selection
-
-### 📤 Transactions Screen
-- **Transaction History**: Complete transaction list
-- **Transaction Details**: Hash, amount, addresses, timestamps
-- **Status Indicators**: Visual confirmation status
-- **Real-time Updates**: Live transaction status updates
-
-### 🌐 Network Screen
-- **Network Overview**: Connection and sync status
-- **Peer List**: Connected peers with statistics
-- **Network Actions**: Connection and sync controls
-- **Health Monitoring**: Network performance metrics
-
-## Architecture
-
-### Component Structure
-```
-src/tui/
-├── app.rs # Main application logic
-├── components/ # Reusable UI components
-│ ├── wallet_list.rs # Wallet list component
-│ ├── transaction_form.rs # Transaction form overlay
-│ ├── transaction_list.rs # Transaction history
-│ ├── status_bar.rs # Bottom status bar
-│ └── help_popup.rs # Help overlay
-├── screens/ # Full-screen views
-│ ├── dashboard.rs # Overview screen
-│ ├── wallets.rs # Wallet management
-│ ├── transactions.rs # Transaction history
-│ └── network.rs # Network information
-├── styles.rs # Color and style definitions
-└── utils.rs # Helper functions and types
-```
-
-### Integration Points
-- **Wallet Backend**: Integrates with existing `crypto::wallets::Wallets`
-- **Blockchain**: Uses `UnifiedModularOrchestrator` for blockchain operations
-- **Configuration**: Respects existing `DataContext` and configuration
-- **Networking**: Displays real network status and peer information
-
-## Customization
-
-### Styling
-The TUI uses a consistent color scheme defined in `styles.rs`:
-- **Primary**: Cyan for titles and highlights
-- **Success**: Green for positive states
-- **Warning**: Yellow for caution states
-- **Error**: Red for error states
-- **Info**: Blue for informational text
-
-### Configuration
-The TUI respects all existing Polytorus configuration:
-- Data directories from `DataContext`
-- Network settings from configuration files
-- Wallet encryption types and preferences
-
-## Development
-
-### Adding New Screens
-1. Create new screen module in `src/tui/screens/`
-2. Implement the screen with `render()` method
-3. Add to the main application router in `app.rs`
-4. Add keyboard shortcut for navigation
-
-### Adding New Components
-1. Create component in `src/tui/components/`
-2. Implement with `render()` method taking `Frame` and `Rect`
-3. Add to the appropriate screen
-4. Export in the module's `mod.rs`
-
-### Extending Functionality
-- **Real Transaction Sending**: Implement actual transaction creation and signing
-- **Live Updates**: Add periodic blockchain state refreshing
-- **Settings Screen**: Add configuration management
-- **Advanced Features**: Smart contracts, governance, mining
-
-## Dependencies
-
-- **ratatui**: Terminal UI framework
-- **crossterm**: Cross-platform terminal handling
-- **tokio**: Async runtime for blockchain integration
-- **chrono**: Date and time formatting
-- **anyhow**: Error handling
-
-## Examples
-
-### Send Transaction Flow
-1. Navigate to Wallets screen (`2`)
-2. Select a wallet with balance (arrow keys)
-3. Press `s` to open transaction form
-4. Fill in recipient address (Tab to navigate fields)
-5. Enter amount in BTC
-6. Navigate to Send button and press Enter
-7. Transaction is created and added to history
-
-### Create New Wallet
-1. Press `n` from any screen
-2. New ECDSA wallet is created automatically
-3. Address is added to wallet list
-4. Wallet is saved to disk
-
-### View Network Status
-1. Navigate to Network screen (`4`)
-2. View connection status and peer count
-3. Monitor blockchain synchronization
-4. Check network health metrics
-
-## Future Enhancements
-
-- **Smart Contract Interface**: Deploy and interact with contracts
-- **Mining Dashboard**: Mining status and controls
-- **Governance Interface**: Proposal creation and voting
-- **Multi-signature Support**: Multi-sig wallet management
-- **Hardware Wallet**: Hardware wallet integration
-- **QR Code Support**: QR code generation and scanning
-- **Export/Import**: Transaction and wallet data export
diff --git a/README_VIM_TUI.md b/README_VIM_TUI.md
deleted file mode 100644
index 786b297..0000000
--- a/README_VIM_TUI.md
+++ /dev/null
@@ -1,314 +0,0 @@
-# Polytorus Vim-Style TUI
-
-A powerful vim-inspired Terminal User Interface for the Polytorus blockchain platform. Experience the full power of blockchain operations with familiar vim keybindings and modes.
-
-## 🚀 Quick Start
-
-### Launch from CLI
-```bash
-# Start the main CLI and launch TUI
-./target/release/polytorus --tui
-
-# Or use the standalone TUI binary
-./target/release/polytorus_tui
-```
-
-## 🔧 Vim Modes & Navigation
-
-### 📍 **Normal Mode** (Default)
-The primary mode for navigation and commands.
-
-#### **Navigation (hjkl style)**
-- `h` - Move left
-- `j` - Move down
-- `k` - Move up
-- `l` - Move right
-- `g` - Go to top of list
-- `G` - Go to bottom of list
-- `Ctrl+u` - Page up
-- `Ctrl+d` - Page down
-
-#### **Screen Navigation**
-- `1` - Dashboard screen
-- `2` - Wallets screen
-- `3` - Transactions screen
-- `4` - Network screen
-- `Tab` - Next screen
-- `Shift+Tab` - Previous screen
-
-#### **Core Actions**
-- `s` - Send transaction (when wallet selected)
-- `n` - Create new wallet
-- `r` - Refresh all data
-- `?` - Show help
-- `q` - Quit application
-
-#### **Mode Switching**
-- `i`, `a`, `o` - Enter Insert mode
-- `v`, `V` - Enter Visual mode
-- `:` - Enter Command mode
-
-### ✏️ **Insert Mode**
-Active when creating transactions or editing data.
-
-- `Esc` - Return to Normal mode
-- `Enter` - Confirm action
-- `Tab` / `Shift+Tab` - Navigate form fields
-- `Backspace` - Delete character
-- Type normally to input text
-
-### 👁️ **Visual Mode**
-For selection and visual feedback.
-
-- `h`, `j`, `k`, `l` - Navigate while selecting
-- `Enter` or `y` - Confirm selection
-- `Esc` - Return to Normal mode
-
-### ⌨️ **Command Mode**
-Execute powerful commands with `:` prefix.
-
-#### **Navigation Commands**
-- `:1` or `:dashboard` - Go to Dashboard
-- `:2` or `:wallets` - Go to Wallets
-- `:3` or `:transactions` - Go to Transactions
-- `:4` or `:network` - Go to Network
-
-#### **Action Commands**
-- `:q` or `:quit` - Quit application
-- `:q!` - Force quit
-- `:wq` or `:x` - Save and quit
-- `:send` - Send transaction
-- `:new` or `:newwallet` - Create new wallet
-- `:refresh` or `:r` - Refresh data
-
-## 📱 Screen Overview
-
-### 📊 **Dashboard** (`1` or `:dashboard`)
-Overview of your blockchain status:
-- Total balance across all wallets
-- Wallet count and transaction history
-- Network connection status
-- Quick action shortcuts
-- Recent activity feed
-
-**Vim Commands:**
-- `s` - Quick send transaction
-- `n` - Create new wallet
-- `r` - Refresh data
-
-### 💰 **Wallets** (`2` or `:wallets`)
-Comprehensive wallet management:
-- List all wallets with balances
-- Select wallets with `j`/`k` navigation
-- View detailed wallet information
-- Balance display in BTC and satoshis
-
-**Vim Commands:**
-- `j`/`k` - Navigate wallet list
-- `s` - Send from selected wallet
-- `n` - Create new wallet
-- `Enter` - Select wallet
-- `i` - Edit wallet (future feature)
-
-### 📤 **Transactions** (`3` or `:transactions`)
-Transaction history and monitoring:
-- Complete transaction history
-- Real-time status updates
-- Transaction details (hash, amounts, addresses)
-- Visual status indicators
-
-**Vim Commands:**
-- `j`/`k` - Navigate transaction list
-- `Enter` - View transaction details
-- `r` - Refresh transaction status
-- `g`/`G` - First/last transaction
-
-### 🌐 **Network** (`4` or `:network`)
-Network status and peer management:
-- Connected peers list
-- Network health monitoring
-- Blockchain synchronization status
-- Network performance metrics
-
-**Vim Commands:**
-- `r` - Refresh network status
-- `j`/`k` - Navigate peer list
-- Future: Connect/disconnect peers
-
-## 💸 Transaction Workflow (Vim Style)
-
-### Quick Send (Vim-Style)
-1. **Navigate to wallet**: `2` → `j`/`k` to select
-2. **Start transaction**: `s` (enters Insert mode)
-3. **Fill form**: Tab between fields, type address/amount
-4. **Send**: Navigate to Send button with Tab, press `Enter`
-5. **Return**: Automatically returns to Normal mode
-
-### Command-Line Send
-1. **Command mode**: `:`
-2. **Send command**: `send` + `Enter`
-3. **Fill form**: Same as above
-
-## 🎨 Status Bar
-
-The bottom status bar shows:
-- 📍 Current screen name
-- 🌐 Network connection status
-- 🔗 Current block height
-- 👥 Connected peers count
-- ⏳ Sync status
-- **🔥 Current Vim Mode** (NORMAL/INSERT/COMMAND/VISUAL)
-
-Mode colors:
-- `NORMAL` - Default white
-- `INSERT` - Green (active editing)
-- `COMMAND` - Yellow (command input)
-- `VISUAL` - Cyan (selection mode)
-
-## ⌨️ Complete Keybinding Reference
-
-### Normal Mode Shortcuts
-```
-NAVIGATION:
-h j k l - Navigate (vim style)
-g / G - Top / Bottom
-Ctrl+u/d - Page up/down
-1 2 3 4 - Switch screens
-Tab - Next screen
-
-ACTIONS:
-s - Send transaction
-n - New wallet
-r - Refresh data
-? - Help
-q - Quit
-
-MODE SWITCH:
-i a o - Insert mode
-v V - Visual mode
-: - Command mode
-Esc - Normal mode
-```
-
-### Command Mode Reference
-```
-NAVIGATION:
-:1 - Dashboard
-:2 - Wallets
-:3 - Transactions
-:4 - Network
-
-ACTIONS:
-:q - Quit
-:send - Send transaction
-:new - New wallet
-:refresh - Refresh data
-```
-
-### Insert Mode (Transaction Form)
-```
-Tab - Next field
-Shift+Tab - Previous field
-Enter - Confirm/Send
-Esc - Cancel (Normal mode)
-Backspace - Delete char
-Type - Input data
-```
-
-## 🔥 Advanced Vim Features
-
-### Vim-Style Movement Patterns
-- `5j` - Move down 5 items (future)
-- `gg` - Go to first item
-- `G` - Go to last item
-- `/search` - Search functionality (future)
-
-### Visual Mode Selection
-- Enter visual mode with `v`
-- Navigate to select items
-- `y` to "yank" (copy) selection
-- `Esc` to exit visual mode
-
-### Command History
-- `:`⬆️⬇️ - Browse command history (future)
-- `:!!` - Repeat last command (future)
-
-## 🛠️ Customization
-
-### Vim Configuration (Future)
-Create `~/.polytorusrc` for custom keybindings:
-```vim
-" Custom key mappings
-map w :wallets
-map s :send
-map n :new
-
-" Custom colors
-colorscheme dark
-```
-
-## 💡 Tips & Tricks
-
-### Efficiency Tips
-1. **Quick Navigation**: Use `2s` to go to wallets and immediately send
-2. **Batch Operations**: Use `:refresh` after multiple transactions
-3. **Status Monitoring**: Keep eye on status bar for mode/network info
-4. **Command Mode**: Use `:` for complex operations
-
-### Muscle Memory
-- Coming from vim? All navigation keys work as expected
-- New to vim? Start with arrow keys, gradually adopt `hjkl`
-- Use `?` frequently to reference commands
-
-### Power User Shortcuts
-```bash
-# Quick send workflow
-2 # Go to wallets
-jjj # Navigate to wallet 3
-s # Start send
-# Type address and amount
-Enter # Send transaction
-
-# Quick refresh everything
-:refresh
-
-# Quick quit
-:q
-```
-
-## 🔧 Integration with CLI
-
-The TUI integrates seamlessly with the existing Polytorus CLI:
-
-```bash
-# Launch TUI from any CLI operation
-polytorus --tui
-
-# Continue CLI operations after TUI
-polytorus --listaddresses
-polytorus --getbalance
-
-# Background blockchain operations
-polytorus --modular-start &
-polytorus --tui
-```
-
-## 🎯 Future Enhancements
-
-### Advanced Vim Features
-- [ ] Search functionality (`/` and `?`)
-- [ ] Command history and completion
-- [ ] Macro recording (`qq...q`)
-- [ ] Multiple window support (`:split`)
-- [ ] Custom key mappings
-- [ ] Vim configuration file
-
-### Enhanced Functionality
-- [ ] Smart contract interaction
-- [ ] Mining dashboard
-- [ ] Governance voting interface
-- [ ] Multi-signature wallet support
-- [ ] Hardware wallet integration
-- [ ] QR code display and scanning
-
-The Polytorus Vim-Style TUI brings the power and efficiency of vim to blockchain operations, making complex transactions and network management as intuitive as text editing. 🚀
diff --git a/REALISTIC_TESTNET_GUIDE.md b/REALISTIC_TESTNET_GUIDE.md
deleted file mode 100644
index ac904d3..0000000
--- a/REALISTIC_TESTNET_GUIDE.md
+++ /dev/null
@@ -1,430 +0,0 @@
-# PolyTorus Realistic Testnet Guide
-
-## Overview
-
-This guide explains how to use the enhanced ContainerLab topology for PolyTorus that simulates realistic network conditions with Autonomous System (AS) separation, geographic distribution, and various network constraints.
-
-## Architecture
-
-### Autonomous Systems
-
-The testnet simulates four autonomous systems representing different global regions:
-
-#### AS65001 - North America
-- **Tier**: Tier-1 ISP infrastructure
-- **Characteristics**: High bandwidth (1Gbps), low latency (10-50ms)
-- **Nodes**:
- - `bootstrap-na`: Primary bootstrap node with 99.9% uptime
- - `miner-pool-na`: High-performance mining pool infrastructure
- - `exchange-na`: Exchange infrastructure with compliance requirements
-
-#### AS65002 - Europe
-- **Tier**: Datacenter/institutional infrastructure
-- **Characteristics**: Good bandwidth (100-500Mbps), moderate latency (80-120ms to NA)
-- **Nodes**:
- - `validator-institution-eu`: Institutional validator with GDPR compliance
- - `research-eu`: Academic research node with experimental features
-
-#### AS65003 - Asia-Pacific
-- **Tier**: Business ISP with mobile optimization
-- **Characteristics**: Variable bandwidth (25-200Mbps), high latency (150-250ms to other regions)
-- **Nodes**:
- - `miner-apac`: Regional miner with trans-Pacific connectivity
- - `mobile-backend-apac`: Mobile wallet backend with carrier-grade connectivity
-
-#### AS65004 - Edge/Mobile
-- **Tier**: Satellite and rural connectivity
-- **Characteristics**: Limited bandwidth (2-25Mbps), very high latency (300-2000ms)
-- **Nodes**:
- - `light-client-mobile`: Mobile light client for edge devices
- - `rural-satellite`: Rural node with satellite connectivity
-
-### Network Characteristics
-
-#### Latency Matrix
-```
- NA EU APAC EDGE
-NA 10ms 100ms 180ms 50ms
-EU 100ms 15ms 220ms 80ms
-APAC 180ms 220ms 20ms 150ms
-EDGE 50ms 80ms 150ms 100ms
-```
-
-#### Bandwidth Limits
-- **Tier-1 (NA)**: 500Mbps - 1Gbps
-- **Datacenter (EU)**: 100-500Mbps
-- **Business (APAC)**: 25-200Mbps
-- **Mobile/Satellite (EDGE)**: 2-25Mbps
-
-#### Packet Loss
-- **Fiber connections**: 0.01-0.1%
-- **Wireless/cellular**: 0.1-1%
-- **Satellite connections**: 1-2%
-
-## Quick Start
-
-### Prerequisites
-
-1. **ContainerLab**: Install with `bash -c "$(curl -sL https://get.containerlab.dev)"`
-2. **Docker**: Container runtime
-3. **Rust/Cargo**: For building PolyTorus
-4. **Linux Traffic Control (tc)**: For network impairments
-5. **FRRouting (optional)**: For BGP simulation
-
-### Basic Usage
-
-1. **Start the realistic testnet**:
-```bash
-./scripts/realistic_testnet_simulation.sh
-```
-
-2. **Start with custom parameters**:
-```bash
-./scripts/realistic_testnet_simulation.sh 1800 200 15 false
-# Duration: 30 minutes, 200 transactions, 15s interval, no chaos mode
-```
-
-3. **Enable chaos engineering**:
-```bash
-./scripts/realistic_testnet_simulation.sh 3600 500 10 true
-# 1 hour simulation with chaos testing enabled
-```
-
-## Advanced Configuration
-
-### Network Simulation Parameters
-
-Edit `/home/shiro/workspace/polytorus/config/realistic-testnet.toml` to adjust:
-
-#### Geographic Latency Settings
-```toml
-[network.latency_matrix]
-north_america_to_europe = 100
-north_america_to_asia_pacific = 180
-europe_to_asia_pacific = 220
-# Add jitter and packet loss per link
-```
-
-#### Regional Characteristics
-```toml
-[network.regions.north_america]
-base_latency_ms = 10
-jitter_ms = 2
-bandwidth_mbps = 1000
-packet_loss_percent = 0.01
-connectivity_tier = "tier1_isp"
-```
-
-#### Node Type Definitions
-```toml
-[node_types.mining_pool]
-description = "High-performance mining pool infrastructure"
-min_uptime_percent = 99.5
-min_bandwidth_mbps = 200
-max_latency_ms = 20
-required_connections = 15
-```
-
-### BGP Configuration
-
-The testnet includes FRR routers for realistic BGP simulation:
-
-#### Viewing BGP Status
-```bash
-# Check BGP neighbors
-docker exec clab-polytorus-realistic-testnet-router-na vtysh -c "show ip bgp summary"
-
-# View routing table
-docker exec clab-polytorus-realistic-testnet-router-na vtysh -c "show ip route"
-
-# Check BGP routes
-docker exec clab-polytorus-realistic-testnet-router-na vtysh -c "show ip bgp"
-```
-
-#### BGP Communities
-- `65001:100`: North America routes
-- `65002:777`: GDPR protected routes (Europe)
-- `65003:555`: Mobile optimized routes (APAC)
-- `65004:999`: Satellite/low-bandwidth routes (Edge)
-
-### Traffic Control Examples
-
-#### Manual Network Impairment
-```bash
-# Add 200ms latency with 20ms jitter
-docker exec clab-polytorus-realistic-testnet-miner-apac \
- tc qdisc add dev eth1 root netem delay 200ms 20ms
-
-# Limit bandwidth to 10Mbps
-docker exec clab-polytorus-realistic-testnet-rural-satellite \
- tc qdisc add dev eth1 root handle 1: tbf rate 10mbit burst 10kb latency 50ms
-
-# Add packet loss
-docker exec clab-polytorus-realistic-testnet-light-client-mobile \
- tc qdisc add dev eth1 root netem loss 1%
-```
-
-#### Network Partition Simulation
-```bash
-# Isolate APAC region
-docker exec clab-polytorus-realistic-testnet-router-apac \
- tc qdisc add dev eth2 root netem loss 100%
-docker exec clab-polytorus-realistic-testnet-router-apac \
- tc qdisc add dev eth3 root netem loss 100%
-
-# Restore connectivity
-docker exec clab-polytorus-realistic-testnet-router-apac \
- tc qdisc del dev eth2 root
-docker exec clab-polytorus-realistic-testnet-router-apac \
- tc qdisc del dev eth3 root
-```
-
-## Monitoring & Observability
-
-### Node Status Endpoints
-
-Each node exposes HTTP APIs for monitoring:
-
-```bash
-# Bootstrap node status
-curl http://localhost:9000/status
-
-# Mining pool statistics
-curl http://localhost:9001/stats
-
-# Institutional validator metrics
-curl http://localhost:9010/metrics
-```
-
-### Network Performance Monitoring
-
-The simulation includes automated monitoring for:
-
-- **Inter-AS connectivity**: Latency and reachability between regions
-- **Bandwidth utilization**: Traffic patterns and congestion
-- **Partition detection**: Network splits and healing
-- **BGP convergence**: Routing table updates and stability
-
-### Blockchain Metrics
-
-Monitor blockchain-specific metrics:
-
-- **Block propagation**: Time for blocks to reach all regions
-- **Transaction latency**: End-to-end transaction confirmation time
-- **Fork resolution**: Consensus behavior during network partitions
-- **Mining distribution**: Hash rate distribution across regions
-
-## Testing Scenarios
-
-### 1. Geographic Distribution Testing
-
-**Objective**: Validate blockchain performance across global regions
-
-**Test Steps**:
-1. Deploy full testnet
-2. Generate transactions from each region
-3. Monitor block propagation times
-4. Measure transaction confirmation latency
-
-**Expected Results**:
-- Blocks propagate within 30-60 seconds globally
-- Transaction finality varies by region (10s NA, 60s satellite)
-- No consensus failures during normal operation
-
-### 2. Network Partition Testing
-
-**Objective**: Test consensus resilience during network splits
-
-**Test Steps**:
-1. Start testnet in normal operation
-2. Simulate partition isolating one region
-3. Monitor consensus behavior
-4. Heal partition and observe recovery
-
-**Expected Results**:
-- Consensus continues in majority partition
-- Minority partition stops producing blocks
-- Recovery occurs within 5-10 minutes after healing
-
-### 3. Performance Under Constraint Testing
-
-**Objective**: Validate operation under bandwidth/latency constraints
-
-**Test Steps**:
-1. Deploy testnet with realistic constraints
-2. Generate high transaction load
-3. Monitor system performance
-4. Identify bottlenecks and limitations
-
-**Expected Results**:
-- Graceful degradation under load
-- Mobile/satellite nodes maintain connectivity
-- Transaction throughput scales with network capacity
-
-### 4. Compliance and Regulatory Testing
-
-**Objective**: Test regulatory compliance features across jurisdictions
-
-**Test Steps**:
-1. Enable compliance mode on EU nodes
-2. Generate cross-border transactions
-3. Monitor compliance reporting
-4. Validate data protection requirements
-
-**Expected Results**:
-- GDPR compliance maintained for EU data
-- Cross-border transactions properly logged
-- Regulatory reporting functions correctly
-
-## Chaos Engineering
-
-### Automated Chaos Testing
-
-When chaos mode is enabled (`CHAOS_MODE=true`), the simulation includes:
-
-#### Network Partitions
-- **Timing**: After 10 minutes of operation
-- **Duration**: 5 minutes
-- **Scope**: Isolates APAC region from other AS
-- **Recovery**: Gradual healing over 1 minute
-
-#### Node Failures
-- **Timing**: After 15 minutes of operation
-- **Duration**: 5 minutes
-- **Target**: EU research node (non-critical)
-- **Recovery**: Automatic restart
-
-#### Performance Degradation
-- **Timing**: After 20 minutes of operation
-- **Duration**: 10 minutes
-- **Target**: Satellite connections (bandwidth reduction)
-- **Recovery**: Gradual improvement
-
-### Manual Chaos Injection
-
-```bash
-# Inject random packet loss
-./scripts/inject_packet_loss.sh 2%
-
-# Simulate DDoS on bootstrap node
-./scripts/simulate_ddos.sh bootstrap-na
-
-# Create bandwidth bottleneck
-./scripts/limit_bandwidth.sh router-na 50mbit
-```
-
-## Performance Expectations
-
-### Transaction Throughput
-- **Global testnet**: 50-100 TPS sustained
-- **Regional clusters**: 200-500 TPS
-- **Single node**: 1000+ TPS
-
-### Latency Expectations
-- **Intra-region confirmation**: 10-30 seconds
-- **Cross-region confirmation**: 60-120 seconds
-- **Satellite confirmation**: 120-300 seconds
-
-### Resource Usage
-- **Memory**: 2-4GB per node
-- **CPU**: 1-2 cores per node
-- **Network**: 1-100Mbps per node (varies by tier)
-- **Storage**: 1-10GB per node (depends on duration)
-
-## Troubleshooting
-
-### Common Issues
-
-#### Nodes Not Starting
-```bash
-# Check container logs
-docker logs clab-polytorus-realistic-testnet-bootstrap-na
-
-# Verify network connectivity
-docker exec clab-polytorus-realistic-testnet-bootstrap-na ping 10.1.0.1
-
-# Check resource constraints
-docker stats
-```
-
-#### BGP Not Converging
-```bash
-# Check FRR status
-docker exec clab-polytorus-realistic-testnet-router-na vtysh -c "show ip bgp summary"
-
-# Verify interface configuration
-docker exec clab-polytorus-realistic-testnet-router-na ip addr show
-
-# Restart BGP daemon
-docker exec clab-polytorus-realistic-testnet-router-na vtysh -c "clear ip bgp *"
-```
-
-#### High Latency/Packet Loss
-```bash
-# Check traffic control configuration
-docker exec clab-polytorus-realistic-testnet-miner-apac tc qdisc show
-
-# Reset network impairments
-docker exec clab-polytorus-realistic-testnet-miner-apac tc qdisc del dev eth1 root
-
-# Verify routing
-docker exec clab-polytorus-realistic-testnet-miner-apac ip route show
-```
-
-### Performance Optimization
-
-#### For Development Testing
-- Reduce latency values by 50%
-- Increase bandwidth limits by 2x
-- Disable packet loss simulation
-- Use fewer chaos scenarios
-
-#### For Production Simulation
-- Use real-world latency measurements
-- Implement time-zone based traffic patterns
-- Enable full compliance monitoring
-- Add economic incentive modeling
-
-## Integration with CI/CD
-
-### Automated Testing
-
-```bash
-# Quick smoke test (5 minutes)
-./scripts/realistic_testnet_simulation.sh 300 50 5 false
-
-# Full integration test (30 minutes)
-./scripts/realistic_testnet_simulation.sh 1800 200 10 true
-
-# Performance benchmark (2 hours)
-./scripts/realistic_testnet_simulation.sh 7200 1000 5 false
-```
-
-### Test Metrics Collection
-
-The simulation automatically collects:
-- Block propagation times
-- Transaction confirmation latencies
-- Network partition recovery times
-- Resource utilization statistics
-- BGP convergence metrics
-
-Results are stored in `./data/monitoring/` for analysis.
-
-## Future Enhancements
-
-### Planned Features
-1. **Economic modeling**: Transaction fee markets across regions
-2. **Regulatory simulation**: Country-specific compliance requirements
-3. **Mobile optimization**: 5G and edge computing integration
-4. **Quantum readiness**: Post-quantum cryptography testing
-5. **Interoperability**: Cross-chain bridge simulation
-
-### Research Applications
-- Academic research on distributed consensus
-- Economic analysis of global blockchain networks
-- Regulatory compliance testing
-- Network optimization research
-- Security vulnerability assessment
-
-This realistic testnet provides an excellent platform for validating PolyTorus performance under real-world conditions and preparing for global deployment.
diff --git a/TESTNET_DEPLOYMENT.md b/TESTNET_DEPLOYMENT.md
deleted file mode 100644
index bb8ce27..0000000
--- a/TESTNET_DEPLOYMENT.md
+++ /dev/null
@@ -1,540 +0,0 @@
-# PolyTorus テストネット展開ガイド
-
-このドキュメントでは、PolyTorusブロックチェーンのテストネットを様々な環境で展開する方法を説明します。
-
-## 目次
-
-1. [ローカルテストネット](#ローカルテストネット)
-2. [EC2分散テストネット](#ec2分散テストネット)
-3. [Dockerクラスター展開](#dockerクラスター展開)
-4. [マイニング設定](#マイニング設定)
-5. [ネットワーク監視とメンテナンス](#ネットワーク監視とメンテナンス)
-6. [トラブルシューティング](#トラブルシューティング)
-
-## ローカルテストネット
-
-### 前提条件
-
-- Rust 1.87 nightly以降
-- OpenFHE (MachinaIO fork)
-- システム依存関係: `cmake`, `libgmp-dev`, `libntl-dev`, `libboost-all-dev`
-
-### 1. 環境セットアップ
-
-```bash
-# プロジェクトビルド
-cargo build --release
-
-# テストネット設定ディレクトリ作成
-mkdir -p testnet-config
-
-# データディレクトリ作成
-mkdir -p testnet-data testnet-data-2
-```
-
-### 2. ノード1設定 (testnet-config/testnet.toml)
-
-```toml
-[network]
-chain_id = "polytorus-testnet-1"
-network_name = "PolyTorus Testnet"
-p2p_port = 8000
-rpc_port = 8545
-discovery_port = 8900
-max_peers = 50
-
-[consensus]
-block_time = 6000 # 6秒
-difficulty = 2 # テストネット用低難易度
-max_block_size = 1048576 # 1MB
-
-[diamond_io]
-mode = "Testing"
-ring_dimension = 1024
-noise_bound = 6.4
-
-[storage]
-data_dir = "./testnet-data"
-cache_size = 1000
-
-[mempool]
-max_transactions = 10000
-max_transaction_age = "3600s"
-min_fee = 1
-
-[rpc]
-enabled = true
-bind_address = "127.0.0.1:8545"
-max_connections = 100
-```
-
-### 3. ノード2設定 (testnet-config/testnet-node2.toml)
-
-```toml
-[network]
-chain_id = "polytorus-testnet-1"
-network_name = "PolyTorus Testnet"
-p2p_port = 8001
-rpc_port = 8546
-discovery_port = 8901
-max_peers = 50
-
-[consensus]
-block_time = 6000
-difficulty = 2
-max_block_size = 1048576
-
-[diamond_io]
-mode = "Testing"
-ring_dimension = 1024
-noise_bound = 6.4
-
-[storage]
-data_dir = "./testnet-data-2"
-cache_size = 1000
-
-[bootstrap]
-nodes = [
- "127.0.0.1:8000" # 最初のノードをブートストラップとして使用
-]
-
-[mempool]
-max_transactions = 10000
-max_transaction_age = "3600s"
-min_fee = 1
-
-[rpc]
-enabled = true
-bind_address = "127.0.0.1:8546"
-max_connections = 100
-```
-
-### 4. ノード起動
-
-```bash
-# ノード1初期化と起動
-./target/release/polytorus --modular-init --data-dir ./testnet-data --config testnet-config/testnet.toml
-./target/release/polytorus --modular-start --data-dir ./testnet-data --config testnet-config/testnet.toml --http-port 8080 > testnet.log 2>&1 &
-
-# ノード2初期化と起動
-./target/release/polytorus --modular-init --data-dir ./testnet-data-2 --config testnet-config/testnet-node2.toml
-./target/release/polytorus --modular-start --data-dir ./testnet-data-2 --config testnet-config/testnet-node2.toml --http-port 8081 > testnet-node2.log 2>&1 &
-```
-
-### 5. 動作確認
-
-```bash
-# ヘルスチェック
-curl http://127.0.0.1:8080/health
-curl http://127.0.0.1:8081/health
-
-# ノード状態確認
-curl http://127.0.0.1:8080/status
-curl http://127.0.0.1:8081/status
-
-# トランザクション送信テスト
-curl -X POST http://127.0.0.1:8080/transaction \
- -H "Content-Type: application/json" \
- -d '{"from":"test-addr-1","to":"test-addr-2","amount":100}'
-
-# 統計情報確認
-curl http://127.0.0.1:8080/stats
-curl http://127.0.0.1:8081/stats
-```
-
-## EC2分散テストネット
-
-### アーキテクチャ概要
-
-```
-┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
-│ EC2 Node 1 │────│ EC2 Node 2 │────│ EC2 Node 3 │
-│ us-east-1 │ │ eu-west-1 │ │ ap-southeast-1 │
-│ P2P: 8000 │ │ P2P: 8000 │ │ P2P: 8000 │
-│ API: 8080 │ │ API: 8080 │ │ API: 8080 │
-│ RPC: 8545 │ │ RPC: 8545 │ │ RPC: 8545 │
-└─────────────────┘ └─────────────────┘ └─────────────────┘
-```
-
-### 1. EC2インスタンス作成
-
-**推奨スペック:**
-- インスタンスタイプ: `t3.medium` 以上 (2 vCPU, 4GB RAM)
-- OS: Ubuntu 22.04 LTS
-- ストレージ: 20GB gp3
-- セキュリティグループ: 以下のポート開放
- - SSH (22)
- - P2P (8000)
- - HTTP API (8080)
- - RPC (8545)
- - Discovery (8900)
-
-### 2. 自動セットアップスクリプト実行
-
-各EC2インスタンスで以下を実行:
-
-```bash
-# リポジトリクローン
-git clone https://github.com/PolyTorus/polytorus.git
-cd polytorus
-
-# 自動セットアップ実行
-chmod +x deployment/ec2-setup.sh
-./deployment/ec2-setup.sh
-```
-
-### 3. ネットワーク設定の更新
-
-最初のノード起動後、各ノードの設定ファイル `~/polytorus-testnet.toml` を編集:
-
-```toml
-[bootstrap]
-nodes = [
- "FIRST_NODE_PUBLIC_IP:8000",
- "SECOND_NODE_PUBLIC_IP:8000"
-]
-```
-
-### 4. ノード起動と管理
-
-```bash
-# ノード起動
-sudo systemctl start polytorus
-
-# 状態確認
-sudo systemctl status polytorus
-
-# ログ確認
-sudo journalctl -u polytorus -f
-
-# 設定リロード
-sudo systemctl restart polytorus
-```
-
-### 5. グローバルネットワーク確認
-
-```bash
-# 各ノードの外部アクセステスト
-curl http://FIRST_NODE_IP:8080/status
-curl http://SECOND_NODE_IP:8080/status
-curl http://THIRD_NODE_IP:8080/status
-
-# P2P接続確認
-curl http://FIRST_NODE_IP:8080/network/peers
-```
-
-## Dockerクラスター展開
-
-### Docker Compose使用
-
-```bash
-# 分散Docker環境起動
-cd docker
-docker-compose -f docker-compose.distributed.yml up -d
-
-# ログ確認
-docker-compose -f docker-compose.distributed.yml logs -f
-
-# スケール拡張
-docker-compose -f docker-compose.distributed.yml up -d --scale polytorus-node-2=3
-```
-
-### Kubernetes展開 (オプション)
-
-```yaml
-# k8s/polytorus-deployment.yaml
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: polytorus-testnet
-spec:
- replicas: 3
- selector:
- matchLabels:
- app: polytorus
- template:
- metadata:
- labels:
- app: polytorus
- spec:
- containers:
- - name: polytorus
- image: polytorus:distributed
- ports:
- - containerPort: 8000
- - containerPort: 8080
- - containerPort: 8545
- env:
- - name: RUST_LOG
- value: "info"
----
-apiVersion: v1
-kind: Service
-metadata:
- name: polytorus-service
-spec:
- selector:
- app: polytorus
- ports:
- - name: p2p
- port: 8000
- targetPort: 8000
- - name: api
- port: 8080
- targetPort: 8080
- - name: rpc
- port: 8545
- targetPort: 8545
- type: LoadBalancer
-```
-
-## マイニング設定
-
-### 1. マイニング用ウォレット作成
-
-```bash
-# ウォレット作成
-./target/release/polytorus --createwallet --data-dir ./testnet-data
-
-# アドレス一覧表示
-./target/release/polytorus --listaddresses --data-dir ./testnet-data
-```
-
-### 2. マイニング開始
-
-```bash
-# コンセンサス層でのマイニング
-# PolyTorusは統合されたmodular architectureでマイニングを実行
-# consensus.rs の mine_block() 関数が自動的に呼び出されます
-
-# マイニング統計確認
-curl http://localhost:8080/stats
-```
-
-### 3. マイニング設定調整
-
-```toml
-[consensus]
-block_time = 6000 # ブロック時間 (ミリ秒)
-difficulty = 2 # 難易度 (1-32)
-max_block_size = 1048576 # 最大ブロックサイズ
-```
-
-### 4. マイニングプール設定 (将来対応)
-
-```toml
-[mining_pool]
-enabled = false
-pool_address = "pool.polytorus.network:8333"
-worker_name = "worker1"
-```
-
-## ネットワーク監視とメンテナンス
-
-### 監視ダッシュボード
-
-```bash
-# ネットワーク状態監視
-watch -n 5 'curl -s http://localhost:8080/status | jq'
-
-# トランザクション処理監視
-watch -n 2 'curl -s http://localhost:8080/stats | jq'
-
-# P2P接続監視
-curl http://localhost:8080/network/health
-```
-
-### ログ分析
-
-```bash
-# エラーログ抽出
-sudo journalctl -u polytorus | grep ERROR
-
-# P2P接続ログ
-sudo journalctl -u polytorus | grep "peer\|P2P"
-
-# マイニングログ
-sudo journalctl -u polytorus | grep "mine\|block"
-```
-
-### パフォーマンスチューニング
-
-```toml
-[performance]
-# メモリプール設定
-max_transactions = 20000
-cache_size = 2000
-
-# ネットワーク設定
-max_peers = 100
-connection_timeout = 30000
-
-# 同期設定
-sync_batch_size = 1000
-sync_timeout = 60000
-```
-
-## トラブルシューティング
-
-### よくある問題と解決方法
-
-#### 1. ノード間接続失敗
-
-```bash
-# ファイアウォール確認
-sudo ufw status
-
-# ポート開放
-sudo ufw allow 8000/tcp
-sudo ufw allow 8080/tcp
-sudo ufw allow 8545/tcp
-
-# ネットワーク接続テスト
-telnet OTHER_NODE_IP 8000
-```
-
-#### 2. OpenFHE依存関係エラー
-
-```bash
-# OpenFHE再インストール
-sudo rm -rf /usr/local/include/openfhe
-sudo ./scripts/install_openfhe.sh
-
-# 環境変数設定
-export OPENFHE_ROOT=/usr/local
-export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
-```
-
-#### 3. データベースロックエラー
-
-```bash
-# プロセス確認と停止
-ps aux | grep polytorus
-kill -9 PID
-
-# データディレクトリクリーンアップ
-rm -rf ./testnet-data/modular_storage/*.lock
-```
-
-#### 4. メモリ不足
-
-```bash
-# システムリソース確認
-free -h
-df -h
-
-# スワップ追加
-sudo fallocate -l 2G /swapfile
-sudo chmod 600 /swapfile
-sudo mkswap /swapfile
-sudo swapon /swapfile
-```
-
-### ログレベル調整
-
-```bash
-# デバッグモードで起動
-RUST_LOG=debug ./target/release/polytorus --modular-start
-
-# 特定モジュールのみ詳細ログ
-RUST_LOG=polytorus::modular::consensus=debug ./target/release/polytorus --modular-start
-```
-
-### ネットワーク診断ツール
-
-```bash
-# P2P接続状態
-curl http://localhost:8080/network/peers | jq
-
-# ネットワークトポロジー
-curl http://localhost:8080/network/topology | jq
-
-# メッセージキュー統計
-curl http://localhost:8080/network/queue-stats | jq
-```
-
-## 高度な設定
-
-### セキュリティ強化
-
-```toml
-[security]
-enable_rate_limiting = true
-max_requests_per_minute = 1000
-allowed_origins = ["https://app.polytorus.network"]
-api_key_required = true
-```
-
-### 暗号化設定
-
-```toml
-[diamond_io]
-mode = "Production" # 本番環境用高セキュリティ
-ring_dimension = 2048
-noise_bound = 3.2
-encryption_level = "Maximum"
-```
-
-### 負荷分散設定
-
-```toml
-[load_balancing]
-enable_auto_scaling = true
-min_nodes = 3
-max_nodes = 10
-cpu_threshold = 80
-memory_threshold = 85
-```
-
-## 検証とテスト
-
-### 機能テストスイート
-
-```bash
-# 完全なテストスイート実行
-cargo test --lib
-
-# P2Pネットワークテスト
-cargo test network_tests --nocapture
-
-# コンセンサステスト
-cargo test consensus_tests --nocapture
-
-# Diamond IOテスト
-cargo test diamond_io_tests --nocapture
-```
-
-### パフォーマンステスト
-
-```bash
-# ベンチマークテスト
-cargo bench
-
-# トランザクション処理性能テスト
-./scripts/test_complete_propagation.sh
-
-# マルチノードシミュレーション
-./scripts/simulate.sh local --nodes 4 --duration 300
-```
-
-### セキュリティ監査
-
-```bash
-# Kani形式検証
-make kani-verify
-
-# セキュリティ監査
-cargo audit
-
-# 依存関係チェック
-cargo outdated
-```
-
-## サポートとコミュニティ
-
-- **ドキュメント**: [docs.polytorus.network](https://docs.polytorus.network)
-- **GitHub**: [github.com/PolyTorus/polytorus](https://github.com/PolyTorus/polytorus)
-- **Discord**: [discord.gg/polytorus](https://discord.gg/polytorus)
-- **テストネットエクスプローラー**: [testnet.polytorus.network](https://testnet.polytorus.network)
-
-このガイドにより、ローカル環境から本格的なグローバル分散テストネットまで、様々なスケールでPolyTorusブロックチェーンを展開できます。
diff --git a/advanced_network_test.sh b/advanced_network_test.sh
deleted file mode 100755
index 74c8580..0000000
--- a/advanced_network_test.sh
+++ /dev/null
@@ -1,320 +0,0 @@
-#!/bin/bash
-
-# Advanced PolyTorus Network Error Testing
-# This script tests various network failure scenarios
-
-set -e
-
-# Colors
-RED='\033[0;31m'
-GREEN='\033[0;32m'
-YELLOW='\033[1;33m'
-BLUE='\033[0;34m'
-PURPLE='\033[0;35m'
-CYAN='\033[0;36m'
-NC='\033[0m'
-
-# Configuration
-export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/lib:$LD_LIBRARY_PATH
-
-print_header() {
- echo -e "${BLUE}"
- echo "╔══════════════════════════════════════════════════════════╗"
- echo "║ Advanced Network Error Testing Suite ║"
- echo "║ PolyTorus Resilience Testing ║"
- echo "╚══════════════════════════════════════════════════════════╝"
- echo -e "${NC}"
-}
-
-cleanup() {
- echo -e "\n${YELLOW}🛑 Cleaning up all processes...${NC}"
- pkill -f "polytorus.*modular-start" 2>/dev/null || true
- pkill -f "nc.*127.0.0.1" 2>/dev/null || true
- sleep 2
- echo -e "${GREEN}✅ Cleanup completed${NC}"
-}
-
-trap cleanup EXIT
-
-print_header
-
-echo -e "${PURPLE}🧪 Test 1: Node Startup with Port Conflicts${NC}"
-
-# Start a process to occupy port 8001
-echo -e "${CYAN}Creating port conflict on 8001...${NC}"
-nc -l 127.0.0.1 8001 < /dev/null > /dev/null 2>&1 &
-NC_PID=$!
-sleep 1
-
-# Try to start a node on the conflicted port
-echo -e "${CYAN}Attempting to start node on conflicted port...${NC}"
-timeout 10 ./target/release/polytorus \
- --config config/modular-node1.toml \
- --data-dir data/test-conflict \
- --modular-start > logs/conflict-test.log 2>&1 &
-CONFLICT_NODE_PID=$!
-
-sleep 5
-
-# Check if the node handled the conflict gracefully
-if kill -0 $CONFLICT_NODE_PID 2>/dev/null; then
- echo -e "${YELLOW}⚠️ Node is still running despite port conflict${NC}"
- kill $CONFLICT_NODE_PID 2>/dev/null
-else
- echo -e "${GREEN}✅ Node properly failed to start due to port conflict${NC}"
-fi
-
-# Clean up port conflict
-kill $NC_PID 2>/dev/null
-sleep 1
-
-echo -e "\n${PURPLE}🧪 Test 2: Network Partition Simulation${NC}"
-
-# Start 3 nodes
-echo -e "${CYAN}Starting 3-node network...${NC}"
-mkdir -p data/partition-test/{node1,node2,node3}
-
-./target/release/polytorus \
- --config config/modular-node1.toml \
- --data-dir data/partition-test/node1 \
- --http-port 9101 \
- --modular-start > logs/partition-node1.log 2>&1 &
-PART_NODE1_PID=$!
-
-sleep 3
-
-./target/release/polytorus \
- --config config/modular-node2.toml \
- --data-dir data/partition-test/node2 \
- --http-port 9102 \
- --modular-start > logs/partition-node2.log 2>&1 &
-PART_NODE2_PID=$!
-
-sleep 3
-
-./target/release/polytorus \
- --config config/modular-node3.toml \
- --data-dir data/partition-test/node3 \
- --http-port 9103 \
- --modular-start > logs/partition-node3.log 2>&1 &
-PART_NODE3_PID=$!
-
-sleep 5
-
-echo -e "${GREEN}✅ Network started${NC}"
-
-# Test initial connectivity
-echo -e "${CYAN}Testing initial network connectivity...${NC}"
-for port in 9101 9102 9103; do
- if timeout 3 curl -s "http://127.0.0.1:$port/health" > /dev/null; then
- echo -e "${GREEN} ✅ Node on port $port is responding${NC}"
- else
- echo -e "${RED} ❌ Node on port $port is not responding${NC}"
- fi
-done
-
-# Send transactions to test propagation
-echo -e "${CYAN}Sending test transactions...${NC}"
-for i in {1..3}; do
- port=$((9100 + i))
- echo -e "${CYAN} Sending transaction $i to node on port $port...${NC}"
-
- RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d "{\"from\":\"wallet_$i\",\"to\":\"wallet_target\",\"amount\":$((i*100)),\"nonce\":$((2000+i))}" \
- "http://127.0.0.1:$port/send" 2>/dev/null || echo "Failed")
-
- if [[ "$RESPONSE" == *"Failed"* ]]; then
- echo -e "${YELLOW} ⚠️ Transaction $i failed${NC}"
- else
- echo -e "${GREEN} ✅ Transaction $i sent${NC}"
- fi
-done
-
-# Wait for propagation
-sleep 3
-
-# Check transaction counts on all nodes
-echo -e "${CYAN}Checking transaction propagation...${NC}"
-for port in 9101 9102 9103; do
- node_num=$((port - 9100))
- echo -e "${CYAN} Node $node_num statistics:${NC}"
-
- STATS=$(timeout 3 curl -s "http://127.0.0.1:$port/stats" 2>/dev/null || echo "Unavailable")
- echo " $STATS"
-done
-
-# Simulate node failure
-echo -e "\n${CYAN}Simulating Node 2 failure...${NC}"
-kill $PART_NODE2_PID 2>/dev/null
-sleep 2
-
-echo -e "${CYAN}Testing network after node failure...${NC}"
-for port in 9101 9103; do
- node_num=$((port - 9100))
- if timeout 3 curl -s "http://127.0.0.1:$port/health" > /dev/null; then
- echo -e "${GREEN} ✅ Node $node_num still responding after partition${NC}"
- else
- echo -e "${RED} ❌ Node $node_num not responding after partition${NC}"
- fi
-done
-
-# Test transaction propagation with failed node
-echo -e "${CYAN}Testing transaction propagation with failed node...${NC}"
-RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d '{"from":"wallet_recovery","to":"wallet_target","amount":500,"nonce":3001}' \
- "http://127.0.0.1:9101/send" 2>/dev/null || echo "Failed")
-
-if [[ "$RESPONSE" == *"Failed"* ]]; then
- echo -e "${YELLOW} ⚠️ Transaction failed during partition${NC}"
-else
- echo -e "${GREEN} ✅ Transaction succeeded during partition${NC}"
-fi
-
-# Clean up partition test
-kill $PART_NODE1_PID $PART_NODE3_PID 2>/dev/null
-sleep 2
-
-echo -e "\n${PURPLE}🧪 Test 3: High Load Stress Testing${NC}"
-
-# Start a single node for stress testing
-echo -e "${CYAN}Starting node for stress testing...${NC}"
-mkdir -p data/stress-test
-
-./target/release/polytorus \
- --config config/modular-node1.toml \
- --data-dir data/stress-test \
- --http-port 9201 \
- --modular-start > logs/stress-test.log 2>&1 &
-STRESS_NODE_PID=$!
-
-sleep 5
-
-if kill -0 $STRESS_NODE_PID 2>/dev/null; then
- echo -e "${GREEN}✅ Stress test node started${NC}"
-
- # Send multiple concurrent transactions
- echo -e "${CYAN}Sending 10 concurrent transactions...${NC}"
-
- for i in {1..10}; do
- (
- RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d "{\"from\":\"stress_wallet_$i\",\"to\":\"target_wallet\",\"amount\":$i,\"nonce\":$((4000+i))}" \
- "http://127.0.0.1:9201/send" 2>/dev/null || echo "Failed")
-
- if [[ "$RESPONSE" == *"Failed"* ]]; then
- echo -e "${YELLOW} ⚠️ Concurrent transaction $i failed${NC}"
- else
- echo -e "${GREEN} ✅ Concurrent transaction $i succeeded${NC}"
- fi
- ) &
- done
-
- # Wait for all concurrent requests to complete
- wait
-
- sleep 2
-
- # Check final statistics
- echo -e "${CYAN}Final stress test statistics:${NC}"
- FINAL_STATS=$(timeout 5 curl -s "http://127.0.0.1:9201/stats" 2>/dev/null || echo "Unavailable")
- echo " $FINAL_STATS"
-
- # Clean up stress test
- kill $STRESS_NODE_PID 2>/dev/null
-else
- echo -e "${RED}❌ Stress test node failed to start${NC}"
-fi
-
-echo -e "\n${PURPLE}🧪 Test 4: Invalid Request Handling${NC}"
-
-# Start a node for invalid request testing
-echo -e "${CYAN}Starting node for invalid request testing...${NC}"
-mkdir -p data/invalid-test
-
-./target/release/polytorus \
- --config config/modular-node1.toml \
- --data-dir data/invalid-test \
- --http-port 9301 \
- --modular-start > logs/invalid-test.log 2>&1 &
-INVALID_NODE_PID=$!
-
-sleep 5
-
-if kill -0 $INVALID_NODE_PID 2>/dev/null; then
- echo -e "${GREEN}✅ Invalid request test node started${NC}"
-
- # Test various invalid requests
- echo -e "${CYAN}Testing invalid JSON...${NC}"
- RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d '{"invalid":"json","missing":}' \
- "http://127.0.0.1:9301/send" 2>/dev/null || echo "Connection failed")
- echo " Response: ${RESPONSE:0:100}..."
-
- echo -e "${CYAN}Testing missing fields...${NC}"
- RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d '{"from":"wallet1"}' \
- "http://127.0.0.1:9301/send" 2>/dev/null || echo "Connection failed")
- echo " Response: ${RESPONSE:0:100}..."
-
- echo -e "${CYAN}Testing invalid amounts...${NC}"
- RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d '{"from":"wallet1","to":"wallet2","amount":-100,"nonce":1}' \
- "http://127.0.0.1:9301/send" 2>/dev/null || echo "Connection failed")
- echo " Response: ${RESPONSE:0:100}..."
-
- echo -e "${CYAN}Testing oversized request...${NC}"
- LARGE_DATA=$(printf 'x%.0s' {1..10000})
- RESPONSE=$(timeout 5 curl -s -X POST -H "Content-Type: application/json" \
- -d "{\"from\":\"$LARGE_DATA\",\"to\":\"wallet2\",\"amount\":100,\"nonce\":1}" \
- "http://127.0.0.1:9301/send" 2>/dev/null || echo "Connection failed")
- echo " Response: ${RESPONSE:0:100}..."
-
- # Clean up invalid test
- kill $INVALID_NODE_PID 2>/dev/null
-else
- echo -e "${RED}❌ Invalid request test node failed to start${NC}"
-fi
-
-echo -e "\n${PURPLE}📊 Test Results Summary${NC}"
-
-echo -e "${CYAN}Log Analysis:${NC}"
-
-# Analyze all test logs
-for log in logs/conflict-test.log logs/partition-node*.log logs/stress-test.log logs/invalid-test.log; do
- if [ -f "$log" ]; then
- echo -e "${CYAN} $log:${NC}"
-
- # Count errors
- ERROR_COUNT=$(grep -i "error\|fail\|panic" "$log" 2>/dev/null | wc -l)
- if [ $ERROR_COUNT -gt 0 ]; then
- echo -e "${YELLOW} ⚠️ Errors found: $ERROR_COUNT${NC}"
- echo -e "${YELLOW} Recent errors:${NC}"
- grep -i "error\|fail\|panic" "$log" 2>/dev/null | tail -2 | sed 's/^/ /'
- else
- echo -e "${GREEN} ✅ No errors detected${NC}"
- fi
-
- # Show last few lines
- echo -e " Last activity:"
- tail -2 "$log" 2>/dev/null | sed 's/^/ /' || echo " No activity"
- echo ""
- fi
-done
-
-echo -e "\n${GREEN}🎉 Advanced Network Error Testing Completed!${NC}"
-
-echo -e "\n${CYAN}📋 Test Summary:${NC}"
-echo -e "${GREEN}✅ Port conflict handling tested${NC}"
-echo -e "${GREEN}✅ Network partition resilience tested${NC}"
-echo -e "${GREEN}✅ High load stress testing completed${NC}"
-echo -e "${GREEN}✅ Invalid request handling verified${NC}"
-echo -e "${GREEN}✅ Error logging and recovery mechanisms validated${NC}"
-
-echo -e "\n${CYAN}💡 Key Findings:${NC}"
-echo -e " - Network gracefully handles port conflicts"
-echo -e " - Nodes continue operating during network partitions"
-echo -e " - Concurrent transaction processing works correctly"
-echo -e " - Invalid requests are properly rejected"
-echo -e " - Error logging provides good debugging information"
-
-echo -e "\n${GREEN}✅ PolyTorus network demonstrates excellent resilience!${NC}"
diff --git a/audit.toml b/audit.toml
deleted file mode 100644
index 737e37e..0000000
--- a/audit.toml
+++ /dev/null
@@ -1,21 +0,0 @@
-# Ignore specific vulnerabilities that are not applicable or have been reviewed
-[advisories]
-# rust-crypto is being replaced with modern alternatives
-ignore = [
- "RUSTSEC-2016-0005", # rust-crypto is unmaintained (we're migrating to ring/modern crypto)
- "RUSTSEC-2020-0071", # time crate issue (transitive dependency)
- "RUSTSEC-2021-0139", # ansi_term unmaintained (from clap 2.x, we're upgrading)
- "RUSTSEC-2024-0375", # atty unmaintained (transitive dependency)
- "RUSTSEC-2020-0036", # failure deprecated (we're migrating to anyhow)
- "RUSTSEC-2024-0384", # instant unmaintained (transitive dependency)
- "RUSTSEC-2024-0436", # paste unmaintained (from wasmtime, we're upgrading)
- "RUSTSEC-2025-0025", # rustc-serialize unmaintained (transitive dependency)
- "RUSTSEC-2021-0145", # atty unsound (transitive dependency)
- "RUSTSEC-2019-0036", # failure unsound (we're migrating to anyhow)
- "RUSTSEC-2022-0011", # rust-crypto AES miscomputation (we're migrating away)
- "RUSTSEC-2022-0004", # rustc-serialize stack overflow (transitive dependency)
-]
-
-# Prioritize security updates
-[sources]
-allow-registry = ["https://github.com/rust-lang/crates.io-index"]
diff --git a/benches/blockchain_bench.rs b/benches/blockchain_bench.rs
deleted file mode 100644
index f6e6f0c..0000000
--- a/benches/blockchain_bench.rs
+++ /dev/null
@@ -1,414 +0,0 @@
-use std::time::Duration;
-
-use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
-use polytorus::{
- blockchain::{
- block::{Block, DifficultyAdjustmentConfig, MiningStats},
- types::{block_states, network},
- },
- crypto::transaction::{TXInput, TXOutput, Transaction},
-};
-
-/// Create a test transaction for benchmarking
-fn create_test_transaction() -> Transaction {
- Transaction::new_coinbase(
- "benchmark_address".to_string(),
- "benchmark_reward".to_string(),
- )
- .expect("Failed to create test transaction")
-}
-
-/// Create a test block for benchmarking
-fn create_test_block(difficulty: usize) -> Block {
- let config = DifficultyAdjustmentConfig {
- base_difficulty: difficulty,
- min_difficulty: 1,
- max_difficulty: 5,
- adjustment_factor: 0.25,
- tolerance_percentage: 20.0,
- };
-
- Block::::new_building_with_config(
- vec![create_test_transaction()],
- "benchmark_prev_hash".to_string(),
- 1,
- difficulty,
- config,
- MiningStats::default(),
- )
-}
-
-/// Benchmark transaction creation
-fn benchmark_transaction_creation(c: &mut Criterion) {
- c.bench_function("create_transaction", |b| {
- b.iter(|| black_box(create_test_transaction()));
- });
-}
-
-/// Benchmark block creation
-fn benchmark_block_creation(c: &mut Criterion) {
- c.bench_function("create_block", |b| {
- b.iter(|| black_box(create_test_block(2)));
- });
-}
-
-/// Benchmark mining with different difficulties
-fn benchmark_mining_difficulties(c: &mut Criterion) {
- let mut group = c.benchmark_group("mining_difficulties");
- group.measurement_time(Duration::from_secs(10));
- group.sample_size(10);
-
- for difficulty in [1, 2, 3].iter() {
- group.bench_with_input(
- BenchmarkId::new("difficulty", difficulty),
- difficulty,
- |b, &difficulty| {
- b.iter(|| {
- let block = create_test_block(difficulty);
- let mined = black_box(block.mine()).expect("Mining failed");
- black_box(mined)
- });
- },
- );
- }
-
- group.finish();
-}
-
-/// Benchmark block validation
-fn benchmark_block_validation(c: &mut Criterion) {
- c.bench_function("validate_block", |b| {
- b.iter(|| {
- // Create a new block for each iteration to avoid ownership issues
- let test_block = create_test_block(1);
- let mined_block = test_block.mine().expect("Failed to mine test block");
- let validated = black_box(mined_block.validate()).expect("Validation failed");
- black_box(validated)
- });
- });
-}
-
-/// Benchmark difficulty calculations
-fn benchmark_difficulty_calculations(c: &mut Criterion) {
- let mut group = c.benchmark_group("difficulty_calculations");
-
- // Create mock finalized blocks by mining them properly
- let finalized_blocks: Vec> = (0..5)
- .map(|i| {
- let building_block =
- Block::::new_building_with_config(
- vec![create_test_transaction()],
- format!("prev_hash_{i}"),
- i + 1,
- 1, // Low difficulty for fast mining
- DifficultyAdjustmentConfig::default(),
- MiningStats::default(),
- );
- building_block
- .mine()
- .unwrap()
- .validate()
- .unwrap()
- .finalize()
- })
- .collect();
-
- let block_refs: Vec<&Block> =
- finalized_blocks.iter().collect();
-
- group.bench_function("dynamic_difficulty", |b| {
- let building_block = create_test_block(3);
- b.iter(|| black_box(building_block.calculate_dynamic_difficulty(&block_refs[..])));
- });
-
- group.bench_function("advanced_difficulty_adjustment", |b| {
- b.iter(|| black_box(finalized_blocks[0].adjust_difficulty_advanced(&block_refs[..])));
- });
-
- group.finish();
-}
-
-/// Benchmark mining statistics operations
-fn benchmark_mining_stats(c: &mut Criterion) {
- let mut group = c.benchmark_group("mining_stats");
-
- let mut stats = MiningStats::default();
- for i in 0..50 {
- stats.record_mining_time(1000 + i * 10);
- stats.record_attempt();
- }
-
- group.bench_function("record_mining_time", |b| {
- b.iter(|| {
- let mut test_stats = stats.clone();
- test_stats.record_mining_time(1500);
- black_box(());
- });
- });
-
- group.bench_function("calculate_success_rate", |b| {
- b.iter(|| black_box(stats.success_rate()));
- });
-
- group.finish();
-}
-
-/// Benchmark multiple transactions
-fn benchmark_multiple_transactions(c: &mut Criterion) {
- let mut group = c.benchmark_group("multiple_transactions");
- group.measurement_time(Duration::from_secs(15));
- group.sample_size(10);
-
- for tx_count in [1, 3, 5, 10].iter() {
- group.bench_with_input(
- BenchmarkId::new("transactions", tx_count),
- tx_count,
- |b, &tx_count| { b.iter(|| {
- // Create first transaction as coinbase
- let mut transactions = vec![create_test_transaction()]; // Add regular transactions if needed
- for i in 1..tx_count {
- let tx = create_simple_transaction(
- format!("multi_addr_{i}"),
- format!("multi_dest_{i}"),
- 10 + i,
- i,
- );
- transactions.push(tx);
- }
-
- let config = DifficultyAdjustmentConfig {
- base_difficulty: 1,
- min_difficulty: 1,
- max_difficulty: 3,
- adjustment_factor: 0.25,
- tolerance_percentage: 20.0,
- };
-
- let block = Block::::new_building_with_config(
- transactions,
- "multi_tx_prev".to_string(),
- 1,
- 1,
- config,
- MiningStats::default(),
- );
-
- let mined = black_box(block.mine()).expect("Mining failed");
- black_box(mined)
- });
- },
- );
- }
-
- group.finish();
-}
-
-/// Create a simple test transaction (non-coinbase)
-fn create_simple_transaction(from: String, to: String, amount: i32, nonce: i32) -> Transaction {
- // Create a fake input referencing a previous transaction
- let prev_tx_id = format!("prev_tx_{nonce}");
- let input = TXInput {
- txid: prev_tx_id,
- vout: 0,
- signature: Vec::new(),
- pub_key: format!("pubkey_{from}").into_bytes(),
- redeemer: None,
- };
-
- // Create output
- let output = TXOutput::new(amount, to).expect("Failed to create output");
-
- let mut tx = Transaction {
- id: String::new(),
- vin: vec![input],
- vout: vec![output],
- contract_data: None,
- };
-
- // Generate transaction ID
- tx.id = tx.hash().expect("Failed to hash transaction");
- tx
-}
-
-/// TPS (Transactions Per Second) benchmark
-fn benchmark_tps(c: &mut Criterion) {
- let mut group = c.benchmark_group("tps_throughput");
- group.measurement_time(Duration::from_secs(20));
- group.sample_size(10); // Test different transaction volumes to measure TPS
- for tx_count in [10, 25, 50].iter() {
- group.bench_with_input(
- BenchmarkId::new("tps", tx_count),
- tx_count,
- |b, &tx_count| {
- b.iter_custom(|iters| {
- let start = std::time::Instant::now();
- let mut total_transactions = 0i32;
-
- for _ in 0..iters {
- // Create first transaction as coinbase (block reward)
- let mut transactions = vec![Transaction::new_coinbase(
- "block_reward_address".to_string(),
- "Block reward".to_string(),
- ).expect("Failed to create coinbase transaction")]; // Add regular transactions
- for i in 1..tx_count {
- let tx = create_simple_transaction(
- format!("addr_{i}"),
- format!("dest_{i}"),
- 10 + i,
- total_transactions + i,
- );
- transactions.push(tx);
- }
-
- total_transactions += transactions.len() as i32;
-
- // Process transactions in batches (simulating real blockchain behavior)
- let config = DifficultyAdjustmentConfig {
- base_difficulty: 1, // Low difficulty for speed
- min_difficulty: 1,
- max_difficulty: 2,
- adjustment_factor: 0.1,
- tolerance_percentage: 30.0,
- };
-
- let block = Block::::new_building_with_config(
- transactions,
- format!("tps_prev_{total_transactions}"),
- 1,
- 1, // Minimal difficulty for maximum TPS
- config,
- MiningStats::default(),
- );
-
- // Mine and validate the block
- let mined = black_box(block.mine()).expect("Mining failed");
- let _validated = black_box(mined.validate()).expect("Validation failed");
- }
-
- start.elapsed()
- });
- },
- );
- }
-
- group.finish();
-}
-
-/// Benchmark transaction processing without mining (pure TPS)
-fn benchmark_pure_transaction_processing(c: &mut Criterion) {
- let mut group = c.benchmark_group("pure_transaction_tps");
- group.measurement_time(Duration::from_secs(15));
- group.sample_size(10);
-
- for tx_count in [50, 100, 500].iter() {
- group.bench_with_input(
- BenchmarkId::new("pure_tps", tx_count),
- tx_count,
- |b, &tx_count| {
- b.iter_custom(|iters| {
- let start = std::time::Instant::now();
- for _ in 0..iters {
- // Create first transaction as coinbase
- let mut transactions = vec![create_test_transaction()]; // Create regular transactions
- for i in 1..tx_count {
- let tx = create_simple_transaction(
- format!("pure_addr_{i}"),
- format!("pure_dest_{i}"),
- 10 + i,
- i,
- );
- transactions.push(tx);
- }
-
- // Just measure transaction creation and basic validation
- for tx in transactions {
- black_box(tx.is_coinbase());
- black_box(&tx.id);
- }
- }
-
- start.elapsed()
- });
- },
- );
- }
-
- group.finish();
-}
-
-/// Benchmark concurrent transaction processing
-fn benchmark_concurrent_tps(c: &mut Criterion) {
- use std::thread;
-
- let mut group = c.benchmark_group("concurrent_tps");
- group.measurement_time(Duration::from_secs(20));
- group.sample_size(10);
-
- for thread_count in [2, 4].iter() {
- group.bench_with_input(
- BenchmarkId::new("concurrent", thread_count),
- thread_count,
- |b, &thread_count| {
- b.iter_custom(|iters| {
- let start = std::time::Instant::now();
-
- for _ in 0..iters {
- let handles: Vec> = (0..thread_count)
- .map(|thread_id| {
- thread::spawn(move || {
- // Each thread processes transactions
- // First create a coinbase transaction
- let mut transactions = vec![Transaction::new_coinbase(
- format!("concurrent_address_{thread_id}"),
- format!("concurrent_reward_{thread_id}"),
- )
- .expect("Failed to create coinbase transaction")];
- // Add regular transactions
- for i in 1..50 {
- let tx = create_simple_transaction(
- format!("concurrent_addr_{thread_id}_{i}"),
- format!("concurrent_dest_{thread_id}_{i}"),
- 10 + i,
- thread_id * 1000 + i,
- );
- transactions.push(tx);
- }
-
- // Simulate processing
- for tx in transactions {
- black_box(tx.hash().unwrap());
- }
- })
- })
- .collect();
-
- // Wait for all threads to complete
- for handle in handles {
- handle.join().unwrap();
- }
- }
-
- start.elapsed()
- });
- },
- );
- }
-
- group.finish();
-}
-
-criterion_group!(
- benches,
- benchmark_transaction_creation,
- benchmark_block_creation,
- benchmark_mining_difficulties,
- benchmark_block_validation,
- benchmark_difficulty_calculations,
- benchmark_mining_stats,
- benchmark_multiple_transactions,
- benchmark_tps,
- benchmark_pure_transaction_processing,
- benchmark_concurrent_tps
-);
-
-criterion_main!(benches);
diff --git a/benches/database_storage_bench.rs b/benches/database_storage_bench.rs
deleted file mode 100644
index 088baf6..0000000
--- a/benches/database_storage_bench.rs
+++ /dev/null
@@ -1,415 +0,0 @@
-//! Database Storage Benchmarks
-//!
-//! These benchmarks measure the performance of different storage backends.
-//! Run with: cargo bench --bench database_storage_bench
-
-use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
-use polytorus::smart_contract::{
- database_storage::{
- DatabaseContractStorage, DatabaseStorageConfig, PostgresConfig, RedisConfig,
- },
- unified_contract_storage::UnifiedContractStorage,
- unified_engine::{
- ContractExecutionRecord, ContractStateStorage, ContractType, UnifiedContractMetadata,
- },
-};
-use tokio::runtime::Runtime;
-
-// Create test configurations
-fn create_database_config() -> DatabaseStorageConfig {
- DatabaseStorageConfig {
- postgres: Some(PostgresConfig {
- host: "localhost".to_string(),
- port: 5433,
- database: "polytorus_test".to_string(),
- username: "polytorus_test".to_string(),
- password: "test_password_123".to_string(),
- schema: "smart_contracts".to_string(),
- max_connections: 20,
- }),
- redis: Some(RedisConfig {
- url: "redis://localhost:6380".to_string(),
- password: Some("test_redis_password_123".to_string()),
- database: 1, // Use different database for benchmarks
- max_connections: 20,
- key_prefix: "polytorus:bench:contracts:".to_string(),
- ttl_seconds: Some(3600),
- }),
- fallback_to_memory: true,
- connection_timeout_secs: 10,
- max_connections: 40,
- use_ssl: false,
- }
-}
-
-fn create_test_metadata(id: usize) -> UnifiedContractMetadata {
- UnifiedContractMetadata {
- address: format!("0x{:0>40}", format!("bench{:06}", id)),
- name: format!("BenchContract{id:06}"),
- description: format!("Benchmark contract {id}"),
- contract_type: ContractType::Wasm {
- bytecode: vec![0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00],
- abi: Some(format!(
- r#"{{"contract": "bench{id:06}", "version": "1.0"}}"#
- )),
- },
- deployment_tx: format!("0x{:0>64}", format!("benchdeploy{:06}", id)),
- deployment_time: 1640995200 + id as u64,
- owner: format!("0x{:0>40}", format!("benchowner{:06}", id)),
- is_active: true,
- }
-}
-
-fn create_test_execution(contract_id: usize, exec_id: usize) -> ContractExecutionRecord {
- ContractExecutionRecord {
- execution_id: format!("bench_exec_{contract_id}_{exec_id}"),
- contract_address: format!("0x{:0>40}", format!("bench{:06}", contract_id)),
- function_name: "benchmark_function".to_string(),
- caller: format!("0x{:0>40}", format!("benchcaller{:06}", exec_id)),
- timestamp: 1640995200 + (contract_id * 1000 + exec_id) as u64,
- gas_used: 21000 + (exec_id * 1000) as u64,
- success: exec_id % 10 != 0, // 10% failure rate
- error_message: if exec_id % 10 == 0 {
- Some("Benchmark error".to_string())
- } else {
- None
- },
- }
-}
-
-// Benchmark metadata operations
-fn bench_metadata_operations(c: &mut Criterion) {
- let rt = Runtime::new().unwrap();
-
- let mut group = c.benchmark_group("metadata_operations");
- group.throughput(Throughput::Elements(1));
-
- // In-memory storage
- group.bench_function("in_memory_store_metadata", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- b.iter(|| {
- let metadata = create_test_metadata(black_box(0));
- storage.store_contract_metadata(&metadata).unwrap();
- });
- });
-
- group.bench_function("in_memory_get_metadata", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- let metadata = create_test_metadata(0);
- storage.store_contract_metadata(&metadata).unwrap();
-
- b.iter(|| {
- storage
- .get_contract_metadata(black_box(&metadata.address))
- .unwrap();
- });
- });
-
- // Sled storage
- group.bench_function("sled_store_metadata", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- b.iter(|| {
- let metadata = create_test_metadata(black_box(0));
- storage.store_contract_metadata(&metadata).unwrap();
- });
- });
-
- group.bench_function("sled_get_metadata", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- let metadata = create_test_metadata(0);
- storage.store_contract_metadata(&metadata).unwrap();
-
- b.iter(|| {
- storage
- .get_contract_metadata(black_box(&metadata.address))
- .unwrap();
- });
- });
-
- // Database storage (if available)
- if let Ok(storage) =
- rt.block_on(async { DatabaseContractStorage::new(create_database_config()).await })
- {
- group.bench_function("database_store_metadata", |b| {
- b.iter(|| {
- let metadata = create_test_metadata(black_box(0));
- storage.store_contract_metadata(&metadata).unwrap();
- });
- });
-
- group.bench_function("database_get_metadata", |b| {
- let metadata = create_test_metadata(0);
- storage.store_contract_metadata(&metadata).unwrap();
-
- b.iter(|| {
- storage
- .get_contract_metadata(black_box(&metadata.address))
- .unwrap();
- });
- });
- }
-
- group.finish();
-}
-
-// Benchmark state operations
-fn bench_state_operations(c: &mut Criterion) {
- let rt = Runtime::new().unwrap();
-
- let mut group = c.benchmark_group("state_operations");
- group.throughput(Throughput::Elements(1));
-
- let contract_address = "0x1234567890abcdef1234567890abcdef12345678";
- let test_value = b"benchmark_test_value_1234567890";
-
- // In-memory storage
- group.bench_function("in_memory_set_state", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- b.iter(|| {
- storage
- .set_contract_state(
- black_box(contract_address),
- black_box("bench_key"),
- black_box(test_value),
- )
- .unwrap();
- });
- });
-
- group.bench_function("in_memory_get_state", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- storage
- .set_contract_state(contract_address, "bench_key", test_value)
- .unwrap();
-
- b.iter(|| {
- storage
- .get_contract_state(black_box(contract_address), black_box("bench_key"))
- .unwrap();
- });
- });
-
- // Sled storage
- group.bench_function("sled_set_state", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- b.iter(|| {
- storage
- .set_contract_state(
- black_box(contract_address),
- black_box("bench_key"),
- black_box(test_value),
- )
- .unwrap();
- });
- });
-
- group.bench_function("sled_get_state", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- storage
- .set_contract_state(contract_address, "bench_key", test_value)
- .unwrap();
-
- b.iter(|| {
- storage
- .get_contract_state(black_box(contract_address), black_box("bench_key"))
- .unwrap();
- });
- });
-
- // Database storage (if available)
- if let Ok(storage) =
- rt.block_on(async { DatabaseContractStorage::new(create_database_config()).await })
- {
- group.bench_function("database_set_state", |b| {
- b.iter(|| {
- storage
- .set_contract_state(
- black_box(contract_address),
- black_box("bench_key"),
- black_box(test_value),
- )
- .unwrap();
- });
- });
-
- group.bench_function("database_get_state", |b| {
- storage
- .set_contract_state(contract_address, "bench_key", test_value)
- .unwrap();
-
- b.iter(|| {
- storage
- .get_contract_state(black_box(contract_address), black_box("bench_key"))
- .unwrap();
- });
- });
- }
-
- group.finish();
-}
-
-// Benchmark execution history operations
-fn bench_execution_operations(c: &mut Criterion) {
- let rt = Runtime::new().unwrap();
-
- let mut group = c.benchmark_group("execution_operations");
- group.throughput(Throughput::Elements(1));
-
- // In-memory storage
- group.bench_function("in_memory_store_execution", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- b.iter(|| {
- let execution = create_test_execution(black_box(0), black_box(0));
- storage.store_execution(&execution).unwrap();
- });
- });
-
- group.bench_function("in_memory_get_history", |b| {
- let storage = UnifiedContractStorage::new_sync_memory();
- for i in 0..10 {
- let execution = create_test_execution(0, i);
- storage.store_execution(&execution).unwrap();
- }
-
- b.iter(|| {
- storage
- .get_execution_history(black_box(
- "0x0000000000000000000000000000000000000000000000000000000000bench000000",
- ))
- .unwrap();
- });
- });
-
- // Database storage (if available)
- if let Ok(storage) =
- rt.block_on(async { DatabaseContractStorage::new(create_database_config()).await })
- {
- group.bench_function("database_store_execution", |b| {
- b.iter(|| {
- let execution = create_test_execution(black_box(0), black_box(0));
- storage.store_execution(&execution).unwrap();
- });
- });
-
- group.bench_function("database_get_history", |b| {
- for i in 0..10 {
- let execution = create_test_execution(0, i);
- storage.store_execution(&execution).unwrap();
- }
-
- b.iter(|| {
- storage
- .get_execution_history(black_box(
- "0x0000000000000000000000000000000000000000000000000000000000bench000000",
- ))
- .unwrap();
- });
- });
- }
-
- group.finish();
-}
-
-// Benchmark bulk operations
-fn bench_bulk_operations(c: &mut Criterion) {
- let rt = Runtime::new().unwrap();
-
- let mut group = c.benchmark_group("bulk_operations");
-
- for size in [10, 100, 1000].iter() {
- group.throughput(Throughput::Elements(*size as u64));
-
- // In-memory bulk metadata storage
- group.bench_with_input(
- BenchmarkId::new("in_memory_bulk_metadata", size),
- size,
- |b, &size| {
- b.iter(|| {
- let storage = UnifiedContractStorage::new_sync_memory();
- for i in 0..size {
- let metadata = create_test_metadata(black_box(i));
- storage.store_contract_metadata(&metadata).unwrap();
- }
- });
- },
- );
-
- // Database bulk metadata storage (if available)
- if let Ok(storage) =
- rt.block_on(async { DatabaseContractStorage::new(create_database_config()).await })
- {
- group.bench_with_input(
- BenchmarkId::new("database_bulk_metadata", size),
- size,
- |b, &size| {
- b.iter(|| {
- for i in 0..size {
- let metadata = create_test_metadata(black_box(i));
- storage.store_contract_metadata(&metadata).unwrap();
- }
- });
- },
- );
- }
- }
-
- group.finish();
-}
-
-// Benchmark concurrent operations
-fn bench_concurrent_operations(c: &mut Criterion) {
- let rt = Runtime::new().unwrap();
-
- let mut group = c.benchmark_group("concurrent_operations");
-
- for concurrency in [1, 4, 8, 16].iter() {
- group.throughput(Throughput::Elements(*concurrency as u64));
-
- // Database concurrent operations (if available)
- if rt
- .block_on(async { DatabaseContractStorage::new(create_database_config()).await })
- .is_ok()
- {
- group.bench_with_input(
- BenchmarkId::new("database_concurrent_metadata", concurrency),
- concurrency,
- |b, &concurrency| {
- b.iter(|| {
- rt.block_on(async {
- let mut handles = Vec::new();
-
- for i in 0..concurrency {
- let storage =
- DatabaseContractStorage::new(create_database_config())
- .await
- .unwrap();
- let handle = tokio::spawn(async move {
- let metadata = create_test_metadata(black_box(i));
- storage.store_contract_metadata(&metadata).unwrap();
- storage.get_contract_metadata(&metadata.address).unwrap();
- });
- handles.push(handle);
- }
-
- for handle in handles {
- handle.await.unwrap();
- }
- });
- });
- },
- );
- }
- }
-
- group.finish();
-}
-
-criterion_group!(
- benches,
- bench_metadata_operations,
- bench_state_operations,
- bench_execution_operations,
- bench_bulk_operations,
- bench_concurrent_operations
-);
-criterion_main!(benches);
diff --git a/build.rs b/build.rs
deleted file mode 100644
index 3a5116e..0000000
--- a/build.rs
+++ /dev/null
@@ -1,360 +0,0 @@
-use std::{env, path::Path, process::Command};
-
-fn main() {
- println!("cargo::rerun-if-changed=src/main.rs");
- println!("cargo::rerun-if-changed=build.rs");
-
- // Enable Kani verification cfg
- println!("cargo::rustc-check-cfg=cfg(kani)");
-
- // Setup OpenFHE environment
- if let Err(e) = setup_openfhe() {
- eprintln!("Warning: OpenFHE setup failed: {e}");
- eprintln!("Build may fail if OpenFHE libraries are required at runtime");
- }
-}
-
-fn setup_openfhe() -> Result<(), String> {
- // Only show verbose warnings if OPENFHE_DEBUG is set
- let verbose = env::var("OPENFHE_DEBUG").is_ok();
-
- if verbose {
- println!("cargo::warning=Starting OpenFHE setup process");
- }
-
- // Check if OpenFHE is installed
- let openfhe_root = env::var("OPENFHE_ROOT").unwrap_or_else(|_| "/usr/local".to_string());
- let lib_path = format!("{openfhe_root}/lib");
- let include_path = format!("{openfhe_root}/include");
-
- if verbose {
- println!("cargo::warning=OPENFHE_ROOT: {openfhe_root}");
- println!("cargo::warning=Library path: {lib_path}");
- println!("cargo::warning=Include path: {include_path}");
- }
-
- println!("cargo::rustc-env=OPENFHE_ROOT={openfhe_root}");
- println!("cargo::rustc-env=OPENFHE_LIB_DIR={lib_path}");
- println!("cargo::rustc-env=OPENFHE_INCLUDE_DIR={include_path}");
-
- // For cxx crate: provide include paths
- println!("cargo::rustc-env=DEP_OPENFHE_INCLUDE={include_path}");
-
- // Check CPATH environment variable for additional include paths
- let mut include_paths = vec![
- include_path.clone(),
- format!("{openfhe_root}/include/openfhe"),
- "/usr/include/openfhe".to_string(),
- "/usr/local/include/openfhe".to_string(),
- "/opt/homebrew/include/openfhe".to_string(),
- ];
-
- // Add CPATH directories if available
- if let Ok(cpath) = env::var("CPATH") {
- for path in cpath.split(':') {
- include_paths.push(path.to_string());
- include_paths.push(format!("{path}/openfhe"));
- }
- }
-
- // Additional common include paths for OpenFHE
- include_paths.extend(vec![
- "/usr/local/include".to_string(),
- "/usr/include".to_string(),
- format!("{openfhe_root}/include"),
- ]);
-
- // Find a valid include path and check for key headers
- let mut found_include = false;
- for path in &include_paths {
- if Path::new(path).exists() {
- // Check for key OpenFHE headers that are referenced in the error messages
- let critical_headers = vec![
- // Primary patterns from CI errors
- format!("{path}/openfhe/core/lattice/hal/lat-backend.h"),
- format!("{path}/openfhe/binfhe/lwe-ciphertext-fwd.h"),
- format!("{path}/openfhe/core/utils/exception.h"),
- // Alternative include patterns
- format!("{path}/openfhe/core/include/lattice/hal/lat-backend.h"),
- format!("{path}/openfhe/binfhe/include/lwe-ciphertext-fwd.h"),
- format!("{path}/openfhe/core/include/utils/exception.h"),
- // Direct directory patterns (fallback)
- format!("{path}/core/lattice/hal/lat-backend.h"),
- format!("{path}/binfhe/lwe-ciphertext-fwd.h"),
- format!("{path}/core/utils/exception.h"),
- // Additional critical OpenFHE headers
- format!("{path}/openfhe/core/lattice/hal/lat-hal.h"),
- format!("{path}/openfhe/pke/include/scheme/scheme-id.h"),
- format!("{path}/openfhe/binfhe/include/binfhe.h"),
- ];
-
- // Also check for common OpenFHE headers to verify installation
- let common_headers = vec![
- format!("{path}/openfhe/core/include/lattice/lat-hal.h"),
- format!("{path}/openfhe/pke/include/scheme/scheme-id.h"),
- format!("{path}/openfhe/binfhe/include/binfhe.h"),
- format!("{path}/core/include/lattice/lat-hal.h"),
- format!("{path}/pke/include/scheme/scheme-id.h"),
- format!("{path}/binfhe/include/binfhe.h"),
- ];
-
- let mut found_critical = false;
- let mut found_common = false;
-
- // Check for critical headers
- for header in &critical_headers {
- if Path::new(header).exists() {
- found_critical = true;
- if verbose {
- println!("cargo::warning=Found critical header: {header}");
- }
- break;
- }
- }
-
- // Check for common headers as fallback
- if !found_critical {
- for header in &common_headers {
- if Path::new(header).exists() {
- found_common = true;
- if verbose {
- println!("cargo::warning=Found common header: {header}");
- }
- break;
- }
- }
- }
-
- if found_critical || found_common {
- println!("cargo::rustc-env=OPENFHE_INCLUDE_PATH={path}");
-
- // Also add openfhe subdirectory if it exists
- let openfhe_subdir = format!("{path}/openfhe");
- if Path::new(&openfhe_subdir).exists() {
- println!("cargo::rustc-env=OPENFHE_INCLUDE_SUBDIR={openfhe_subdir}");
- if verbose {
- println!(
- "cargo::warning=Also including OpenFHE subdirectory: {openfhe_subdir}"
- );
- }
- }
-
- if verbose {
- let header_type = if found_critical { "critical" } else { "common" };
- println!("cargo::warning=Found OpenFHE {header_type} headers in: {path}");
-
- // List some of the found headers for debugging
- println!("cargo::warning=Verified header files:");
- for header in &critical_headers {
- if Path::new(header).exists() {
- println!("cargo::warning= ✅ {header}");
- }
- }
- for header in &common_headers {
- if Path::new(header).exists() {
- println!("cargo::warning= ✅ {header}");
- }
- }
- }
- found_include = true;
- break;
- }
- }
- }
-
- if !found_include {
- if verbose {
- eprintln!("Warning: OpenFHE headers not found in any of: {include_paths:?}");
- eprintln!("Please install OpenFHE or set OPENFHE_ROOT environment variable");
- println!("cargo::warning=OpenFHE headers not found in: {include_paths:?}");
- }
- // Continue anyway - might be available through pkg-config or CI cache
- } else if verbose {
- println!("cargo::warning=OpenFHE headers found and verified");
- }
-
- // Verify OpenFHE installation - check all required libraries
- let lib_paths = vec![
- lib_path.clone(),
- "/usr/lib".to_string(),
- "/usr/local/lib".to_string(),
- "/opt/homebrew/lib".to_string(),
- "/usr/lib/x86_64-linux-gnu".to_string(), // Ubuntu path
- ];
-
- let required_libs = ["libOPENFHEcore", "libOPENFHEpke", "libOPENFHEbinfhe"];
- let mut found_libs = false;
- let mut found_lib_path = String::new();
-
- for lib_dir in &lib_paths {
- let mut all_found = true;
- for lib in &required_libs {
- let so_path = format!("{lib_dir}/{lib}.so");
- let a_path = format!("{lib_dir}/{lib}.a");
- let dylib_path = format!("{lib_dir}/{lib}.dylib");
-
- if !Path::new(&so_path).exists()
- && !Path::new(&a_path).exists()
- && !Path::new(&dylib_path).exists()
- {
- all_found = false;
- break;
- }
- }
- if all_found {
- found_libs = true;
- found_lib_path = lib_dir.clone();
- println!("cargo::rustc-link-search=native={lib_dir}");
- break;
- }
- }
-
- if !found_libs {
- if verbose {
- eprintln!("Warning: OpenFHE libraries not found in standard locations");
- eprintln!("Searched in: {lib_paths:?}");
- eprintln!(
- "Please install OpenFHE from https://github.com/MachinaIO/openfhe-development"
- );
- eprintln!("Using fallback library path: {lib_path}");
- println!("cargo::warning=OpenFHE libraries not found, searched in: {lib_paths:?}");
- }
- println!("cargo::rustc-link-search=native={lib_path}");
- } else if verbose {
- println!("cargo::warning=OpenFHE libraries found in: {found_lib_path}");
- }
-
- // Set C++ compiler flags for cc-rs and cxx crates
- println!("cargo::rustc-env=CXXFLAGS=-std=c++17 -O2 -DNDEBUG");
- println!("cargo::rustc-env=CXX_FLAGS=-std=c++17 -O2 -DNDEBUG");
-
- // Set include paths for C++ compilation
- if found_include {
- for path in &include_paths {
- if Path::new(path).exists() {
- println!("cargo::rustc-env=CPATH={path}");
- // Also set individual include directories
- let openfhe_subdir = format!("{path}/openfhe");
- if Path::new(&openfhe_subdir).exists() {
- println!("cargo::rustc-env=CPATH={openfhe_subdir}");
- }
- break; // Use the first valid path
- }
- }
- }
-
- // Disable problematic compiler warnings that cause errors
- let cxx_flags = "-std=c++17 -O2 -DNDEBUG -Wno-unused-parameter -Wno-unused-function -Wno-missing-field-initializers";
- env::set_var("CXXFLAGS", cxx_flags);
- env::set_var("CXX_FLAGS", cxx_flags);
-
- // Set additional include paths in environment
- if let Ok(existing_cpath) = env::var("CPATH") {
- env::set_var(
- "CPATH",
- format!("{existing_cpath}:/usr/local/include:/usr/local/include/openfhe"),
- );
- } else {
- env::set_var("CPATH", "/usr/local/include:/usr/local/include/openfhe");
- }
-
- // Check for pkg-config
- if let Ok(output) = Command::new("pkg-config")
- .args(["--exists", "openfhe"])
- .output()
- {
- if output.status.success() {
- // Use pkg-config if available
- let libs = Command::new("pkg-config")
- .args(["--libs", "openfhe"])
- .output()
- .expect("Failed to run pkg-config");
-
- let cflags = Command::new("pkg-config")
- .args(["--cflags", "openfhe"])
- .output()
- .expect("Failed to run pkg-config");
-
- println!(
- "cargo::rustc-flags={}",
- String::from_utf8_lossy(&libs.stdout).trim()
- );
- println!(
- "cargo::rustc-flags={}",
- String::from_utf8_lossy(&cflags.stdout).trim()
- );
- }
- }
-
- // Fallback to manual linking
- println!("cargo::rustc-link-search=native={lib_path}");
-
- // Add additional library search paths for tarpaulin compatibility
- println!("cargo::rustc-link-search=native=/usr/local/lib");
- println!("cargo::rustc-link-search=native=/usr/lib");
- println!("cargo::rustc-link-search=native=/usr/lib/x86_64-linux-gnu");
-
- // Link OpenFHE libraries in correct order
- println!("cargo::rustc-link-lib=OPENFHEcore");
- println!("cargo::rustc-link-lib=OPENFHEpke");
- println!("cargo::rustc-link-lib=OPENFHEbinfhe");
-
- // Additional system libraries that OpenFHE may depend on
- println!("cargo::rustc-link-lib=ntl");
- println!("cargo::rustc-link-lib=gmp");
- println!("cargo::rustc-link-lib=stdc++");
-
- // Link OpenMP if available
- if cfg!(target_os = "linux") {
- println!("cargo::rustc-link-lib=gomp");
- } else if cfg!(target_os = "macos") {
- // Try to find libomp from Homebrew
- let homebrew_paths = vec![
- "/opt/homebrew/lib".to_string(),
- "/usr/local/lib".to_string(),
- ];
-
- let mut found_omp = false;
- for lib_dir in &homebrew_paths {
- let omp_lib = format!("{lib_dir}/libomp.dylib");
- if Path::new(&omp_lib).exists() {
- println!("cargo::rustc-link-search=native={lib_dir}");
- println!("cargo::rustc-link-lib=omp");
- found_omp = true;
- break;
- }
- }
-
- if !found_omp {
- eprintln!("Warning: OpenMP library not found on macOS");
- eprintln!("Consider installing with: brew install libomp");
- // Don't fail the build - OpenFHE might be built without OpenMP
- }
- }
-
- // Set rpath for runtime library loading - enhanced for tarpaulin
- if !found_lib_path.is_empty() {
- println!("cargo::rustc-link-arg=-Wl,-rpath,{found_lib_path}");
- println!("cargo::rustc-link-arg=-Wl,-rpath,/usr/local/lib");
- } else {
- println!("cargo::rustc-link-arg=-Wl,-rpath,{lib_path}");
- println!("cargo::rustc-link-arg=-Wl,-rpath,/usr/local/lib");
- }
-
- // Additional rpath entries for system libraries
- println!("cargo::rustc-link-arg=-Wl,-rpath,/usr/lib/x86_64-linux-gnu");
- println!("cargo::rustc-link-arg=-Wl,-rpath,/lib/x86_64-linux-gnu");
-
- // Enable additional linker flags for better compatibility
- println!("cargo::rustc-link-arg=-Wl,--enable-new-dtags");
-
- // For tarpaulin: ensure libraries are found at runtime
- if env::var("CARGO_TARPAULIN").is_ok() {
- println!(
- "cargo::warning=Detected tarpaulin execution, applying additional linker settings"
- );
- println!("cargo::rustc-link-arg=-Wl,--no-as-needed");
- }
-
- Ok(())
-}
diff --git a/config/database-storage.toml b/config/database-storage.toml
deleted file mode 100644
index 88174a0..0000000
--- a/config/database-storage.toml
+++ /dev/null
@@ -1,84 +0,0 @@
-# Database Storage Configuration for Polytorus Smart Contracts
-# This configuration enables PostgreSQL and Redis for contract state persistence
-
-[database_storage]
-# Enable fallback to in-memory storage if databases are unavailable
-fallback_to_memory = true
-# Connection timeout in seconds
-connection_timeout_secs = 30
-# Maximum connection pool size
-max_connections = 20
-# Enable SSL/TLS encryption
-use_ssl = false
-
-# PostgreSQL Configuration
-[database_storage.postgres]
-host = "localhost"
-port = 5432
-database = "polytorus"
-username = "polytorus"
-password = "polytorus"
-schema = "smart_contracts"
-max_connections = 20
-
-# Redis Configuration
-[database_storage.redis]
-url = "redis://localhost:6379"
-# password = "your_redis_password" # Uncomment if Redis requires authentication
-database = 0
-max_connections = 20
-key_prefix = "polytorus:contracts:"
-ttl_seconds = 3600 # 1 hour cache TTL
-
-# Example configurations for different environments:
-
-# Development Environment
-[development.database_storage]
-fallback_to_memory = true
-connection_timeout_secs = 10
-
-[development.database_storage.postgres]
-host = "localhost"
-port = 5432
-database = "polytorus_dev"
-username = "dev_user"
-password = "dev_password"
-schema = "smart_contracts"
-max_connections = 5
-
-[development.database_storage.redis]
-url = "redis://localhost:6379"
-database = 1
-max_connections = 5
-key_prefix = "polytorus:dev:contracts:"
-ttl_seconds = 1800 # 30 minutes
-
-# Production Environment
-[production.database_storage]
-fallback_to_memory = false # Strict mode - fail if databases unavailable
-connection_timeout_secs = 60
-use_ssl = true
-
-[production.database_storage.postgres]
-host = "postgres.example.com"
-port = 5432
-database = "polytorus_prod"
-username = "prod_user"
-password = "secure_password"
-schema = "smart_contracts"
-max_connections = 50
-
-[production.database_storage.redis]
-url = "rediss://redis.example.com:6380" # SSL Redis
-password = "redis_secure_password"
-database = 0
-max_connections = 50
-key_prefix = "polytorus:prod:contracts:"
-ttl_seconds = 7200 # 2 hours
-
-# Testing Environment
-[testing.database_storage]
-fallback_to_memory = true
-connection_timeout_secs = 5
-
-# No external databases for testing - uses in-memory fallback only
diff --git a/config/diamond_io.toml b/config/diamond_io.toml
deleted file mode 100644
index cb0fe33..0000000
--- a/config/diamond_io.toml
+++ /dev/null
@@ -1,63 +0,0 @@
-# Diamond IO Configuration for PolyTorus
-# This configuration file demonstrates how to set up Diamond IO
-# for use with the PolyTorus modular blockchain
-
-[diamond_io]
-# Ring dimension - must be a power of 2
-ring_dimension = 16
-
-# CRT (Chinese Remainder Theorem) parameters
-crt_depth = 2
-crt_bits = 17
-
-# Base bits for gadget decomposition
-base_bits = 1
-
-# Switched modulus for the cryptographic scheme
-switched_modulus = "123456789012345"
-
-# Circuit parameters
-input_size = 4
-level_width = 4
-
-# Security parameters
-d = 2
-hardcoded_key_sigma = 4.578
-p_sigma = 4.578
-trapdoor_sigma = 4.578
-
-# Default input values for testing
-inputs = [true, false, true, false]
-
-[layer_config]
-# Maximum number of concurrent contract executions
-max_concurrent_executions = 10
-
-# Enable/disable obfuscation (requires OpenFHE)
-obfuscation_enabled = false
-
-# Enable/disable encryption
-encryption_enabled = true
-
-# Gas limit per contract execution
-gas_limit_per_execution = 1000000
-
-[smart_contracts]
-# Enable automatic contract obfuscation after deployment
-auto_obfuscate = false
-
-# Default gas price (in smallest unit)
-default_gas_price = 1000
-
-# Maximum contract size in bytes
-max_contract_size = 1048576 # 1MB
-
-[security]
-# Enable additional security checks
-strict_mode = true
-
-# Require signature verification for contract deployment
-require_signature = true
-
-# Enable audit logging
-audit_logging = true
diff --git a/config/docker-node.toml b/config/docker-node.toml
deleted file mode 100644
index cfadfa4..0000000
--- a/config/docker-node.toml
+++ /dev/null
@@ -1,57 +0,0 @@
-# Docker Configuration for Node Containers
-[execution]
-gas_limit = 8000000
-gas_price = 1
-
-[execution.wasm_config]
-max_memory_pages = 256
-max_stack_size = 65536
-gas_metering = true
-
-[settlement]
-challenge_period = 100
-batch_size = 100
-min_validator_stake = 1000
-
-[consensus]
-block_time = 10000 # milliseconds (10 seconds)
-difficulty = 4
-max_block_size = 1048576 # 1MB
-
-[data_availability]
-retention_period = 604800 # seconds (7 days)
-max_data_size = 1048576 # 1MB
-
-[data_availability.network_config]
-listen_addr = "0.0.0.0:7000"
-bootstrap_peers = []
-max_peers = 50
-
-# Network Configuration (will be overridden by environment variables)
-[network]
-listen_addr = "0.0.0.0:8000"
-bootstrap_peers = []
-max_peers = 50
-connection_timeout = 10 # seconds
-ping_interval = 30 # seconds
-peer_timeout = 120 # seconds
-enable_discovery = true
-discovery_interval = 300 # seconds (5 minutes)
-max_message_size = 10485760 # 10MB
-bandwidth_limit = 0 # 0 = unlimited
-
-# Logging Configuration
-[logging]
-level = "INFO" # DEBUG, INFO, WARN, ERROR
-output = "console" # console, file, both
-# file_path = null # null = no file logging
-max_file_size = 104857600 # 100MB
-rotation_count = 5
-
-# Storage Configuration
-[storage]
-data_dir = "/data"
-max_cache_size = 1073741824 # 1GB
-sync_interval = 60 # seconds
-compression = true
-backup_interval = 3600 # seconds (1 hour)
diff --git a/config/frr/router-ap.conf b/config/frr/router-ap.conf
deleted file mode 100644
index 043d604..0000000
--- a/config/frr/router-ap.conf
+++ /dev/null
@@ -1,103 +0,0 @@
-# FRRouting Configuration for AS 65003 (Asia Pacific)
-# Simulates Asia Pacific ISP with mobile/IoT focus
-
-hostname router-ap
-password zebra
-enable password zebra
-
-# BGP Configuration
-router bgp 65003
- bgp router-id 192.168.3.1
-
- # eBGP Neighbors
- neighbor 172.100.1.10 remote-as 65001 # North America
- neighbor 172.100.1.10 description "NA-NewYork-Tier1"
- neighbor 172.100.1.10 ebgp-multihop 2
-
- neighbor 172.100.2.10 remote-as 65002 # Europe
- neighbor 172.100.2.10 description "EU-Frankfurt-Tier1"
- neighbor 172.100.2.10 ebgp-multihop 2
-
- neighbor 172.100.4.10 remote-as 65004 # Edge/Mobile
- neighbor 172.100.4.10 description "Edge-Mobile-Provider"
- neighbor 172.100.4.10 ebgp-multihop 2
-
- # Network advertisements
- network 172.100.3.0/24
-
- # BGP communities for Asia Pacific characteristics
- bgp community-list standard MOBILE_OPTIMIZED permit 65003:100
- bgp community-list standard IOT_TRAFFIC permit 65003:200
- bgp community-list standard LOW_LATENCY permit 65003:300
- bgp community-list standard SATELLITE_BACKUP permit 65003:400
-
- # Route maps for mobile/IoT optimization
- route-map EXPORT_TO_NA permit 10
- match community MOBILE_OPTIMIZED
- set community 65003:100
- set med 100 # Lower MED for mobile-optimized routes
-
- route-map EXPORT_TO_EU permit 10
- match community IOT_TRAFFIC
- set community 65003:200
- set local-preference 180
-
- route-map EXPORT_TO_EDGE permit 10
- match community LOW_LATENCY
- set community 65003:300
- set local-preference 250
-
- # Apply mobile-focused policies
- neighbor 172.100.1.10 route-map EXPORT_TO_NA out
- neighbor 172.100.2.10 route-map EXPORT_TO_EU out
- neighbor 172.100.4.10 route-map EXPORT_TO_EDGE out
-
- # Prefer Asia Pacific routes for regional traffic
- neighbor 172.100.1.10 route-map REGIONAL_PREFERENCE in
- neighbor 172.100.2.10 route-map REGIONAL_PREFERENCE in
-
- address-family ipv4 unicast
- neighbor 172.100.1.10 activate
- neighbor 172.100.2.10 activate
- neighbor 172.100.4.10 activate
- exit-address-family
-
-# Interface configurations
-interface eth0
- ip address 172.100.3.10/24
- no shutdown
-
-interface eth1
- ip address 192.168.13.2/30
- no shutdown
- description "Link to NA-NewYork"
-
-interface eth2
- ip address 192.168.23.2/30
- no shutdown
- description "Link to EU-Frankfurt"
-
-interface eth3
- ip address 192.168.34.1/30
- no shutdown
- description "Direct link to Mobile Edge"
-
-# Regional preference for AP traffic
-route-map REGIONAL_PREFERENCE permit 10
- set local-preference 200
-
-# Static routes with satellite backup
-ip route 0.0.0.0/0 172.100.3.1
-ip route 0.0.0.0/0 192.168.34.2 200 # Backup via Edge
-
-# Logging optimized for high-volume mobile traffic
-log file /var/log/frr/bgpd.log
-log timestamp precision 3 # Less precision for mobile
-
-# Access control
-access-list 30 permit 172.100.0.0/16
-access-list 30 permit 192.168.0.0/16
-access-list 30 deny any
-
-line vty
- access-class 30 in
diff --git a/config/frr/router-apac/frr.conf b/config/frr/router-apac/frr.conf
deleted file mode 100644
index cd1aa05..0000000
--- a/config/frr/router-apac/frr.conf
+++ /dev/null
@@ -1,136 +0,0 @@
-# FRR Configuration for Asia-Pacific Router (AS65003)
-# Simulates APAC ISP infrastructure with mobile and IoT optimization
-
-# Global configuration
-frr version 8.0
-frr defaults traditional
-hostname router-apac
-log syslog informational
-service integrated-vtysh-config
-
-# Interface configuration
-interface eth1
- description Internal AS65003 Network
- ip address 10.3.0.1/24
- no shutdown
-!
-
-interface eth2
- description Trans-Pacific Link to North America (AS65001)
- ip address 192.168.101.2/30
- no shutdown
-!
-
-interface eth3
- description APAC to Europe Link (AS65002)
- ip address 192.168.103.2/30
- no shutdown
-!
-
-# Static routes for internal network
-ip route 10.3.0.0/24 10.3.0.1
-
-# BGP Configuration for AS65003
-router bgp 65003
- bgp router-id 192.168.101.2
-
- # Internal network advertisement
- network 10.3.0.0/24
-
- # BGP neighbors (eBGP peering)
- neighbor 192.168.101.1 remote-as 65001
- neighbor 192.168.101.1 description "Router-NA (AS65001)"
- neighbor 192.168.101.1 ebgp-multihop 2
- neighbor 192.168.101.1 next-hop-self
-
- neighbor 192.168.103.1 remote-as 65002
- neighbor 192.168.103.1 description "Router-EU (AS65002)"
- neighbor 192.168.103.1 ebgp-multihop 2
- neighbor 192.168.103.1 next-hop-self
-
- # Address family configuration
- address-family ipv4 unicast
- # Redistribute connected networks
- redistribute connected
-
- # Neighbor policies for North America (preferred path)
- neighbor 192.168.101.1 activate
- neighbor 192.168.101.1 soft-reconfiguration inbound
- neighbor 192.168.101.1 route-map NA-IN in
- neighbor 192.168.101.1 route-map NA-OUT out
-
- # Neighbor policies for Europe (backup path)
- neighbor 192.168.103.1 activate
- neighbor 192.168.103.1 soft-reconfiguration inbound
- neighbor 192.168.103.1 route-map EU-IN in
- neighbor 192.168.103.1 route-map EU-OUT out
- exit-address-family
-!
-
-# Route-maps optimized for mobile and IoT traffic
-route-map NA-IN permit 10
- description "Routes from North America (AS65001) - Primary path"
- set local-preference 120
- set community 65003:100
-!
-
-route-map NA-OUT permit 10
- description "Routes to North America (AS65001) - Mobile optimized"
- set as-path prepend 65003
- # Mark mobile/IoT traffic for QoS
- set community additive 65003:555
-!
-
-route-map EU-IN permit 10
- description "Routes from Europe (AS65002) - Backup path"
- set local-preference 100
- set community 65003:200
-!
-
-route-map EU-OUT permit 10
- description "Routes to Europe (AS65002) - IoT traffic"
- set as-path prepend 65003 65003
- set community additive 65003:444
-!
-
-# Mobile network optimization
-route-map MOBILE-OPTIMIZE permit 10
- description "Optimize routes for mobile networks"
- match community MOBILE-TRAFFIC
- set metric 50
- set community additive 65003:777
-!
-
-route-map IOT-OPTIMIZE permit 10
- description "Optimize routes for IoT devices"
- match community IOT-TRAFFIC
- set metric 100
- set community additive 65003:888
-!
-
-# Access lists for APAC networks
-ip prefix-list APAC-INTERNAL-NETWORKS seq 5 permit 10.3.0.0/24 le 32
-ip prefix-list MOBILE-NETWORKS seq 10 permit 10.3.0.0/26 le 32
-ip prefix-list IOT-NETWORKS seq 15 permit 10.3.0.64/26 le 32
-
-# Community lists for mobile and IoT traffic classification
-ip community-list standard MOBILE-TRAFFIC permit 65003:555
-ip community-list standard IOT-TRAFFIC permit 65003:444
-ip community-list standard HIGH-PRIORITY permit 65003:777
-ip community-list standard LOW-LATENCY permit 65003:888
-
-# OSPF for internal routing with mobile optimization
-router ospf
- ospf router-id 192.168.101.2
- network 10.3.0.0/24 area 0
- passive-interface default
- no passive-interface eth1
- # Adjust timers for mobile networks
- timers throttle spf 200 1000 10000
-!
-
-# Line VTY configuration
-line vty
-!
-
-end
diff --git a/config/frr/router-edge.conf b/config/frr/router-edge.conf
deleted file mode 100644
index a5ecb0d..0000000
--- a/config/frr/router-edge.conf
+++ /dev/null
@@ -1,107 +0,0 @@
-# FRRouting Configuration for AS 65004 (Edge/Mobile Network)
-# Simulates edge ISP with satellite/rural connections
-
-hostname router-edge
-password zebra
-enable password zebra
-
-# BGP Configuration
-router bgp 65004
- bgp router-id 192.168.4.1
-
- # eBGP Neighbors (limited connectivity)
- neighbor 172.100.1.10 remote-as 65001 # North America (primary)
- neighbor 172.100.1.10 description "NA-Primary-Connection"
- neighbor 172.100.1.10 ebgp-multihop 2
-
- neighbor 172.100.2.10 remote-as 65002 # Europe (backup)
- neighbor 172.100.2.10 description "EU-Backup-Connection"
- neighbor 172.100.2.10 ebgp-multihop 2
-
- neighbor 172.100.3.10 remote-as 65003 # Asia Pacific (mobile)
- neighbor 172.100.3.10 description "AP-Mobile-Connection"
- neighbor 172.100.3.10 ebgp-multihop 2
-
- # Network advertisements
- network 172.100.4.0/24
-
- # BGP communities for edge characteristics
- bgp community-list standard SATELLITE_LINK permit 65004:100
- bgp community-list standard RURAL_CONNECTION permit 65004:200
- bgp community-list standard MOBILE_EDGE permit 65004:300
- bgp community-list standard EMERGENCY_BACKUP permit 65004:400
-
- # Route maps for edge network optimization
- route-map EXPORT_LIMITED permit 10
- match community SATELLITE_LINK
- set community 65004:100
- set med 300 # Higher MED due to limited bandwidth
-
- route-map EXPORT_LIMITED permit 20
- match community RURAL_CONNECTION
- set community 65004:200
- set med 250
-
- # Path preference: NA primary, EU backup, AP for mobile
- neighbor 172.100.1.10 route-map EXPORT_LIMITED out
- neighbor 172.100.1.10 route-map PRIMARY_PATH in
-
- neighbor 172.100.2.10 route-map EXPORT_LIMITED out
- neighbor 172.100.2.10 route-map BACKUP_PATH in
-
- neighbor 172.100.3.10 route-map EXPORT_LIMITED out
- neighbor 172.100.3.10 route-map MOBILE_PATH in
-
- address-family ipv4 unicast
- neighbor 172.100.1.10 activate
- neighbor 172.100.2.10 activate
- neighbor 172.100.3.10 activate
- exit-address-family
-
-# Interface configurations
-interface eth0
- ip address 172.100.4.10/24
- no shutdown
-
-interface eth1
- ip address 192.168.14.2/30
- no shutdown
- description "Primary link to NA"
-
-interface eth2
- ip address 192.168.24.2/30
- no shutdown
- description "Backup link to EU"
-
-interface eth3
- ip address 192.168.34.2/30
- no shutdown
- description "Mobile link to AP"
-
-# Path preference route maps
-route-map PRIMARY_PATH permit 10
- set local-preference 300
-
-route-map BACKUP_PATH permit 10
- set local-preference 100
-
-route-map MOBILE_PATH permit 10
- match community MOBILE_EDGE
- set local-preference 250
-
-# Default routes with failover
-ip route 0.0.0.0/0 192.168.14.1 100 # Primary via NA
-ip route 0.0.0.0/0 192.168.24.1 200 # Backup via EU
-ip route 0.0.0.0/0 192.168.34.1 250 # Mobile via AP
-
-# Logging for limited bandwidth
-log file /var/log/frr/bgpd.log
-log timestamp precision 1
-
-# Restrictive access control for edge security
-access-list 40 permit 172.100.0.0/16
-access-list 40 deny any
-
-line vty
- access-class 40 in
- exec-timeout 5 0 # Shorter timeout for satellite links
diff --git a/config/frr/router-edge/frr.conf b/config/frr/router-edge/frr.conf
deleted file mode 100644
index 39ed429..0000000
--- a/config/frr/router-edge/frr.conf
+++ /dev/null
@@ -1,128 +0,0 @@
-# FRR Configuration for Edge/Mobile Router (AS65004)
-# Simulates edge infrastructure with satellite and rural connectivity
-
-# Global configuration
-frr version 8.0
-frr defaults traditional
-hostname router-edge
-log syslog informational
-service integrated-vtysh-config
-
-# Interface configuration
-interface eth1
- description Internal AS65004 Edge Network
- ip address 10.4.0.1/24
- no shutdown
-!
-
-interface eth2
- description Link to North America (AS65001) - Primary uplink
- ip address 192.168.102.2/30
- no shutdown
-!
-
-# Static routes for internal edge network
-ip route 10.4.0.0/24 10.4.0.1
-
-# BGP Configuration for AS65004 (Edge/Mobile)
-router bgp 65004
- bgp router-id 192.168.102.2
-
- # Internal network advertisement
- network 10.4.0.0/24
-
- # Single upstream provider (AS65001) - typical for edge networks
- neighbor 192.168.102.1 remote-as 65001
- neighbor 192.168.102.1 description "Router-NA (AS65001) - Primary uplink"
- neighbor 192.168.102.1 ebgp-multihop 2
- neighbor 192.168.102.1 next-hop-self
-
- # Address family configuration
- address-family ipv4 unicast
- # Redistribute connected networks
- redistribute connected
-
- # Simple upstream policy for edge network
- neighbor 192.168.102.1 activate
- neighbor 192.168.102.1 soft-reconfiguration inbound
- neighbor 192.168.102.1 route-map UPSTREAM-IN in
- neighbor 192.168.102.1 route-map UPSTREAM-OUT out
-
- # Default route acceptance for internet access
- neighbor 192.168.102.1 default-originate
- exit-address-family
-!
-
-# Route-maps for edge network with bandwidth conservation
-route-map UPSTREAM-IN permit 10
- description "Routes from upstream (AS65001) - Accept all with default preference"
- set local-preference 100
- set community 65004:100
-!
-
-route-map UPSTREAM-OUT permit 10
- description "Advertise edge networks to upstream - Bandwidth limited"
- match ip address prefix-list EDGE-NETWORKS
- set as-path prepend 65004 65004 65004
- # Mark as low-priority traffic due to bandwidth constraints
- set community 65004:999
-!
-
-route-map UPSTREAM-OUT deny 20
- description "Block everything else to conserve bandwidth"
-!
-
-# Bandwidth conservation and prioritization
-route-map SATELLITE-PRIORITY permit 10
- description "High priority for critical traffic over satellite"
- match community CRITICAL-TRAFFIC
- set metric 10
- set community additive 65004:777
-!
-
-route-map SATELLITE-PRIORITY permit 20
- description "Normal priority for regular traffic"
- match community NORMAL-TRAFFIC
- set metric 50
- set community additive 65004:555
-!
-
-route-map SATELLITE-PRIORITY permit 30
- description "Low priority for bulk traffic"
- set metric 100
- set community additive 65004:333
-!
-
-# Access lists for edge network classification
-ip prefix-list EDGE-NETWORKS seq 5 permit 10.4.0.0/24 le 32
-ip prefix-list SATELLITE-NETWORKS seq 10 permit 10.4.0.0/26 le 32
-ip prefix-list RURAL-NETWORKS seq 15 permit 10.4.0.64/26 le 32
-ip prefix-list MOBILE-EDGE seq 20 permit 10.4.0.128/26 le 32
-
-# Community lists for traffic prioritization
-ip community-list standard CRITICAL-TRAFFIC permit 65004:777
-ip community-list standard NORMAL-TRAFFIC permit 65004:555
-ip community-list standard BULK-TRAFFIC permit 65004:333
-ip community-list standard SATELLITE-OPTIMIZED permit 65004:999
-
-# OSPF for internal routing with satellite-friendly timers
-router ospf
- ospf router-id 192.168.102.2
- network 10.4.0.0/24 area 0
- passive-interface default
- no passive-interface eth1
-
- # Extended timers for satellite links
- timers throttle spf 500 2000 30000
- area 0 range 10.4.0.0/24
-!
-
-# Static routes for satellite backup (if primary fails)
-# These would be activated during network failures
-ip route 0.0.0.0/0 192.168.102.1 100 name "Primary uplink"
-
-# Line VTY configuration
-line vty
-!
-
-end
diff --git a/config/frr/router-eu.conf b/config/frr/router-eu.conf
deleted file mode 100644
index e76255a..0000000
--- a/config/frr/router-eu.conf
+++ /dev/null
@@ -1,95 +0,0 @@
-# FRRouting Configuration for AS 65002 (Europe)
-# Simulates European Tier-1 ISP with GDPR compliance routing
-
-hostname router-eu
-password zebra
-enable password zebra
-
-# BGP Configuration
-router bgp 65002
- bgp router-id 192.168.2.1
-
- # eBGP Neighbors
- neighbor 172.100.1.10 remote-as 65001 # North America
- neighbor 172.100.1.10 description "NA-NewYork-Tier1"
- neighbor 172.100.1.10 ebgp-multihop 2
-
- neighbor 172.100.3.10 remote-as 65003 # Asia Pacific
- neighbor 172.100.3.10 description "AP-Singapore-Tier1"
- neighbor 172.100.3.10 ebgp-multihop 2
-
- neighbor 172.100.4.10 remote-as 65004 # Edge/Mobile
- neighbor 172.100.4.10 description "Edge-Mobile-Provider"
- neighbor 172.100.4.10 ebgp-multihop 2
-
- # Network advertisements
- network 172.100.2.0/24
-
- # BGP communities for GDPR compliance
- bgp community-list standard GDPR_COMPLIANT permit 65002:100
- bgp community-list standard INSTITUTIONAL_ONLY permit 65002:200
- bgp community-list standard RESEARCH_DATA permit 65002:300
- bgp community-list standard FINANCIAL_DATA permit 65002:400
-
- # Route maps for regulatory compliance
- route-map EXPORT_TO_NA permit 10
- match community GDPR_COMPLIANT
- set community 65002:100
- route-map EXPORT_TO_NA deny 20
- match community INSTITUTIONAL_ONLY
-
- route-map EXPORT_TO_AP permit 10
- match community RESEARCH_DATA
- set community 65002:300
- set local-preference 150
-
- # Apply compliance policies
- neighbor 172.100.1.10 route-map EXPORT_TO_NA out
- neighbor 172.100.3.10 route-map EXPORT_TO_AP out
-
- # Prefer European routes for latency
- neighbor 172.100.1.10 route-map PREFER_LOCAL in
-
- address-family ipv4 unicast
- neighbor 172.100.1.10 activate
- neighbor 172.100.3.10 activate
- neighbor 172.100.4.10 activate
- exit-address-family
-
-# Interface configurations
-interface eth0
- ip address 172.100.2.10/24
- no shutdown
-
-interface eth1
- ip address 192.168.12.2/30
- no shutdown
- description "Link to NA-NewYork"
-
-interface eth2
- ip address 192.168.23.1/30
- no shutdown
- description "Link to AP-Singapore"
-
-interface eth3
- ip address 192.168.24.1/30
- no shutdown
- description "Link to Edge-Network"
-
-# Compliance route map
-route-map PREFER_LOCAL permit 10
- set local-preference 300
-
-# Static routes
-ip route 0.0.0.0/0 172.100.2.1
-
-# Logging with GDPR considerations
-log file /var/log/frr/bgpd.log
-log timestamp precision 6
-
-# Access control for European privacy
-access-list 20 permit 172.100.0.0/16
-access-list 20 deny any
-
-line vty
- access-class 20 in
diff --git a/config/frr/router-eu/frr.conf b/config/frr/router-eu/frr.conf
deleted file mode 100644
index 4684886..0000000
--- a/config/frr/router-eu/frr.conf
+++ /dev/null
@@ -1,128 +0,0 @@
-# FRR Configuration for Europe Router (AS65002)
-# Simulates European ISP infrastructure with regulatory compliance focus
-
-# Global configuration
-frr version 8.0
-frr defaults traditional
-hostname router-eu
-log syslog informational
-service integrated-vtysh-config
-
-# Interface configuration
-interface eth1
- description Internal AS65002 Network
- ip address 10.2.0.1/24
- no shutdown
-!
-
-interface eth2
- description Trans-Atlantic Link to North America (AS65001)
- ip address 192.168.100.2/30
- no shutdown
-!
-
-interface eth3
- description Europe to Asia-Pacific Link (AS65003)
- ip address 192.168.103.1/30
- no shutdown
-!
-
-# Static routes for internal network
-ip route 10.2.0.0/24 10.2.0.1
-
-# BGP Configuration for AS65002
-router bgp 65002
- bgp router-id 192.168.100.2
-
- # Internal network advertisement
- network 10.2.0.0/24
-
- # BGP neighbors (eBGP peering)
- neighbor 192.168.100.1 remote-as 65001
- neighbor 192.168.100.1 description "Router-NA (AS65001)"
- neighbor 192.168.100.1 ebgp-multihop 2
- neighbor 192.168.100.1 next-hop-self
-
- neighbor 192.168.103.2 remote-as 65003
- neighbor 192.168.103.2 description "Router-APAC (AS65003)"
- neighbor 192.168.103.2 ebgp-multihop 2
- neighbor 192.168.103.2 next-hop-self
-
- # Address family configuration
- address-family ipv4 unicast
- # Redistribute connected networks
- redistribute connected
-
- # Neighbor policies for North America
- neighbor 192.168.100.1 activate
- neighbor 192.168.100.1 soft-reconfiguration inbound
- neighbor 192.168.100.1 route-map NA-IN in
- neighbor 192.168.100.1 route-map NA-OUT out
-
- # Neighbor policies for Asia-Pacific
- neighbor 192.168.103.2 activate
- neighbor 192.168.103.2 soft-reconfiguration inbound
- neighbor 192.168.103.2 route-map APAC-IN in
- neighbor 192.168.103.2 route-map APAC-OUT out
- exit-address-family
-!
-
-# Route-maps for European regulatory compliance
-route-map NA-IN permit 10
- description "Routes from North America (AS65001)"
- set local-preference 110
- set community 65002:100
-!
-
-route-map NA-OUT permit 10
- description "Routes to North America (AS65001) - Compliance filtered"
- set as-path prepend 65002
- # Apply European data protection requirements
- set community additive 65002:999
-!
-
-route-map APAC-IN permit 10
- description "Routes from Asia-Pacific (AS65003)"
- set local-preference 95
- set community 65002:200
-!
-
-route-map APAC-OUT permit 10
- description "Routes to Asia-Pacific (AS65003) - GDPR compliance"
- set as-path prepend 65002
- set community additive 65002:888
-!
-
-# European compliance route filtering
-route-map GDPR-FILTER permit 10
- description "GDPR compliance filtering"
- match community INSTITUTIONAL-TRAFFIC
- set community additive 65002:777
-!
-
-route-map GDPR-FILTER deny 20
- description "Block non-compliant traffic"
-!
-
-# Access lists for regulatory compliance
-ip prefix-list EU-INTERNAL-NETWORKS seq 5 permit 10.2.0.0/24 le 32
-ip prefix-list GDPR-PROTECTED seq 10 permit 10.2.0.0/24 le 32
-
-# Community lists for institutional traffic
-ip community-list standard INSTITUTIONAL-TRAFFIC permit 65002:777
-ip community-list standard COMPLIANCE-REQUIRED permit 65002:999
-ip community-list standard GDPR-PROTECTED permit 65002:888
-
-# OSPF for internal routing
-router ospf
- ospf router-id 192.168.100.2
- network 10.2.0.0/24 area 0
- passive-interface default
- no passive-interface eth1
-!
-
-# Line VTY configuration
-line vty
-!
-
-end
diff --git a/config/frr/router-na-east.conf b/config/frr/router-na-east.conf
deleted file mode 100644
index 44a0e7a..0000000
--- a/config/frr/router-na-east.conf
+++ /dev/null
@@ -1,87 +0,0 @@
-# FRRouting Configuration for AS 65001 (North America East)
-# Simulates major Tier-1 ISP in North America
-
-hostname router-na-east
-password zebra
-enable password zebra
-
-# BGP Configuration
-router bgp 65001
- bgp router-id 192.168.1.1
-
- # eBGP Neighbors (External AS peers)
- neighbor 172.100.2.10 remote-as 65002 # Europe
- neighbor 172.100.2.10 description "EU-Frankfurt-Tier1"
- neighbor 172.100.2.10 ebgp-multihop 2
-
- neighbor 172.100.3.10 remote-as 65003 # Asia Pacific
- neighbor 172.100.3.10 description "AP-Singapore-Tier1"
- neighbor 172.100.3.10 ebgp-multihop 2
-
- neighbor 172.100.4.10 remote-as 65004 # Edge/Mobile
- neighbor 172.100.4.10 description "Edge-Mobile-Provider"
- neighbor 172.100.4.10 ebgp-multihop 2
-
- # Network advertisements
- network 172.100.1.0/24
-
- # BGP communities for traffic engineering
- bgp community-list standard HIGH_PRIORITY permit 65001:100
- bgp community-list standard BACKUP_PATH permit 65001:200
- bgp community-list standard CRYPTO_TRAFFIC permit 65001:300
-
- # Route maps for traffic policies
- route-map EXPORT_TO_EU permit 10
- set community 65001:100 # High priority for financial traffic
- route-map EXPORT_TO_EU permit 20
- set community 65001:300 # Crypto traffic classification
-
- route-map EXPORT_TO_AP permit 10
- set community 65001:100
- set local-preference 200
-
- # Apply route maps
- neighbor 172.100.2.10 route-map EXPORT_TO_EU out
- neighbor 172.100.3.10 route-map EXPORT_TO_AP out
-
- # Address families
- address-family ipv4 unicast
- neighbor 172.100.2.10 activate
- neighbor 172.100.3.10 activate
- neighbor 172.100.4.10 activate
- exit-address-family
-
-# Interface configurations
-interface eth0
- ip address 172.100.1.10/24
- no shutdown
-
-interface eth1
- ip address 192.168.12.1/30
- no shutdown
- description "Link to EU-Frankfurt"
-
-interface eth2
- ip address 192.168.13.1/30
- no shutdown
- description "Link to AP-Singapore"
-
-interface eth3
- ip address 192.168.14.1/30
- no shutdown
- description "Link to Edge-Network"
-
-# Static routes for management
-ip route 0.0.0.0/0 172.100.1.1
-
-# Logging
-log file /var/log/frr/bgpd.log
-log timestamp precision 6
-
-# Access control
-access-list 10 permit 172.100.0.0/16
-access-list 10 deny any
-
-# Line configurations
-line vty
- access-class 10 in
diff --git a/config/frr/router-na/frr.conf b/config/frr/router-na/frr.conf
deleted file mode 100644
index 02c28b9..0000000
--- a/config/frr/router-na/frr.conf
+++ /dev/null
@@ -1,145 +0,0 @@
-# FRR Configuration for North America Router (AS65001)
-# Simulates Tier-1 ISP infrastructure with global connectivity
-
-# Global configuration
-frr version 8.0
-frr defaults traditional
-hostname router-na
-log syslog informational
-service integrated-vtysh-config
-
-# Interface configuration
-interface eth1
- description Internal AS65001 Network
- ip address 10.1.0.1/24
- no shutdown
-!
-
-interface eth2
- description Trans-Atlantic Link to Europe (AS65002)
- ip address 192.168.100.1/30
- no shutdown
-!
-
-interface eth3
- description Trans-Pacific Link to Asia-Pacific (AS65003)
- ip address 192.168.101.1/30
- no shutdown
-!
-
-interface eth4
- description Link to Edge/Mobile Network (AS65004)
- ip address 192.168.102.1/30
- no shutdown
-!
-
-# Static routes for internal network
-ip route 10.1.0.0/24 10.1.0.1
-
-# BGP Configuration for AS65001
-router bgp 65001
- bgp router-id 192.168.100.1
-
- # Internal network advertisement
- network 10.1.0.0/24
-
- # BGP neighbors (eBGP peering)
- neighbor 192.168.100.2 remote-as 65002
- neighbor 192.168.100.2 description "Router-EU (AS65002)"
- neighbor 192.168.100.2 ebgp-multihop 2
- neighbor 192.168.100.2 next-hop-self
-
- neighbor 192.168.101.2 remote-as 65003
- neighbor 192.168.101.2 description "Router-APAC (AS65003)"
- neighbor 192.168.101.2 ebgp-multihop 2
- neighbor 192.168.101.2 next-hop-self
-
- neighbor 192.168.102.2 remote-as 65004
- neighbor 192.168.102.2 description "Router-Edge (AS65004)"
- neighbor 192.168.102.2 ebgp-multihop 2
- neighbor 192.168.102.2 next-hop-self
-
- # Address family configuration
- address-family ipv4 unicast
- # Redistribute connected networks
- redistribute connected
-
- # Neighbor policies for Europe
- neighbor 192.168.100.2 activate
- neighbor 192.168.100.2 soft-reconfiguration inbound
- neighbor 192.168.100.2 route-map EU-IN in
- neighbor 192.168.100.2 route-map EU-OUT out
-
- # Neighbor policies for Asia-Pacific
- neighbor 192.168.101.2 activate
- neighbor 192.168.101.2 soft-reconfiguration inbound
- neighbor 192.168.101.2 route-map APAC-IN in
- neighbor 192.168.101.2 route-map APAC-OUT out
-
- # Neighbor policies for Edge/Mobile
- neighbor 192.168.102.2 activate
- neighbor 192.168.102.2 soft-reconfiguration inbound
- neighbor 192.168.102.2 route-map EDGE-IN in
- neighbor 192.168.102.2 route-map EDGE-OUT out
- exit-address-family
-!
-
-# Route-maps for traffic engineering and policy
-route-map EU-IN permit 10
- description "Routes from Europe (AS65002)"
- set local-preference 100
- set community 65001:100
-!
-
-route-map EU-OUT permit 10
- description "Routes to Europe (AS65002)"
- set as-path prepend 65001
-!
-
-route-map APAC-IN permit 10
- description "Routes from Asia-Pacific (AS65003)"
- set local-preference 90
- set community 65001:200
-!
-
-route-map APAC-OUT permit 10
- description "Routes to Asia-Pacific (AS65003)"
- set as-path prepend 65001
-!
-
-route-map EDGE-IN permit 10
- description "Routes from Edge/Mobile (AS65004)"
- set local-preference 80
- set community 65001:300
-!
-
-route-map EDGE-OUT permit 10
- description "Routes to Edge/Mobile (AS65004)"
- set as-path prepend 65001
-!
-
-# Access lists for route filtering
-ip prefix-list INTERNAL-NETWORKS seq 5 permit 10.1.0.0/24 le 32
-ip prefix-list INTERNAL-NETWORKS seq 10 permit 10.2.0.0/24 le 32
-ip prefix-list INTERNAL-NETWORKS seq 15 permit 10.3.0.0/24 le 32
-ip prefix-list INTERNAL-NETWORKS seq 20 permit 10.4.0.0/24 le 32
-
-# Community lists for traffic engineering
-ip community-list standard AS65001-INTERNAL permit 65001:100
-ip community-list standard AS65002-ROUTES permit 65002:100
-ip community-list standard AS65003-ROUTES permit 65003:100
-ip community-list standard AS65004-ROUTES permit 65004:100
-
-# OSPF for internal routing (if needed)
-router ospf
- ospf router-id 192.168.100.1
- network 10.1.0.0/24 area 0
- passive-interface default
- no passive-interface eth1
-!
-
-# Line VTY configuration for management
-line vty
-!
-
-end
diff --git a/config/modular.toml b/config/modular.toml
index d5fc6f2..5a6f2fa 100644
--- a/config/modular.toml
+++ b/config/modular.toml
@@ -17,7 +17,7 @@ min_validator_stake = 1000
[consensus]
block_time = 10000 # milliseconds (10 seconds)
-difficulty = 4
+difficulty = 0 # PoW difficulty (0 = instant mining for testing)
max_block_size = 1048576 # 1MB
[data_availability]
diff --git a/config/realistic-testnet.toml b/config/realistic-testnet.toml
deleted file mode 100644
index cbd12a7..0000000
--- a/config/realistic-testnet.toml
+++ /dev/null
@@ -1,229 +0,0 @@
-# Realistic Testnet Configuration for PolyTorus
-# This configuration simulates real-world network conditions
-
-# Geographic and network settings based on node location
-[network]
-# These will be overridden by environment variables per node
-listen_addr = "0.0.0.0:8000"
-bootstrap_peers = []
-max_peers = 50
-connection_timeout = 30 # Longer timeout for international connections
-ping_interval = 60 # Less frequent pings for bandwidth conservation
-peer_timeout = 300 # Longer timeout for satellite connections
-enable_discovery = true
-discovery_interval = 600 # Less frequent discovery for edge nodes
-max_message_size = 1048576 # 1MB max for satellite connections
-# bandwidth_limit = null # Will be set per node type
-
-# Network quality parameters (will be adjusted per region)
-[network.quality]
-base_latency = "10ms" # Overridden per node
-jitter = "2ms"
-packet_loss = "0.01%"
-bandwidth = "1000mbps"
-connection_type = "fiber" # fiber, cable, dsl, mobile, satellite
-
-# Execution layer with geographic considerations
-[execution]
-gas_limit = 8000000
-gas_price = 1
-max_transaction_size = 65536
-transaction_timeout = 300 # Longer for international propagation
-
-[execution.wasm_config]
-max_memory_pages = 256
-max_stack_size = 65536
-gas_metering = true
-
-# Settlement layer with regional compliance
-[settlement]
-challenge_period = 200 # Longer for international dispute resolution
-batch_size = 50 # Smaller batches for limited bandwidth
-min_validator_stake = 1000
-settlement_timeout = 600 # International settlement takes longer
-
-# Consensus adapted for global network
-[consensus]
-block_time = 30000 # 30 seconds to accommodate satellite delays
-difficulty = 3 # Lower difficulty for testnet
-max_block_size = 512000 # 512KB for bandwidth-limited connections
-confirmation_depth = 6 # More confirmations for international tx
-
-# Data availability with geographic distribution
-[data_availability]
-retention_period = 604800 # 7 days
-max_data_size = 512000 # Smaller for satellite nodes
-replication_factor = 3 # Ensure geographic distribution
-
-[data_availability.network_config]
-listen_addr = "0.0.0.0:7000"
-bootstrap_peers = []
-max_peers = 20 # Fewer peers for DA layer
-connection_timeout = 60 # Longer for satellite
-chunk_size = 32768 # 32KB chunks for limited bandwidth
-
-# Regional logging configuration
-[logging]
-level = "INFO" # Will be overridden per node type
-output = "both" # console and file
-file_path = "/data/logs/polytorus.log"
-max_file_size = 52428800 # 50MB for space-limited edge nodes
-rotation_count = 3
-
-# Storage optimized for different node types
-[storage]
-data_dir = "/data"
-max_cache_size = 268435456 # 256MB for edge nodes
-sync_interval = 120 # Less frequent sync for bandwidth
-compression = true
-backup_interval = 7200 # 2 hours
-
-# Node type specific configurations
-[node_types]
-
-[node_types.exchange]
-# Major exchange/bootstrap node
-max_connections = 200
-cache_size = 2147483648 # 2GB
-log_level = "INFO"
-bandwidth_limit = "1000mbps"
-enable_metrics = true
-api_rate_limit = 1000 # requests per minute
-
-[node_types.mining_pool]
-# Professional mining operation
-max_connections = 100
-cache_size = 1073741824 # 1GB
-log_level = "INFO"
-bandwidth_limit = "500mbps"
-mining_enabled = true
-pool_fee = 0.01 # 1% pool fee
-target_block_time = 30000 # 30 seconds
-
-[node_types.institutional_validator]
-# Bank/financial institution
-max_connections = 50
-cache_size = 536870912 # 512MB
-log_level = "WARN"
-bandwidth_limit = "200mbps"
-compliance_mode = true
-audit_logging = true
-kyc_required = true
-
-[node_types.research]
-# University/research institution
-max_connections = 75
-cache_size = 1073741824 # 1GB
-log_level = "DEBUG"
-bandwidth_limit = "100mbps"
-enable_metrics = true
-research_data_collection = true
-anonymized_stats = true
-
-[node_types.mobile_backend]
-# Mobile app backend
-max_connections = 30
-cache_size = 268435456 # 256MB
-log_level = "WARN"
-bandwidth_limit = "50mbps"
-mobile_optimized = true
-push_notifications = true
-offline_support = true
-
-[node_types.iot_infrastructure]
-# IoT device management
-max_connections = 100
-cache_size = 134217728 # 128MB
-log_level = "ERROR"
-bandwidth_limit = "25mbps"
-iot_optimized = true
-device_management = true
-edge_computing = true
-
-[node_types.light_client]
-# Rural/satellite connection
-max_connections = 5
-cache_size = 67108864 # 64MB
-log_level = "ERROR"
-bandwidth_limit = "5mbps"
-light_mode = true
-minimal_storage = true
-sync_on_demand = true
-
-[node_types.mobile_edge]
-# Mobile edge device
-max_connections = 10
-cache_size = 134217728 # 128MB
-log_level = "WARN"
-bandwidth_limit = "25mbps"
-mobile_optimized = true
-battery_optimization = true
-offline_capability = true
-
-# Regional compliance settings
-[compliance]
-
-[compliance.gdpr]
-enabled = false # Enabled for EU nodes
-data_minimization = true
-consent_required = true
-right_to_deletion = true
-data_portability = true
-
-[compliance.finra]
-enabled = false # Enabled for US financial nodes
-transaction_reporting = true
-audit_trail = true
-risk_monitoring = true
-
-[compliance.mifid2]
-enabled = false # Enabled for EU financial nodes
-best_execution = true
-transaction_reporting = true
-investor_protection = true
-
-# Simulation parameters
-[simulation]
-enable_chaos_engineering = true
-network_partition_probability = 0.05 # 5% chance per hour
-node_failure_probability = 0.02 # 2% chance per hour
-performance_degradation_probability = 0.1 # 10% chance per hour
-
-[simulation.business_hours]
-# Different regions have different active hours
-north_america_active = ["09:00-17:00", "EST"]
-europe_active = ["08:00-18:00", "CET"]
-asia_pacific_active = ["09:00-17:00", "SGT"]
-
-[simulation.traffic_patterns]
-cross_border_multiplier = 0.3 # 30% of traffic is cross-border
-business_hours_multiplier = 3.0 # 3x traffic during business hours
-weekend_multiplier = 0.4 # 40% traffic on weekends
-
-# Testing scenarios
-[testing]
-
-[testing.partition_scenarios]
-# Network partition testing
-transatlantic_partition_duration = 300 # 5 minutes
-transpacific_partition_duration = 180 # 3 minutes
-regional_isolation_duration = 120 # 2 minutes
-
-[testing.performance_scenarios]
-# Performance degradation testing
-satellite_storm_duration = 600 # 10 minutes of high latency
-mobile_congestion_duration = 300 # 5 minutes of bandwidth limits
-ddos_simulation_duration = 180 # 3 minutes of connection limits
-
-# Monitoring and metrics
-[monitoring]
-enable_detailed_metrics = true
-export_prometheus = true
-export_grafana = true
-alert_thresholds = true
-
-[monitoring.thresholds]
-max_block_propagation_time = 60000 # 60 seconds
-max_transaction_confirmation_time = 180000 # 3 minutes
-min_network_connectivity = 0.7 # 70% of peers reachable
-max_memory_usage = 0.8 # 80% of available memory
diff --git a/config/testnet.toml b/config/testnet.toml
deleted file mode 100644
index 9e851b8..0000000
--- a/config/testnet.toml
+++ /dev/null
@@ -1,159 +0,0 @@
-# PolyTorus Local Testnet Configuration
-# Optimized for local development and testing
-
-[network]
-listen_addr = "0.0.0.0:8000"
-bootstrap_peers = []
-max_peers = 20
-connection_timeout = 10
-ping_interval = 30
-peer_timeout = 120
-enable_discovery = true
-discovery_interval = 60
-max_message_size = 1048576 # 1MB
-# bandwidth_limit = null
-
-[execution]
-gas_limit = 8000000
-gas_price = 1
-max_transaction_size = 65536
-transaction_timeout = 30
-
-[execution.wasm_config]
-max_memory_pages = 256
-max_stack_size = 65536
-gas_metering = true
-
-[settlement]
-challenge_period = 50 # Shorter for testnet
-batch_size = 10 # Smaller batches for testing
-min_validator_stake = 100 # Lower stake for testing
-settlement_timeout = 120
-
-[consensus]
-block_time = 10000 # 10 seconds
-difficulty = 2 # Low difficulty for quick mining
-max_block_size = 1048576 # 1MB
-confirmation_depth = 3 # Fewer confirmations for testing
-
-[data_availability]
-retention_period = 86400 # 24 hours for testing
-max_data_size = 1048576 # 1MB
-replication_factor = 2 # Lower replication for local testing
-
-[data_availability.network_config]
-listen_addr = "0.0.0.0:7000"
-bootstrap_peers = []
-max_peers = 10
-connection_timeout = 10
-chunk_size = 32768 # 32KB chunks
-
-[logging]
-level = "INFO"
-output = "both"
-file_path = "/data/logs/polytorus.log"
-max_file_size = 10485760 # 10MB
-rotation_count = 3
-
-[storage]
-data_dir = "/data"
-max_cache_size = 134217728 # 128MB
-sync_interval = 30
-compression = true
-backup_interval = 3600 # 1 hour
-
-# Testnet specific settings
-[testnet]
-network_id = "polytorus-local-testnet"
-chain_id = 31337
-genesis_time = 1735200000 # Fixed genesis time for consistency
-initial_supply = 1000000000 # 1 billion tokens
-initial_difficulty = 2
-
-# Pre-funded accounts for testing
-[testnet.prefunded_accounts]
-# These accounts will have initial balances
-"test_account_1" = 1000000 # 1M tokens
-"test_account_2" = 500000 # 500K tokens
-"test_account_3" = 100000 # 100K tokens
-
-# Node type specific configurations
-[node_types]
-
-[node_types.bootstrap]
-role = "bootstrap"
-enable_mining = false
-enable_api = true
-api_cors_enabled = true
-api_rate_limit = 100
-
-[node_types.miner]
-role = "miner"
-enable_mining = true
-enable_api = true
-mining_reward = 50
-target_block_time = 10000
-
-[node_types.validator]
-role = "validator"
-enable_mining = false
-enable_api = true
-validation_only = true
-
-[node_types.interface]
-role = "interface"
-enable_mining = false
-enable_api = true
-enable_web_ui = true
-api_gateway = true
-
-[node_types.explorer]
-role = "explorer"
-enable_mining = false
-enable_api = true
-enable_block_explorer = true
-historical_data = true
-
-# Development and testing features
-[development]
-enable_debug_endpoints = true
-enable_test_accounts = true
-auto_generate_wallets = true
-fast_sync = true
-disable_peer_verification = false
-
-# API Gateway configuration
-[api_gateway]
-enable = true
-port = 9020
-cors_enabled = true
-rate_limit = 1000
-timeout = 30
-endpoints = [
- "/balance/{address}",
- "/transaction/send",
- "/transaction/status/{hash}",
- "/block/latest",
- "/block/{hash}",
- "/network/status",
- "/wallet/create",
- "/wallet/list"
-]
-
-# Web UI configuration
-[web_ui]
-enable = true
-port = 3000
-api_endpoint = "http://localhost:9020"
-refresh_interval = 5000
-default_gas_price = 1
-default_gas_limit = 21000
-
-# Block Explorer configuration
-[block_explorer]
-enable = true
-port = 8080
-blocks_per_page = 20
-transactions_per_page = 50
-cache_blocks = 1000
-update_interval = 5000
diff --git a/containerlab-topology-enhanced.yml b/containerlab-topology-enhanced.yml
deleted file mode 100644
index bf4a749..0000000
--- a/containerlab-topology-enhanced.yml
+++ /dev/null
@@ -1,455 +0,0 @@
-# Enhanced ContainerLab Topology for PolyTorus Realistic Testnet
-# This topology simulates realistic network conditions with AS separation,
-# geographic distribution, latency/bandwidth constraints, and BGP-like routing
-
-name: polytorus-realistic-testnet
-
-# Global management network configuration
-mgmt:
- network: clab-mgmt
- ipv4-subnet: 172.100.100.0/24
- ipv6-subnet: 2001:172:100:100::/80
-
-topology:
- defaults:
- env:
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_DATA_DIR: /data
-
- nodes:
- # =======================================================================
- # AUTONOMOUS SYSTEM 65001 - NORTH AMERICA
- # Bootstrap nodes, mining pools, exchange infrastructure
- # =======================================================================
-
- # Core Internet Router - North America
- router-na:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.100.10
- exec:
- - ip addr add 10.1.0.1/24 dev eth1 # Internal AS65001
- - ip addr add 192.168.100.1/30 dev eth2 # Link to EU
- - ip addr add 192.168.101.1/30 dev eth3 # Link to APAC
- - ip addr add 192.168.102.1/30 dev eth4 # Link to Edge
- binds:
- - ./config/frr/router-na:/etc/frr
- labels:
- clab-mgmt-net-attach: false
-
- # Bootstrap Node - North America (Primary)
- bootstrap-na:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.20
- ports:
- - "9000:9000" # HTTP API
- - "8000:8000" # P2P
- env:
- POLYTORUS_NODE_ID: bootstrap-na
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: ""
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65001"
- POLYTORUS_REGION: "north_america"
- POLYTORUS_NODE_TYPE: "bootstrap"
- POLYTORUS_CONNECTIVITY_TIER: "tier1_isp"
- volumes:
- - ./data/containerlab/bootstrap-na:/data
- - ./config:/config
- exec:
- - ip addr add 10.1.0.10/24 dev eth1
- - ip route add default via 10.1.0.1
- cmd: |
- mkdir -p /data &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # Mining Pool - North America
- miner-pool-na:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.21
- ports:
- - "9001:9000" # HTTP API
- - "8001:8000" # P2P
- env:
- POLYTORUS_NODE_ID: miner-pool-na
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.1.0.10:8000"
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "miner_pool_na_address"
- POLYTORUS_AS_NUMBER: "65001"
- POLYTORUS_REGION: "north_america"
- POLYTORUS_NODE_TYPE: "mining_pool"
- POLYTORUS_CONNECTIVITY_TIER: "business_isp"
- volumes:
- - ./data/containerlab/miner-pool-na:/data
- - ./config:/config
- exec:
- - ip addr add 10.1.0.11/24 dev eth1
- - ip route add default via 10.1.0.1
- # High-performance mining pool - minimal latency
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 1gbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 1gbit ceil 1gbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 2ms 1ms
- cmd: |
- mkdir -p /data &&
- sleep 5 &&
- polytorus --config /config/realistic-testnet.toml modular start &
- sleep 5 &&
- polytorus --config /config/realistic-testnet.toml modular mine miner_pool_na_address
-
- # Exchange Node - North America
- exchange-na:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.22
- ports:
- - "9002:9000" # HTTP API
- - "8002:8000" # P2P
- env:
- POLYTORUS_NODE_ID: exchange-na
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.1.0.10:8000,10.1.0.11:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65001"
- POLYTORUS_REGION: "north_america"
- POLYTORUS_NODE_TYPE: "exchange"
- POLYTORUS_CONNECTIVITY_TIER: "datacenter"
- volumes:
- - ./data/containerlab/exchange-na:/data
- - ./config:/config
- exec:
- - ip addr add 10.1.0.12/24 dev eth1
- - ip route add default via 10.1.0.1
- # Exchange node - high reliability, low latency
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 500mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 500mbit ceil 500mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 1ms 0.5ms
- cmd: |
- mkdir -p /data &&
- sleep 8 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # =======================================================================
- # AUTONOMOUS SYSTEM 65002 - EUROPE
- # Institutional validators, compliance nodes, research infrastructure
- # =======================================================================
-
- # Core Internet Router - Europe
- router-eu:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.100.30
- exec:
- - ip addr add 10.2.0.1/24 dev eth1 # Internal AS65002
- - ip addr add 192.168.100.2/30 dev eth2 # Link to NA
- - ip addr add 192.168.103.1/30 dev eth3 # Link to APAC
- binds:
- - ./config/frr/router-eu:/etc/frr
-
- # Institutional Validator - Europe
- validator-institution-eu:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.40
- ports:
- - "9010:9000" # HTTP API
- - "8010:8000" # P2P
- env:
- POLYTORUS_NODE_ID: validator-institution-eu
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.1.0.10:8000" # Cross-AS bootstrap
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65002"
- POLYTORUS_REGION: "europe"
- POLYTORUS_NODE_TYPE: "institutional_validator"
- POLYTORUS_CONNECTIVITY_TIER: "datacenter"
- POLYTORUS_COMPLIANCE_MODE: "enabled"
- volumes:
- - ./data/containerlab/validator-institution-eu:/data
- - ./config:/config
- exec:
- - ip addr add 10.2.0.10/24 dev eth1
- - ip route add default via 10.2.0.1
- # Trans-Atlantic latency simulation (NA to EU: ~100ms)
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 100mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 100mbit ceil 100mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 100ms 10ms loss 0.1%
- cmd: |
- mkdir -p /data &&
- sleep 15 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # Research Node - Europe (Academic)
- research-eu:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.41
- ports:
- - "9011:9000" # HTTP API
- - "8011:8000" # P2P
- env:
- POLYTORUS_NODE_ID: research-eu
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.2.0.10:8000,10.1.0.10:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65002"
- POLYTORUS_REGION: "europe"
- POLYTORUS_NODE_TYPE: "research"
- POLYTORUS_CONNECTIVITY_TIER: "university"
- POLYTORUS_EXPERIMENTAL_FEATURES: "enabled"
- volumes:
- - ./data/containerlab/research-eu:/data
- - ./config:/config
- exec:
- - ip addr add 10.2.0.11/24 dev eth1
- - ip route add default via 10.2.0.1
- # University connection - moderate bandwidth, variable latency
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 50mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 50mbit ceil 50mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 50ms 20ms loss 0.2%
- cmd: |
- mkdir -p /data &&
- sleep 18 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # =======================================================================
- # AUTONOMOUS SYSTEM 65003 - ASIA-PACIFIC
- # Mobile backends, IoT nodes, high-frequency trading infrastructure
- # =======================================================================
-
- # Core Internet Router - Asia-Pacific
- router-apac:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.100.50
- exec:
- - ip addr add 10.3.0.1/24 dev eth1 # Internal AS65003
- - ip addr add 192.168.101.2/30 dev eth2 # Link to NA
- - ip addr add 192.168.103.2/30 dev eth3 # Link to EU
- binds:
- - ./config/frr/router-apac:/etc/frr
-
- # Mining Node - Asia-Pacific
- miner-apac:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.60
- ports:
- - "9020:9000" # HTTP API
- - "8020:8000" # P2P
- env:
- POLYTORUS_NODE_ID: miner-apac
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.1.0.10:8000" # Cross-Pacific bootstrap
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "miner_apac_address"
- POLYTORUS_AS_NUMBER: "65003"
- POLYTORUS_REGION: "asia_pacific"
- POLYTORUS_NODE_TYPE: "miner"
- POLYTORUS_CONNECTIVITY_TIER: "business_isp"
- volumes:
- - ./data/containerlab/miner-apac:/data
- - ./config:/config
- exec:
- - ip addr add 10.3.0.10/24 dev eth1
- - ip route add default via 10.3.0.1
- # Trans-Pacific latency simulation (APAC to NA: ~180ms)
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 75mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 75mbit ceil 75mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 180ms 15ms loss 0.3%
- cmd: |
- mkdir -p /data &&
- sleep 20 &&
- polytorus --config /config/realistic-testnet.toml modular start &
- sleep 5 &&
- polytorus --config /config/realistic-testnet.toml modular mine miner_apac_address
-
- # Mobile Backend - Asia-Pacific
- mobile-backend-apac:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.61
- ports:
- - "9021:9000" # HTTP API
- - "8021:8000" # P2P
- env:
- POLYTORUS_NODE_ID: mobile-backend-apac
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.3.0.10:8000,10.1.0.10:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65003"
- POLYTORUS_REGION: "asia_pacific"
- POLYTORUS_NODE_TYPE: "mobile_backend"
- POLYTORUS_CONNECTIVITY_TIER: "mobile_carrier"
- volumes:
- - ./data/containerlab/mobile-backend-apac:/data
- - ./config:/config
- exec:
- - ip addr add 10.3.0.11/24 dev eth1
- - ip route add default via 10.3.0.1
- # Mobile carrier connection - variable performance
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 25mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 25mbit ceil 25mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 80ms 30ms loss 0.5%
- cmd: |
- mkdir -p /data &&
- sleep 25 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # =======================================================================
- # AUTONOMOUS SYSTEM 65004 - EDGE/MOBILE
- # Light clients, mobile nodes, rural/satellite connections
- # =======================================================================
-
- # Edge Router - Mobile/Rural
- router-edge:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.100.70
- exec:
- - ip addr add 10.4.0.1/24 dev eth1 # Internal AS65004
- - ip addr add 192.168.102.2/30 dev eth2 # Link to NA
- binds:
- - ./config/frr/router-edge:/etc/frr
-
- # Light Client - Mobile/Edge
- light-client-mobile:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.80
- ports:
- - "9030:9000" # HTTP API
- - "8030:8000" # P2P
- env:
- POLYTORUS_NODE_ID: light-client-mobile
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.1.0.10:8000" # Bootstrap to NA
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65004"
- POLYTORUS_REGION: "edge_mobile"
- POLYTORUS_NODE_TYPE: "light_client"
- POLYTORUS_CONNECTIVITY_TIER: "mobile_edge"
- POLYTORUS_LIGHT_CLIENT_MODE: "enabled"
- volumes:
- - ./data/containerlab/light-client-mobile:/data
- - ./config:/config
- exec:
- - ip addr add 10.4.0.10/24 dev eth1
- - ip route add default via 10.4.0.1
- # Mobile/satellite connection - high latency, limited bandwidth
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 10mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 10mbit ceil 10mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 300ms 50ms loss 1%
- cmd: |
- mkdir -p /data &&
- sleep 30 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # Rural Node - Satellite Connection
- rural-satellite:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.100.81
- ports:
- - "9031:9000" # HTTP API
- - "8031:8000" # P2P
- env:
- POLYTORUS_NODE_ID: rural-satellite
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_BOOTSTRAP_PEERS: "10.1.0.10:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_AS_NUMBER: "65004"
- POLYTORUS_REGION: "edge_mobile"
- POLYTORUS_NODE_TYPE: "rural_node"
- POLYTORUS_CONNECTIVITY_TIER: "satellite"
- POLYTORUS_INTERMITTENT_CONNECTION: "enabled"
- volumes:
- - ./data/containerlab/rural-satellite:/data
- - ./config:/config
- exec:
- - ip addr add 10.4.0.11/24 dev eth1
- - ip route add default via 10.4.0.1
- # Satellite connection - very high latency, limited bandwidth
- - tc qdisc add dev eth1 root handle 1: htb default 12
- - tc class add dev eth1 parent 1: classid 1:1 htb rate 5mbit
- - tc class add dev eth1 parent 1:1 classid 1:12 htb rate 5mbit ceil 5mbit
- - tc qdisc add dev eth1 parent 1:12 netem delay 600ms 100ms loss 2%
- cmd: |
- mkdir -p /data &&
- sleep 35 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # =======================================================================
- # NETWORK LINKS - Realistic Geographic Connectivity
- # =======================================================================
- links:
- # Router Interconnections (BGP peering)
- - endpoints: ["router-na:eth2", "router-eu:eth2"] # Trans-Atlantic
- - endpoints: ["router-na:eth3", "router-apac:eth2"] # Trans-Pacific
- - endpoints: ["router-eu:eth3", "router-apac:eth3"] # EU-APAC
- - endpoints: ["router-na:eth4", "router-edge:eth2"] # NA-Edge
-
- # AS65001 - North America Internal
- - endpoints: ["router-na:eth1", "bootstrap-na:eth1"]
- - endpoints: ["router-na:eth1", "miner-pool-na:eth1"]
- - endpoints: ["router-na:eth1", "exchange-na:eth1"]
-
- # AS65002 - Europe Internal
- - endpoints: ["router-eu:eth1", "validator-institution-eu:eth1"]
- - endpoints: ["router-eu:eth1", "research-eu:eth1"]
-
- # AS65003 - Asia-Pacific Internal
- - endpoints: ["router-apac:eth1", "miner-apac:eth1"]
- - endpoints: ["router-apac:eth1", "mobile-backend-apac:eth1"]
-
- # AS65004 - Edge/Mobile Internal
- - endpoints: ["router-edge:eth1", "light-client-mobile:eth1"]
- - endpoints: ["router-edge:eth1", "rural-satellite:eth1"]
-
- # =======================================================================
- # LABELS AND METADATA
- # =======================================================================
- labels:
- # Network simulation metadata
- simulation.type: "realistic-testnet"
- simulation.version: "1.0"
- blockchain.platform: "polytorus"
- network.topology: "multi-as-geographic"
-
- # Autonomous System labels
- as.65001: "north-america"
- as.65002: "europe"
- as.65003: "asia-pacific"
- as.65004: "edge-mobile"
-
- # Geographic regions
- region.na: "North America - Low latency cluster"
- region.eu: "Europe - Institutional/Compliance focus"
- region.apac: "Asia Pacific - Mobile/IoT infrastructure"
- region.edge: "Edge/Mobile - Constrained connectivity"
-
- # Network characteristics
- latency.intra-region: "10-50ms"
- latency.inter-region: "100-600ms"
- bandwidth.tier1: "500Mbps-1Gbps"
- bandwidth.business: "50-500Mbps"
- bandwidth.mobile: "5-50Mbps"
- packet-loss.range: "0.01-2%"
diff --git a/containerlab-topology-realistic.yml b/containerlab-topology-realistic.yml
deleted file mode 100644
index f59b038..0000000
--- a/containerlab-topology-realistic.yml
+++ /dev/null
@@ -1,368 +0,0 @@
-# Realistic ContainerLab Topology with AS Separation
-# This topology simulates a real-world distributed blockchain network
-
-name: polytorus-realistic-testnet
-
-topology:
- # BGP Routers for AS separation
- routers:
- # AS 65001 - North America (East Coast)
- router-na-east:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.1.10
- ports:
- - "2601:2601" # BGP port
- volumes:
- - ./config/frr/router-na-east.conf:/etc/frr/frr.conf
- env:
- - ROUTER_ID=65001
- - AS_NUMBER=65001
-
- # AS 65002 - Europe (Frankfurt)
- router-eu:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.2.10
- ports:
- - "2602:2601"
- volumes:
- - ./config/frr/router-eu.conf:/etc/frr/frr.conf
- env:
- - ROUTER_ID=65002
- - AS_NUMBER=65002
-
- # AS 65003 - Asia Pacific (Singapore)
- router-ap:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.3.10
- ports:
- - "2603:2601"
- volumes:
- - ./config/frr/router-ap.conf:/etc/frr/frr.conf
- env:
- - ROUTER_ID=65003
- - AS_NUMBER=65003
-
- # AS 65004 - Edge/Mobile Network
- router-edge:
- kind: linux
- image: frrouting/frr:latest
- mgmt-ipv4: 172.100.4.10
- ports:
- - "2604:2601"
- volumes:
- - ./config/frr/router-edge.conf:/etc/frr/frr.conf
- env:
- - ROUTER_ID=65004
- - AS_NUMBER=65004
-
- nodes:
- # === AS 65001 - North America ===
- # Bootstrap node (Major exchange/infrastructure)
- node-na-bootstrap:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.1.20
- ports:
- - "9000:9000"
- - "8000:8000"
- env:
- POLYTORUS_NODE_ID: na-bootstrap
- POLYTORUS_REGION: north-america
- POLYTORUS_AS: "65001"
- POLYTORUS_NODE_TYPE: exchange
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: ""
- POLYTORUS_IS_MINER: "false"
- # Simulate high-bandwidth connection
- POLYTORUS_BANDWIDTH_LIMIT: "1000mbps"
- POLYTORUS_LATENCY_BASE: "10ms"
- volumes:
- - ./data/realistic/na-bootstrap:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 10ms 2ms &&
- mkdir -p /data &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # Mining pool in NA
- node-na-mining:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.1.21
- ports:
- - "9001:9000"
- - "8001:8000"
- env:
- POLYTORUS_NODE_ID: na-mining-pool
- POLYTORUS_REGION: north-america
- POLYTORUS_AS: "65001"
- POLYTORUS_NODE_TYPE: mining_pool
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000"
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "na_mining_pool_address"
- POLYTORUS_BANDWIDTH_LIMIT: "500mbps"
- POLYTORUS_LATENCY_BASE: "15ms"
- volumes:
- - ./data/realistic/na-mining:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 15ms 3ms &&
- mkdir -p /data &&
- sleep 10 &&
- polytorus --config /config/realistic-testnet.toml modular start &
- sleep 5 &&
- polytorus --config /config/realistic-testnet.toml modular mine na_mining_pool_address
-
- # === AS 65002 - Europe ===
- # Institutional validator (Bank/Financial)
- node-eu-institutional:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.2.20
- ports:
- - "9002:9000"
- - "8002:8000"
- env:
- POLYTORUS_NODE_ID: eu-institutional
- POLYTORUS_REGION: europe
- POLYTORUS_AS: "65002"
- POLYTORUS_NODE_TYPE: institutional_validator
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- # Connect to NA bootstrap with realistic latency
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_BANDWIDTH_LIMIT: "200mbps"
- POLYTORUS_LATENCY_BASE: "100ms" # Trans-Atlantic latency
- volumes:
- - ./data/realistic/eu-institutional:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 100ms 10ms loss 0.1% &&
- mkdir -p /data &&
- sleep 15 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # Research/University node
- node-eu-research:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.2.21
- ports:
- - "9003:9000"
- - "8003:8000"
- env:
- POLYTORUS_NODE_ID: eu-research
- POLYTORUS_REGION: europe
- POLYTORUS_AS: "65002"
- POLYTORUS_NODE_TYPE: research
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: DEBUG
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000,node-eu-institutional:8000"
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "eu_research_address"
- POLYTORUS_BANDWIDTH_LIMIT: "100mbps"
- POLYTORUS_LATENCY_BASE: "25ms"
- volumes:
- - ./data/realistic/eu-research:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 25ms 5ms loss 0.05% &&
- mkdir -p /data &&
- sleep 20 &&
- polytorus --config /config/realistic-testnet.toml modular start &
- sleep 5 &&
- polytorus --config /config/realistic-testnet.toml modular mine eu_research_address
-
- # === AS 65003 - Asia Pacific ===
- # Mobile backend infrastructure
- node-ap-mobile:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.3.20
- ports:
- - "9004:9000"
- - "8004:8000"
- env:
- POLYTORUS_NODE_ID: ap-mobile-backend
- POLYTORUS_REGION: asia-pacific
- POLYTORUS_AS: "65003"
- POLYTORUS_NODE_TYPE: mobile_backend
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_BANDWIDTH_LIMIT: "50mbps"
- POLYTORUS_LATENCY_BASE: "200ms" # Trans-Pacific latency
- volumes:
- - ./data/realistic/ap-mobile:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 200ms 20ms loss 0.5% &&
- mkdir -p /data &&
- sleep 25 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # IoT infrastructure node
- node-ap-iot:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.3.21
- ports:
- - "9005:9000"
- - "8005:8000"
- env:
- POLYTORUS_NODE_ID: ap-iot-infrastructure
- POLYTORUS_REGION: asia-pacific
- POLYTORUS_AS: "65003"
- POLYTORUS_NODE_TYPE: iot_infrastructure
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: WARN
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000,node-ap-mobile:8000"
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "ap_iot_address"
- POLYTORUS_BANDWIDTH_LIMIT: "25mbps"
- POLYTORUS_LATENCY_BASE: "150ms"
- volumes:
- - ./data/realistic/ap-iot:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 150ms 15ms loss 1% &&
- mkdir -p /data &&
- sleep 30 &&
- polytorus --config /config/realistic-testnet.toml modular start &
- sleep 5 &&
- polytorus --config /config/realistic-testnet.toml modular mine ap_iot_address
-
- # === AS 65004 - Edge/Mobile Network ===
- # Light client (rural/satellite connection)
- node-edge-rural:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.4.20
- ports:
- - "9006:9000"
- - "8006:8000"
- env:
- POLYTORUS_NODE_ID: edge-rural-satellite
- POLYTORUS_REGION: edge
- POLYTORUS_AS: "65004"
- POLYTORUS_NODE_TYPE: light_client
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: ERROR
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_BANDWIDTH_LIMIT: "5mbps"
- POLYTORUS_LATENCY_BASE: "600ms" # Satellite latency
- volumes:
- - ./data/realistic/edge-rural:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 600ms 100ms loss 2% &&
- mkdir -p /data &&
- sleep 35 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- # Mobile edge node
- node-edge-mobile:
- kind: linux
- image: polytorus:latest
- mgmt-ipv4: 172.100.4.21
- ports:
- - "9007:9000"
- - "8007:8000"
- env:
- POLYTORUS_NODE_ID: edge-mobile-4g
- POLYTORUS_REGION: edge
- POLYTORUS_AS: "65004"
- POLYTORUS_NODE_TYPE: mobile_edge
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: WARN
- POLYTORUS_BOOTSTRAP_PEERS: "node-na-bootstrap:8000,node-edge-rural:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_BANDWIDTH_LIMIT: "25mbps"
- POLYTORUS_LATENCY_BASE: "80ms"
- volumes:
- - ./data/realistic/edge-mobile:/data
- - ./config:/config
- cmd: |
- tc qdisc add dev eth0 root netem delay 80ms 20ms loss 0.8% corrupt 0.01% &&
- mkdir -p /data &&
- sleep 40 &&
- polytorus --config /config/realistic-testnet.toml modular start
-
- links:
- # Inter-AS BGP peering (realistic ISP connections)
- - endpoints: ["router-na-east:eth1", "router-eu:eth1"]
- vars:
- latency: 100ms
- bandwidth: 10gbps
- loss: 0.01%
-
- - endpoints: ["router-na-east:eth2", "router-ap:eth1"]
- vars:
- latency: 180ms
- bandwidth: 10gbps
- loss: 0.02%
-
- - endpoints: ["router-eu:eth2", "router-ap:eth2"]
- vars:
- latency: 160ms
- bandwidth: 1gbps
- loss: 0.05%
-
- - endpoints: ["router-na-east:eth3", "router-edge:eth1"]
- vars:
- latency: 50ms
- bandwidth: 100mbps
- loss: 0.1%
-
- - endpoints: ["router-eu:eth3", "router-edge:eth2"]
- vars:
- latency: 80ms
- bandwidth: 100mbps
- loss: 0.1%
-
- # Intra-AS connections (within regions)
- # North America
- - endpoints: ["router-na-east:eth4", "node-na-bootstrap:eth1"]
- - endpoints: ["router-na-east:eth5", "node-na-mining:eth1"]
-
- # Europe
- - endpoints: ["router-eu:eth4", "node-eu-institutional:eth1"]
- - endpoints: ["router-eu:eth5", "node-eu-research:eth1"]
-
- # Asia Pacific
- - endpoints: ["router-ap:eth3", "node-ap-mobile:eth1"]
- - endpoints: ["router-ap:eth4", "node-ap-iot:eth1"]
-
- # Edge network
- - endpoints: ["router-edge:eth3", "node-edge-rural:eth1"]
- - endpoints: ["router-edge:eth4", "node-edge-mobile:eth1"]
-
-# Management network with geographic IP allocation
-mgmt:
- network: realistic-testnet-mgmt
- ipv4-subnet: 172.100.0.0/16
diff --git a/containerlab-topology.yml b/containerlab-topology.yml
deleted file mode 100644
index cae2170..0000000
--- a/containerlab-topology.yml
+++ /dev/null
@@ -1,118 +0,0 @@
-# ContainerLab Topology for PolyTorus Testnet
-# This topology creates a 4-node testnet with mining capabilities
-
-name: polytorus-testnet
-
-topology:
- nodes:
- # Bootstrap node (seed node)
- node-0:
- kind: linux
- image: polytorus:latest
- ports:
- - "9000:9000" # HTTP API
- - "8000:8000" # P2P
- env:
- POLYTORUS_NODE_ID: node-0
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: ""
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_MINING_ADDRESS: ""
- volumes:
- - ./data/containerlab/node-0:/data
- - ./config:/config
- cmd: |
- mkdir -p /data &&
- polytorus --config /config/docker-node.toml modular start
-
- # Miner node 1
- node-1:
- kind: linux
- image: polytorus:latest
- ports:
- - "9001:9000" # HTTP API
- - "8001:8000" # P2P
- env:
- POLYTORUS_NODE_ID: node-1
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: "node-0:8000"
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "miner1_address_here"
- volumes:
- - ./data/containerlab/node-1:/data
- - ./config:/config
- cmd: |
- mkdir -p /data &&
- sleep 10 &&
- polytorus --config /config/docker-node.toml modular start &
- sleep 5 &&
- polytorus --config /config/docker-node.toml modular mine miner1_address_here
-
- # Miner node 2
- node-2:
- kind: linux
- image: polytorus:latest
- ports:
- - "9002:9000" # HTTP API
- - "8002:8000" # P2P
- env:
- POLYTORUS_NODE_ID: node-2
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: "node-0:8000,node-1:8000"
- POLYTORUS_IS_MINER: "true"
- POLYTORUS_MINING_ADDRESS: "miner2_address_here"
- volumes:
- - ./data/containerlab/node-2:/data
- - ./config:/config
- cmd: |
- mkdir -p /data &&
- sleep 15 &&
- polytorus --config /config/docker-node.toml modular start &
- sleep 5 &&
- polytorus --config /config/docker-node.toml modular mine miner2_address_here
-
- # Validator node 3
- node-3:
- kind: linux
- image: polytorus:latest
- ports:
- - "9003:9000" # HTTP API
- - "8003:8000" # P2P
- env:
- POLYTORUS_NODE_ID: node-3
- POLYTORUS_HTTP_PORT: 9000
- POLYTORUS_P2P_PORT: 8000
- POLYTORUS_DATA_DIR: /data
- POLYTORUS_LOG_LEVEL: INFO
- POLYTORUS_BOOTSTRAP_PEERS: "node-0:8000,node-1:8000,node-2:8000"
- POLYTORUS_IS_MINER: "false"
- POLYTORUS_MINING_ADDRESS: ""
- volumes:
- - ./data/containerlab/node-3:/data
- - ./config:/config
- cmd: |
- mkdir -p /data &&
- sleep 20 &&
- polytorus --config /config/docker-node.toml modular start
-
- links:
- # Define network topology - full mesh for better connectivity
- - endpoints: ["node-0:eth1", "node-1:eth1"]
- - endpoints: ["node-0:eth2", "node-2:eth1"]
- - endpoints: ["node-0:eth3", "node-3:eth1"]
- - endpoints: ["node-1:eth2", "node-2:eth2"]
- - endpoints: ["node-1:eth3", "node-3:eth2"]
- - endpoints: ["node-2:eth3", "node-3:eth3"]
-
-mgmt:
- network: clab-mgmt
- ipv4-subnet: 172.100.100.0/24
diff --git a/contracts/counter.wat b/contracts/counter.wat
deleted file mode 100644
index 7702cc1..0000000
--- a/contracts/counter.wat
+++ /dev/null
@@ -1,140 +0,0 @@
-;; Counter contract - demonstrates state management and function calls
-(module
- ;; Import host functions
- (import "env" "storage_get" (func $storage_get (param i32 i32) (result i32)))
- (import "env" "storage_set" (func $storage_set (param i32 i32 i32 i32)))
- (import "env" "log" (func $log (param i32 i32)))
- (import "env" "get_caller" (func $get_caller (result i32)))
- (import "env" "get_value" (func $get_value (result i64)))
-
- ;; Memory for contract operations
- (memory 1)
-
- ;; Global variables
- (global $counter_key_ptr i32 (i32.const 0))
- (global $counter_key_len i32 (i32.const 7))
-
- ;; String constants
- (data (i32.const 0) "counter")
- (data (i32.const 8) "Counter incremented to: ")
- (data (i32.const 32) "Counter initialized")
- (data (i32.const 50) "Current counter value: ")
-
- ;; Initialize the counter contract
- (func (export "init") (result i32)
- ;; Set initial counter value to 0
- (call $storage_set
- (global.get $counter_key_ptr) ;; key pointer
- (global.get $counter_key_len) ;; key length
- (i32.const 100) ;; value pointer (store 0 at memory[100])
- (i32.const 4)) ;; value length (4 bytes for i32)
-
- ;; Store initial value 0 at memory[100]
- (i32.store (i32.const 100) (i32.const 0))
-
- ;; Log initialization
- (call $log (i32.const 32) (i32.const 17))
-
- (i32.const 1) ;; return success
- )
-
- ;; Increment the counter
- (func (export "increment") (result i32)
- (local $current_value i32)
-
- ;; Get current counter value
- (local.set $current_value (call $get_counter_value))
-
- ;; Increment the value
- (local.set $current_value (i32.add (local.get $current_value) (i32.const 1)))
-
- ;; Store the new value
- (call $set_counter_value (local.get $current_value))
-
- ;; Log the increment
- (call $log_counter_value (local.get $current_value))
-
- (local.get $current_value) ;; return new value
- )
-
- ;; Get the current counter value
- (func (export "get") (result i32)
- (call $get_counter_value)
- )
-
- ;; Add a specific value to the counter
- (func (export "add") (param $amount i32) (result i32)
- (local $current_value i32)
-
- ;; Get current value
- (local.set $current_value (call $get_counter_value))
-
- ;; Add the amount
- (local.set $current_value (i32.add (local.get $current_value) (local.get $amount)))
-
- ;; Store the new value
- (call $set_counter_value (local.get $current_value))
-
- ;; Log the new value
- (call $log_counter_value (local.get $current_value))
-
- (local.get $current_value)
- )
-
- ;; Reset counter to zero
- (func (export "reset") (result i32)
- ;; Set counter to 0
- (call $set_counter_value (i32.const 0))
-
- ;; Log reset
- (call $log (i32.const 32) (i32.const 17))
-
- (i32.const 0)
- )
-
- ;; Helper function to get counter value from storage
- (func $get_counter_value (result i32)
- (local $length i32)
-
- ;; Try to get the value from storage
- (local.set $length
- (call $storage_get
- (global.get $counter_key_ptr)
- (global.get $counter_key_len)))
-
- ;; If we got data, load it from memory, otherwise return 0
- (if (result i32) (i32.gt_u (local.get $length) (i32.const 0))
- (then
- ;; For this simple implementation, assume the value is stored at a known location
- ;; In a real implementation, storage_get would write to a specified memory location
- (i32.load (i32.const 100))
- )
- (else
- ;; No data found, return 0
- (i32.const 0)
- )
- )
- )
-
- ;; Helper function to set counter value in storage
- (func $set_counter_value (param $value i32)
- ;; Store the value in memory first
- (i32.store (i32.const 100) (local.get $value))
-
- ;; Then save to persistent storage
- (call $storage_set
- (global.get $counter_key_ptr) ;; key pointer
- (global.get $counter_key_len) ;; key length
- (i32.const 100) ;; value pointer
- (i32.const 4)) ;; value length
- )
-
- ;; Helper function to log counter value
- (func $log_counter_value (param $value i32)
- ;; Store the message prefix
- (call $log (i32.const 50) (i32.const 22))
-
- ;; In a real implementation, we'd format the number and log it
- ;; For now, just indicate the operation happened
- )
-)
diff --git a/contracts/test_contract.wat b/contracts/test_contract.wat
deleted file mode 100644
index aec65fc..0000000
--- a/contracts/test_contract.wat
+++ /dev/null
@@ -1,9 +0,0 @@
-(module
- (func (export "main") (result i32)
- i32.const 42)
- (func (export "add") (param i32 i32) (result i32)
- local.get 0
- local.get 1
- i32.add)
- (memory (export "memory") 1)
-)
diff --git a/contracts/token.wat b/contracts/token.wat
deleted file mode 100644
index 888feef..0000000
--- a/contracts/token.wat
+++ /dev/null
@@ -1,207 +0,0 @@
-;; Simple Token Contract - demonstrates complex state management
-(module
- ;; Import host functions
- (import "env" "storage_get" (func $storage_get (param i32 i32) (result i32)))
- (import "env" "storage_set" (func $storage_set (param i32 i32 i32 i32)))
- (import "env" "log" (func $log (param i32 i32)))
- (import "env" "get_caller" (func $get_caller (result i32)))
- (import "env" "get_value" (func $get_value (result i64)))
-
- ;; Memory for contract operations
- (memory 2)
-
- ;; Global constants for storage keys
- (global $total_supply_key_ptr i32 (i32.const 0))
- (global $total_supply_key_len i32 (i32.const 12))
- (global $balance_prefix_ptr i32 (i32.const 16))
- (global $balance_prefix_len i32 (i32.const 8))
-
- ;; String constants
- (data (i32.const 0) "total_supply")
- (data (i32.const 16) "balance_")
- (data (i32.const 32) "Token initialized with supply: ")
- (data (i32.const 64) "Transfer successful")
- (data (i32.const 82) "Transfer failed: insufficient balance")
- (data (i32.const 120) "Mint successful")
- (data (i32.const 136) "Burn successful")
-
- ;; Initialize the token contract with total supply
- (func (export "init") (param $initial_supply i32) (result i32)
- (local $caller i32)
-
- ;; Get the caller (contract deployer)
- (local.set $caller (call $get_caller))
-
- ;; Set total supply
- (call $set_total_supply (local.get $initial_supply))
-
- ;; Give all initial tokens to the deployer
- (call $set_balance (local.get $caller) (local.get $initial_supply))
-
- ;; Log initialization
- (call $log (i32.const 32) (i32.const 31))
-
- (i32.const 1) ;; return success
- )
-
- ;; Get total supply
- (func (export "total_supply") (result i32)
- (call $get_total_supply)
- )
-
- ;; Get balance of an address
- (func (export "balance_of") (param $address i32) (result i32)
- (call $get_balance (local.get $address))
- )
-
- ;; Transfer tokens from caller to recipient
- (func (export "transfer") (param $to i32) (param $amount i32) (result i32)
- (local $caller i32)
- (local $caller_balance i32)
- (local $recipient_balance i32)
-
- ;; Get caller
- (local.set $caller (call $get_caller))
-
- ;; Check if caller has enough balance
- (local.set $caller_balance (call $get_balance (local.get $caller)))
-
- (if (i32.lt_u (local.get $caller_balance) (local.get $amount))
- (then
- ;; Insufficient balance
- (call $log (i32.const 82) (i32.const 37))
- (return (i32.const 0))
- )
- )
-
- ;; Get recipient balance
- (local.set $recipient_balance (call $get_balance (local.get $to)))
-
- ;; Update balances
- (call $set_balance
- (local.get $caller)
- (i32.sub (local.get $caller_balance) (local.get $amount)))
-
- (call $set_balance
- (local.get $to)
- (i32.add (local.get $recipient_balance) (local.get $amount)))
-
- ;; Log success
- (call $log (i32.const 64) (i32.const 18))
-
- (i32.const 1) ;; return success
- )
-
- ;; Mint new tokens (only for demonstration)
- (func (export "mint") (param $to i32) (param $amount i32) (result i32)
- (local $current_supply i32)
- (local $recipient_balance i32)
-
- ;; Get current supply and recipient balance
- (local.set $current_supply (call $get_total_supply))
- (local.set $recipient_balance (call $get_balance (local.get $to)))
-
- ;; Update total supply
- (call $set_total_supply (i32.add (local.get $current_supply) (local.get $amount)))
-
- ;; Add tokens to recipient
- (call $set_balance
- (local.get $to)
- (i32.add (local.get $recipient_balance) (local.get $amount)))
-
- ;; Log success
- (call $log (i32.const 120) (i32.const 15))
-
- (i32.const 1)
- )
-
- ;; Burn tokens from caller's balance
- (func (export "burn") (param $amount i32) (result i32)
- (local $caller i32)
- (local $caller_balance i32)
- (local $current_supply i32)
-
- ;; Get caller and balance
- (local.set $caller (call $get_caller))
- (local.set $caller_balance (call $get_balance (local.get $caller)))
-
- ;; Check sufficient balance
- (if (i32.lt_u (local.get $caller_balance) (local.get $amount))
- (then
- (call $log (i32.const 82) (i32.const 37))
- (return (i32.const 0))
- )
- )
-
- ;; Get current supply
- (local.set $current_supply (call $get_total_supply))
-
- ;; Update balances and supply
- (call $set_balance
- (local.get $caller)
- (i32.sub (local.get $caller_balance) (local.get $amount)))
-
- (call $set_total_supply (i32.sub (local.get $current_supply) (local.get $amount)))
-
- ;; Log success
- (call $log (i32.const 136) (i32.const 15))
-
- (i32.const 1)
- )
-
- ;; Helper functions for storage operations
-
- ;; Get total supply from storage
- (func $get_total_supply (result i32)
- (local $length i32)
-
- (local.set $length
- (call $storage_get
- (global.get $total_supply_key_ptr)
- (global.get $total_supply_key_len)))
-
- (if (result i32) (i32.gt_u (local.get $length) (i32.const 0))
- (then (i32.load (i32.const 200)))
- (else (i32.const 0))
- )
- )
-
- ;; Set total supply in storage
- (func $set_total_supply (param $supply i32)
- (i32.store (i32.const 200) (local.get $supply))
- (call $storage_set
- (global.get $total_supply_key_ptr)
- (global.get $total_supply_key_len)
- (i32.const 200)
- (i32.const 4))
- )
-
- ;; Get balance for an address
- (func $get_balance (param $address i32) (result i32)
- (local $length i32)
-
- ;; Create storage key: "balance_" + address
- ;; For simplicity, we'll use the address as-is
- ;; In practice, you'd create a proper key
-
- (local.set $length
- (call $storage_get
- (global.get $balance_prefix_ptr)
- (i32.add (global.get $balance_prefix_len) (i32.const 4)))) ;; simplified
-
- (if (result i32) (i32.gt_u (local.get $length) (i32.const 0))
- (then (i32.load (i32.const 300)))
- (else (i32.const 0))
- )
- )
-
- ;; Set balance for an address
- (func $set_balance (param $address i32) (param $balance i32)
- (i32.store (i32.const 300) (local.get $balance))
- (call $storage_set
- (global.get $balance_prefix_ptr)
- (i32.add (global.get $balance_prefix_len) (i32.const 4)) ;; simplified
- (i32.const 300)
- (i32.const 4))
- )
-)
diff --git a/crates/consensus/Cargo.toml b/crates/consensus/Cargo.toml
new file mode 100644
index 0000000..43b34d5
--- /dev/null
+++ b/crates/consensus/Cargo.toml
@@ -0,0 +1,30 @@
+[package]
+name = "consensus"
+version = "0.1.0"
+edition = "2021"
+description = "Consensus Layer - Block ordering and validation"
+authors = ["quantumshiro"]
+license = "MIT"
+
+[dependencies]
+traits = { path = "../traits" }
+
+# Core dependencies
+anyhow = { workspace = true }
+tokio = { workspace = true }
+async-trait = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
+log = { workspace = true }
+
+# Cryptography
+sha2 = { workspace = true }
+hex = { workspace = true }
+
+# Storage
+sled = { workspace = true }
+
+# Utilities
+chrono = { workspace = true }
+uuid = { workspace = true }
+rand = { workspace = true }
\ No newline at end of file
diff --git a/crates/consensus/src/consensus_engine.rs b/crates/consensus/src/consensus_engine.rs
new file mode 100644
index 0000000..9690769
--- /dev/null
+++ b/crates/consensus/src/consensus_engine.rs
@@ -0,0 +1,645 @@
+//! eUTXO Consensus Layer Implementation
+//!
+//! This module provides eUTXO consensus capabilities:
+//! - eUTXO block validation and creation
+//! - Slot-based timing consensus
+//! - UTXO set consistency validation
+
+use std::{
+ collections::HashMap,
+ sync::{Arc, Mutex},
+ time::{SystemTime, UNIX_EPOCH},
+};
+
+use async_trait::async_trait;
+use serde::{Deserialize, Serialize};
+use sha2::{Digest, Sha256};
+use traits::{Hash, Result, UtxoBlock, UtxoConsensusLayer, UtxoTransaction, ValidatorInfo};
+
+/// eUTXO consensus layer configuration
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct UtxoConsensusConfig {
+ /// Slot time in milliseconds
+ pub slot_time: u64,
+ /// Proof of work difficulty for eUTXO blocks
+ pub difficulty: usize,
+ /// Maximum block size
+ pub max_block_size: usize,
+ /// Maximum transactions per block
+ pub max_transactions_per_block: usize,
+}
+
+impl Default for UtxoConsensusConfig {
+ fn default() -> Self {
+ Self {
+ slot_time: 1000, // 1 second slots
+ difficulty: 4,
+ max_block_size: 2 * 1024 * 1024, // 2MB
+ max_transactions_per_block: 1000,
+ }
+ }
+}
+
+/// eUTXO consensus layer with slot-based timing
+pub struct PolyTorusUtxoConsensusLayer {
+ /// Blockchain state
+ chain_state: Arc>,
+ /// Validator set
+ validators: Arc>>,
+ /// Configuration
+ config: UtxoConsensusConfig,
+ /// Node's validator address (if validator)
+ validator_address: Option,
+ /// Genesis slot timestamp
+ genesis_time: u64,
+}
+
+/// Internal eUTXO chain state
+#[derive(Debug, Clone)]
+struct UtxoChainState {
+ /// Canonical chain (block hashes in order)
+ canonical_chain: Vec,
+ /// Block storage
+ blocks: HashMap,
+ /// Current block height
+ height: u64,
+ /// Current slot
+ current_slot: u64,
+ /// Pending transactions
+ pending_transactions: Vec,
+}
+
+impl PolyTorusUtxoConsensusLayer {
+ /// Create new eUTXO consensus layer
+ pub fn new(config: UtxoConsensusConfig) -> Result {
+ let genesis_time = SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .unwrap()
+ .as_millis() as u64;
+
+ let genesis_block = Self::create_genesis_utxo_block(genesis_time);
+ let genesis_hash = genesis_block.hash.clone();
+
+ let mut blocks = HashMap::new();
+ blocks.insert(genesis_hash.clone(), genesis_block);
+
+ let chain_state = UtxoChainState {
+ canonical_chain: vec![genesis_hash],
+ blocks,
+ height: 0,
+ current_slot: 0,
+ pending_transactions: Vec::new(),
+ };
+
+ Ok(Self {
+ chain_state: Arc::new(Mutex::new(chain_state)),
+ validators: Arc::new(Mutex::new(HashMap::new())),
+ config,
+ validator_address: None,
+ genesis_time,
+ })
+ }
+
+ /// Create new eUTXO consensus layer as validator
+ pub fn new_as_validator(
+ config: UtxoConsensusConfig,
+ validator_address: String,
+ ) -> Result {
+ let mut layer = Self::new(config)?;
+ layer.validator_address = Some(validator_address.clone());
+
+ // Add self as validator
+ let validator_info = ValidatorInfo {
+ address: validator_address,
+ stake: 1000,
+ public_key: vec![1, 2, 3],
+ active: true,
+ };
+
+ {
+ let mut validators = layer.validators.lock().unwrap();
+ validators.insert(validator_info.address.clone(), validator_info);
+ }
+
+ Ok(layer)
+ }
+
+ /// Create genesis eUTXO block
+ fn create_genesis_utxo_block(genesis_time: u64) -> UtxoBlock {
+ UtxoBlock {
+ hash: "genesis_utxo_block_hash".to_string(),
+ parent_hash: "0x0".to_string(),
+ number: 0,
+ timestamp: genesis_time,
+ slot: 0,
+ transactions: vec![],
+ utxo_set_hash: "genesis_utxo_set_hash".to_string(),
+ transaction_root: "genesis_tx_root".to_string(),
+ validator: "genesis_validator".to_string(),
+ proof: vec![],
+ }
+ }
+
+ /// Calculate current slot from timestamp
+ pub fn timestamp_to_slot(&self, timestamp: u64) -> u64 {
+ if timestamp < self.genesis_time {
+ return 0;
+ }
+ (timestamp - self.genesis_time) / self.config.slot_time
+ }
+
+ /// Calculate timestamp for a given slot
+ pub fn slot_to_timestamp(&self, slot: u64) -> u64 {
+ self.genesis_time + (slot * self.config.slot_time)
+ }
+
+ /// Get current slot
+ pub fn get_current_slot_from_time(&self) -> u64 {
+ let current_time = SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .unwrap()
+ .as_millis() as u64;
+ self.timestamp_to_slot(current_time)
+ }
+
+ /// Calculate block hash including proof (nonce) for PoW
+ pub fn calculate_utxo_block_hash(&self, block: &UtxoBlock) -> Hash {
+ let mut hasher = Sha256::new();
+ hasher.update(&block.parent_hash);
+ hasher.update(block.number.to_be_bytes());
+ hasher.update(block.timestamp.to_be_bytes());
+ hasher.update(block.slot.to_be_bytes());
+ hasher.update(&block.utxo_set_hash);
+ hasher.update(&block.transaction_root);
+ hasher.update(&block.validator);
+ hasher.update(&block.proof);
+ hex::encode(hasher.finalize())
+ }
+
+ /// Validate proof of work for eUTXO block
+ pub fn validate_proof_of_work(&self, block: &UtxoBlock) -> bool {
+ if self.config.difficulty == 0 {
+ return true;
+ }
+ let hash = self.calculate_utxo_block_hash(block);
+ let required_zeros = "0".repeat(self.config.difficulty);
+ hash.starts_with(&required_zeros)
+ }
+
+ /// Mine proof of work for eUTXO block
+ fn mine_proof_of_work(&self, mut block: UtxoBlock) -> Result {
+ if self.config.difficulty == 0 {
+ block.proof = vec![0u8; 8];
+ block.hash = self.calculate_utxo_block_hash(&block);
+ return Ok(block);
+ }
+
+ let mut nonce = 0u64;
+ let required_zeros = "0".repeat(self.config.difficulty);
+
+ loop {
+ block.proof = nonce.to_be_bytes().to_vec();
+ let hash = self.calculate_utxo_block_hash(&block);
+
+ if hash.starts_with(&required_zeros) {
+ block.hash = hash;
+ log::info!(
+ "Successfully mined eUTXO block with nonce {} after {} attempts",
+ nonce,
+ nonce + 1
+ );
+ return Ok(block);
+ }
+
+ nonce += 1;
+
+ if nonce.is_multiple_of(100_000) {
+ log::info!(
+ "Mining attempt {}: hash = {}, required = {} zeros",
+ nonce,
+ &hash[0..10.min(hash.len())],
+ self.config.difficulty
+ );
+ }
+
+ if nonce > 10_000_000 {
+ log::error!(
+ "Mining failed after 10M attempts. Difficulty: {}, Last hash: {}",
+ self.config.difficulty,
+ &hash[0..10.min(hash.len())]
+ );
+ return Err(anyhow::anyhow!(
+ "Failed to mine eUTXO block after 10M attempts"
+ ));
+ }
+ }
+ }
+
+ /// Validate eUTXO block structure and rules
+ fn validate_utxo_block_structure(&self, block: &UtxoBlock) -> bool {
+ // Check basic structure
+ if block.hash.is_empty() || block.parent_hash.is_empty() {
+ return false;
+ }
+
+ // Check transaction count limits
+ if block.transactions.len() > self.config.max_transactions_per_block {
+ return false;
+ }
+
+ // Validate slot timing (relaxed for testing)
+ let expected_slot = self.timestamp_to_slot(block.timestamp);
+ if self.config.slot_time > 500 && block.slot != expected_slot {
+ // Only strict timing for production (slot_time > 500ms)
+ log::warn!(
+ "Invalid slot timing: block slot={}, expected={}, timestamp={}",
+ block.slot,
+ expected_slot,
+ block.timestamp
+ );
+ return false;
+ }
+ // For fast testing (slot_time <= 500ms), allow any slot progression
+ log::info!(
+ "Slot timing validation: block slot={}, expected={} (relaxed for testing)",
+ block.slot,
+ expected_slot
+ );
+
+ // Check timestamp is reasonable (not too far in future)
+ let current_time = SystemTime::now()
+ .duration_since(UNIX_EPOCH)
+ .unwrap()
+ .as_millis() as u64;
+
+ if block.timestamp > current_time + (5 * self.config.slot_time) {
+ return false;
+ }
+
+ // Validate proof of work
+ self.validate_proof_of_work(block)
+ }
+
+ /// Add transaction to pending pool
+ pub fn add_pending_utxo_transaction(&self, transaction: UtxoTransaction) -> Result<()> {
+ let mut state = self.chain_state.lock().unwrap();
+ state.pending_transactions.push(transaction);
+ Ok(())
+ }
+
+ /// Get pending transactions for block creation
+ pub fn get_pending_utxo_transactions(&self, limit: usize) -> Vec {
+ let mut state = self.chain_state.lock().unwrap();
+ let len = state.pending_transactions.len();
+
+ state
+ .pending_transactions
+ .split_off(len.saturating_sub(limit))
+ }
+
+ /// Calculate transaction root for eUTXO transactions
+ fn calculate_transaction_root(&self, transactions: &[UtxoTransaction]) -> Hash {
+ let mut hasher = Sha256::new();
+ for tx in transactions {
+ hasher.update(&tx.hash);
+ }
+ hex::encode(hasher.finalize())
+ }
+}
+
+#[async_trait]
+impl UtxoConsensusLayer for PolyTorusUtxoConsensusLayer {
+ async fn propose_utxo_block(&mut self, block: UtxoBlock) -> Result<()> {
+ // For now, directly validate and add the block
+ if self.validate_utxo_block(&block).await? {
+ self.add_utxo_block(block).await?;
+ } else {
+ return Err(anyhow::anyhow!("Invalid block proposal"));
+ }
+ Ok(())
+ }
+
+ async fn validate_utxo_block(&self, block: &UtxoBlock) -> Result {
+ log::info!("Validating UTXO block: {}", block.hash);
+
+ // Validate block structure
+ log::info!("Checking block structure...");
+ if !self.validate_utxo_block_structure(block) {
+ log::error!("Block structure validation failed");
+ return Ok(false);
+ }
+ log::info!("Block structure validation passed");
+
+ // Check if parent exists
+ let state = self.chain_state.lock().unwrap();
+ log::info!("Checking parent block exists: {}", block.parent_hash);
+ if !state.blocks.contains_key(&block.parent_hash) {
+ log::error!("Parent block not found: {}", block.parent_hash);
+ return Ok(false);
+ }
+ log::info!("Parent block found");
+
+ // Validate block number sequence
+ let parent_block = state.blocks.get(&block.parent_hash).unwrap();
+ log::info!(
+ "Checking block number sequence: block={}, parent={}",
+ block.number,
+ parent_block.number
+ );
+ if block.number != parent_block.number + 1 {
+ log::error!(
+ "Block number sequence invalid: expected {}, got {}",
+ parent_block.number + 1,
+ block.number
+ );
+ return Ok(false);
+ }
+ log::info!("Block number sequence valid");
+
+ // Validate slot progression
+ log::info!(
+ "Checking slot progression: block={}, parent={}",
+ block.slot,
+ parent_block.slot
+ );
+ if block.slot <= parent_block.slot {
+ log::error!(
+ "Slot progression invalid: block slot {} <= parent slot {}",
+ block.slot,
+ parent_block.slot
+ );
+ return Ok(false);
+ }
+ log::info!("Slot progression valid");
+
+ log::info!("Block validation passed for: {}", block.hash);
+ Ok(true)
+ }
+
+ async fn get_canonical_chain(&self) -> Result> {
+ let state = self.chain_state.lock().unwrap();
+ Ok(state.canonical_chain.clone())
+ }
+
+ async fn get_block_height(&self) -> Result {
+ let state = self.chain_state.lock().unwrap();
+ Ok(state.height)
+ }
+
+ async fn get_current_slot(&self) -> Result {
+ let state = self.chain_state.lock().unwrap();
+ Ok(state.current_slot)
+ }
+
+ async fn get_utxo_block_by_hash(&self, hash: &Hash) -> Result