Commit Graph

57 Commits

Author SHA1 Message Date
Bryan Stitt
41950c886c improvements for web3-this-then-that 2023-06-09 16:35:14 -07:00
Bryan Stitt
40bee30730 back to moka 2023-06-07 17:30:05 -07:00
Bryan Stitt
fb97ef5180 cargo clippy lints 2023-06-07 10:55:07 -07:00
Bryan Stitt
fbe0ecfbff rate limit on websockets 2023-05-31 16:05:44 -07:00
Bryan Stitt
d64761403b Cow instead of String 2023-05-30 23:17:05 -07:00
Bryan Stitt
fd8bba4bdd most of these are for the whole app, not just the frontend 2023-05-30 21:26:11 -07:00
Bryan Stitt
cebe8ed1ea
Request refactor (#99)
* wip

* AsRef finally works like i wanted

* actually return the block

* start adding async trait

* remove stale import

* include id in the error response when possible

* remove stale comments
2023-05-30 16:32:34 -07:00
Bryan Stitt
2080739865
Quick cache (#70)
* quick cache and allocate less

* improve /status cache

* prepare to cache raw transaction hashes so we dont dos our backends

* simple benchmark for /health and /status

* mut not needed with atomics

* DRY all the status pages

* use u64 instead of bytes for subscriptions

* fix setting earliest_retry_at and improve logs

* Revert "use kanal instead of flume or tokio channels (#68)"

This reverts commit 510612d343fc51338a8a4282dcc229b50097835b.

* fix automatic retries

* put relaxed back

* convert error message time to seconds

* assert instead of debug_assert while we debug

* ns instead of seconds

* disable peak_latency for now

* null is the default

* cargo fmt

* comments

* remove request caching for now

* log on exit

* unit weigher for now

* make cache smaller. we need a weigher for prod. just debugging

* oops. we need async

* add todo

* no need for to_string on a RawValue
2023-05-13 11:13:02 -07:00
Bryan Stitt
510612d343
use kanal instead of flume or tokio channels (#68) 2023-05-12 15:47:01 -07:00
Bryan Stitt
8a097dabbe
Bryan devel 2023-05-12 (#67)
* add minor todo

* BadRequest instead of web3_context

* more bad request error codes

* use tokio-uring for the tcp listener

* clear block instead of panic

* clone earlier

* more watch channels instead of rwlocks

* drop uring for now (its single threaded) and combine get/post/put routes

* clean up iter vs into_iter and unnecessary collect

* arcswap instead of rwlock for Web3Rpcs.by_name

* cargo upgrade

* uuid fast-rng and alphabetize

* if protected rpcs, only use protected rpcs

* listenfd

* make connectinfo optional

* try_get_with_by_ref instead of try_get_with

* anyhow ensure. and try_get_with_as_ref isn't actually needed

* fix feature flags

* more refs and less clone

* automatic retry for eth_getTransactionReceipt and eth_getTransactionByHash

thanks for the report Lefteris @ Rotki

* ArcSwap for provider

* set archive_request to true on transaction retrying

* merge durable stats

* Revert "ArcSwap for provider"

This reverts commit 166d77f204cde9fa7722c0cefecbb27008749d47.

* comments

* less clones

* more refs

* fix test

* add optional mimalloc feature

* remove stale dependency

* sort

* cargo upgrade

* lint constants

* add todo

* another todo

* lint

* anyhow::ensure instead of panic

* allow rpc_accounting_v2 entries for requests without an rpc key
2023-05-12 15:15:32 -07:00
Bryan Stitt
b1120e635a change some error codes jsonrpc error handling 2023-04-10 22:29:02 -07:00
Rory Neithinger
ffdf25787f Merge branch 'stats_v3' of github.com:yenicelik/web3-proxy into Web3ProxyError 2023-03-31 23:23:30 -07:00
yenicelik
05463c7ee5 migration seems to work for the most part 2023-03-30 12:54:01 +01:00
Rory Neithinger
1493d73386 better error handling for ws 2023-03-19 19:14:46 -07:00
Rory Neithinger
beac7ee017 better error handling for proxy_web3_rpc() 2023-03-19 18:52:28 -07:00
Rory Neithinger
f3fc4924dc Refactor FrontendErrorResponse into Web3ProxyError
Renamed FrontendResponse to Web3ProxyResponse and introduced
a new generic type alias Web3ProxyResult.

Fixed a few noisy cargo warnings.
2023-03-16 22:21:20 -07:00
Bryan Stitt
eb4d05a520 stats v2
rebased all my commits and squashed them down to one
2023-03-04 20:48:49 +01:00
Bryan Stitt
3098791ad9 add optional kafka feature 2023-03-03 01:39:50 +00:00
Bryan Stitt
0f280ce483 cargo upgrade and shorten variable names
also begin adding a latency tracker for rpc stats
2023-02-06 09:55:27 -08:00
Bryan Stitt
0731d92dec use best, not fastest with websocket 2023-01-19 18:32:31 -08:00
Bryan Stitt
90d3371eee improved rate limiting on websockets 2023-01-18 16:17:47 -08:00
Bryan Stitt
d7c75f843e add stub try_proxy_connection 2023-01-16 22:54:40 -08:00
Bryan Stitt
4a837b35cc improve eth_sendRawTransaction 2022-12-23 17:35:35 -08:00
Bryan Stitt
9bcbadd81a improve some errors 2022-12-23 12:17:14 -08:00
Bryan Stitt
11a7aff8e0 don't unwrap. still might be more errors to handle though 2022-12-23 12:12:17 -08:00
Bryan Stitt
1fecfd8821 don't unwrap an error 2022-12-23 12:03:48 -08:00
Bryan Stitt
4d34bc629c whitespace 2022-12-20 10:58:57 -08:00
Bryan Stitt
fd1be8a702 move more into the spawned task 2022-12-20 10:54:13 -08:00
Bryan Stitt
82eb449e96 add backend nodes to the rpc response headers
only do this in dev?
2022-12-19 21:37:12 -08:00
Bryan Stitt
0406b0dc8d fix redirect. config for login domain 2022-11-28 19:59:42 +00:00
Bryan Stitt
43d550190b lower log level 2022-11-24 11:04:10 +00:00
Bryan Stitt
ae39636cd2 fix some error status codes 2022-11-21 17:49:57 +00:00
Bryan Stitt
217a7b3fd3 eth_subscribe rpc_accounting logging 2022-11-19 22:05:51 +00:00
Bryan Stitt
4d8808b886 a little bit more trace logging 2022-11-16 08:34:17 +00:00
Bryan Stitt
2829ce7a7d lint more 2022-11-16 07:19:56 +00:00
Bryan Stitt
0e1cf5767c cut out tracing for now 2022-11-12 08:24:32 +00:00
Bryan Stitt
c35dd96cfb save rpc_key_id or origin. needs some testing 2022-11-11 06:19:14 +00:00
Bryan Stitt
c33342d9dd simplify authorization types so we can pass them deeper easily 2022-11-11 06:19:12 +00:00
Bryan Stitt
31395c9934 rpc_key_id in the redirect. weights in the /status page 2022-11-07 22:10:19 +00:00
Bryan Stitt
a534eae968 trace everything 2022-10-28 22:52:47 +00:00
Bryan Stitt
366f2c8f84 rename api_key to rpc_key 2022-10-27 00:12:42 +00:00
Bryan Stitt
9422a335a7 allow origins on public entrypoints 2022-10-21 20:59:05 +00:00
Bryan Stitt
6c9189ef76 remove unused variables 2022-10-20 20:26:14 +00:00
Bryan Stitt
848af3d8b3 more docs 2022-10-17 21:47:58 +00:00
Bryan Stitt
25aa68a5bf add per-user rpc accounting 2022-10-10 04:15:49 +00:00
Bryan Stitt
a7b5f25467 unwrap less 2022-09-30 04:18:18 +00:00
Bryan Stitt
0c7a2b05ec start adding semaphores 2022-09-27 02:01:45 +00:00
Bryan Stitt
5df2469d53 ULID or UUID. Prefer ULID 2022-09-24 05:53:45 +00:00
Bryan Stitt
961ccf7cf2 ip, origin, referer, and user agent checks 2022-09-23 05:22:33 +00:00
Bryan Stitt
3854312674 we need to clone :'( 2022-09-22 21:51:52 +00:00