substrate icon indicating copy to clipboard operation
substrate copied to clipboard

pallet-mmr: Consolidate/deduplicate methods in runtime API and RPC API

Open serban300 opened this issue 3 years ago • 3 comments

Since we're changing the pallet-mmr runtime & RPC APIs as part of #12339 it's a good opportunity to revisit some other decisions related to the API:

  1. Whether we should have 2 separate methods generate_batch_proof() and generate_historical_batch_proof(). Since in the end generate_batch_proof() is a special case of generate_historical_batch_proof(). See the discussion here: https://github.com/paritytech/substrate/pull/12324#discussion_r976692621
  2. If we should keep generate_proof(), verify_proof(), and verify_proof_stateless() since all these can be done via batching methods (e.g. generate_batch_proof(), etc)

cc: @acatangiu @Lederstrumpf @svyatonik

serban300 avatar Sep 30 '22 08:09 serban300

I agree with unifying all, but drop "batching" or "historical" from new "universal" API name, should be simple generate_proof(), verify_proof(), and verify_proof_stateless() with optional extra params. Documentation should also be very clear to explain specific param combinations.

acatangiu avatar Oct 03 '22 07:10 acatangiu

I agree with unifying all, but drop "batching" or "historical" from new "universal" API name, should be simple generate_proof(), verify_proof(), and verify_proof_stateless() with optional extra params. Documentation should also be very clear to explain specific param combinations.

ditto: I support unification, and if unified, then batching & historical qualifiers are superfluous and should be dropped.

Lederstrumpf avatar Oct 03 '22 08:10 Lederstrumpf

Sounds good ! I also agree with this naming scheme.

serban300 avatar Oct 03 '22 08:10 serban300