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: replace fold heuristic by func/method #13235

Closed
AskAlexSharov opened this issue Dec 26, 2024 · 0 comments · Fixed by #13348
Closed

commitment: replace fold heuristic by func/method #13235

AskAlexSharov opened this issue Dec 26, 2024 · 0 comments · Fixed by #13348
Assignees
Labels
erigon3 imp2 Medium importance

Comments

@AskAlexSharov
Copy link
Collaborator

AskAlexSharov commented Dec 26, 2024

in fold we have heuristic:

partsCount := bits.OnesCount16(hph.afterMap[row])
switch partsCount {
	case 0: // Everything deleted
	case 1: // Leaf or extension node
	default: // Branch node
}

need replace it by something more readable:

switch partsCount, t := hph.updateType(); t {
	case UpdateTypeEverythingDeleted: 
	case NewExtension:
        case NewBranch: 
	default: 
}

and such enum must have comments - what is it about, why only 3 values, what is "everything", etc...

@AskAlexSharov AskAlexSharov added erigon3 imp2 Medium importance labels Dec 26, 2024
@AskAlexSharov AskAlexSharov changed the title commitment: replace fold heuristic by func/method commitment: replace fold heuristic by func/method Dec 26, 2024
@awskii awskii closed this as completed in e2563f8 Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erigon3 imp2 Medium importance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants