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

Second mempool, small refactoring #929

Merged
merged 4 commits into from
Jul 11, 2022

Conversation

nibhar
Copy link
Member

@nibhar nibhar commented Jul 11, 2022

  • Move MempoolState and MempoolTransactions alongside their additional types to their own files
  • Unify MempoolExecutor and ControlMempoolExecutor into a single MempoolExecutor struct that is instantiated two times
  • Remove some duplicated code

The first commit moving the code does not change any logic for an easier reviewing process.

@nibhar nibhar requested a review from viquezclaudio July 11, 2022 14:11
@nibhar nibhar self-assigned this Jul 11, 2022
@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #929 (8c2a455) into viquezcl/second_mempool (df8fd9d) will decrease coverage by 0.07%.
The diff coverage is 81.02%.

@@                     Coverage Diff                     @@
##           viquezcl/second_mempool     #929      +/-   ##
===========================================================
- Coverage                    64.31%   64.24%   -0.08%     
===========================================================
  Files                          357      359       +2     
  Lines                        42329    42257      -72     
===========================================================
- Hits                         27222    27146      -76     
- Misses                       15107    15111       +4     
Flag Coverage Δ
unittests 64.24% <81.02%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mempool/src/lib.rs 100.00% <ø> (ø)
mempool/src/mempool_metrics.rs 59.09% <ø> (ø)
mempool/src/verify.rs 65.67% <ø> (ø)
mempool/src/mempool_state.rs 68.75% <68.75%> (ø)
mempool/src/mempool_transactions.rs 92.38% <92.38%> (ø)
mempool/src/mempool.rs 73.62% <97.72%> (-1.41%) ⬇️
mempool/src/executor.rs 94.23% <100.00%> (+1.09%) ⬆️
network-mock/src/network.rs 78.75% <0.00%> (-2.25%) ⬇️
network-mock/src/lib.rs 50.84% <0.00%> (-1.70%) ⬇️
blockchain/src/chain_store.rs 75.14% <0.00%> (-0.90%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df8fd9d...8c2a455. Read the comment docs.

@viquezclaudio viquezclaudio merged commit a6a699e into viquezcl/second_mempool Jul 11, 2022
@viquezclaudio viquezclaudio deleted the sebastian/second_mempool branch July 11, 2022 16:40
viquezclaudio pushed a commit that referenced this pull request Jul 11, 2022
* Move some structs to their own modules

All logic remains unchanged, this commit only moves code around.

* Only use a single MempoolExecutor by using generic Topic

* Add private fn start_executor and reuse where applicable

* Move expired_transactions function to MempoolState
viquezclaudio pushed a commit that referenced this pull request Jul 11, 2022
* Move some structs to their own modules

All logic remains unchanged, this commit only moves code around.

* Only use a single MempoolExecutor by using generic Topic

* Add private fn start_executor and reuse where applicable

* Move expired_transactions function to MempoolState
viquezclaudio pushed a commit that referenced this pull request Jul 12, 2022
* Move some structs to their own modules

All logic remains unchanged, this commit only moves code around.

* Only use a single MempoolExecutor by using generic Topic

* Add private fn start_executor and reuse where applicable

* Move expired_transactions function to MempoolState
viquezclaudio pushed a commit that referenced this pull request Jul 13, 2022
* Move some structs to their own modules

All logic remains unchanged, this commit only moves code around.

* Only use a single MempoolExecutor by using generic Topic

* Add private fn start_executor and reuse where applicable

* Move expired_transactions function to MempoolState
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