Commit Graph

226 Commits

Author SHA1 Message Date
Matthew Slipper
fa7425683a proxyd: Custom rate limiter implementation
Our current proxyd deployment does not share rate limit state across multiple servers within a backend group. This means that rate limits on the public endpoint are artifically high.

This PR adds a Redis-based rate limiter to fix this problem. While our current rate limiting library (github.com/sethvargo/go-limiter) _does_ support Redis, the client library it uses is not type safe, is less performant, and would require us to update the other places we use Redis. To avoid these issues, I created a simple rate limiting interface with both Redis and memory backend.

Note that this PR only adds the new implementations - it does not integrate them with the rest of the codebase. I'll do that in a separate PR to make review easier.
2022-10-11 17:20:23 -05:00
Chris Wessels
15a59bad99 fix(proxyd): Fix compliance with JSON-RPC 2.0 spec by adding optional RPCError.Data (#3683)
* fix: add optional data field to RPCError struct

* fix: formatting lint

* feat(proxyd): add changeset
2022-10-11 08:51:02 -06:00
Matthew Slipper
8476e1b194 Merge pull request #3604 from ethereum-optimism/develop
Develop -> Master
2022-09-28 19:37:57 -06:00
Matthew Slipper
7cadaca188 Merge pull request #3603 from ethereum-optimism/changeset-release/master
Version Packages
2022-09-28 19:37:23 -06:00
github-actions[bot]
09552fddea Version Packages 2022-09-29 01:37:00 +00:00
Matthew Slipper
3638b5575b Merge pull request #3602 from ethereum-optimism/develop
Develop -> Master
2022-09-28 19:34:57 -06:00
Matthew Slipper
537717610e proxyd: Add batch size metric and configurable max (#3545)
* proxyd: Add batch size metric and configurable max

The max batch size will be overwritten if it is over `MaxBatchRPCCallsHardLimit`.

Builds on https://github.com/ethereum-optimism/optimism/pull/3544.

* changeset

* fix lint

* fix test
2022-09-23 15:06:02 -06:00
Matthew Slipper
485258d3c2 proxyd: Add customizable whitelist error message (#3544)
* proxyd: Add customizable whitelist error message

Alchemy is asking for this so that we can include their affiliate link.

* add missing test case

* fix error message

* goimports
2022-09-23 14:21:12 -06:00
Matthew Slipper
795d1025bb Merge pull request #3540 from ethereum-optimism/develop
Version Packages
2022-09-23 15:49:28 +02:00
Matthew Slipper
7f2456f217 Merge pull request #3539 from ethereum-optimism/changeset-release/master
Version Packages
2022-09-23 15:47:59 +02:00
Matthew Slipper
11ffe341b2 Merge pull request #3510 from ethereum-optimism/develop
ci: release step 3
2022-09-20 17:27:49 +02:00
Matthew Slipper
9fb21b52b8 Merge pull request #3509 from ethereum-optimism/changeset-release/master
Version Packages
2022-09-20 17:24:31 +02:00
github-actions[bot]
70557fdafd Version Packages 2022-09-20 15:21:51 +00:00
Matthew Slipper
787ae9b9a5 Merge pull request #3508 from ethereum-optimism/develop
ci: trigger releases
2022-09-20 17:19:04 +02:00
Matthew Slipper
d228a55bd7 proxyd: Fix error message in tests (#3503)
* proxyd: Fix error message in tests

The custom error message wasn't being carried over in batch responses.

* review fixes

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-09-19 16:44:08 +00:00
Matthew Slipper
3fb4debfe1 proxyd: Add logging for origin and remote IP (#3482)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
2022-09-16 17:28:56 +00:00
Matthew Slipper
487f61e2f2 Merge pull request #3481 from ethereum-optimism/develop
Develop -> Master
2022-09-15 10:55:56 +02:00
Matthew Slipper
859c950fd0 Merge pull request #3480 from ethereum-optimism/changeset-release/master
Version Packages
2022-09-15 10:55:22 +02:00
github-actions[bot]
320d6ebeea Version Packages 2022-09-15 08:51:21 +00:00
Matthew Slipper
c1ab3f356d Merge pull request #3479 from ethereum-optimism/develop
Develop -> Master
2022-09-15 10:49:26 +02:00
Matthew Slipper
ccf0934459 proxyd: Support per-RPC rate limits (#3471)
* proxyd: Support per-RPC rate limits

* add log

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-09-15 08:46:11 +00:00
Mark Tyneway
d9b654b6c1 Merge pull request #3465 from ethereum-optimism/develop
Trigger Releases
2022-09-14 08:53:19 -07:00
Mark Tyneway
f6f4a32997 Merge pull request #3464 from ethereum-optimism/changeset-release/master
Version Packages
2022-09-14 08:52:37 -07:00
Mark Tyneway
3122ee718a Merge pull request #3427 from ethereum-optimism/develop
Trigger Releases
2022-09-12 05:13:11 -07:00
Mark Tyneway
eb267a1a74 Merge pull request #3426 from ethereum-optimism/changeset-release/master
Version Packages
2022-09-12 05:12:25 -07:00
Matthew Slipper
7e54f414f7 Merge pull request #3389 from ethereum-optimism/develop
Develop -> Master
2022-09-10 01:59:41 -06:00
Joshua Gutow
8e92c91e6d Last unwrapped errors
These where missed in local lints but when a full lint was run these
popped up.
2022-09-09 04:56:59 -07:00
protolambda
9a4626856a style(batch-submitter,bss-core,proxyd): Fix lint Go (#3328)
* style(batch-submitter): fix lint

* style(bss-core): fix lint

* chore(proxyd): use io and os instead of deprecated ioutil methods, fixes lint
2022-08-26 19:39:30 -06:00
smartcontracts
c76107cdb0 Merge pull request #3316 from ethereum-optimism/master
merge Master into Develop
2022-08-25 19:50:04 -04:00
Matthew Slipper
d54217657d Merge pull request #3192 from ethereum-optimism/develop
Develop -> Master
2022-08-08 12:42:12 -06:00
Matthew Slipper
0791dd2328 Merge pull request #3191 from ethereum-optimism/changeset-release/master
Version Packages
2022-08-08 12:40:29 -06:00
Matthew Slipper
2be30523c9 Merge pull request #3176 from ethereum-optimism/develop
Develop -> Master
2022-08-04 12:49:14 -06:00
Matthew Slipper
f84edae8ae Merge pull request #3175 from ethereum-optimism/changeset-release/master
Version Packages
2022-08-04 12:48:37 -06:00
github-actions[bot]
fc9487bf83 Version Packages 2022-08-04 18:48:19 +00:00
Matthew Slipper
db220c7ff1 Merge pull request #3174 from ethereum-optimism/develop
Develop -> Master
2022-08-04 12:46:46 -06:00
Matthew Slipper
7a2b4bdf45 proxyd: Add rate limit logging (#3173) 2022-08-04 18:44:46 +00:00
Matthew Slipper
d5ddd4f75d Merge pull request #3172 from ethereum-optimism/develop
Develop -> Master
2022-08-04 11:53:56 -06:00
Matthew Slipper
e8c202d30a Merge pull request #3171 from ethereum-optimism/changeset-release/master
Version Packages
2022-08-04 11:53:20 -06:00
github-actions[bot]
7c599f758f Version Packages 2022-08-04 17:40:22 +00:00
Matthew Slipper
f3d3492a81 proxyd: Add frontend rate limiting (#3166)
* proxyd: Add frontend rate limiting

To give us more flexibiltiy with rate limiting, proxyd now supports rate limiting of client (frontend) requests in addition to upstream (backend) requests. This PR also gives us the ability to exempt certain user agents/origins from rate limiting.

* lint
2022-08-04 11:34:43 -06:00
Matthew Slipper
4ea6a054c3 proxyd: Unwrap single RPC batches (#3165)
* proxyd: Unwrap single RPC batches

* Update backend.go
2022-08-04 01:36:07 +00:00
Matthew Slipper
cd0afa3176 proxyd: Parameterize full RPC request logging (#3110)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-27 17:12:47 +00:00
Matthew Slipper
68cdd2ec8f Merge pull request #2846 from ethereum-optimism/changeset-release/master
Version Packages
2022-06-23 10:37:05 -06:00
Matthew Slipper
812b8469e4 Merge pull request #2845 from ethereum-optimism/develop
Merge develop into master
2022-06-23 10:31:07 -06:00
Matthew Slipper
614366aa5b ci: Upgrade golangci-lint version to one that handles Go 1.18 (#2841)
* ci: Upgrade golangci-lint version to one that handles Go 1.18

* Fix proxyd lint
2022-06-23 04:45:26 +00:00
Matthew Slipper
46be47e6a1 Merge pull request #2818 from ethereum-optimism/develop
Develop -> Master
2022-06-17 20:50:15 -06:00
Matthew Slipper
35e71fd5cb Merge pull request #2817 from ethereum-optimism/changeset-release/master
Version Packages
2022-06-17 20:49:35 -06:00
github-actions[bot]
5da617a5ba Version Packages 2022-06-18 02:48:41 +00:00
Matthew Slipper
37f98eb677 Merge pull request #2816 from ethereum-optimism/develop
Develop -> Master
2022-06-17 20:46:55 -06:00
Matthew Slipper
e2e3a622ce proxyd: Use canned response for eth_accounts (#2801)
We never want to expose Geth's accounts to the public internet, so proxyd will now return `[]` for `eth_accounts` RPC calls without hitting the backend.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-06-16 19:02:39 +00:00