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

Commitment: do not use cell getter function to fold the row #13509

Merged
merged 14 commits into from
Feb 5, 2025

Conversation

awskii
Copy link
Member

@awskii awskii commented Jan 20, 2025

Refactors how we collect trie branch updates.

  • encode whole row without encoding update and merging it with existing value
  • access to row in grid directly, avoiding logic multiplication and need of lambda returning cell
  • simplify folding code: looks and reads much more straightforward

@awskii awskii added this to the 3.0.0-beta2 milestone Jan 20, 2025
@awskii awskii self-assigned this Jan 20, 2025
// has to copy :(
if err = ctx.PutBranch(common.Copy(prefix), common.Copy(update), prev, prevStep); err != nil {
return 0, err
if fields&fieldStateHash != 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can add method fields.Has(fieldStateHash)

if err != nil {
return fmt.Errorf("failed to encode leaf node update: %w", err)
}
if err = hph.ctx.PutBranch(common.Copy(updateKey), common.Copy(del), nil, 0); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Inside ctx.PutBranch:

  • AddPrevValue - does copy inside
  • DomainUpdate - does copy inside
    in this case: ctx.PutBranch also can do copy inside?

@awskii awskii marked this pull request as draft January 30, 2025 09:33
@AskAlexSharov AskAlexSharov removed this from the 3.0.0-beta2 milestone Feb 3, 2025
@awskii awskii marked this pull request as ready for review February 3, 2025 14:43
@awskii awskii merged commit 1f87c16 into main Feb 5, 2025
13 checks passed
@awskii awskii deleted the hph-no-cellgetter branch February 5, 2025 13:47
awskii added a commit that referenced this pull request Feb 7, 2025
awskii added a commit that referenced this pull request Feb 7, 2025
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