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

mempool: add txs from Update to cache #2882

Merged
merged 2 commits into from Nov 20, 2018

Conversation

melekes
Copy link
Contributor

@melekes melekes commented Nov 19, 2018

Fixes #2855

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@codecov-io
Copy link

codecov-io commented Nov 19, 2018

Codecov Report

Merging #2882 into develop will increase coverage by 0.06%.
The diff coverage is 94.11%.

@@             Coverage Diff             @@
##           develop    #2882      +/-   ##
===========================================
+ Coverage     62.1%   62.16%   +0.06%     
===========================================
  Files          212      212              
  Lines        17288    17293       +5     
===========================================
+ Hits         10736    10750      +14     
+ Misses        5647     5635      -12     
- Partials       905      908       +3
Impacted Files Coverage Δ
mempool/mempool.go 77.96% <94.11%> (+0.15%) ⬆️
libs/events/events.go 93.2% <0%> (-4.86%) ⬇️
privval/ipc_server.go 67.92% <0%> (-1.89%) ⬇️
node/id.go 0% <0%> (ø) ⬆️
evidence/reactor.go 62.62% <0%> (+1.57%) ⬆️
consensus/reactor.go 67.09% <0%> (+1.61%) ⬆️

@melekes melekes self-assigned this Nov 19, 2018
@@ -163,6 +163,18 @@ func TestMempoolFilters(t *testing.T) {
}
}

func TestMempoolUpdate(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps rename to TestMempoolUpdate_cache, or something to that extent. From the name, I thought it was going to test that update removed the tx from the mempool list itself.

Copy link
Contributor

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

lgtm!

- rename filterTxs to removeTxs
- move txsMap into removeTxs func
- rename goodTxs to txsLeft
We should add txs that come in from mempool.Update to the mempool's
cache, so that they never hit a potentially expensive check tx.

Originally posted by @ValarDragon in #2846
#2846 (comment)

Refs #2855
@melekes melekes force-pushed the 2855-add-txs-from-update-to-cache branch from 5598fe3 to 3c8d893 Compare November 20, 2018 06:27
@melekes melekes merged commit 2d525bf into develop Nov 20, 2018
@melekes melekes deleted the 2855-add-txs-from-update-to-cache branch November 20, 2018 06:47
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.

None yet

3 participants