Commit Graph

466 Commits

Author SHA1 Message Date
Bryan Stitt cc2eb9e862 no more overflow on the pending txid firehose 2023-10-07 03:41:11 -07:00
Bryan Stitt d38a35903e cargo update 2023-10-07 00:35:22 -07:00
Bryan Stitt aeb30787dd more openssl and no rmp
i like rustls, but we can't use it on everything and so our compile times are bad
2023-10-07 00:35:22 -07:00
Bryan Stitt 9e1be629ca cargo update 2023-10-07 00:35:22 -07:00
Bryan Stitt 9258d36e6a refactor rpc selection 2023-10-07 00:35:22 -07:00
Bryan Stitt aee8ede8ef 1.43.15 2023-10-06 00:05:27 -07:00
Bryan Stitt 572fc87cf5 1.43.14 2023-10-05 20:28:51 -07:00
Bryan Stitt 1c7fb8ae29 cargo update 2023-10-05 11:01:24 -07:00
Bryan Stitt ac8d77252e 1.43.13 2023-10-05 11:01:24 -07:00
Bryan Stitt 5aa967dfa9 1.43.12 2023-10-03 21:35:43 -07:00
Bryan Stitt 633177c0a6 bump version to 1.43.11 2023-10-03 19:29:44 -07:00
Bryan Stitt 73d16b83e6 cargo upgrade and update 2023-10-03 19:07:21 -07:00
Bryan Stitt e917a11d6c
Suprisingly large refactor to get ids everywhere (#222)
* cargo upgrade --incompatible and update

* first draft at suprisingly_large_refactor_to_get_ids_everywhere

* put app in a task_local

* ref cleanup

* use a OnceLock instead of a tokio local

* test more methods

* APP isn't set in all tests

* it compiles. tests fail. todos still open

* use the app only when necessary

* more tests. less panic

* less verbose debug impl

* short enum names

* move kafka and secrets to their own files

* main tests pass

* add debug chain block time

* helper for stats that ignores internal stats

* Update Jenkinsfile (#223)

* more tests

---------

Co-authored-by: Pewxz <124064710+pewxz@users.noreply.github.com>
2023-10-03 13:46:27 -07:00
Bryan Stitt f0b6465069
streaming responses 2 (#219)
* streaming responses compile, still small TODOs & cleanup

* refactor to allow short curcuits on uncacheable requests (#220)

* refactor to allow short curcuits on uncacheable requests

* handle error inside an Arc from moka

* arc instead of box

* lint

* more lint

* add bonus rate limits and keep all semaphores after rate limits (#221)

* add bonus rate limits and keep all semaphores after rate limits

* remove stale todos

* better function names

* cargo upgrade and update

* make some panics warn. more todo

* pass request_metadata through so streaming responses include their final size

* remove stale TODO

* remove more stale todos

* add file i missed

* make to_json_string work well enough

* check config for free_subscriptions

---------

Co-authored-by: Rory Neithinger <rory@llamanodes.com>
2023-09-26 18:18:06 -07:00
Bryan Stitt e1f922dc57 v1.43.8 2023-09-25 10:39:31 -07:00
Bryan Stitt d732b8a171 cargo upgrade and update
ordered-float went from v3 to v4
2023-09-25 10:02:04 -07:00
Bryan Stitt f9b6c2fe0c cargo upgrade and update 2023-09-21 09:35:06 -07:00
Bryan Stitt 44e8cce9c8 no need for this yield. recv is cooperative 2023-09-20 12:34:51 -07:00
Bryan Stitt 0b3dfd095e upgrade nightly for doc fix 2023-09-20 11:02:41 -07:00
Bryan Stitt b44c774edb remove some unused features 2023-09-19 18:48:15 -07:00
Bryan Stitt 98da8cdfa7 add a yield_now just in case 2023-09-19 15:40:24 -07:00
Bryan Stitt 416d179c09 1.43.6 2023-09-19 14:43:15 -07:00
Bryan Stitt ca2056e16f lru instead of moka for deduped_broadcast 2023-09-19 14:39:59 -07:00
Bryan Stitt 6233faeec4 cargo update 2023-09-19 10:57:14 -07:00
Bryan Stitt 10c4ffc9d2 smarter archive retry 2023-09-19 10:56:54 -07:00
Bryan Stitt 9ec408765c v1.43.2 2023-09-18 23:43:45 -07:00
Bryan Stitt 37df2a5650 delete unused deps 2023-09-18 14:32:02 -07:00
Bryan Stitt a68a98ce41 cargo upgrade and update
moka 0.12 required some migration help: https://github.com/moka-rs/moka/blob/main/MIGRATION-GUIDE.md
2023-09-18 11:04:22 -07:00
Bryan Stitt 01179d14f2 cargo upgrade and update 2023-09-14 12:51:16 -07:00
Bryan Stitt 1fd8f6f383
Deduped broadcast channel (#209)
* upgrade and start adding deduped_broadcast

* basic test

* accept arg for cache ttl

* first pass at bringing the tx firehose back

* try_send instead of send since there aren't always receivers

* deduped broadcaster needs the try send

* track counts and include in /status

* use config for enable subscribe_txs
2023-09-13 12:05:47 -07:00
Bryan Stitt 274b2c89fc v1.43.1 2023-09-12 13:43:17 -07:00
Bryan Stitt 1ad6b2ad3e cargo upgrade and cargo update 2023-09-12 13:01:41 -07:00
Bryan Stitt 8050f699f3 cargo upgrade and cargo update 2023-09-11 11:33:36 -07:00
Bryan Stitt 0dcd368ac7 v1.42.18 2023-09-06 13:17:35 -07:00
Bryan Stitt d5090df5a4 1.42.17 2023-09-02 10:59:37 -07:00
Bryan Stitt bd77a6cac4 cargo upgrade and update 2023-09-02 10:20:30 -07:00
Bryan Stitt 57f5d5b483 cargo upgrade and update 2023-09-01 16:58:02 -07:00
Bryan Stitt 7530605e5b v1.42.14 2023-08-30 21:06:09 -07:00
Bryan Stitt 484610b80f cargo upgrade and update 2023-08-30 21:05:34 -07:00
Bryan Stitt ec533c8b30 cargo upgrade and update 2023-08-30 20:59:06 -07:00
Bryan Stitt df12b3dc73 cargo upgrade and update 2023-08-24 14:37:04 -07:00
Bryan Stitt a32e2ddcad cargo upgrade 2023-08-22 13:27:19 -07:00
Bryan Stitt d036806a61 cargo upgrade and cargo update 2023-08-22 10:42:59 -07:00
Bryan Stitt 4e0467b3ca cargo update 2023-08-18 17:06:38 -07:00
Bryan Stitt eed03d2bfe cargo upgrade 2023-08-18 16:18:30 -07:00
Bryan Stitt 24058e04f1 bump version to 1.42.10 2023-08-18 16:01:32 -07:00
Bryan Stitt 6be05bab4b cargo upgrade 2023-08-17 13:49:45 -07:00
Bryan Stitt e0f700189b fix error code on method not implemented and error_response user_response bools 2023-08-17 13:44:26 -07:00
Bryan Stitt 5b9ef30e64 include user_error_response in aggregate stats 2023-08-15 17:08:11 -07:00
Bryan Stitt 54341c4654 learn to cache more 2023-08-15 16:37:53 -07:00
Bryan Stitt 9bd18250fe bump 1.42.6 2023-08-15 16:21:13 -07:00
Bryan Stitt aa71a406bb cargo upgrade 2023-08-15 15:39:13 -07:00
Bryan Stitt 891243ed46 cargo upgrade 2023-08-08 17:40:17 -07:00
Bryan Stitt cee4603b55 add check_balance command 2023-08-08 16:18:07 -07:00
Bryan Stitt 3f932b9d57 also bump cli version 2023-08-08 15:58:21 -07:00
Bryan Stitt c7bf7173cf bump version 1.42.4 2023-08-08 15:51:01 -07:00
Bryan Stitt 5f07213c8d new nightly supposedly compiles faster 2023-08-08 14:14:34 -07:00
Bryan Stitt d56d39c82f cargo upgrade 2023-08-07 15:40:59 -07:00
Bryan Stitt 5257329559 cargo upgrade 2023-08-04 16:19:43 -07:00
Bryan Stitt ab6d3a1d9b split command line into separte module 2023-08-03 00:16:54 -07:00
Bryan Stitt 7cd91af3a8 don't cache nulls 2023-07-31 14:26:07 -07:00
Bryan Stitt 2885bc6ef2 cargo upgrade 2023-07-31 12:58:20 -07:00
Bryan Stitt d14837aa77 cargo upgrade 2023-07-28 12:55:10 -07:00
Bryan Stitt 32a73a0c53 cargo upgrade --incompatible 2023-07-27 12:29:10 -07:00
Bryan Stitt ebfb4c6386 cargo upgrade 2023-07-27 12:29:10 -07:00
Bryan Stitt d2f0d45dd2 reduce out of funds tier to match free config and bump to version 1 2023-07-26 16:40:08 -07:00
Bryan Stitt 4d8836538d drop old fk 2023-07-26 09:33:15 -07:00
Bryan Stitt 05e618f74c
Anon rpc accounting (#194)
* cargo generate migrations didnt work without this

* anon rpc accounting

* Revert "anon rpc accounting"

This reverts commit f1b8cbcdeca0d5f9545da32f11dda6a90854f97a.

* 0 for anon in mysql

* only set approximate_balance_remaining on owned stats

* only set self.approximate_balance_remaining when adding if some

* todo complete
2023-07-24 22:02:33 -07:00
Bryan Stitt 9b361cb849 cargo upgrade 2023-07-24 21:59:37 -07:00
Bryan Stitt 766e1939d5 cargo upgrade 2023-07-20 18:23:04 -07:00
Bryan Stitt 6c6a2406b7 cargo upgrade 2023-07-19 22:55:53 -07:00
Bryan Stitt 1b8ae5dee0 cargo upgrade 2023-07-18 09:54:56 -07:00
David 31f840432d
Add DateCreated fields to admin and on-chain deposit (#190)
* tests seem to be passing

* bump version

* bump version
2023-07-13 19:25:14 -07:00
David d8e4115d5a
fix default timestamp for stripe table (#189)
* fix default timestamp for stripe table

* changed time local to time utc

* keep chrono for now
2023-07-13 13:38:56 -07:00
Bryan Stitt b6cbf02ae7 test_sum_credits_used needs docker 2023-07-12 00:47:55 -07:00
Bryan Stitt df2f3d340f
More balance tests (#182)
* fix popularity contest

* more info in the Debug for Web3Rpc

* add frontend_requests and cache_misses to the Balance query

* add more to balance and stats flushing and improved test coverage

* it compiles

* deserializer for Ulid to Uuid

I think a wrapper type on Ulid that implements sea_orm::Value is probably better

* rename variable to match struct name

* add deserializer for Address -> Vec<u8>

* sql sum returns a Decimal. need to convert to u64

* assert more

* one log and assert more

* log more

* use a helper to get the user's rpc provider

* this should be 2 now that we have a public and authed call

* this should be zero. the public has the cache miss

* instrument cu calcs

* trace the value we took, not the default that replaced it

* move usd_per_chain into config

* remove some extra logging

* use Arc::into_inner to maybe avoid a race

* off by 1

* pass paid credits used instead of returning it

this lets us use it to write to our user balance cache first. importantly, this keeps us from holding a write lock while writing to mysql

* no cache misses expected in this test

* actually check the admin

* put the balance checks back now that the rest of the test works

* archive request is being set incorrectly

* wow howd we manage flipping the greater than sign on archive depth

* move latest_balance and premium_credits_used to before any stats are emitted

* lint

* and build undoes the linting. fun

i didnt even want to lint them in the first place, so this is fine

* missed incrementing total_spent when not incrementing total_spent_paid_credits

* use the credits on self

* use the credits on self (pt 2)

* fix type for 10 cu query

* convert the requestmetadata on the other side of the channel

* logs

* viewing stats is allowed even without a balance

* move paid_credits_used to AuthorizationChecks

* wip

* test_sum_credits_used finally passes

* UserBalanceCache::get_or_insert

* re-enable rpc_secret_key_cache

* move invalidate to a helper function

and always call it **after** the db is commited

* fix PartialEq and Eq on RpcSecretKey

* cargo upgrade
2023-07-12 00:35:07 -07:00
Bryan Stitt 0f7e370c92 drop flume. just use tokio
i dont know if this is the problem, but this will also get compile times down
2023-07-10 23:08:06 -07:00
Bryan Stitt 1af023d689 no iouring for now 2023-07-10 21:17:48 -07:00
Bryan Stitt cceee646ad cargo upgrade 2023-07-10 14:05:03 -07:00
Bryan Stitt 71aab0dedc cargo upgrade 2023-07-07 15:16:14 -07:00
Bryan Stitt b234265458
Premium tier changes (#170)
* lower premium concurrency in preparation for key+IP limits

* include the ip in the user semaphore

* 3, not 5

this is our current limit for free

* per user_id+ip rate limiting
2023-07-07 15:15:41 -07:00
Bryan Stitt e0c57a22ae derivative and serde didn't work together like we'd hoped 2023-07-06 03:51:39 -07:00
Bryan Stitt cc0ce1611a cargo upgrade 2023-07-05 21:02:30 -07:00
Bryan Stitt 04d58a68dd fix version number to match migration count 2023-07-05 20:58:24 -07:00
Bryan Stitt eb7b98fdbe
Split errors (#158)
* add migration for splitting errors

* fix type from u32 to u64

* update entities to match migrations

* no migration needed. these are only in stats

* add user_error_response to influx

* only if detailed

* set error_response and user_error_response

* 0 cost error responses

* only 33 migrations now

* put macros back

* get the stat buffer sender to the TestApp helper

* fixes
2023-07-05 18:18:10 -07:00
Bryan Stitt f8d824330b cargo upgrade 2023-07-05 11:55:17 -07:00
Bryan Stitt 4fa28608b1 cargo upgrade 2023-07-03 16:55:44 -07:00
Bryan Stitt 64505953ee cargo upgrade 2023-07-03 12:28:07 -07:00
Bryan Stitt 832432e9d4 cargo upgrade 2023-07-02 16:21:10 -07:00
Bryan Stitt 501ec21442 drop workspace-hack for now
it doesn't work well with features and so we were installing things like kafka even if the feature was off
2023-06-30 13:18:37 -07:00
Bryan Stitt 645fa7328b cargo upgrade tokio 2023-06-29 23:16:31 -07:00
Bryan Stitt 581af0d596
stripe integration first mvp (replaces #140) (#154)
* stripe integration first mvp

* addressing some points from #140

* stripe endpoint needs testing

* addressed some comments

* added Json(payload)

* update toolchain

* lint (well, most of it)

---------

Co-authored-by: yenicelik <david.yenicelik@gmail.com>
2023-06-29 14:32:05 -07:00
Bryan Stitt 5cc0483096 cargo hakari generate 2023-06-27 16:02:39 -07:00
Bryan Stitt cdea61cb6b one list for ranked rpcs 2023-06-27 15:55:29 -07:00
Bryan Stitt 272f7ce800 add cargo hakari and chef to build process 2023-06-27 11:59:49 -07:00
Bryan Stitt 86f9560fc3 less serde features
if we don't use them its just wasted compile time
2023-06-27 10:18:32 -07:00
Bryan Stitt 1cf18b78a9 cargo upgrade 2023-06-27 10:04:48 -07:00
Bryan Stitt 54107a390b cargo upgrade 2023-06-26 21:07:25 -07:00
Bryan Stitt fb76fd2d1c remove unused ewma crate now that we have our own 2023-06-25 14:32:45 -07:00
Bryan Stitt a440d51377 test fixture 2023-06-24 21:17:08 -07:00
Bryan Stitt 94d0a25aaf test logs 2023-06-24 16:43:11 -07:00
Bryan Stitt 1d6e1ef9af polish error logs 2023-06-24 15:24:46 -07:00
Bryan Stitt 8f76d9320d support EIP1271 login 2023-06-24 09:48:31 -07:00
Bryan Stitt 4e6a80caa2 cargo upgrade 2023-06-24 00:41:48 -07:00
Bryan Stitt 89330cfba0 upstream ethers again 2023-06-23 22:23:51 -07:00
Bryan Stitt fd661689a3
Tracing (#144)
* tracing

* add tracing and features to match

* use just one hostname crate

* cargo upgrade

* set up pretty logger and sentry layer
2023-06-23 16:28:45 -07:00
Bryan Stitt 66212b5cf5 cargo upgrade --incompatible -p itertools 2023-06-22 09:26:57 -07:00
Bryan Stitt 095a505017 cargo upgrade 2023-06-21 17:57:53 -07:00
Bryan Stitt 78efad5453 cargo upgrade strum 2023-06-19 17:48:46 -07:00
Bryan Stitt 6038351cb8 change default tracking in prep for premium-only keys 2023-06-19 13:00:57 -07:00
Bryan Stitt 9dd0bae40a text instead of string payload 2023-06-18 16:13:55 -07:00
Bryan Stitt e54299beca rolling median for choosing tier 2023-06-18 09:53:36 -07:00
Bryan Stitt 74d2333039 try this version of influxdb2 2023-06-16 23:41:12 -07:00
Bryan Stitt 5d9365449f simplify max item weight by having the weigher send MAX for big things 2023-06-16 16:14:11 -07:00
Bryan Stitt 1ec0f14144 upgrade to influxdb 1e5577e14150797584f5ed0ea7aba0bd68f0a678 2023-06-16 14:48:03 -07:00
Bryan Stitt cb71de7d14 pin influxdb2 to 6d3cf64d61967f41fafb57b3f4553206a8f3f2a3 2023-06-16 13:30:35 -07:00
Bryan Stitt d9a865fd1b cargo upgrade 2023-06-16 10:58:09 -07:00
Bryan Stitt fe8675ddf2 cargo upgrade 2023-06-16 00:48:22 -07:00
Bryan Stitt a083bc652d
Handle uncle transactions (#129)
* add more columns to handle uncled transactions

* handle payment uncles

* put relations back

* include all the new columns

* lower log levels

* improve block caching

if we have a block with a number, its canonical. uncles don't get returned

* improve disconnect logic

* lint

* clear first changed for new_top_config_receiver

* better logs around config changing

* i guess we do want one apply top_config at the start

* check correct variable for data limits
2023-06-16 00:46:27 -07:00
Bryan Stitt c771479d94 use WyRand instead of Xoshiro 2023-06-12 19:46:36 -07:00
Bryan Stitt e26aef4313 cargo upgrade 2023-06-12 16:40:37 -07:00
Bryan Stitt c456432cc3 cargo upgrade 2023-06-12 11:44:51 -07:00
David 81aa4788b4
David/60 add basic email verification (#119)
* added logic to check e-mails thru SMPT server, very basic, no validation e-mails etc.

* added rpc key logic to use db numbers instead of UUIDs

* Revert "added rpc key logic to use db numbers instead of UUIDs"

This reverts commit 056771d02725f90ed5f1745b0372e13e630a19ac.
2023-06-11 19:10:10 -07:00
Bryan Stitt 4a9c1a0ce6 move user registration into a dedicated function 2023-06-09 18:31:47 -07:00
Bryan Stitt 1f3040f6c7 automated tiers 2023-06-09 12:21:55 -07:00
Bryan Stitt b6ff14210d cargo upgrade 2023-06-08 22:35:14 -07:00
Bryan Stitt bfaff81626 cargo upgrade 2023-06-07 17:31:29 -07:00
Bryan Stitt 40bee30730 back to moka 2023-06-07 17:30:05 -07:00
Bryan Stitt f6b2b0deab cargo upgrade 2023-06-07 10:50:34 -07:00
Bryan Stitt 2b814e7a4d serialize the caches on /status 2023-06-07 10:48:55 -07:00
Bryan Stitt 7dcc2b4d93 use MultiAbigen 2023-05-31 11:52:57 -07:00
Bryan Stitt 7947cb95ff use bloom filters and support transactions with multiple deposit events 2023-05-31 11:20:17 -07:00
Bryan Stitt fcc1843af0 put it back. duplication between cargo.toml isnt worth it 2023-05-30 21:37:58 -07:00
Bryan Stitt 2273637a07 move cli into a separate packge and clean up dependencies 2023-05-30 20:58:24 -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 c1eba556a5 fix missing ttl send and add name to cache 2023-05-29 17:19:05 -07:00
Bryan Stitt 9e935e2c44 cargo upgrade 2023-05-29 09:43:51 -07:00
Bryan Stitt 0d15d5baf7 bump versions to match number of migrations 2023-05-23 20:58:29 -07:00
Bryan Stitt 4c7a7b87cb cargo upgrade 2023-05-23 14:58:13 -07:00
Bryan Stitt 78f247fc6c split http and ws provider 2023-05-23 14:40:34 -07:00
Bryan Stitt 05f862f3e4 cargo upgrade 2023-05-22 15:50:00 -07:00
Bryan Stitt 3ac15558e3 fix decay time 2023-05-22 15:43:39 -07:00
Bryan Stitt c443f76623 refactor tiers again 2023-05-19 14:09:03 -07:00
Bryan Stitt 8898ffe578 cargo upgrade 2023-05-18 13:36:35 -07:00
Bryan Stitt b61675e928 replace all moka with quick_cache_ttl 2023-05-18 13:34:22 -07:00
Bryan Stitt 0f367d9035 more quick cache ttl 2023-05-18 00:04:30 -07:00
Bryan Stitt f4cebde53f use ttl quick cache 2023-05-16 14:46:05 -07:00
Bryan Stitt 9621cfdccd add quick cache wrapper for ttl expiration 2023-05-13 16:28:27 -07:00
Bryan Stitt 685c1d039a cargo upgrade 2023-05-13 15:00:24 -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 510612d343.

* 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