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

feat: lpmessage: Correct message sending #11467

Merged
merged 4 commits into from
Nov 30, 2023

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Nov 29, 2023

Related Issues

Proposed Changes

This PR improves the lotus-provider message sender to handle failed message pushes correctly. Without this patch any failed message push (due to push error, network error between lotus and lotus-provider, etc..) would cause us to never send a message at the failed nonce, causing nonce gaps - essentially making it impossible to send more messages from that address without manual intervention to fix that issue.

Here we add a mechanism where:

  • The message sender (lpmessage) now creates a Send task - harmonydb will make sure that this task will get executed
    • Sending can't fail in the middle now - harmony will retry
  • There is a cluster-wide locking mechanism making sure that we don't ever try to do more than one send in parallel per address
    • This resembles what we do in raft-clustered lotus where all sends are sequenced by the leader - but here we don't need a leader
    • Locks don't automatically expire, they can only be dropped after we fully finish related send tasks - if a task runner fails in the middle, harmony will retry the task, and the task will be able to reclaim the send lock and finish the process.

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@magik6k magik6k requested a review from a team as a code owner November 29, 2023 15:38
@magik6k magik6k requested review from Stebalien and aarshkshah1992 and removed request for a team November 29, 2023 15:38
provider/lpmessage/sender.go Outdated Show resolved Hide resolved
provider/lpmessage/sender.go Show resolved Hide resolved
provider/lpmessage/sender.go Show resolved Hide resolved
@magik6k magik6k merged commit 20d3b26 into feat/sturdypost Nov 30, 2023
85 of 89 checks passed
@magik6k magik6k deleted the feat/correct-lp-message-send branch November 30, 2023 18:18
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.

2 participants