Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/integration-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,26 @@ jobs:

# Note: Using specific features instead of --all-features to avoid sp1-sdk
# build issues (linker OOM on Linux, C++20 on Windows).
# adaptive-ml is required for these tests.
- name: Build tests
run: cargo build --tests --features "default,mocks,h2_greedy,test-utils"
run: cargo build --tests --features "default,adaptive-ml,mocks,h2_greedy,test-utils"

- name: Clean incremental artifacts
run: |
find target -name "incremental" -type d -exec rm -rf {} + 2>/dev/null || true
df -h

- name: Adaptive Components
run: cargo nextest run --test adaptive_components_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test adaptive_components_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Adaptive Integration
run: cargo nextest run --test adaptive_integration_tests --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test adaptive_integration_tests --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Multi-Armed Bandit
run: cargo nextest run --test multi_armed_bandit_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test multi_armed_bandit_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Q-Learning Cache
run: cargo nextest run --test q_learning_cache_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test q_learning_cache_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Hyperbolic Routing
run: cargo nextest run --test hyperbolic_routing_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test hyperbolic_routing_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast
11 changes: 6 additions & 5 deletions .github/workflows/integration-identity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,23 @@ jobs:
# Note: Using specific features instead of --all-features to avoid sp1-sdk
# build issues (linker OOM on Linux, C++20 on Windows).
# Using -j2 to reduce parallel linking and avoid linker memory exhaustion.
# adaptive-ml is required for EigenTrust tests.
- name: Build tests
run: cargo build --tests --features "default,mocks,h2_greedy,test-utils" -j2
run: cargo build --tests --features "default,adaptive-ml,mocks,h2_greedy,test-utils" -j2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI enables wrong feature

integration-security runs security_comprehensive_test, validation_security_test, and validation_test with adaptive-ml enabled (.github/workflows/integration-identity.yml:132-148), but these tests aren’t feature-gated. This makes adaptive-ml look required for identity/security CI and can mask regressions when running with the default feature set. If adaptive-ml is only needed for eigentrust_integration_test, split the workflow so only that test (and its build) uses adaptive-ml.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/integration-identity.yml
Line: 132:134

Comment:
**CI enables wrong feature**

`integration-security` runs `security_comprehensive_test`, `validation_security_test`, and `validation_test` with `adaptive-ml` enabled (`.github/workflows/integration-identity.yml:132-148`), but these tests aren’t feature-gated. This makes `adaptive-ml` look required for identity/security CI and can mask regressions when running with the default feature set. If `adaptive-ml` is only needed for `eigentrust_integration_test`, split the workflow so only that test (and its build) uses `adaptive-ml`.

How can I resolve this? If you propose a fix, please make it concise.


- name: Clean incremental artifacts
run: |
find target -name "incremental" -type d -exec rm -rf {} + 2>/dev/null || true
df -h

- name: Security Comprehensive
run: cargo nextest run --test security_comprehensive_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test security_comprehensive_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Validation Security
run: cargo nextest run --test validation_security_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test validation_security_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Validation Tests
run: cargo nextest run --test validation_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test validation_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: EigenTrust
run: cargo nextest run --test eigentrust_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test eigentrust_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast
11 changes: 6 additions & 5 deletions .github/workflows/integration-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,23 @@ jobs:

# Note: Using specific features instead of --all-features to avoid sp1-sdk
# build issues (linker OOM on Linux, C++20 on Windows).
# adaptive-ml is required for gossipsub and coordinator tests.
- name: Build tests
run: cargo build --tests --features "default,mocks,h2_greedy,test-utils"
run: cargo build --tests --features "default,adaptive-ml,mocks,h2_greedy,test-utils"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI over-enables adaptive-ml

The integration-protocols job builds/runs all protocol tests with adaptive-ml (.github/workflows/integration-network.yml:135-154), but four_word_integration_test and health_integration_test aren’t feature-gated. This forces an optional feature on tests that don’t require it and can hide failures in the default feature set. Consider running only gossipsub_integration_test/coordinator_integration_test under adaptive-ml, and keep the rest on the baseline features.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/integration-network.yml
Line: 135:138

Comment:
**CI over-enables adaptive-ml**

The `integration-protocols` job builds/runs *all* protocol tests with `adaptive-ml` (`.github/workflows/integration-network.yml:135-154`), but `four_word_integration_test` and `health_integration_test` aren’t feature-gated. This forces an optional feature on tests that don’t require it and can hide failures in the default feature set. Consider running only `gossipsub_integration_test`/`coordinator_integration_test` under `adaptive-ml`, and keep the rest on the baseline features.

How can I resolve this? If you propose a fix, please make it concise.

- name: Clean incremental artifacts
run: |
find target -name "incremental" -type d -exec rm -rf {} + 2>/dev/null || true
df -h

- name: Gossipsub
run: cargo nextest run --test gossipsub_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test gossipsub_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Four Word Integration
run: cargo nextest run --test four_word_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test four_word_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Coordinator Integration
run: cargo nextest run --test coordinator_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test coordinator_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast

- name: Health Integration
run: cargo nextest run --test health_integration_test --features "default,mocks,h2_greedy,test-utils" --no-fail-fast
run: cargo nextest run --test health_integration_test --features "default,adaptive-ml,mocks,h2_greedy,test-utils" --no-fail-fast
54 changes: 54 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,51 @@ h2_greedy = []
# Test utilities including mock DHT for integration tests
test-utils = []

# ============================================================================
# Optional Features (production-ready with fallbacks)
# ============================================================================
#
# These features enhance functionality but are NOT required for core operation.
# All code paths have fallback implementations when these features are disabled.
# Enable them for enhanced trust-weighted routing and ML-based optimization.

# Machine learning components: Thompson Sampling, Q-Learning, EigenTrust, LSTM
# Enables trust-weighted peer selection, EigenTrust reputation tracking, and ML-based optimization.
# When disabled: DHT uses standard Kademlia routing without trust weighting.
adaptive-ml = []

# Trust-weighted peer selection using EigenTrust in routing decisions
trust-routing = []

# Region-aware routing and geographic peer selection
geographic = []

# Sybil attack detection for DHT protection
sybil-detection = []

# Collusion detection for witness validation
collusion-detection = []

# S/Kademlia security extensions (requires trust-routing)
skademlia = ["trust-routing"]

# Storage orchestration and placement engine (requires adaptive-ml)
placement = ["adaptive-ml"]

# Enable all experimental features
experimental = [
"adaptive-ml",
"trust-routing",
"geographic",
"sybil-detection",
"collusion-detection",
"skademlia",
"placement",
]

# Backwards compatibility alias
full = ["experimental"]

[dependencies]
# Core async and serialization
tokio = { version = "1.49", features = ["full"] }
Expand Down Expand Up @@ -158,6 +203,15 @@ path = "tests/eigentrust_integration_test.rs"
name = "gossipsub_integration_test"
path = "tests/gossipsub_integration_test.rs"

# Examples requiring adaptive-ml feature
[[example]]
name = "security_example"
required-features = ["adaptive-ml"]

[[example]]
name = "adaptive_network_monitor"
required-features = ["adaptive-ml"]

# Platform-specific dependencies for secure memory management
[target.'cfg(unix)'.dependencies]
libc = "0.2"
Expand Down
Loading