Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2ccf7c0
histor. batch proof: make best block arg optional
Lederstrumpf Oct 17, 2022
019d5cd
correct testing range
Lederstrumpf Oct 17, 2022
deb12a4
make generate_batch_proof stub for historical
Lederstrumpf Oct 18, 2022
5ffff01
merge generate_{historical_}batch_proof functions
Lederstrumpf Oct 18, 2022
ed0f1fa
merge generate_{batch_}proof functions
Lederstrumpf Oct 18, 2022
0730e9a
merge verify_{batch_}proof functions
Lederstrumpf Oct 18, 2022
e617095
merge verify_{batch_}proof_stateless functions
Lederstrumpf Oct 18, 2022
f08f6f0
remove {Leaf}Proof
Lederstrumpf Oct 19, 2022
2657723
rename BatchProof->Proof
Lederstrumpf Oct 19, 2022
f0454e5
cleanup
Lederstrumpf Oct 19, 2022
e77bcd9
expose verify_proof rpc api
Lederstrumpf Nov 6, 2022
1c599ef
document verify_proof
Lederstrumpf Nov 6, 2022
159712e
expose verify_proof_stateless rpc api
Lederstrumpf Nov 6, 2022
d576d3a
add optional BlockHash to mmr_root rpc api
Lederstrumpf Nov 7, 2022
087c77e
fixup! expose verify_proof rpc api
Lederstrumpf Nov 7, 2022
39f3676
fix documentation phrasing
Lederstrumpf Nov 7, 2022
212161d
documentation grammar
Lederstrumpf Nov 7, 2022
5ae856a
Merge remote-tracking branch 'origin/master' into consolidate-and-ded…
Nov 8, 2022
d5f4cf7
define mmr error msgs together with error enum
Lederstrumpf Nov 8, 2022
a7069fd
fixup! define mmr error msgs together with error enum
Lederstrumpf Nov 8, 2022
63d7694
map decoding errors to CallError::InvalidParams
Lederstrumpf Nov 8, 2022
95aa689
fixup! map decoding errors to CallError::InvalidParams
Lederstrumpf Nov 8, 2022
bfaaa06
Merge remote-tracking branch 'origin/master' into consolidate-and-ded…
Nov 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
documentation grammar
Co-authored-by: Adrian Catangiu <adrian@parity.io>
  • Loading branch information
Lederstrumpf and acatangiu committed Nov 7, 2022
commit 212161d5cddf041060025b8ded705cd266c51546
8 changes: 4 additions & 4 deletions frame/merkle-mountain-range/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Generate an MMR proof for the given `block_numbers`.
///
/// This method calls into a runtime with MMR pallet included and attempts to generate
/// a MMR proof for the set of blocks that have the given `block_numbers` with MMR given the
/// an MMR proof for the set of blocks that have the given `block_numbers` with the MMR root at
/// `best_known_block_number`. `best_known_block_number` must be larger than all the
/// `block_numbers` for the function to succeed.
///
Expand All @@ -111,7 +111,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Verify an MMR `proof`.
///
/// This method calls into a runtime with MMR pallet included and attempts to verify
/// a MMR proof.
/// an MMR proof.
///
/// Returns `true` if the proof is valid, else returns the verification error.
#[method(name = "mmr_verifyProof")]
Expand All @@ -120,7 +120,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
/// Verify an MMR `proof` statelessly given an `mmr_root`.
///
/// This method calls into a runtime with MMR pallet included and attempts to verify
/// a MMR proof against a provided mmr root.
/// an MMR proof against a provided MMR root.
///
/// Returns `true` if the proof is valid, else returns the verification error.
#[method(name = "mmr_verifyProofStateless")]
Expand Down Expand Up @@ -236,7 +236,7 @@ where
}
}

/// Converts a mmr-specific error into a [`CallError`].
/// Converts an mmr-specific error into a [`CallError`].
fn mmr_error_into_rpc_error(err: MmrError) -> CallError {
let data = format!("{:?}", err);
match err {
Expand Down
8 changes: 4 additions & 4 deletions frame/merkle-mountain-range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! Details on Merkle Mountain Ranges (MMRs) can be found here:
//! <https://github.com/mimblewimble/grin/blob/master/doc/mmr.md>
//!
//! The MMR pallet constructs a MMR from leaf data obtained on every block from
//! The MMR pallet constructs an MMR from leaf data obtained on every block from
//! `LeafDataProvider`. MMR nodes are stored both in:
//! - on-chain storage - hashes only; not full leaf content)
//! - off-chain storage - via Indexing API we push full leaf content (and all internal nodes as
Expand Down Expand Up @@ -50,7 +50,7 @@
//!
//! Secondary use case is to archive historical data, but still be able to retrieve them on-demand
//! if needed. For instance if parent block hashes are stored in the MMR it's possible at any point
//! in time to provide a MMR proof about some past block hash, while this data can be safely pruned
//! in time to provide an MMR proof about some past block hash, while this data can be safely pruned
//! from on-chain storage.
//!
//! NOTE This pallet is experimental and not proven to work in production.
Expand Down Expand Up @@ -103,7 +103,7 @@ pub trait WeightInfo {
fn on_initialize(peaks: NodeIndex) -> Weight;
}

/// A MMR specific to the pallet.
/// An MMR specific to the pallet.
type ModuleMmr<StorageType, T, I> = mmr::Mmr<StorageType, T, I, LeafOf<T, I>>;

/// Leaf data.
Expand Down Expand Up @@ -381,7 +381,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Ok(leaf_idx)
}

/// Generate a MMR proof for the given `block_numbers`.
/// Generate an MMR proof for the given `block_numbers`.
/// If `best_known_block_number = Some(n)`, this generates a historical proof for
/// the chain with head at height `n`.
/// Else it generates a proof for the MMR at the current block height.
Expand Down
2 changes: 1 addition & 1 deletion frame/merkle-mountain-range/src/mmr/mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ where
.map_err(|e| Error::Verify.log_debug(e))
}

/// A wrapper around a MMR library to expose limited functionality.
/// A wrapper around an MMR library to expose limited functionality.
///
/// Available functions depend on the storage kind ([Runtime](crate::mmr::storage::RuntimeStorage)
/// vs [Off-chain](crate::mmr::storage::OffchainStorage)).
Expand Down
2 changes: 1 addition & 1 deletion frame/merkle-mountain-range/src/mmr/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! A MMR storage implementations.
//! An MMR storage implementation.

use codec::Encode;
use frame_support::log::{debug, error, trace};
Expand Down
2 changes: 1 addition & 1 deletion primitives/beefy/src/mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub struct MmrLeaf<BlockNumber, Hash, MerkleRoot, ExtraData> {
pub leaf_extra: ExtraData,
}

/// A MMR leaf versioning scheme.
/// An MMR leaf versioning scheme.
///
/// Version is a single byte that constist of two components:
/// - `major` - 3 bits
Expand Down
2 changes: 1 addition & 1 deletion primitives/merkle-mountain-range/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl_leaf_data_for_tuple!(A:0, B:1, C:2);
impl_leaf_data_for_tuple!(A:0, B:1, C:2, D:3);
impl_leaf_data_for_tuple!(A:0, B:1, C:2, D:3, E:4);

/// A MMR proof data for a group of leaves.
/// An MMR proof data for a group of leaves.
#[derive(codec::Encode, codec::Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)]
pub struct Proof<Hash> {
/// The indices of the leaves the proof is for.
Expand Down