Commit Graph

2024 Commits

Author SHA1 Message Date
Bryan Stitt 269aa32260
First pass implementation of async serialize for Web3Rps (#192)
Co-authored-by: Rory Neithinger <rorytrent@gmail.com>
2023-07-14 18:29:48 -07:00
Bryan Stitt fe45813e4c remove info logging 2023-07-14 01:21:50 -07:00
Bryan Stitt 37e3d0be2b you cant do a runtime in a drop like this apparently 2023-07-14 01:19:27 -07:00
Bryan Stitt 6371206315 rate limit by ip if unknown key 2023-07-14 00:23:05 -07:00
Bryan Stitt 6f28f7c337 lint 2023-07-14 00:22:26 -07:00
Bryan Stitt f217bf33b3 disable db stats for now 2023-07-13 23:45:04 -07:00
Bryan Stitt 7ea23371aa mention innodb_rollback_on_timeout=1 2023-07-13 19:27:38 -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
Bryan Stitt 3c2d06324e faster rpc. backups always lose 2023-07-13 18:14:13 -07:00
Bryan Stitt 46127149b9 lint 2023-07-13 18:12:07 -07:00
Bryan Stitt 45af241429 less db transactions 2023-07-13 15:44:07 -07:00
Bryan Stitt 5d5e65ed40 close the db connection on exit 2023-07-13 15:44:07 -07:00
Bryan Stitt a893a41c90 rename get to connect 2023-07-13 15:44:07 -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 dce3540ee3 less authorization and remove pending txs for now 2023-07-13 11:01:16 -07:00
Bryan Stitt 53877ed2e5 less transactions when handling uncles 2023-07-13 10:27:44 -07:00
Bryan Stitt 28e6be5d9b handle uncles in the background and keep transaction open for a shorter time 2023-07-13 10:13:50 -07:00
Bryan Stitt fa21b7c0a8 lint 2023-07-13 10:13:14 -07:00
David c1a3a2dfbb
Remove stripe duplicate endpoint (#186) 2023-07-12 19:19:15 -07:00
Bryan Stitt 2b1829a882 move db and anvil functions to their proper places 2023-07-12 14:42:59 -07:00
Bryan Stitt 6b5437be2c split mysql and anvil into their own fixtures 2023-07-12 14:28:31 -07:00
Bryan Stitt 5d207fb2c6
Auto tier change (#184)
* lint

* change user to premium on admin credits

todo: change on other deposits

* set tier more places

* BadRequest instead of 500

* insert existing users too

* add the premium file
2023-07-12 10:24:16 -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 5f215facab fix typo 2023-07-11 13:18:19 -07:00
Bryan Stitt 8746cc1ae6 catch the new error format for returndata limit 2023-07-10 23:38:23 -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 3059d08674 error on max_head_block_age and keep the sender alive longer 2023-07-10 22:17:15 -07:00
Bryan Stitt 1af023d689 no iouring for now 2023-07-10 21:17:48 -07:00
Bryan Stitt 04825be99d error if health checks are failing 2023-07-10 20:59:17 -07:00
Bryan Stitt fe39ad1e1e Revert "Revert "fixes for disconnect and config reloads""
This reverts commit 3cfbc3cbf1.
2023-07-10 20:59:03 -07:00
Bryan Stitt 3cfbc3cbf1 Revert "fixes for disconnect and config reloads"
This reverts commit 50fed0b0e7.
2023-07-10 20:30:10 -07:00
Bryan Stitt 50fed0b0e7 fixes for disconnect and config reloads 2023-07-10 19:41:14 -07:00
Bryan Stitt 2dfc5dcdf3 set http keep alive to a longer time 2023-07-10 18:37:25 -07:00
Bryan Stitt 31f772591b put rpcs in a rwlock again 2023-07-10 18:09:58 -07:00
Bryan Stitt 670b64de31 9th try? 2023-07-10 16:40:41 -07:00
Bryan Stitt ad8763b5d1 add them 2023-07-10 16:39:43 -07:00
Bryan Stitt dbe7db69e0 more pwd 2023-07-10 16:38:16 -07:00
Bryan Stitt 75fb5927ef hmmm 2023-07-10 16:37:28 -07:00
Bryan Stitt 5e6da3e456 wat 2 2023-07-10 16:35:31 -07:00
Bryan Stitt 4a88aa295c wat 2023-07-10 16:34:11 -07:00
Bryan Stitt 8503c49c04 touch payment-contracts
stupid caches. this shouldnt be needed
2023-07-10 16:32:58 -07:00
Bryan Stitt 98bda65735 inner instead of left 2023-07-10 16:25:01 -07:00
Bryan Stitt 0181347b42 one less clone 2023-07-10 15:41:55 -07:00
Bryan Stitt e80d1bd23a add more to Web3Rpcs debug 2023-07-10 15:31:10 -07:00
Bryan Stitt a7f1c043c5 sync before Serialize 2023-07-10 15:26:00 -07:00
Bryan Stitt c00eebeb32 admin_ should be unimplemented cost 2023-07-10 15:13:49 -07:00
Bryan Stitt cceee646ad cargo upgrade 2023-07-10 14:05:03 -07:00
Bryan Stitt a7119f6b5b
split balance queries up (#177)
* wip

* tests pass, referee_bonus changed to one_time_referee_bonus

---------

Co-authored-by: yenicelik <david.yenicelik@gmail.com>
2023-07-10 14:03:05 -07:00
Bryan Stitt 9ef08c80e1 remove parking_lot 2023-07-10 11:05:07 -07:00