Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inter link between para block and relay blocks #187

Open
hackfisher opened this issue Apr 2, 2022 · 0 comments
Open

Inter link between para block and relay blocks #187

hackfisher opened this issue Apr 2, 2022 · 0 comments

Comments

@hackfisher
Copy link
Contributor

Follow-up suggestions for improving some parachain related functions.

In Polkadot, you can often see some parainclusion (CandidateIncluded) events, which record that a parachain block para_block is included by the relay chain. For this para_block, there are some relay chain related blocks, including relay_parent, backed_relay_block, included_relay_block, you can Consider doing some association via hyperlinks. (It happens that the parachain bridge also needs to do a related data, maybe use subquery indexing)

  • It is recommended that the parachain display para_id, or make some associations between para_id and its related parachain block header hashes in some Polkadot events.

  • Reverse para chain -> relay chain can also be linked and displayed, consider referring to this subql: Add parachain subql darwinia-network/bridger#437

/// A unique descriptor of the candidate receipt.
#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug)]
#[cfg_attr(feature = "std", derive(Hash, MallocSizeOf))]
pub struct CandidateDescriptor<H = Hash> {
	/// The ID of the para this is a candidate for.
	pub para_id: Id,
	/// The hash of the relay-chain block this is executed in the context of.
	pub relay_parent: H,
	/// The collator's sr25519 public key.
	pub collator: CollatorId,
	/// The blake2-256 hash of the persisted validation data. This is extra data derived from
	/// relay-chain state which may vary based on bitfields included before the candidate.
	/// Thus it cannot be derived entirely from the relay-parent.
	pub persisted_validation_data_hash: Hash,
	/// The blake2-256 hash of the PoV.
	pub pov_hash: Hash,
	/// The root of a block's erasure encoding Merkle tree.
	pub erasure_root: Hash,
	/// Signature on blake2-256 of components of this receipt:
	/// The parachain index, the relay parent, the validation data hash, and the `pov_hash`.
	pub signature: CollatorSignature,
	/// Hash of the para header that is being generated by this candidate.
	pub para_head: Hash,
	/// The blake2-256 hash of the validation code bytes.
	pub validation_code_hash: ValidationCodeHash,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant