Skip to content

Conversation

@dharjeezy
Copy link
Contributor

This PR introduces a dedicated system for verifying Hyperbridge parachain proofs submitted via inherents and subsequently emitting an EVM-compatible log through pallet-revive.

The primary goal is to provide a standalone mechanism for verifying Hyperbridge consensus updates directly within the runtime while maintaining compatibility with the relayers and indexer that expects EVM log events (specifically StateMachineUpdated). Existing ISMP mechanisms were deemed unsuitable as we needed this inherent and inherent handler to reside upstream (in Polkadot SDK) without depending on ISMP pallets.

Implementation Details:

  1. hyperbridge-ismp-parachain:

    • A new pallet responsible for verifying Hyperbridge parachain proofs via an inherent.
    • Implements the InherentHandler trait that resides in pallet-revive for processing system log message so as to emit EVM log events.
  2. hyperbridge-ismp-parachain-inherent:

    • A new inherent data provider crate.
    • Defines the HyperbridgeVerifierApi runtime API trait to allow querying the runtime for the HyperbridgeParaId and current_relay_chain_state.
    • Provides the HyperbridgeConsensusProof data under the INHERENT_IDENTIFIER (b"hypbridg").

    companion
    introduce inherent handler in pallet revive paritytech/polkadot-sdk#10140

DigestItem::PreRuntime(consensus_engine_id, value)
if *consensus_engine_id == AURA_ENGINE_ID =>
{
if let Ok(slot) = Slot::decode(&mut &value[..]) {
Copy link
Member

Choose a reason for hiding this comment

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

lets use the timestamp digest

let topic_0_hash = keccak_256(b"StateMachineUpdated(bytes32,bytes)");
let topic_0: H256 = H256::from(topic_0_hash);

let topic_1_hash = keccak_256(b"hyperbridge_state_machine");
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this second topic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i was thinking to tag it specifically as a hyperbridge state machine event, but yeah, seems redundant

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

Successfully merging this pull request may close these issues.

4 participants