less queries
This commit is contained in:
parent
ad59c08543
commit
42c8d33d83
2
TODO.md
2
TODO.md
@ -34,6 +34,8 @@
|
|||||||
- [ ] rpc errors propagate too far. one subscription failing ends the app. isolate the providers more
|
- [ ] rpc errors propagate too far. one subscription failing ends the app. isolate the providers more
|
||||||
- [ ] if web3 proxy gets an http error back, retry another node
|
- [ ] if web3 proxy gets an http error back, retry another node
|
||||||
- [ ] endpoint for health checks. if no synced servers, give a 502 error
|
- [ ] endpoint for health checks. if no synced servers, give a 502 error
|
||||||
|
- [ ] interval for http subscriptions should be based on block time.
|
||||||
|
- [ ] todo: include private rpcs with regular queries? i don't want to overwhelm them, but they could be good for excess load
|
||||||
|
|
||||||
## V1
|
## V1
|
||||||
|
|
||||||
|
@ -1,27 +1,67 @@
|
|||||||
[shared]
|
[shared]
|
||||||
chain_id = 1
|
chain_id = 1
|
||||||
# in prod, do `rate_limit_redis = "redis://redis:6379/"`
|
# in prod, do `rate_limit_redis = "redis://redis:6379/"`
|
||||||
rate_limit_redis = "redis://dev-redis:6379/"
|
|
||||||
|
|
||||||
[balanced_rpcs]
|
[balanced_rpcs]
|
||||||
|
|
||||||
[balanced_rpcs.erigon_archive]
|
[balanced_rpcs.ankr]
|
||||||
url = "http://10.11.12.16:8549"
|
url = "https://rpc.ankr.com/eth"
|
||||||
# TODO: double check soft_limit on erigon
|
soft_limit = 1_000
|
||||||
soft_limit = 100_000
|
|
||||||
|
|
||||||
[balanced_rpcs.erigon_archive_ws]
|
[balanced_rpcs.cloudflare]
|
||||||
url = "ws://10.11.12.16:8549"
|
url = "https://cloudflare-eth.com"
|
||||||
# TODO: double check soft_limit on erigon
|
soft_limit = 1_000
|
||||||
soft_limit = 100_000
|
|
||||||
|
|
||||||
[balanced_rpcs.geth]
|
[balanced_rpcs.flashbots]
|
||||||
url = "http://10.11.12.16:8545"
|
url = "https://rpc.flashbots.net"
|
||||||
soft_limit = 200_000
|
soft_limit = 1_000
|
||||||
hard_limit = 1_000
|
|
||||||
|
|
||||||
[balanced_rpcs.geth_ws]
|
[balanced_rpcs.linkpool-light]
|
||||||
url = "ws://10.11.12.16:8546"
|
url = "https://main-light.eth.linkpool.io"
|
||||||
soft_limit = 200_000
|
soft_limit = 1_000
|
||||||
|
|
||||||
|
[balanced_rpcs.blastapi]
|
||||||
|
url = "https://eth-mainnet.public.blastapi.io"
|
||||||
|
soft_limit = 1_000
|
||||||
|
|
||||||
|
#[balanced_rpcs.mycryptoapi]
|
||||||
|
#url = "https://api.mycryptoapi.com/eth"
|
||||||
|
#soft_limit = 1_000
|
||||||
|
|
||||||
|
[balanced_rpcs.runonflux]
|
||||||
|
url = "https://ethereumnodelight.app.runonflux.io"
|
||||||
|
soft_limit = 1_000
|
||||||
|
|
||||||
|
[balanced_rpcs.pokt-v1]
|
||||||
|
url = "https://eth-mainnet.gateway.pokt.network/v1/5f3453978e354ab992c4da79"
|
||||||
|
soft_limit = 1_000
|
||||||
|
|
||||||
|
[balanced_rpcs.pokt]
|
||||||
|
url = "https://eth-rpc.gateway.pokt.network"
|
||||||
|
soft_limit = 1_000
|
||||||
|
|
||||||
|
[balanced_rpcs.linkpool]
|
||||||
|
url = "https://main-rpc.linkpool.io"
|
||||||
|
soft_limit = 1_000
|
||||||
|
|
||||||
[private_rpcs]
|
[private_rpcs]
|
||||||
|
|
||||||
|
[private_rpcs.eden]
|
||||||
|
url = "https://api.edennetwork.io/v1/"
|
||||||
|
soft_limit = 1_805
|
||||||
|
|
||||||
|
[private_rpcs.eden_beta]
|
||||||
|
url = "https://api.edennetwork.io/v1/beta"
|
||||||
|
soft_limit = 5_861
|
||||||
|
|
||||||
|
[private_rpcs.ethermine]
|
||||||
|
url = "https://rpc.ethermine.org"
|
||||||
|
soft_limit = 5_861
|
||||||
|
|
||||||
|
[private_rpcs.flashbots]
|
||||||
|
url = "https://rpc.flashbots.net"
|
||||||
|
soft_limit = 7074
|
||||||
|
|
||||||
|
[private_rpcs.securerpc]
|
||||||
|
url = "https://gibson.securerpc.com/v1"
|
||||||
|
soft_limit = 4560
|
||||||
|
@ -41,8 +41,9 @@ impl Web3Provider {
|
|||||||
let provider = ethers::providers::Http::new_with_client(url, http_client);
|
let provider = ethers::providers::Http::new_with_client(url, http_client);
|
||||||
|
|
||||||
// TODO: dry this up (needs https://github.com/gakonst/ethers-rs/issues/592)
|
// TODO: dry this up (needs https://github.com/gakonst/ethers-rs/issues/592)
|
||||||
|
// TODO: i don't think this interval matters, but it should probably come from config
|
||||||
ethers::providers::Provider::new(provider)
|
ethers::providers::Provider::new(provider)
|
||||||
.interval(Duration::from_secs(1))
|
.interval(Duration::from_secs(13))
|
||||||
.into()
|
.into()
|
||||||
} else if url_str.starts_with("ws") {
|
} else if url_str.starts_with("ws") {
|
||||||
// TODO: wrapper automatically reconnect
|
// TODO: wrapper automatically reconnect
|
||||||
@ -342,7 +343,7 @@ impl Web3Connection {
|
|||||||
// TODO: what should this interval be? probably some fraction of block time. set automatically?
|
// TODO: what should this interval be? probably some fraction of block time. set automatically?
|
||||||
// TODO: maybe it would be better to have one interval for all of the http providers, but this works for now
|
// TODO: maybe it would be better to have one interval for all of the http providers, but this works for now
|
||||||
// TODO: if there are some websocket providers, maybe have a longer interval and a channel that tells the https to update when a websocket gets a new head? if they are slow this wouldn't work well though
|
// TODO: if there are some websocket providers, maybe have a longer interval and a channel that tells the https to update when a websocket gets a new head? if they are slow this wouldn't work well though
|
||||||
let mut interval = interval(Duration::from_secs(2));
|
let mut interval = interval(Duration::from_secs(13));
|
||||||
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
|
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
|
||||||
|
|
||||||
let mut last_hash = Default::default();
|
let mut last_hash = Default::default();
|
||||||
|
Loading…
Reference in New Issue
Block a user