{"repo":"BobTheBuidler/dank_mids","free":true,"listed":false,"github":"https://github.com/BobTheBuidler/dank_mids","clone":"git clone https://github.com/BobTheBuidler/dank_mids.git","description":"Async web3py middleware that collects eth calls and batches them into multicalls, then batches those multicalls into jsonrpc batches along with all your other calls in the background.","language":"C","stars":89,"topics":["evm","multicall","python","web3","web3py","ethereum","jsonrpc","asyncio"],"license":"MIT","category":"blockchain-web3","readme_excerpt":"Dank Mids Dank Mids is a EVM RPC batching library that helps reduce the number of HTTP requests to a node, saving time and resources. It automatically collects eth call calls into multicalls and bundles all RPC calls together in jsonrpc batch calls. tl;dr: its fast as fuck. The goal of this tool is to reduce the workload on RPC nodes and allow users to make calls to their preferred node more efficiently. This optimization is especially useful for developers writing scripts that perform large-scale blockchain analysis, as it can save development time and resources. Why is Dank so fast? There are a number of optimizations that went into making Dank the fastest way to pull rpc data to Python. 1. Implemented (mostly) in C. 2. Bypasses the default formatters in web3.py 3. JSON encoding and decoding is handled by msgspec. All responses are decoded to specialized msgspec.Struct objects defined in the evmspec library. 4. We use my C-compiled faster-eth-abi and faster-eth-utils instead of the original python implementations eth-abi and eth-utils. 5. Responses are decoded on a JIT (just-in-time) basis, meaning individual task cancellation works as expected even when response data is received as part of a larger batch. 6. more stuff I'll write down later... Batching Flow This diagram shows how requests move from user calls into Dank Mids queues, then through batch execution and response spoofing. Notes: - Batches can start early when the queue is full ( Batch.append - controller.early s","default_branch":null,"files":null,"tree":[],"storefront":"/r/BobTheBuidler","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/BobTheBuidler/dank_mids/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}