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

Add backoff procedure to the proof courier receive procedure #637

Merged
merged 12 commits into from
Nov 2, 2023

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Oct 30, 2023

Fixes #512

This PR generalises the proof courier proof transfer backoff procedure so that it can be used for both retrieving and delivering proofs. It also extends the universe proof courier's proof retrieval functionality using the backoff handler.

@ffranr ffranr self-assigned this Oct 30, 2023
@Roasbeef Roasbeef requested a review from GeorgeTsagk October 31, 2023 00:48
tapdb/assets_store.go Outdated Show resolved Hide resolved
tapdb/sqlc/migrations/000011_transfers.up.sql Show resolved Hide resolved
proof/courier.go Outdated Show resolved Hide resolved
proof/courier.go Outdated Show resolved Hide resolved
proof/courier.go Outdated Show resolved Hide resolved
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

lgtm overall, waiting for the itest update 📫

proof/courier.go Outdated Show resolved Hide resolved
proof/courier.go Outdated Show resolved Hide resolved
@ffranr ffranr force-pushed the recev-backoff branch 2 times, most recently from c2bac16 to 74716ff Compare October 31, 2023 15:55
@ffranr
Copy link
Contributor Author

ffranr commented Oct 31, 2023

I've updated this PR and the new itest is now passing.

This PR does not add the backoff procedure to the hashmail proof courier receive process.

This PR does not add an itest to ensure that the asset is eventually correctly received by the receiving node when the universe proof courier is used. Such a test does exist for the hashmail proof courier (see testOfflineReceiverEventuallyReceives). I don't think that the lack of that test should block this PR.

@ffranr
Copy link
Contributor Author

ffranr commented Nov 1, 2023

I've made a few changes to this PR today. I've added a new RPC endpoint for subscribing to asset receive event notifications specifically.

@ffranr ffranr force-pushed the recev-backoff branch 2 times, most recently from 861f483 to d6978b3 Compare November 1, 2023 18:47
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

tapgarden/custodian.go Show resolved Hide resolved
itest/send_test.go Show resolved Hide resolved
@dstadulis dstadulis added this to the v0.3.1 milestone Nov 2, 2023
Copy link
Contributor

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

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

Looks great! Happy to have all these new reliability features in.

One bit I'm confused about is teh new ntfn channel in the custodian - I don't see additional code for actually broadcasting events on that channel, is it rebroadcasting backoff events from somewhere? I see it in the new itest but am missing how its wired up.

tapgarden/custodian.go Show resolved Hide resolved
@ffranr
Copy link
Contributor Author

ffranr commented Nov 2, 2023

One bit I'm confused about is teh new ntfn channel in the custodian - I don't see additional code for actually broadcasting events on that channel, is it rebroadcasting backoff events from somewhere? I see it in the new itest but am missing how its wired up.

@jharveyb The custodian executes

courier.SetSubscribers(c.statusEventsSubs)

And then the courier's backoff handler broadcasts events via the Exec function's subscriberEvent callback.

In other words, all we had to do to hookup the custodian was to register its subscribers with the courier.

Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

LGTM 📫

@ffranr ffranr added this pull request to the merge queue Nov 2, 2023
Merged via the queue into main with commit 263a22a Nov 2, 2023
@jharveyb jharveyb deleted the recev-backoff branch November 16, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Implement backoff procedure in universe proof courier
5 participants