Skip to content

add 0.13.4 support #11

@Mohiiit

Description

@Mohiiit

Context

Stateful compression was introduced in StarkNet v0.13.4. This feature relies on data from previous blocks, making its integration non-trivial.
📖 Full details: https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257


Steps for Integration

  • Propose an Architecture
    Since stateful compression has dependencies on historical state, the architecture needs to be thoughtfully designed. Below are a few ideas:

    1. On-the-fly get_storage_at lookups
      For every key missing in the current squashed state diff, use get_storage_at (specifically for address 0x2).

      • Pros: Easy and quick to implement
      • Cons: Potentially slow, especially if there are many keys
    2. Maintain a Historical DB

      • Use block info from the blob to build a local state DB incrementally.
      • Decompress blobs using this DB.
      • Take periodic snapshots (e.g., upload/download from S3).
      • Allow updates via cron jobs or manual uploads.
      • Pros: Fast decompression once setup
      • Cons: Significant initial complexity and infra overhead
    3. Open to other proposals

  • Implement the Chosen Architecture
    Implementation will depend on the selected strategy from above.

  • Add Tests
    Validate correctness using real-world data (i.e. from mainnet or Sepolia).


Other Information

some part of the code is already being implemented here: https://github.com/Mohiiit/orch-compression

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions