-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forward OP transactions to sequencer #14
Conversation
Signed-off-by: nomaxg <[email protected]>
Signed-off-by: nomaxg <[email protected]>
Signed-off-by: nomaxg <[email protected]>
Signed-off-by: nomaxg <[email protected]>
Signed-off-by: nomaxg <[email protected]>
op-geth-proxy/geth-proxy.go
Outdated
@@ -36,11 +37,20 @@ type rpcMessage struct { | |||
} | |||
|
|||
func ForwardToSequencer(message rpcMessage) { | |||
var hexString string | |||
if err := json.Unmarshal(message.Params[0], &hexString); err != nil { | |||
panic(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not panic based on user input. Better to log the error and do nothing, the client can then retry and the server will still be alive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there is some panic recovery built in to this http request handler (sending invalid bytes doesn't kill the server). Still, I think the stack trace is unnecessary here, so I'll switch to logging
Signed-off-by: nomaxg <[email protected]>
Simple proxy service that parses payload data from an
eth_sendRawTransacton
RPC request and forwards it to Espresso sequencer.Note that this will still forward txns to the op-geth mempool (I wanted to keep the RPC API intact completely), but we can prevent mempool bloat by adjusting TRANSACTION POOL settings here: https://geth.ethereum.org/docs/fundamentals/command-line-options.
Closes #1