Skip to content

Instant verification for the parachain relay using Fiat–Shamir#1565

Draft
yrong wants to merge 37 commits intomainfrom
ron/submitFiatShamir-relay
Draft

Instant verification for the parachain relay using Fiat–Shamir#1565
yrong wants to merge 37 commits intomainfrom
ron/submitFiatShamir-relay

Conversation

@yrong
Copy link
Contributor

@yrong yrong commented Sep 14, 2025

Context

This change introduces FiatShamir support on the relay side by adding a separate relay based on the existing parachain relay. The main changes include:

  • Instead of scanning undelivered orders in the context of light client, scan them directly against the latest BEEFY block on the Relay chain.
  • When an undelivered order is found and the attached fee is sufficient to cover the FiatShamir cost, first submit the consensus update with submitFiatShmir, followed by v2_submit with the proof derived from the latest BEEFY block in the light client.

Copy link
Contributor

@alistair-singh alistair-singh left a comment

Choose a reason for hiding this comment

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

Would we ever relay fiat shamir from the relayers given that it is 3x more expensive? I do not think we need any relayer changes here. Maybe a one shot command, that we could use in a playbook to unstuck the beefy client.

A more important relayer change is to make sure the beefy and on-demand-beefy relayer abandons a ticket if someone has successfully submitted a fiat shamir with a block greater than your tickets block.

Comment on lines +143 to +157
state, err := wr.queryBeefyClientState(ctx)
if err != nil {
return fmt.Errorf("query beefy client state: %w", err)
}

// Ignore beefy block already synced
if uint64(task.SignedCommitment.Commitment.BlockNumber) <= state.LatestBeefyBlock {
log.WithFields(log.Fields{
"validatorSetID": state.CurrentValidatorSetID,
"beefyBlock": state.LatestBeefyBlock,
"relayBlock": task.SignedCommitment.Commitment.BlockNumber,
}).Info("Beefy block already synced, just ignore")
return nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check with the light client whether this update is outdated.

@yrong
Copy link
Contributor Author

yrong commented Nov 26, 2025

Would we ever relay fiat shamir from the relayers given that it is 3x more expensive? I do not think we need any relayer changes here.

This PR is mainly intended to address a specific use case where the end user is willing to bear the full cost of both the consensus update and the message execution for time-sensitive scenarios (as mentioned by the Hydration team in the channel). In such cases, the message relay will submit the Fiat-Shamir consensus update together with the message update.

Maybe a one shot command, that we could use in a playbook to unstuck the beefy client.

Yes, we add a one shot command for submit Fiat-Shamir in this PR.

A more important relayer change is to make sure the beefy and on-demand-beefy relayer abandons a ticket if someone has successfully submitted a fiat shamir with a block greater than your tickets block.

Yes, we've added this check, as mentioned in https://github.com/Snowfork/snowbridge/pull/1565/files#r2563477732 before commitRandao and submitFinal in the previous two-phase flow.

Base automatically changed from ron/submitFiatShamir to main November 28, 2025 09:30
@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.02%. Comparing base (1cf39a2) to head (0efa2b3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1565   +/-   ##
=======================================
  Coverage   91.02%   91.02%           
=======================================
  Files          19       19           
  Lines         903      903           
  Branches      164      164           
=======================================
  Hits          822      822           
  Misses         64       64           
  Partials       17       17           
Flag Coverage Δ
solidity 91.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yrong yrong changed the title Submit Fiat-Shamir (Relay) Instant verification for the parachain relay using Fiat–Shamir Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants