Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

[Bug] TAPOS validation fails for ref_block_num of 0 #554

Closed
zquestz opened this issue Jun 5, 2019 · 4 comments
Closed

[Bug] TAPOS validation fails for ref_block_num of 0 #554

zquestz opened this issue Jun 5, 2019 · 4 comments
Assignees
Labels

Comments

@zquestz
Copy link

zquestz commented Jun 5, 2019

Version of EOSJS
Latest

Describe the bug
There appears to be a bug in eos-api.ts where hasRequiredTaposFields returns false if ref_block_num is equal to 0. We noticed a failed transaction where the block number was 61931520. This caused refBlock.block_num & 0xffff in eosjs-serialize.ts to return 0 and then the subsequent transaction failed to get signed.

To Reproduce
Steps to reproduce the behavior:

  1. Generate an unsigned transaction for a block where refBlock.block_num & 0xffff equals zero. This is any block divisible by 65536.
  2. Try to sign the transaction
  3. Watch the signing fail due to hasRequiredTaposFields returning false!

Expected behavior
The transaction is valid when ref_block_num is zero.

@tbfleming tbfleming added the bug label Jun 5, 2019
@c0d3ster c0d3ster self-assigned this Jun 7, 2019
@zquestz
Copy link
Author

zquestz commented Jun 7, 2019

The merged PR appears to fix the issue. Will you be cutting a new release soon with the fix?

@jeffreyssmith2nd
Copy link
Contributor

I'm not sure of the release timeline at the moment, but you can use the @edge package on NPM to get the latest unreleased changes

@zquestz
Copy link
Author

zquestz commented Jun 7, 2019

I'm not sure of the release timeline at the moment, but you can use the @edge package on NPM to get the latest unreleased changes

Is there a list of breaking changes between the latest release and what is available in the edge package? A changelog would be required so I can audit the changes and make sure there are no unintended side effects from switching versions...

@c0d3ster
Copy link
Contributor

c0d3ster commented Jun 8, 2019

Closing this since the issue has been resolved with the last PR. @zquestz there are not any breaking changes since v20; however, the develop branch could have breaking changes merged in at any time. I would recommend version locking to this PR to test locally then use that version for production. The NPM version for the last PR is 20.0.1-1fed0be.0. Let us know if you have any other questions or concerns!

@c0d3ster c0d3ster closed this as completed Jun 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants