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

feat(nns): Avoid recomputing wasm/arg hashes during read operations #3490

Open
wants to merge 1 commit into
base: jason/NNS1-2973-1
Choose a base branch
from

Conversation

jasonz-dfinity
Copy link
Contributor

@jasonz-dfinity jasonz-dfinity commented Jan 17, 2025

Why

Calculating hashes for wasm/arg actually takes quite a bit of instructions (80/byte), which makes it the dominant part of the list_proposals instructions. Such hashes can be calculated during write operations easily, since the data should be immutable.

What

  • Add wasm_module_hash and arg_hash into InstallCode internal type
  • Move hash calculation from read operation (internal -> response) to write operation (request -> internal)
  • Add backfill for existing Installcode proposals
  • Update benchmark results (96% improvement on list_proposals)

@jasonz-dfinity jasonz-dfinity requested a review from a team as a code owner January 17, 2025 00:59
@github-actions github-actions bot added the feat label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants