l2geth: forward tx to sequencer#2011
Conversation
|
Codecov Report
@@ Coverage Diff @@
## develop #2011 +/- ##
========================================
Coverage 74.58% 74.58%
========================================
Files 79 79
Lines 2554 2554
Branches 401 401
========================================
Hits 1905 1905
Misses 649 649
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
c0e7da0 to
6f2e29d
Compare
|
This looks good to me, some thoughts:
const signed = await env.l2Wallet.signTransaction(tx)
const result = await env.replicaProvider.sendTransaction(signed)
let receipt: TransactionReceipt
while (!receipt) {
receipt = await env.replicaProvider.getTransactionReceipt(result.hash)
await sleep(200)
}
|
tynes
left a comment
There was a problem hiding this comment.
Good work! Will approve once the integration test is added :)
|
Thanks, added the integration test. |
Add missing changeset for #2011 A replica can be configured with the flag `--sequencer.clienthttp` or the env var `SEQUENCER_CLIENT_HTTP` which points to the sequencer and when users hit the RPC endpoint `eth_sendRawTransaction` it will forward the value to the sequencer. If running a mainnet node, this value should be set to `https://mainnet.optimism.io` or an infrastructure provider such as Quiknode, Infura or Alchemy.
Description
This PR makes it easier for replica nodes to handle a transaction submitted via RPC and to transparently forward it to the sequencer, based on the configured endpoint.
This allows the consumer of the replica node's RPC to directly submit transactions instead of having to rely on third-party applications.
Metadata