Skip to content

feat: distributed tracing, audit log partitioning, mock Horizon, fee calculator (#709 #711 #712 #720)#795

Merged
0xVida merged 1 commit into
Stellar-Fluid:mainfrom
devJaja:feat/issues-709-711-712-720
Jun 1, 2026
Merged

feat: distributed tracing, audit log partitioning, mock Horizon, fee calculator (#709 #711 #712 #720)#795
0xVida merged 1 commit into
Stellar-Fluid:mainfrom
devJaja:feat/issues-709-711-712-720

Conversation

@devJaja
Copy link
Copy Markdown
Contributor

@devJaja devJaja commented Jun 1, 2026

Summary

Closes #709
Closes #711
Closes #712
Closes #720

#709 — Distributed Tracing Integration (fluid-server)

  • src/tracing.rs: W3C traceparent SpanContext (TraceId, SpanId), extract/inject helpers for HTTP boundaries
  • fee_bump handler extracts incoming trace context and echoes traceparent on the response
  • Unit tests: round-trip, child spans, malformed input rejection

#711 — Partition Audit Logs Table (server)

  • Migration 20260601000000_partition_audit_logs_by_month: RANGE-partitioned AuditLog with monthly child partitions (24 months back → 3 ahead) + default partition
  • auditLogPartitionManager.ts: ensurePartitions, listPartitions, pruneOldPartitions
  • Full unit tests in auditLogPartitionManager.test.ts

#712 — Extract Congestion Fee Calculator Module (fluid-server)

  • src/fee_calculator.rs: pure calculate_fee() + FeeCalculator struct decoupled from the API server
  • CongestionLevel enum (Low/Medium/High), full unit tests

#720 — Local Mock Horizon API Server (fluid-server)

  • src/mock_horizon.rs: in-process Axum server simulating Horizon
  • Scenarios: success, 429, 500, 502, 503, 504, connection reset, tx_bad_seq, tx_insufficient_fee, tx_failed
  • Latency injection, per-path overrides, fail_count auto-reset, request capture, integration tests

Pre-existing compile fixes

  • xdr.rs borrow checker, archive.rs ByteStream, memory_leak_profiling.rs import, load_testing_integration.rs String type, main.rs duplicate serde import

…cal-mock-horizon-api-server, extract-congestion-fee-calculator-module

- Stellar-Fluid#709: Add W3C traceparent distributed tracing in fluid-server (tracing.rs)
  - SpanContext with trace/span ID generation and propagation
  - Extract/inject helpers for HTTP headers
  - traceparent header on fee-bump responses

- Stellar-Fluid#711: Partition AuditLog table by month in server
  - SQL migration (20260601000000_partition_audit_logs_by_month)
  - AuditLogPartitionManager service with ensurePartitions/listPartitions/pruneOldPartitions
  - Full unit test coverage

- Stellar-Fluid#712: Extract congestion fee calculator module in fluid-server (fee_calculator.rs)
  - Pure calculate_fee() function decoupled from API server
  - FeeCalculator struct with configurable base_fee and multiplier
  - CongestionLevel classification (low/medium/high)

- Stellar-Fluid#720: Local mock Horizon API server in fluid-server (mock_horizon.rs)
  - Simulates success, 429, 500, 502, 503, 504, connection reset
  - Horizon tx error extras (tx_bad_seq, tx_insufficient_fee, tx_failed)
  - Latency injection, per-path scenario overrides, request capture
  - fail_count auto-reset for transient failure simulation

Also fix pre-existing compile errors: xdr.rs borrow, archive.rs ByteStream,
memory_leak_profiling.rs import, load_testing_integration.rs String type,
main.rs duplicate serde import.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@devJaja Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@0xVida 0xVida merged commit 00b7693 into Stellar-Fluid:main Jun 1, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants