Skip to content

[runtime]: Uncle proofs in pallet-beefy-consensus-proofs#802

Open
dharjeezy wants to merge 13 commits intomainfrom
dami/uncle-proofs
Open

[runtime]: Uncle proofs in pallet-beefy-consensus-proofs#802
dharjeezy wants to merge 13 commits intomainfrom
dami/uncle-proofs

Conversation

@dharjeezy
Copy link
Copy Markdown
Contributor

@dharjeezy dharjeezy commented Apr 28, 2026

This PR adds uncle proofs so multiple independent SP1 provers can race for the same target and all get paid, with a decreasing reward curve so the fastest still wins the largest share. Naive proofs are testnet-only with zero reward, so uncles apply to SP1 only.

submit_proof is now a signed extrinsic. The signer is the reward payee. Successful proofs return Pays::No (fee refunded along with the reward); failed proofs pay the fee, which is the spam deterrent. The old ValidateUnsigned path with hand-rolled SR25519 signing is gone.

closes #798

@dharjeezy dharjeezy requested a review from seunlanlege April 28, 2026 13:24
Comment thread modules/pallets/beefy-consensus-proofs/src/lib.rs Outdated
@seunlanlege
Copy link
Copy Markdown
Member

I think its a good idea to have some simnode tests with naive beefy to validate this behaviour

@dharjeezy dharjeezy requested a review from seunlanlege April 29, 2026 11:23
Comment thread modules/pallets/beefy-consensus-proofs/src/lib.rs Outdated
@seunlanlege
Copy link
Copy Markdown
Member

seunlanlege commented Apr 29, 2026

Looking good, 2 things

  • Lets use a boundedvec for proof size so its rejected at txpool not at block execution
  • simnode should construct multiple proofs so we test the uncle proofs

@dharjeezy dharjeezy requested a review from seunlanlege April 29, 2026 18:20
@seunlanlege seunlanlege marked this pull request as ready for review April 30, 2026 13:54
Comment thread modules/pallets/beefy-consensus-proofs/src/lib.rs Outdated
@seunlanlege seunlanlege changed the title [pallet-beefy-consensus-proofs]: Uncle proofs [runtime]: Uncle proofs in pallet-beefy-consensus-proofs Apr 30, 2026
@seunlanlege
Copy link
Copy Markdown
Member

So essentially anyone can copy a proof, add some byte padding and it would still succeed? @dharjeezy we need to prevent this actually.

Either by ensuring decoding consumes all bytes, or re-encoding to abi before hashing to ensure proof uniqueness

…-trip, and reject set_reward_curve entries where numerator > denominator.
abi_payload,
)
.map_err(|_| Error::<T>::AbiDecodeFailed)?;
if <ismp_solidity_abi::sp1_beefy::SP1Beefy::SP1BeefyProof as SolType>::abi_encode_params(&p)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

better to use the abi encoding to compute the proof hash instead

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.

[pallet-beefy-consensus-proofs]: Uncle proofs

3 participants