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

Number overflow halting parser on crypto/file/contract update #409

Merged
merged 8 commits into from
Nov 27, 2019

Conversation

mike-burrage-hedera
Copy link
Contributor

@mike-burrage-hedera mike-burrage-hedera commented Nov 27, 2019

Detailed description:

  • In Entities.create/update, handle overflows during conversion of (seconds,nanos) to a long nanos timestamp and set the database values accordingly.
  • Utilities.convertToNanos changed due to its implementation adding an additional runtime exception possibility (DateTimeException), rather than just the expected ArithmeticException.
  • Tested update via RecordFileLoggerCryptoTest and RecordFileLoggerFileTest

Which issue(s) this PR fixes:
Fixes #386
Needs to be applied to master and hcs

Special notes for your reviewer:
Ran against the problematic testnet data:

2019-11-27 10:40:10,701 INFO  [scheduling-5] c.h.m.p.r.RecordFileParser Loading version 2 record file: 2019-11-16T21_50_31.218215Z.rcd
2019-11-27 10:40:10,702 ERROR [scheduling-5] c.h.m.u.Utility Long overflow when converting time to nanos timestamp : 17343941030s 648045000ns
2019-11-27 10:40:10,702 WARN  [scheduling-5] c.h.m.p.r.Entities Detected an 'update' transaction for entity 0.0.1769 with an invalid expiration date. 17343941030s 648045000ns

Checklist

  • Documentation added
  • Tests updated

@mike-burrage-hedera mike-burrage-hedera added bug Type: Something isn't working P1 labels Nov 27, 2019
@mike-burrage-hedera mike-burrage-hedera added this to the Mirror 0.4.1 milestone Nov 27, 2019
…g nanos_timestamp affecting entity (crypto account, file, contract) updates.

Signed-off-by: Mike Burrage <mike.burrage@hedera.com>
@steven-sheehy steven-sheehy added the parser Area: File parsing label Nov 27, 2019
rest-api/package.json Outdated Show resolved Hide resolved
@steven-sheehy steven-sheehy changed the title WIP: Number overflow halting parser on crypto/file/contract update Number overflow halting parser on crypto/file/contract update Nov 27, 2019
Signed-off-by: Nana-EC <56320167+Nana-EC@users.noreply.github.com>
@steven-sheehy steven-sheehy marked this pull request as ready for review November 27, 2019 21:19
@steven-sheehy steven-sheehy merged commit 9ba5d23 into release/0.4 Nov 27, 2019
@steven-sheehy steven-sheehy deleted the bug/exp-overflow branch November 27, 2019 21:25
mike-burrage-hedera added a commit that referenced this pull request Dec 2, 2019
Signed-off-by: Mike Burrage <mike.burrage@hedera.com>
@mike-burrage-hedera mike-burrage-hedera mentioned this pull request Dec 2, 2019
2 tasks
mike-burrage-hedera added a commit that referenced this pull request Dec 2, 2019
Signed-off-by: Mike Burrage <mike.burrage@hedera.com>
steven-sheehy pushed a commit that referenced this pull request Dec 2, 2019
* Merge bug fix #409 #386 to master.

Signed-off-by: Mike Burrage <mike.burrage@hedera.com>

* Fix comment in RecordFileLoggerCryptoTest.java.
Ensure expiration_ns null value test is still in the rest integration test.
Make the integration test data setup and spec more clear/explicit by using a __tests__/integration_test_data.json data setup file, and adding more comments.

Signed-off-by: Mike Burrage <mike.burrage@hedera.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Something isn't working P1 parser Area: File parsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants