Skip to content

Relayer: record of sent transactions (R15), IPv6 by /64 (R16), URLs cut in logs (R17) - #267

Merged
ChainIntegrate merged 1 commit into
mainfrom
claude/gallant-mccarthy-f82ofp
Nov 24, 2026
Merged

ChainIntegrate merged 1 commit into
mainfrom
claude/gallant-mccarthy-f82ofp

Conversation

@ChainIntegrate

Copy link
Copy Markdown
Owner

What

Three findings of the 2026-11-24 review, all in tools/relayer and tools/nginx. Nothing changes in the pages.

R15: record of sent transactions (Medium)

Every relay transaction is now written, signed, to a record before it is broadcast. The record is relay-sends.json in /var/lib/crosschain-relayer, mode 600.

  • Unknown outcome. If the answer to the broadcast is lost and the transaction is not found, its outcome is marked unknown instead of being forgotten:
    • the page gets 502 with notSent: false, as before;
    • the UP stays blocked;
    • the same operation sent again gets the same signed transaction broadcast again, never a second one at the relayer's cost.
  • Settled (removed from the record) when one of these happens:
    • the transaction is mined;
    • the operation's nonce is used;
    • another relayer transaction used its nonce while it was never seen. It can then never be mined, so the UP is unblocked and the operation can be sent again.
  • Meanwhile, a transaction not yet seen on the network is broadcast again.
  • After a restart, the record is read again: its transactions block their UPs and are settled as usual (dropped after 30 minutes). An unreadable record is moved aside, never overwritten.
  • The relayer unit gets StateDirectory=crosschain-relayer, the same directory as the monitor.

R16: one IPv6 /64 could deny the relayer (Low)

  • The per-IP limit keys an IPv6 address by its /64, with the same ipKey() as the signing service.
  • nginx's zone does too: tools/nginx/relay-limit.conf now has a map from $remote_addr.
  • The global limit is charged after the shape checks and after the lookup of an operation already sent.
  • The per-UP lock is taken only after the handleOps simulation, so a forged operation never holds it.

R17: raw errors in the logs (Low)

  • Log lines keep only the scheme and host of any URL. An RPC's path, query or user part (where a key may be) becomes ….
  • The monitor's findings and emails are cleaned the same way.

Tests

  • npm test in tools/relayer: 32/32 (13 new):
    • R15: the unknown outcome kept and the UP blocked; another operation of that UP waits; the same operation gets the same signed transaction broadcast again; the file is mode 600; the record is restored after a restart; a transaction that never reached the network is settled and its UP unblocked; one not seen is broadcast again; an operation whose nonce is used is settled; an unreadable record is moved aside.
    • R16: three addresses of one /64 share the per-IP limit; refused shapes do not use the global cap; a forged operation never takes the lock.
    • R17: an Alchemy key, user and password, and a query key never reach the log.
  • nginx 1.24: nginx -t passes with the new file.
    • With the map driven by a header, 400 random IPv6 addresses (RFC 5952 compressed, as nginx prints them) give the same key as the relayer's ipKey(), and that key is their first 64 bits.
    • Edge cases checked: ::1, ::, IPv4, ::ffff:1.2.3.4, 2001:db8::1, fe80::1:2:3:4:5.

Deploy (after merge)

  1. Update the relayer as usual.
  2. Install the unit again (StateDirectory).
  3. Add tools/nginx to the server clone's sparse checkout, copy relay-limit.conf into /etc/nginx/conf.d/, run nginx -t and reload nginx.

The README has the commands.


Generated by Claude Code

…its (R16), URLs cut in logs (R17)

Audit 2026-11-24:
- R15: every relay transaction is written, signed, to relay-sends.json in the state directory before it
  is broadcast. An answer lost on sending with the transaction not found is "unknown", not forgotten: the
  UP stays blocked and the same operation sent again gets the same signed transaction broadcast again,
  never a second one. A transaction is settled when mined, when its operation's nonce is used, or when
  another relayer transaction used its nonce while it was never seen (the UP is then unblocked); one not
  seen is broadcast again meanwhile. The record is read again after a restart; an unreadable one is moved
  aside. The relayer unit gets StateDirectory=crosschain-relayer (shared with the monitor).
- R16: the per-IP limit keys an IPv6 address by its /64 (ipKey, as the signing service), nginx's zone
  too (tools/nginx/relay-limit.conf: a map from $remote_addr, checked against ipKey on 400 random
  addresses with nginx 1.24); the global limit is charged after the shape checks and the lookup of an
  operation already sent; the per-UP lock is taken after the handleOps simulation.
- R17: log lines keep only the scheme and host of URLs; the monitor's findings and emails too.

README: the record, the order of the limits, the nginx step (sparse checkout of tools/nginx), tests.
Tests: test/limits.js 32/32 (13 new).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyvXroLy77GnnctsMuDW8x
@ChainIntegrate
ChainIntegrate merged commit 992914c into main Nov 24, 2026
2 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

Development

Successfully merging this pull request may close these issues.

2 participants