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

test(core-transaction-pool): increase coverage to 100% #3553

Merged
merged 48 commits into from Mar 9, 2020

Conversation

@rainydio
Copy link
Contributor

rainydio commented Feb 29, 2020

Summary

In addition to tests there are changes that are fixing various issues that were discovered.

Transaction has expired error

Previously it reported how many blocks ago transaction expired. But when transaction is entering the pool its expiration is checked against next height. So when current height is 100 and transaction expiration is set to 101 it is considered expired and cannot enter. It's unclear how to report blocks ago in such case. I changed error message to report expiration height instead of how many blocks ago it expired.

Sender state race condition

Although hypothetical it was possible to cause races due to async nature of transaction handler. Now sener's transactions are acquiring lock while applying or manipulating stored transactions array.

Error during revert and in-flight transactions

If error was raised during revert (should not happen) transactions that were waiting for lock to release cannot be applied anymore. State is considered corrupted, there isn't much that can be done with it. Any transactions that were waiting for lock to release will raise an error.

Mempool

Sender state was split into two classes SenderState that has only apply and revert functions and also performs transaction related checks and SenderMempool that keeps list of applied transactions and performs sender related checks. Memory was renamed into Mempool.

Fixes #3482

Checklist

  • Collator
  • Dynamic fee matcher
  • Errors
  • Expiration service
  • Mempool
  • Processor
  • Query
  • Sender mempool
  • Sender state
  • Service
  • Storage
  • Utils
  • Functional tests
@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 29, 2020

Codecov Report

Merging #3553 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3553   +/-   ##
========================================
  Coverage    66.86%   66.86%           
========================================
  Files          448      448           
  Lines        10181    10181           
  Branches      1322     1322           
========================================
  Hits          6808     6808           
  Misses        3351     3351           
  Partials        22       22           

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 77646c1...77646c1. Read the comment docs.

@faustbrian

This comment has been minimized.

Copy link
Collaborator

faustbrian commented Feb 29, 2020

faustbrian and others added 3 commits Feb 29, 2020
…core into test/core-transaction-pool
@faustbrian faustbrian changed the title test(core-transaction-pool): Increase test coverage of core-transaction-pool to 100% test(core-transaction-pool): increase coverage to 100% Mar 1, 2020
rainydio and others added 16 commits Mar 2, 2020
…core into test/core-transaction-pool
rainydio and others added 18 commits Mar 5, 2020
…core into test/core-transaction-pool
@faustbrian faustbrian marked this pull request as ready for review Mar 9, 2020
@faustbrian faustbrian merged commit 462314a into develop Mar 9, 2020
25 checks passed
25 checks passed
lint (12.x)
Details
lint (12.x)
Details
test-unit (12.x)
Details
test-integration (12.x)
Details
test-functional-bridgechain-registration (12.x)
Details
test-functional-bridgechain-resignation (12.x)
Details
test-functional-bridgechain-update (12.x)
Details
test-functional-business-registration (12.x)
Details
test-functional-business-resignation (12.x)
Details
test-functional-business-update (12.x)
Details
test-functional-delegate-registration (12.x)
Details
test-functional-delegate-resignation (12.x)
Details
test-functional-htlc-claim (12.x)
Details
test-functional-htlc-lock (12.x)
Details
test-functional-htlc-refund (12.x)
Details
test-functional-ipfs (12.x)
Details
test-functional-multi-payment (12.x)
Details
test-functional-multi-signature-registration (12.x)
Details
test-functional-second-signature-registration (12.x)
Details
test-functional-transfer (12.x)
Details
test-functional-vote (12.x)
Details
benchmark (12.x)
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
codecov/patch Coverage not affected when comparing 77646c1...77646c1
Details
codecov/project 66.86% (+0.00%) compared to 77646c1
Details
@ArkEcosystemBot ArkEcosystemBot deleted the test/core-transaction-pool branch Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.