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

Use tree height instead of chunk limit for merkleizer #74

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Conversation

arnetheduck
Copy link
Member

More closely matches implementation and avoids generic bloat.

Renamed to avoid accidental limit-vs-height confusion.

More closely matches implementation and avoids generic bloat.

Renamed to avoid accidental limit-vs-height confusion.

template getChunkCount*(m: SszMerkleizer): uint64 =
template limit*(T: type SszMerkleizer2): Limit =
if T.height == 0: 0'i64 else: 1'i64 shl (T.height - 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hrm, what about the cases where the limit is not a power of 2? We have to review more carefully how this code is being used.

Copy link
Member Author

Choose a reason for hiding this comment

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

no critical usages, ie it doesn't materially matter since all trees are extended to power-of-2 anyway

@tersec
Copy link
Contributor

tersec commented Jan 11, 2024

nim-lang/Nim#23188 should fix the CI issue in devel which this triggered.

@arnetheduck arnetheduck merged commit 66de36a into master Jan 11, 2024
12 checks passed
@arnetheduck arnetheduck deleted the debloat branch January 11, 2024 15:22
@arnetheduck
Copy link
Member Author

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.

3 participants