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

fix(core-tester-cli): init config manager from network preset #2384

Conversation

Projects
None yet
4 participants
@Nigui
Copy link

Nigui commented Apr 9, 2019

Proposed changes

Configuration manager of crypto package is initialized from devnet preset by default (source #1
#2).

When starting a new chain (for example testnet) with an updated config (for example network.epoch), tester-cli broadcasted transactions are not forged (and it fails silently which could be another issue).

The main reason is that tester-cli load local config from node api (source), but does not reset crypto config manager (like makeOffline does). So, when building a transaction with crypto package, it initialize timestamp with the wrong config (devnet even if I send transaction to a testnet node).

Steps to reproduce

  1. update `testnet.milestones.epoch config to current date.
  2. Start a fresh local node
  3. use core-tester-cli to broadcast a transfer transaction.
  4. Your transaction won't be forged and cli will fail

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

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)

Further comments

Other things to fix:

  • add debug logs to detect that a transaction validation failed due to invalid timestamp.

@Nigui Nigui requested review from faustbrian, kristjank and supaiku0 as code owners Apr 9, 2019

@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 9, 2019

Thanks for submitting this pull request! A maintainer will review this in the next few days and explicitly select labels so you know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 9, 2019

The ci/circleci: test-node11-integration-2 job is failing as of e85408d7c10235f1cbceaaed8a6a65e93747571d. Please review the logs for more information.

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

@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 9, 2019

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

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

@Nigui Nigui force-pushed the universal-name-system:fix/tester-cli-config-preset branch 2 times, most recently from a1c5f8e to e85408d Apr 9, 2019

@Nigui Nigui force-pushed the universal-name-system:fix/tester-cli-config-preset branch from e85408d to 0f56f6a Apr 9, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Apr 9, 2019

Codecov Report

Merging #2384 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2384      +/-   ##
===========================================
+ Coverage    66.18%   66.18%   +<.01%     
===========================================
  Files          400      400              
  Lines         8584     8585       +1     
  Branches       424      383      -41     
===========================================
+ Hits          5681     5682       +1     
- Misses        2858     2859       +1     
+ Partials        45       44       -1
Impacted Files Coverage Δ
packages/core-tester-cli/src/commands/command.ts 54.54% <100%> (+0.69%) ⬆️
packages/core-logger-winston/src/formatter.ts 42.85% <0%> (ø) ⬆️

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 accc4ff...0f56f6a. Read the comment docs.

@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 9, 2019

A collaborator has approved this PR. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait.

Thank you for your contribution!

@faustbrian faustbrian merged commit 0ab2be5 into ArkEcosystem:develop Apr 9, 2019

10 checks passed

ci/circleci: test-node10-functional Your tests passed on CircleCI!
Details
ci/circleci: test-node10-integration-0 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-integration-1 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-integration-2 Your tests passed on CircleCI!
Details
ci/circleci: test-node10-unit Your tests passed on CircleCI!
Details
ci/circleci: test-node11-functional Your tests passed on CircleCI!
Details
ci/circleci: test-node11-integration-0 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-integration-1 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-integration-2 Your tests passed on CircleCI!
Details
ci/circleci: test-node11-unit Your tests passed on CircleCI!
Details
@ArkEcosystemBot

This comment has been minimized.

Copy link
Member

ArkEcosystemBot commented Apr 9, 2019

Your pull request has been merged and marked as tier 4. It will earn you $10 USD.

@Nigui Nigui deleted the universal-name-system:fix/tester-cli-config-preset branch Apr 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.