From 4503a722da60beb30f928955d4b86db8675e33e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 9 Aug 2021 13:39:50 +0200 Subject: [PATCH] Clarify how `ApiId` is being generated (#9519) * Clarify how `ApiId` is being generated * Clarify more --- substrate/primitives/version/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/substrate/primitives/version/src/lib.rs b/substrate/primitives/version/src/lib.rs index b3ddb7d7fe..da2cb342d2 100644 --- a/substrate/primitives/version/src/lib.rs +++ b/substrate/primitives/version/src/lib.rs @@ -98,6 +98,11 @@ pub mod embed; pub use sp_version_proc_macro::runtime_version; /// The identity of a particular API interface that the runtime might provide. +/// +/// The id is generated by hashing the name of the runtime api with BLAKE2 using a hash size +/// of 8 bytes. +/// +/// The name of the runtime api is the name of the trait when using `decl_runtime_apis!` macro. pub type ApiId = [u8; 8]; /// A vector of pairs of `ApiId` and a `u32` for version.