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

Reattempt proof delivery on node restart #1055

Merged
merged 11 commits into from
Aug 8, 2024
Merged

Reattempt proof delivery on node restart #1055

merged 11 commits into from
Aug 8, 2024

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Aug 1, 2024

Some of the commits in this PR refactor the code for clarity and don't modify functionality.

The overall goal of this PR is to ensure that we don't try to deliver proofs which have already been delivered. And that we reattempt proof delivery on node restart.

Related to #1009

@ffranr ffranr self-assigned this Aug 1, 2024
@dstadulis dstadulis added this to the v0.4.2 milestone Aug 6, 2024
@ffranr ffranr changed the title Modify TransferOutput.ShouldDeliverProof such that we don't retry proof deliver if complete Reattempt proof delivery on node restart Aug 6, 2024
@ffranr ffranr requested a review from jharveyb August 6, 2024 18:16
@ffranr ffranr force-pushed the retry-proof-delivery branch 3 times, most recently from 987a93e to bd73f91 Compare August 6, 2024 19:12
@ffranr ffranr requested a review from guggero August 6, 2024 19:27
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Code looks good, nice work.

Just to clarify: There will be a follow-up PR that actually addresses the issue that a transfer isn't completed (e.g. a call to ConfirmProofDelivery) while the proof transfer wasn't successful?
Or was the goal to address this here (might need some re-ordering of actions)?

tapfreighter/interface.go Outdated Show resolved Hide resolved
tapdb/assets_store.go Outdated Show resolved Hide resolved
tapfreighter/chain_porter.go Outdated Show resolved Hide resolved
tapfreighter/chain_porter.go Outdated Show resolved Hide resolved
tapfreighter/chain_porter.go Outdated Show resolved Hide resolved
tapfreighter/chain_porter.go Outdated Show resolved Hide resolved
@ffranr
Copy link
Contributor Author

ffranr commented Aug 7, 2024

Code looks good, nice work.

Just to clarify: There will be a follow-up PR that actually addresses the issue that a transfer isn't completed (e.g. a call to ConfirmProofDelivery) while the proof transfer wasn't successful? Or was the goal to address this here (might need some re-ordering of actions)?

@guggero Thanks for the review! I will put up another PR for the ConfirmProofDelivery changes.

- Set the `ProofDeliveryComplete` field in the transfer output struct
during its initialization.

- The `insertAssetTransferOutput` function now only marshals the
`ProofDeliveryComplete` status for database storage. It does not
determine the status at the time of storing in the database.

- `TransferOutput.ShouldDeliverProof` will return `false` if
`ProofDeliveryComplete == fn.Some(true)`.

- Improved logging for scenarios where proof delivery is skipped,
specifically when `out.ShouldDeliverProof()` returns `false`.
Remove inaccurate comments. Rephrase and reword comments for clarity.
Refactor to perform asset minting and node setup before subscribing to
the send notification events from the sending node. This change aims to
improve test clarity and readability.
This commit moves code into a new `ChainPorter` method called
`resumePendingParcels`.
This commit introduces a new logging method to the `ChainPorter`. The
method captures and logs transfer outputs with delivery pending proofs.
This commit adds a test which ensures that a failed attempt at
transferring a transfer output proof to a proof courier will be
reattempted by the sending tapd node upon restart.
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice, LGTM 🎉

Copy link
Collaborator

@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.

LGTM 💯

Solid clarifications & progress to the next PR. The if blocks with UnwrapOr were a bit hard to read at first but the comments cleared that up.

Needs rebase.

tapfreighter/chain_porter.go Show resolved Hide resolved
@ffranr ffranr added this pull request to the merge queue Aug 8, 2024
Merged via the queue into main with commit 1b5a4ef Aug 8, 2024
16 checks passed
@guggero guggero deleted the retry-proof-delivery branch August 8, 2024 11:14
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.

4 participants