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

Offchain state map: reduce state diff size by removing contract code. #1399

Open
wants to merge 20 commits into
base: nightly
Choose a base branch
from

Conversation

rakanalh
Copy link
Contributor

@rakanalh rakanalh commented Oct 30, 2024

Description

This PR introduces:

Working Set

  1. OffchainDelta
  2. OffchainArchivalWorkingSet
  3. OffchainWorkingSet

State Data types

  1. OffchainStateMap

The code member of the EVM now uses OffchainStateMap which basically just:

  1. Reads from storage or cache
  2. Does NOT append code writes to state diff.

TODO

  • OffchainStateMap
  • Add check for keccack of code
  • Check state diff size decrease rate

Linked Issues

@rakanalh rakanalh marked this pull request as ready for review October 30, 2024 16:50
@rakanalh rakanalh marked this pull request as draft October 30, 2024 17:23
@@ -88,7 +88,7 @@ impl<'a, C: sov_modules_api::Context> Database for EvmDb<'a, C> {
// TODO move to new_raw_with_hash for better performance
Ok(self
Copy link
Member

Choose a reason for hiding this comment

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

need to check if keccak(code_from_offchain) == code_hash

@rakanalh rakanalh marked this pull request as ready for review November 5, 2024 19:45
@auto-assign auto-assign bot requested a review from eyusufatik November 5, 2024 19:45
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.

Offchain contracts
2 participants