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

Parachain Relayer V2 #1321

Open
wants to merge 37 commits into
base: vincent/v2
Choose a base branch
from
Open

Parachain Relayer V2 #1321

wants to merge 37 commits into from

Conversation

yrong
Copy link
Contributor

@yrong yrong commented Oct 22, 2024

Fee types.U128
Nonce uint64
BlockNumber uint32
Fee big.Int
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you use types.UCompact then you won't need to write a custom decoder.

return fmt.Errorf("get block header: %w", err)
}

proof, err := relay.beaconHeader.FetchExecutionProof(*blockHeader.ParentBeaconRoot, false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generate delivery proof

yrong added 3 commits November 4, 2024 21:22
* Update contracts for smoke tests

* Remove unused

* Decode test

* Update subxt
@yrong
Copy link
Contributor Author

yrong commented Nov 6, 2024

Smoke tests for the E2E flow work as expected.

cargo test --test v2 transfer_ena::transfer_ena::transfer_ena -- --nocapture
cargo test --test v2 transfer_pna::transfer_pna::transfer_pna -- --nocapture
image image

@yrong yrong marked this pull request as ready for review November 6, 2024 12:55
Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.44%. Comparing base (4c3b2af) to head (dec8316).
Report is 1 commits behind head on vincent/v2.

Additional details and impacted files
@@              Coverage Diff               @@
##           vincent/v2    #1321      +/-   ##
==============================================
+ Coverage       65.29%   65.44%   +0.14%     
==============================================
  Files              23       23              
  Lines             729      735       +6     
  Branches          122      123       +1     
==============================================
+ Hits              476      481       +5     
  Misses            242      242              
- Partials           11       12       +1     
Flag Coverage Δ
solidity 65.44% <ø> (+0.14%) ⬆️

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.

"golang.org/x/sync/errgroup"
)

func (relay *Relay) startDeliverProof(ctx context.Context, eg *errgroup.Group) error {
Copy link
Collaborator

@vgeddes vgeddes Jan 21, 2025

Choose a reason for hiding this comment

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

Problem here is that we're taking on the responsibility of handling all delivery proofs.

There may be multiple instances of the parachain relayer, each of which only relays messages according to different criteria. Each instance should only handle its own delivery proofs.

Instead, we know that the ethereum-writer calls wr.gateway.V2Submit() after which we have access to the delivery proof. Wouldnt it better to have this algorithm:

  1. Ethereum-writer submits message to Gateway
  2. Ethereum-writer finds receipt for completed transaction, get InboundMessageDispatched log and pushes it on queue deliveryReceipts
  3. The parachain-writer reads from the deliveryReceipts queue and submits proof to parachain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushes it on queue deliveryReceipts

@vgeddes Could you elaborate a bit more about the deliveryReceipts queue, is that on-chain storage or some kind of off-chain global storage like Redis?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would just be a go channel used to communicate within the relayer process

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.

3 participants