Skip to content

BEEFY Consensus Client#553

Draft
dharjeezy wants to merge 16 commits intomainfrom
dami/beefy-consensus-client
Draft

BEEFY Consensus Client#553
dharjeezy wants to merge 16 commits intomainfrom
dami/beefy-consensus-client

Conversation

@dharjeezy
Copy link
Contributor

@dharjeezy dharjeezy commented Oct 9, 2025

This pull request introduces the ismp-beefy pallet, a consensus client for ISMP designed to verify Polkadot's BEEFY finality proofs. This implementation allows ISMP to process consensus updates from BEEFY, making it possible to trustlessly verify state commitments.

@seunlanlege
Copy link
Member

seunlanlege commented Oct 9, 2025

Looks like a great start, lets get tests

@seunlanlege seunlanlege changed the title Beefy Consensus Client BEEFY Consensus Client Oct 10, 2025
@dharjeezy dharjeezy requested a review from seunlanlege October 15, 2025 09:49
Comment on lines +194 to +196
) -> Result<(), Error> {
Ok(())
}
Copy link
Member

Choose a reason for hiding this comment

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

we should support this

…/beefy-consensus-client

# Conflicts:
#	Cargo.toml
#	modules/pallets/testsuite/Cargo.toml
#	modules/pallets/testsuite/src/runtime.rs
verify fraud proof
fix tests
@dharjeezy dharjeezy requested a review from seunlanlege January 27, 2026 22:55
type Hash = [u8; 32];

fn hash(data: &[u8]) -> Self::Hash {
keccak256(data)
Copy link
Member

Choose a reason for hiding this comment

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

i think this should be generic

let mut data = [0u8; 64];
data[..32].copy_from_slice(left);
data[32..].copy_from_slice(right);
Ok(keccak256(&data))
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +79 to +80
let (state, heads_root) = verify_mmr_update_proof::<H>(trusted_state, proof.relay)?;
Ok((state.encode(), heads_root))
Copy link
Member

Choose a reason for hiding this comment

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

missing parachain header verification

Comment on lines +137 to +144
println!("\n======= VERIFIER DEBUG =======");
let target_root = if is_current_authorities {
trusted_state.current_authorities.keyset_commitment
} else {
trusted_state.next_authorities.keyset_commitment
};
println!("Target Merkle Root: {:?}", H256::from(target_root));
println!("Verifier-side calculated authority leaf hashes:");
Copy link
Member

Choose a reason for hiding this comment

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

remove println

Comment on lines +149 to +154
let k256_sig = K256Signature::from_slice(&sig.signature[0..64])
.map_err(|_| Error::InvalidSignatureFormat)?;

let recovered_verifying_key =
VerifyingKey::recover_from_prehash(commitment_hash.as_ref(), &k256_sig, recovery_id)
.map_err(|_| Error::FailedToRecoverPublicKey)?;
Copy link
Member

Choose a reason for hiding this comment

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

make generic

Comment on lines +126 to +131
if !Parachains::<T>::contains_key(para_header.para_id) {
Err(Error::Custom(format!(
"Parachain with id {} not registered",
para_header.para_id
)))?
}
Copy link
Member

Choose a reason for hiding this comment

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

skip instead

Copy link
Member

Choose a reason for hiding this comment

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

also why are we using ismp_parachain storage?

…/beefy-consensus-client

# Conflicts:
#	modules/pallets/testsuite/Cargo.toml
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.

2 participants