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

pallet-mmr: RPC API and Runtime API work with block numbers #12345

Merged
merged 65 commits into from
Oct 13, 2022

Conversation

Szegoo
Copy link
Contributor

@Szegoo Szegoo commented Sep 24, 2022

Closes: #12339

Polkadot companion: paritytech/polkadot#6072

@Szegoo
Copy link
Contributor Author

Szegoo commented Sep 24, 2022

WIP

@Szegoo Szegoo changed the title pallet-mmr: RPC API works with block_numbers pallet-mmr: RPC API works with block numbers Sep 24, 2022
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's first get some feedback on if/how we want to do it in #12339 before working on PR

client/beefy/src/lib.rs Outdated Show resolved Hide resolved
bin/node/runtime/src/lib.rs Outdated Show resolved Hide resolved
frame/merkle-mountain-range/src/lib.rs Outdated Show resolved Hide resolved
frame/merkle-mountain-range/src/lib.rs Outdated Show resolved Hide resolved
@acatangiu acatangiu added the A3-in_progress Pull request is in progress. No review needed at this stage. label Sep 27, 2022
@Szegoo
Copy link
Contributor Author

Szegoo commented Sep 28, 2022

@acatangiu I have changed the runtime API, could you PTAL?

@Szegoo Szegoo requested a review from acatangiu October 7, 2022 16:37
frame/merkle-mountain-range/rpc/src/lib.rs Show resolved Hide resolved
frame/merkle-mountain-range/rpc/src/lib.rs Outdated Show resolved Hide resolved
frame/merkle-mountain-range/src/tests.rs Outdated Show resolved Hide resolved
frame/merkle-mountain-range/src/tests.rs Outdated Show resolved Hide resolved
frame/merkle-mountain-range/src/tests.rs Outdated Show resolved Hide resolved
frame/merkle-mountain-range/src/tests.rs Outdated Show resolved Hide resolved
@acatangiu acatangiu added A0-please_review Pull request needs code review. B3-apinoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit D2-breaksapi D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. and removed A3-in_progress Pull request is in progress. No review needed at this stage. E5-breaksapi labels Oct 11, 2022
@acatangiu acatangiu changed the title pallet-mmr: RPC API works with block numbers pallet-mmr: RPC API and Runtime API work with block numbers Oct 11, 2022
@Szegoo Szegoo requested a review from serban300 October 11, 2022 14:00
Copy link
Contributor

@serban300 serban300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Thank you for the contribution ! @Lederstrumpf could you PTAL ?

Copy link
Contributor

@Lederstrumpf Lederstrumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack - thanks for contribution! :)

@Lederstrumpf
Copy link
Contributor

bot merge

@paritytech-processbot
Copy link

Error: "Check reviews" status is not passing for paritytech/polkadot#6072

@acatangiu
Copy link
Contributor

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 1f39c90 into paritytech:master Oct 13, 2022
@yrong yrong mentioned this pull request Feb 16, 2023
2 tasks
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…ch#12345)

* pallet-mmr: RPC API works with block_numbers

* fixes

* update rpc

* fmt

* final touches in the rpc

* temporary fix

* fix

* fmt

* docs

* Update lib.rs

* use NumberFor

* validate input

* update runtime

* convert block_number to u64

* small edit

* update runtime api

* test fix

* runtime fix

* update test function

* fmt

* fix nits

* remove block_num_to_leaf_index from runtime api

* Update frame/merkle-mountain-range/src/lib.rs

Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>

* fix tests

* get the code to compile after merge

* get the tests to compile

* fix in tests?

* fix test

* Update frame/merkle-mountain-range/src/tests.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update frame/merkle-mountain-range/src/lib.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update primitives/merkle-mountain-range/src/lib.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* fix errors & nits

* change block_num_to_leaf_index

* don't make any assumptions

* Update frame/merkle-mountain-range/src/tests.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update frame/merkle-mountain-range/src/tests.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* Update frame/merkle-mountain-range/src/tests.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* fix

* small fix

* use best_known_block_number

* best_known_block_number instead of leaves_count

* more readable?

* remove warning

* Update frame/merkle-mountain-range/src/lib.rs

Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>

* simplify

* update docs

* nits

* fmt & fix

* merge fixes

* fix

* small fix

* docs & nit fixes

* Nit fixes

* remove leaf_indices_to_block_numbers()

* fmt

Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D2-breaksapi D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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