madara-alliance / madara

Madara is a powerful hybrid Starknet client written in Rust.
https://madara.build
Apache License 2.0
67 stars 25 forks source link

feat(infra): Implement intelligent snapshots natively #194

Open antiyro opened 2 months ago

antiyro commented 2 months ago

Is there an existing issue?

Motivation

Currently, in Deoxys, the only way to synchronize the state is through the feeder gateway starting from block 0. This process can take several days, with or without rate limits, which can be a significant blocker for some developers. Therefore, we want to provide official pre-synced state snapshots that can be easily integrated at the node's startup.

Request

The purpose of this issue is to implement an intelligent snapshot system to enable faster synchronization by importing official pre-synced states. We would like to have a command --snap <block_number> that fetches the snapshot at the closest available height to the specified block number, downloads it to the user's defined --base-path, and decompresses it correctly with the corresponding logs.

Solution

To achieve this, we propose the following steps:

  1. Develop a command --snap <block_number> that identifies the closest available snapshot to the specified block number.
  2. Ensure the command downloads the snapshot to the path defined by the user's --base-path.
  3. Implement the functionality to decompress the snapshot correctly and log the process appropriately.

Are you willing to help with this request?

Yes!

antiyro commented 2 months ago

The snapshots will be hosted in an object storage on OVH. You can simulate that during the development of the issue.