mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-22 20:50:22 +00:00
Both the static and auto POST handlers duplicated the same block: attach an RLN proof, run wakuRelay.validateMessage, and on RlnValidatorErrorMsg substring force-refresh the merkle path and revalidate. Lift the block into attachRlnProofValidateWithRetry alongside a small RlnPublishError variant so the handlers can keep dispatching 500 for proof-gen failures and 400 for validator rejections. Each handler is now ~15 lines instead of ~35 and the retry contract lives in one place. Pure refactor; behavior unchanged. Verified against tests/wakunode_rest/test_rest_relay.nim (13/13) including the two stale- RLN-proof retry tests added earlier on this branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>