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

Add configurable delay before uploading to AWS #10

Merged
merged 2 commits into from
Dec 15, 2023
Merged

Conversation

fleupold
Copy link
Contributor

We used to upload incoming bundles immediately and only then respond to the incoming request. However, in order to make this server compatible with potentially other subscribers that don't have inherent delays such as Dune, we want to configure explicit delays before the data is forwarded (to avoid information leakage). This PR achieves this.

Changes

  • Allow for a configurable upload delay
  • Return from the request immediately after parsing the bundle but before uploading it
  • Upload the bundle in asyn post processing after the delay

Test Plan

Locally send a bundle like

curl -s --data '{"jsonrpc": "2.0","id": "42069","method": "eth_sendBundle","params": [{"txs": ["0x02f8b10181db8
459682f00850c9f5014d282be9894a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4880b844a9059cbb0000000000000000000000005408b27504dfcf7b0c3edf116e847aa19ce7f03c000000000000
0000000000000000000000000000000000000000001e449a9400c080a049c0f50df4219481e031ac35816946daef9d08004f3324f7f46f6938488025aba02a4bda81f792bc5b7033804e39b7e55e619
e56de1afcddd2ae4943ae5e7737c4"],"blockNumber": "0xf79d4e","refundPercent": 99,"refundRecipient": "0xab5801a7d398351b8be11c439e05c5b3259aec9b"}]}' -H "Content-T
ype: application/json" -H "referer: foobar" -X POST localhost:8080

Observe request returning immediately, but upload only happening after the delay.

src/config.ts Outdated Show resolved Hide resolved
@fleupold fleupold merged commit 2e9a82d into main Dec 15, 2023
3 checks passed
@fleupold fleupold deleted the upload_delay branch December 15, 2023 09:45
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.

3 participants