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

Use set_storage_at instead of storage_view #16

Closed
wants to merge 2 commits into from

Conversation

notlesh
Copy link

@notlesh notlesh commented Apr 22, 2024

I think this fixes the tree traversal issue with the block_number storage.

Note that now we traverse into traverse_empty() instead of traverse_edge() for this node.

Issue Number: N/A

Type

  • feature
  • bugfix
  • dev (no functional changes, no API changes)
  • fmt (formatting, renaming)
  • build
  • docs
  • testing

Description

Breaking changes?

  • yes
  • no

@notlesh notlesh requested a review from odesenfans as a code owner April 22, 2024 21:15
@notlesh
Copy link
Author

notlesh commented Apr 22, 2024

0054966 is off-topic, but it's a valid fix.

let storage_view = &mut state.state.storage_view;

storage_view.insert((block_hash_contract_address, block_number), block_hash);
state.set_storage_at(block_hash_contract_address, block_number, block_hash).unwrap();
Copy link
Author

Choose a reason for hiding this comment

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

This is the original "on topic" fix

@odesenfans
Copy link

Cleaned up and PRed upstream.

@odesenfans odesenfans closed this Apr 23, 2024
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