Skip to content
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

Merged
merged 7 commits into from
Aug 9, 2023
Merged

Forward OP transactions to sequencer #14

merged 7 commits into from
Aug 9, 2023

Conversation

nomaxg
Copy link

@nomaxg nomaxg commented Aug 9, 2023

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

@nomaxg nomaxg requested review from jbearer and sveitser August 9, 2023 14:46
Signed-off-by: nomaxg <[email protected]>
@@ -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)
Copy link
Member

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

Copy link
Author

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]>
@nomaxg nomaxg merged commit 57efa33 into develop Aug 9, 2023
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.

Forward OP txns to sequencer
2 participants