-
Notifications
You must be signed in to change notification settings - Fork 285
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
fix: range selection in pool's getTransactions() #2952
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The logic of the previous code about returning transactions in the range [start, start + size) was flawed - transactions would be removed from the list without decrementing the counter i. For example, if: * allTransactions is t1, t2, t3, t4, t5 * t1 and t2 are invalid (wouldn't pass validateTransactions() and it would remove them from the pool) * start=1, size=2 is provided then, t4 and t5 should be returned because after dropping the invalid transactions the list becomes t3, t4, t5. But the code would wrongly return t3 and t4. Fix that by validating every transaction as it is encountered, skipping invalid ones from the counting.
vasild
requested review from
air1one,
faustbrian,
kristjank and
spkjp
as code owners
September 20, 2019 15:33
ghost
added
Complexity: Low
labels
Sep 20, 2019
Codecov Report
@@ Coverage Diff @@
## develop #2952 +/- ##
==========================================
- Coverage 68.41% 68.4% -0.01%
==========================================
Files 405 405
Lines 9832 9829 -3
Branches 509 509
==========================================
- Hits 6727 6724 -3
Misses 3065 3065
Partials 40 40
Continue to review full report at Codecov.
|
ghost
mentioned this pull request
Sep 22, 2019
…l-range-selection * ArkEcosystem/core/develop: chore: drop node 11 support (#2965) test(e2e): No need to run as root the chmod command when modifying own's files (#2958) refactor(crypto): change maximum recipients of multipayment via milestone (#2961) ci: split functional job into 1 job per type (#2963) refactor(core-p2p): make peer reply errors less verbose (#2962) fix(core-state): index recipient wallets during bootstrap (#2947) Tell git to ignore vim's temporary files (#2957) ci: force exit tests if there are hanging promises ci: use different test coverage directories for each type (#2956)
ghost
deleted the
fix-pool-range-selection
branch
September 26, 2019 00:11
vasild
added a commit
that referenced
this pull request
Sep 27, 2019
…ts-nonce * ArkEcosystem/core/develop: refactor(core-transaction-pool): don't accept expired v1 transactions (#2948) fix(core-snapshots): remove bogus skipRoundRows (#2973) feat(core-api): endpoints for locks/businesses/bridgechains (#2940) fix(core-blockchain): round deletion during rollback (#2970) fix: range selection in pool's getTransactions() (#2952) feat: expose `isValidPeer` via ajv format rule (#2960) chore: remove trailing whitespace (#2971) fix(core-transactions): update wallet nonce when applying v1 transaction (#2959) fix(core-blockchain): do not reset `noBlockCounter` when `downloadBlocks` succeeds (#2968) refactor(pool): remove unnecessary check from validateTransactions() (#2951) ci: temporarily disable pull_request.synchronize event (#2966) refactor: strengthen a nonce check in performGenericWalletChecks() (#2949) ci: setup github action workflow for e2e tests (#2964) chore: drop node 11 support (#2965) test(e2e): No need to run as root the chmod command when modifying own's files (#2958) refactor(crypto): change maximum recipients of multipayment via milestone (#2961) ci: split functional job into 1 job per type (#2963) refactor(core-p2p): make peer reply errors less verbose (#2962) fix(core-state): index recipient wallets during bootstrap (#2947) Tell git to ignore vim's temporary files (#2957) ci: force exit tests if there are hanging promises ci: use different test coverage directories for each type (#2956)
ghost
mentioned this pull request
Sep 29, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The logic of the previous code about returning transactions in the range
[start, start + size) was flawed - transactions would be removed from
the list without decrementing the counter i. For example, if:
would remove them from the pool)
then, t4 and t5 should be returned because after dropping the invalid
transactions the list becomes t3, t4, t5. But the code would wrongly
return t3 and t4.
Fix that by validating every transaction as it is encountered, skipping
invalid ones from the counting.
A summary of what changes this PR introduces and why they were made.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Does this PR release a new version?
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
develop
branch, not themaster
branchIf adding a new feature, the PR's description includes: