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

Accounts Cache for Verkle/Kaustinen #2142

Merged
merged 18 commits into from May 4, 2024

Conversation

agnxsh
Copy link
Contributor

@agnxsh agnxsh commented Apr 20, 2024

Rewrite of accounts cache in favour of Verkle Specs, Notable changes:

  1. No storage trie, as storage is now a part of the unified Verkle Trie (EIP 6800)
  2. Changing the format of Witness Data and Witness Cache
  3. Changing the trie in AccountsCache to a VerkleTrie
    4. Changing the format of rootHash to a 32-byte array
  4. Dealing with getter and setter functions related to contract code differently as EIP6800 introduces chunkifyCode
  5. Dealing with getter and setter functions related to storage differently because of 1)
  6. Added the checker function of whether the account is Empty or not
  7. Added the persist code for AccountsCache
  8. Added a placeholder for deleteAccountBytes, since deletion is kept like that as per spec and geth

Still a draft PR, not tested yet. Though underlying functions related to verkle-based accounts are tested. Verkle's account cache directly uses #2133

@agnxsh agnxsh marked this pull request as draft April 20, 2024 12:16
@advaita-saha
Copy link

The rootHash() return type was KeccakHash which has been kept intact to preserve the API and smoothen out future integration

@agnxsh
Copy link
Contributor Author

agnxsh commented Apr 21, 2024

@advaita-saha IsEmptyVerkleAccount should be false in the getAccount check, only then the flag is Alive

@advaita-saha
Copy link

@advaita-saha IsEmptyVerkleAccount should be false in the getAccount check, only then the flag is Alive

Ahh my bad

@advaita-saha
Copy link

advaita-saha commented Apr 30, 2024

Missing Items @agnxsh
Few of them needs more discussion

  • originalStorageValue
  • setStorage
  • clearStorage
  • cachedStorage (iterator)
  • update
  • witnessData
  • collectWitnessData

Lasty figure out the getContractCode()

@advaita-saha
Copy link

Note :-

getContractCode will need a seperate key-value db implementation

@advaita-saha advaita-saha marked this pull request as ready for review May 4, 2024 09:41
@advaita-saha advaita-saha merged commit cbc03b9 into verkle-kaustinen May 4, 2024
25 checks passed
@advaita-saha advaita-saha deleted the verkle-kaustinen-acc-cache branch May 4, 2024 17:28
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.

None yet

2 participants