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

pm: clear senderNonces once their recipientRand has expired #1526

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

kyriediculous
Copy link
Contributor

@kyriediculous kyriediculous commented May 30, 2020

What does this pull request do? Explain your changes. (required)
Relevant commit abb37d7

This PR creates a watchdog to clear senderNonces from the recipient.senderNonces map.

The watchdog will subscribe to new block events from the TimeManager, each time a new block is seen we'll loop through the senderNonces map and remove the recipientRand if it has expired (is past its ParamExpirationBlock

Specific updates (required)

  • Altered recipient.senderNonces map to take in struct{nonce uint32; expirationBlock *big.Int}
  • removed clearSenderNonce method
  • created senderNoncesCleanupLoop() method that is started on a go routine when calling recipient.Start()

How did you test each of these updates (required)
Added a unit test and ran it

Does this pull request close any open issues?
Fixes #1498

Checklist:

  • README and other documentation updated
  • Node runs in OSX and devenv
  • All tests in ./test.sh pass

@kyriediculous kyriediculous changed the title Nv/clear sendernonces pm: clear senderNonces once their recipientRand has expired May 30, 2020
@yondonfu
Copy link
Member

yondonfu commented Jun 1, 2020

Looks like this PR currently contains a bunch of commits from other branches. Can we cleanup the commit history so that only the relevant commits for this feature are in the PR?

@kyriediculous
Copy link
Contributor Author

Since #1495 seems pretty close I'll just wait until that one is rebased and then rebase this one on top as well if that's okay.

@kyriediculous
Copy link
Contributor Author

This PR is now a single commit

Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from nv/rework-sendermonitor to master June 24, 2020 02:28
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.

Clear sendernonces after TicketParams expire
2 participants