Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

pallet-mmr: Change runtime API and RPC API to work with block numbers instead of leaf indices #12339

@acatangiu

Description

@acatangiu

Issue

This issue was triggered by a good observation made by @serban300 in #12324 (comment):

Current pallet-mmr APIs work with leaf indices, leaving the burden of translating block numbers to leaf indices to the users of the pallet.

Light clients might have an easier experience dealing only with block numbers, and avoiding managing leaf indices and the conversion from block numbers => leaf indices.

Suggested solution

pallet-mmr could expose APIs based on block numbers and internally map those to leaf indices.

Implications

  • Breaking API change, both for Runtime API and RPC API.
  • Pallet currently only deployed on Rococo so breaking change only for that. Kusama and Polkadot will directly deploy new API.

Feedback requests

cc @vgeddes and @seunlanlege as current (light-client) users of this pallet

Metadata

Metadata

Assignees

No one assigned

    Labels

    D2-breaksapiI7-refactorCode needs refactoring.U2-some_time_soonIssue is worth doing soon.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.Z6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions