Skip to content

Conversation

@iduartgomez
Copy link
Collaborator

@iduartgomez iduartgomez commented Dec 5, 2025

Implement high-priority performance improvements from issue #2226:

  1. Increase inbound stream channel buffer from 1 to 64

    • Addresses 27x throughput difference identified in benchmarks
    • Reduces channel contention for incoming packet fragments
  2. Replace random nonce generation with counter-based approach

    • Uses atomic counter + random prefix for AES-GCM nonces
    • ~5.5x faster than random generation while maintaining uniqueness
    • Random prefix ensures uniqueness across process restarts
    • Counter ensures uniqueness within process lifetime

These changes target the low-effort, high-impact optimizations from
the transport layer performance analysis (PR #2224).

claude and others added 13 commits December 4, 2025 23:34
- Analyzed test_small_network_get_failure failure modes - Identified gateway crash root cause (fixed in a283e23) - Documented PUT operation timeout issues - Provided recommendations for re-enabling the test - Suggested modernization using #[freenet_test] macro Related: freenet#2023, freenet#2043, freenet#2036, freenet#2011
Re-enabled the previously ignored test with key improvements: - Removed #[ignore] attribute - recent fixes should resolve issues - Increased PUT timeout: 30s → 90s (accounts for connection delays) - Increased overall test timeout: 120s → 180s (3 minutes) - Added detailed error messages for better debugging - Added documentation of recent fixes that resolved the issues Recent fixes that should prevent failures: - a283e23: Fixed gateway crashes during timeout notifications - 615f02d: Fixed PUT response routing through forwarding peers - 5734a33: Fixed local caching before forwarding PUTs Related: freenet#2023
The freenet-ping contract failed to compile because freenet-ping-types uses freenet_stdlib::time::now() when 'std' feature is disabled, but the 'contract' feature wasn't propagated to freenet-stdlib. Changes: - Added 'contract' feature to freenet-ping-types Cargo.toml - Enabled 'contract' feature in ping contract's types dependency - This allows WASM contract compilation to access time::now() function Fixes compilation error when test_small_network_get_failure loads and compiles the ping contract at runtime.
Co-authored-by: nacho.d.g <iduartgomez@users.noreply.github.com>
Cleaned up redundant comments throughout the test file that were explaining self-evident code. Kept the TODO comment as it's actionable. Co-authored-by: nacho.d.g <iduartgomez@users.noreply.github.com>
…enet#2023 This change annotates test_small_network_get_failure with test_log to capture test execution logs in CI. The test passes locally but fails in CI, and these logs will help us debug the issue. Changes: - Add test-log 0.2 to dev-dependencies in freenet-ping-app - Replace manual logger setup with #[test_log::test] attribute - Remove unused LevelFilter import - Logs will now be captured and displayed on test failure This will help us understand what's happening during CI test execution and identify the root cause of issue freenet#2023.
- Update Cargo.lock to include test-log dependency changes - Fix formatting (remove extra blank line in test function) - Resolves CI build failure with --locked flag This addresses the CI error: "the lock file needs to be updated but --locked was passed"
Removes unnecessary implementation notes that were no longer relevant after previous fixes to connection management and timeout handling. Related to issue freenet#2023 investigation.
Update lock file after rebasing PR freenet#2055 onto latest main.
…LuLNaER7JBmDiLQXuDAtpv fix: critical operation state management issues (freenet#1977)
Implement high-priority performance improvements from issue freenet#2226: 1. Increase inbound stream channel buffer from 1 to 64 - Addresses 27x throughput difference identified in benchmarks - Reduces channel contention for incoming packet fragments 2. Replace random nonce generation with counter-based approach - Uses atomic counter + random prefix for AES-GCM nonces - ~5.5x faster than random generation while maintaining uniqueness - Random prefix ensures uniqueness across process restarts - Counter ensures uniqueness within process lifetime These changes target the low-effort, high-impact optimizations from the transport layer performance analysis (PR freenet#2224).
@iduartgomez iduartgomez changed the title Claude/issue 2226 fixes 018m6ks1c k6pg ann1z ce7 bn8 perf: transport layer optimizations for throughput Dec 5, 2025
@iduartgomez iduartgomez marked this pull request as ready for review December 5, 2025 20:49
@iduartgomez iduartgomez merged commit 2918ebf into freenet:main Dec 5, 2025
7 of 8 checks passed
@iduartgomez iduartgomez deleted the claude/issue-2226-fixes-018m6ks1cK6pgANN1zCe7Bn8 branch December 5, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants