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

epic: State accesses #288

Open
ClementWalter opened this issue Dec 17, 2024 · 0 comments
Open

epic: State accesses #288

ClementWalter opened this issue Dec 17, 2024 · 0 comments
Labels
epic Label an issue with sub issues

Comments

@ClementWalter
Copy link
Member

ClementWalter commented Dec 17, 2024

Why

In the context of Kakarot, we used DictAccess to store accesses to the EVM state. For each new context, we needed to create a whole new dict (new segment, new dict manager). This is highly inefficient as illustrated in the first tx of block 21421739

What

Stop to copy segments. We only need to make sure that the values returned in context are

  • consistent with a DictAccess => regular dict squashing
  • consistent with the previous (main) state => the prev values of this small segments needs to be consistent with the values from the main segment.

How

When creating a new context

  • create a new segment
  • at the end of the context
    • if it reverts, squash and append all the prev keys to the main dict segment
    • if it succeeds, memcpy to the main segment OR squash and append memcpy the squashed dict
@ClementWalter ClementWalter moved this to Backlog in Keth Dec 17, 2024
@ClementWalter ClementWalter added this to the EF tests no state root milestone Dec 19, 2024
@ClementWalter ClementWalter changed the title bug: initial_state copy doesn't copy non accessed accounts epic: State accesses Jan 6, 2025
@ClementWalter ClementWalter added the epic Label an issue with sub issues label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Label an issue with sub issues
Projects
Status: Backlog
Development

No branches or pull requests

1 participant