Madara Community Call #3 #150
Replies: 2 comments
-
RPC implementation deep dive1. IntroductionDuring the third community call, the organizers presented a deep dive into the implementation of the Full RPC (Remote Procedure Call) Client for Starknet sequencer. This document provides a summary of the key points discussed during the call, including the motivations behind the RPC Client, an overview of its implementation, and potential challenges and future improvements. 2. Motivations for the RPC ClientThe RPC Client aims to provide full RPC support for Starknet, allowing users to interact with the blockchain through various RPC methods. The goal is to achieve full coverage of the Open RPC specification for Starknet while ensuring compatibility with Substrate. 3. Overview of the RPC Client Implementation3.1. Retrieving Block HashesThe RPC Client retrieves block hashes by querying the current block and using the Substrate Block Hash to index into the storage at a specific block. This method is preferred over directly accessing the storage because it provides a more flexible and less risky approach. It also does not impact the performance of the actual blockchain. 3.2. Runtime API and Storage OverridesTo optimize performance, the RPC Client first attempts to read from the storage directly using storage overrides. If this fails, it falls back to querying the runtime API. This approach reduces the overhead of switching between client execution and the WebAssembly runtime when reading from the storage. 3.3. Substrate and Starknet Block Hash MappingSince Starknet block hashes and Substrate block hashes are different, the RPC Client uses a reverse mapping from Starknet block hashes to Substrate block hashes. The client listens for new finalized blocks and maintains a mapping database, which allows it to quickly retrieve the Substrate block hash associated with a given Starknet block hash. 4. Challenges and Future ImprovementsImplementing new RPC methods will be an interesting task for new contributors. Some challenges may arise along the way, and innovative ways to read from the storage will need to be found. Additionally, implementing a caching mechanism, such as LRU, can help optimize performance if many users call the same RPC methods. 5. ConclusionThe RPC Client is a crucial component for providing full RPC support for Starknet. The implementation is set up to make it easy for new contributors to get involved and add more RPC methods. Timothy is available to help anyone interested in contributing to this project. The community is encouraged to work together to achieve full coverage of the Open RPC specification for Starknet. |
Beta Was this translation helpful? Give feedback.
-
Summary of the Third Madara Community Call
Discussion of emitting events and defining traits for querying data.
Action items:
|
Beta Was this translation helpful? Give feedback.
-
ZOOM LINK
Agenda
Information
Paris, France Fri, 7 Apr 2023 at 14:00 CEST
New York, USA Fri, 7 Apr 2023 at 08:00 EDT
UTC, Time Zone Fri, 7 Apr 2023 at 12:00
Sydney, Australia Fri, 7 Apr 2023 at 22:00 AEST
"Wherever There Is Light — There Are Always Shadows."
Beta Was this translation helpful? Give feedback.
All reactions