The code looks pretty decent.
CF Workers and D1 are still not optimal for hosting relays, in my opinion. SQLite in general performs poorly compared to local KV-store based solutions, and D1 has its own issues.
And JS is kind of a terrible runtime for an application like a relay, which does a lot of memory allocations.
Also, isn’t the single DO a bottleneck?