Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Fraser999
Copy link
Contributor

This PR fixes two separate issues:

  • a historical synced block with no deploys would have no entry written for it in the transfers_db, causing the JSON-RPC chain_get_block_transfers to report the block's transfers as null rather than []
  • for a block with a non-zero number of successful transfers, if its execution results were put to storage more than once, the initial valid entry in the transfers_db would be overwritten with an invalid empty collection, causing the JSON-RPC chain_get_block_transfers to report the block's transfers as [] rather then the correct value

Th fix is to have Storage reconstitute the correct value when reading from transfers_db if it encounters a missing value or an empty collection, and store the corrected value before returning it. The Storage::write_execution_results method has also been corrected to not overwrite good values with empty collections.

Closes #4255.
Closes #4268.

Copy link
Contributor

@rafal-ch rafal-ch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Fraser999
Copy link
Contributor Author

bors merge

casperlabs-bors-ng bot added a commit that referenced this pull request Sep 6, 2023
4272: Fix issues in storage r=Fraser999 a=Fraser999

This PR fixes two separate issues:
* a historical synced block with no deploys would have no entry written for it in the `transfers_db`, causing the JSON-RPC `chain_get_block_transfers` to report the block's transfers as `null` rather than `[]`
* for a block with a non-zero number of successful transfers, if its execution results were put to storage more than once, the initial valid entry in the `transfers_db` would be overwritten with an invalid empty collection, causing the JSON-RPC `chain_get_block_transfers` to report the block's transfers as `[]` rather then the correct value

Th fix is to have `Storage` reconstitute the correct value when reading from `transfers_db` if it encounters a missing value or an empty collection, and store the corrected value before returning it.  The `Storage::write_execution_results` method has also been corrected to not overwrite good values with empty collections.

Closes #4255.
Closes #4268.

Co-authored-by: Fraser Hutchison <[email protected]>
@casperlabs-bors-ng
Copy link
Contributor

This PR was included in a batch that successfully built, but then failed to merge into release-1.5.2-alt. It will not be retried.

Additional information:

{"message":"You're not authorized to push to this branch. Visit https://docs.github.com/articles/about-protected-branches/ for more information.","documentation_url":"https://docs.github.com/articles/about-protected-branches"}

@sacherjj sacherjj merged commit 1b54188 into casper-network:release-1.5.2-alt Sep 6, 2023
@Fraser999 Fraser999 deleted the 4268-fix-storage branch September 6, 2023 12:56
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