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

consolidate Accumulator, StateDiff, commitment.Updates in-memory representation - no reason to store similar things twice in ram. #12944

Open
AskAlexSharov opened this issue Dec 2, 2024 · 1 comment
Labels
complexity:high Issue might take multiple weeks or more to fix erigon3 imp2 Medium importance
Milestone

Comments

@AskAlexSharov
Copy link
Collaborator

AskAlexSharov commented Dec 2, 2024

StateStream: it must use Erigon3 primitives (domains).

Seems it's time to introduce StateChanges type for given tx exec. Reasons:

  • doCallMany using stateCache.Clone() trick to produce StateDiff type
  • Accumulator and StateStream do have own format of StateChanges
  • StateChangeSet - which we using for Domain unwind - using own format.
  • Silkwarm (EVMOne) also producing txn-granularity state diffs.

New type - maybe must use E3 primitives (like "Domain"). I'm not sure - because maybe it must be Ethereum-specific instead of Erigon3-specific.

@AskAlexSharov AskAlexSharov modified the milestones: 3.0.0-beta1, 3.0.0-beta2 Dec 2, 2024
@AskAlexSharov AskAlexSharov changed the title consolidate Accumulator and StateDiff in-memory representation - no reason to store similar things twice in ram. consolidate Accumulator, StateDiff, commitment.Updates in-memory representation - no reason to store similar things twice in ram. Dec 2, 2024
@awskii
Copy link
Member

awskii commented Dec 2, 2024

very much agreed

Btw when commitment mode is ModeDirect, commitment.Updates does not hold recent state updates, it fetches them from domains and fills Updates structure instead.
Since we can merge Updates, could add to this step generating of binary encoding of update or keep list of singular updates which, if applied one by one will provide same commitment.Update as we have in latest state.

making Updates a source of truth could have other benefits.

@AskAlexSharov AskAlexSharov added imp2 Medium importance erigon3 complexity:high Issue might take multiple weeks or more to fix labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:high Issue might take multiple weeks or more to fix erigon3 imp2 Medium importance
Projects
None yet
Development

No branches or pull requests

2 participants