[x] My branch is up-to-date with upstream/develop branch.
[x] Everything works and tested for Python 3.8.0 and above.
[x] I ran pre-commit checks against my changes.
[x] I've written tests against my changes and all the current present tests are passing.
Current behaviour
Rate limiting is currently not supported in RpcHelper
Additionally, core-api is not compatible with the latest architecture changes.
New expected behaviour
RpcHelper now supports rate limiting on a per-second basis using the aiolimiter leaky bucket method. The limits are configurable on a per-node basis as each RPC will have its own limits. A wrapper has been added around any outgoing requests that will check and wait for resources to become available before continuing with the request.
I have also removed all references to the now unused redis_conn argument for RpcHelper calls, and fixed a response parsing issue I found in batch_eth_get_balance_on_block_range.
Core-Api has been updated for the latest architecture changes. I have also updated the get_project_last_finalized_epoch_info endpoint to no longer iterate over all previous epochs until a finalization is found. I have replaced this in favor of the lastFinalizedSnapshot contract call to the Protocol State that is now available.
Fixes #12
Checklist
Current behaviour
Rate limiting is currently not supported in
RpcHelper
Additionally,
core-api
is not compatible with the latest architecture changes.New expected behaviour
RpcHelper
now supports rate limiting on a per-second basis using theaiolimiter
leaky bucket method. The limits are configurable on a per-node basis as each RPC will have its own limits. A wrapper has been added around any outgoing requests that will check and wait for resources to become available before continuing with the request.I have also removed all references to the now unused
redis_conn
argument for RpcHelper calls, and fixed a response parsing issue I found inbatch_eth_get_balance_on_block_range
.Core-Api
has been updated for the latest architecture changes. I have also updated theget_project_last_finalized_epoch_info
endpoint to no longer iterate over all previous epochs until a finalization is found. I have replaced this in favor of thelastFinalizedSnapshot
contract call to the Protocol State that is now available.Change logs
Added
snapshotter/tests/rpc_helper_test.py
snapshotter/tests/static/abi/UUPSUpgradeable.json
snapshotter/tests/static/bytecode/protocol_state.json
snapshotter/tests/static/bytecode/uups_upgradeable.json
Changed
poetry.lock
pyproject.toml
setup.cfg
snapshotter/processor_distributor.py
snapshotter/snapshotter_id_ping.py
snapshotter/system_event_detector.py
snapshotter/tests/test_web3_async_provider.py
snapshotter/utils/generic_worker.py
snapshotter/utils/models/settings_model.py
snapshotter/utils/preloaders/tx_receipts/delegated_worker/tx_receipts.py
snapshotter/utils/rpc.py
snapshotter/utils/snapshot_utils.py
Fixed
snapshotter/core_api.py
build.sh
Deployment Instructions
No Changes