Skip to content

feat: initial nonce implementation #2573

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

Merged
merged 33 commits into from
May 22, 2019
Merged

feat: initial nonce implementation #2573

merged 33 commits into from
May 22, 2019

Conversation

spkjp
Copy link
Contributor

@spkjp spkjp commented May 13, 2019

Summary

Initial implementation of #2086.

What kind of change does this PR introduce?

  • Bugfix
  • New feature
  • Refactoring / Performance Improvements
  • Build-related changes
  • Documentation
  • Tests / Continuous Integration
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Does this PR release a new version?

  • Yes
    • All tests are passing
    • All benchmarks are passing without any major regressions
    • Sync from 0 works on mainnet
    • Sync from 0 works on devnet
    • Starting a new network and forging on it work
    • Explorer is fully functional
    • Wallets are fully functional
  • No

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@ghost ghost added the Type: Feature label May 13, 2019
@ghost
Copy link

ghost commented May 13, 2019

The ci/circleci: test-node10-integration-1 job is failing as of fe8175ae7d68e0df0003cca81043b2632947d036. Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

* ArkEcosystem/core/develop:
  fix(core-blockchain): use resolveOptions("blockchain") to get databaseRollback options (#2572)
  refactor: change hasExceededMaxTransactions()'s argument type (#2568)
@codecov-io
Copy link

Codecov Report

Merging #2573 into 2.6 will decrease coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.6    #2573      +/-   ##
==========================================
- Coverage   66.82%   66.61%   -0.22%     
==========================================
  Files         406      422      +16     
  Lines        8883     9018     +135     
  Branches      460      463       +3     
==========================================
+ Hits         5936     6007      +71     
- Misses       2892     2954      +62     
- Partials       55       57       +2
Impacted Files Coverage Δ
packages/core-transaction-pool/src/processor.ts 80.26% <ø> (ø) ⬆️
packages/core-blockchain/src/state-machine.ts 88.98% <100%> (ø) ⬆️
packages/core-transaction-pool/src/connection.ts 95.59% <100%> (ø) ⬆️
...s/core-interfaces/src/core-database/event-types.ts 0% <0%> (ø)
packages/core-transaction-pool/src/plugin.ts 100% <0%> (ø)
...aces/src/core-database/search/search-parameters.ts 0% <0%> (ø)
packages/core-blockchain/src/plugin.ts 0% <0%> (ø)
packages/core-wallet-api/src/plugin.ts 0% <0%> (ø)
packages/core-logger-winston/src/plugin.ts 75% <0%> (ø)
packages/core-logger-pino/src/plugin.ts 75% <0%> (ø)
... and 9 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 b2b229a...5b15270. Read the comment docs.

@codecov-io
Copy link

codecov-io commented May 13, 2019

Codecov Report

Merging #2573 into 2.6 will decrease coverage by 0.04%.
The diff coverage is 77.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.6    #2573      +/-   ##
==========================================
- Coverage   66.82%   66.78%   -0.05%     
==========================================
  Files         406      422      +16     
  Lines        8883     9074     +191     
  Branches      419      469      +50     
==========================================
+ Hits         5936     6060     +124     
- Misses       2894     2956      +62     
- Partials       53       58       +5
Impacted Files Coverage Δ
packages/crypto/src/transactions/types/schemas.ts 100% <ø> (ø) ⬆️
packages/core-transaction-pool/src/connection.ts 95.59% <ø> (ø) ⬆️
packages/crypto/src/transactions/factory.ts 100% <ø> (ø) ⬆️
.../core-database-postgres/src/postgres-connection.ts 56.07% <0%> (ø) ⬆️
packages/core-state/src/wallets/wallet-manager.ts 72.1% <0%> (-1%) ⬇️
...ages/core-jest-matchers/src/functional/accepted.ts 0% <0%> (ø) ⬆️
packages/crypto/src/transactions/deserializer.ts 90.41% <100%> (+0.13%) ⬆️
packages/crypto/src/transactions/types/factory.ts 90.9% <100%> (+0.9%) ⬆️
...ore-api/src/versions/2/transactions/transformer.ts 100% <100%> (ø) ⬆️
.../transactions/builders/transactions/transaction.ts 98.38% <100%> (+0.14%) ⬆️
... and 34 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 e6c8406...57ea6f7. Read the comment docs.

faustbrian and others added 7 commits May 13, 2019 16:42
Sort transactions in the pool by fee (highest fee first), as before.

However, if we find a transaction from the same sender with a higher
nonce earlier in the sorted array, then move that transaction later in
the array. Ie don't allow transactions with higher nonce before
transactions with a lower nonce (for the same sender).
@faustbrian faustbrian merged commit a69cf51 into 2.6 May 22, 2019
@ghost ghost deleted the nonces branch May 22, 2019 02:09
@faustbrian faustbrian restored the nonces branch May 22, 2019 02:35
vasild added a commit that referenced this pull request May 22, 2019
…ve-incdec

* ArkEcosystem/core/2.6:
  feat: initial nonce implementation (#2573)
  Merge develop into 2.5 (#2600)
  refactor(core-json-rpc): use blockId schema for validation (#2596)
  chore(core-database-postgres): add core-state dependency (#2598)
  fix(core-database-postgres): use day instead of date (#2595)
  refactor: use dayjs as it now has official UTC support (#2592)
  refactor(core-json-rpc): improved version of #2593
  release: 2.3.23 (#2594)
  fix(core-json-rpc): allow use of old and new block IDs (#2593)
  fix(core-p2p): do not suspend peer for `AppNotReady` (#2590)
  chore(changelog): add latest changes for 2.4.0 (#2591)
  chore(ci): setup node.js 12 on CircleCI (#2474)
  fix(core-blockchain): divide blocks into smaller chunks for batch processing (#2586)
  refactor(crypto): fallback to ECDSA signature for version 2 transactions (#2584)
  fix(core-p2p): don't cause suspensions for unresponsive plugins (#2583)
  fix(core-p2p): don't cause suspensions for unresponsive plugins
  test(core-api): set p2p port on dummy peer
  feat(core): command to generate network configuration (#2582)
  fix(core-blockchain): delete bad rounds after unclean shutdown (#2581)
  feat(core-p2p): don't trust headers and verify config and plugin connectivity of peers (#2559)
  refactor: use ApplicationEvents enum instead of string (#2580)
  refactor(core-api): enforce "application/json" as content-type
  refactor(core-api): use pagination configuration limit
  test(e2e): remove version assertions
  chore(ci): update CircleCI configuration
  test(core-tester-cli): update API mock URLs
  refactor(core-api): register /api/v2 as a transition period fallback (#2578)
  test(core-api): use address identity
  refactor(corer-api): remove the legacy API (#2439)
@faustbrian faustbrian deleted the nonces branch June 1, 2019 02:37
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.

4 participants