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 Cell Hash Issues in Block BoC Formation #16

Merged
merged 1 commit into from
May 10, 2023

Conversation

inyellowbus
Copy link

Problems

  • In some cases, a block's BoC could not be formed (Cell.fromBoc) — the calculated hash of exotic cells did not match the hash recorded inside the cell.
  • In some cases, the rootHash of a block (rootCell.hash(0)) obtained using Cell.fromBoc did not match the rootHash obtained from tonCenter for the same block.

Solutions

  • In the getRepr function, when calling getBitsDescriptor, the bits of that cell are now always used (prior to the fix, a hash could be passed in, breaking the reading)
  • In serialization.ts readCell() function, added reading (reader.skip) of hashes and depths recorded inside the cell.

Block hashes are now calculated correctly

Copy link
Collaborator

@dvlkv dvlkv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but can you provide tests?

@dvlkv dvlkv merged commit 580adef into ton-core:main May 10, 2023
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.

2 participants