-
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
refactor: strengthen a nonce check in performGenericWalletChecks() #2949
Conversation
vasild
commented
Sep 20, 2019
In TransactionHandler.performGenericWalletChecks() we would only check if the transaction's nonce is greater than the sender wallet nonce. The check should be not just greater, but exactly sender wallet nonce plus one. Also, move multiplicated code into two methods and use those methods.
f2bf499
to
7052f9a
Compare
LGTM. Just need to sort out the failing tests. |
Codecov Report
@@ Coverage Diff @@
## develop #2949 +/- ##
===========================================
+ Coverage 68.31% 68.41% +0.09%
===========================================
Files 405 405
Lines 9826 9818 -8
Branches 464 462 -2
===========================================
+ Hits 6713 6717 +4
+ Misses 3077 3065 -12
Partials 36 36
Continue to review full report at Codecov.
|
This change revealed a flaw in the code: if we receive more than one transaction for addition in the pool, in There are a few solutions:
|
Later throwIfCannotBeApplied() is called from the pool's Connection.addTransaction().
…hen-nonce-check * ArkEcosystem/core/develop: ci: force exit tests if there are hanging promises ci: use different test coverage directories for each type (#2956)
We could also apply the transactions on a temporary wallet manager, but given that we already call apply (on the pool wallet manager) at the end of the processor, removing the check completely should also be fine. |
Codecov Report
@@ Coverage Diff @@
## develop #2949 +/- ##
==========================================
Coverage ? 68.39%
==========================================
Files ? 405
Lines ? 9827
Branches ? 465
==========================================
Hits ? 6721
Misses ? 3070
Partials ? 36
Continue to review full report at Codecov.
|
…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)