feat(rpc): require auth for OL transaction submission#1844
Conversation
|
Commit: bf44454 SP1 Execution Results
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1844 +/- ##
==========================================
- Coverage 79.84% 79.78% -0.07%
==========================================
Files 674 674
Lines 74711 74927 +216
==========================================
+ Hits 59654 59781 +127
- Misses 15057 15146 +89
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 20 files with indirect coverage changes 🚀 New features to boost your workflow:
|
7e1188b to
3d54e6d
Compare
There was a problem hiding this comment.
I think you could avoid having to roll this on your own, unless there's some annoying reason about how it's inside jsonrpsee: https://matze.github.io/axum-notes/notes/auth/with_tower_http/index.html
There was a problem hiding this comment.
This looks good generally. One config concern I see: a separate host/port per RPC category(admin, submit, general) feels redundant because there's more to configure, document and easier to misconfigure.
A port is worth it when we need network-level isolation. This is true for admin/debug related endpoints but not for read/submit neither of which are privileged. Isolating read/submit from each other doesn't buy much. I'd collapse these to two ports: admin/debug and non-admin(submit included) and make non-admin auth method-specific instead of port-specific.
The tradeoff here is that with method level auth we need to do it for every method we want to have auth whereas for port level, we just need to do it once.
Reminder to update the deployment docs after the PR lands.
|
@purusang or @alexhui01 take a look at this? Testnet blocker |
Description
Moves
strata_submitTransactionoff the unauthenticated public Strata RPC listener and onto a dedicated authenticated submit RPC listener. The public OL RPC surface is now read-only, while the submit listener preserves the existing JSON-RPC method name and uses bearer-token auth.This also adds submit RPC configuration, validation, alpen-client submit endpoint handling, and functional harness/docker updates so internal transaction submission uses the authenticated submit endpoint.
Type of Change
Notes to Reviewers
The public RPC listener no longer registers
strata_submitTransaction. Sequencer deployments now require a non-empty submit RPC bearer token, and public/admin/submit RPC ports must all be distinct by port number.AI was used to assist in this PR.
Is this PR addressing any specification, design doc or external reference document?
If yes, please add relevant links:
Checklist
Related Issues
STR-3548