Skip to content

Rename subtree methods and types to "subtree root" #7463

Closed

Description

Schedule

This cleanup should happen last, because it will conflict with almost every other subtree change.

Motivation

We are storing subtree roots and end heights in the subtree indexes, not the subtree trees themselves.

This looks like the sort of information that gets lost and causes misunderstandings in future :) Can we rename the methods and update comments to correctly reflect what we are storing? Since we want this PR to merge soon we should do it in a follow up PR

Originally posted by @mpguerra in #7437 (comment)

Suggested Changes

Open 2 PRs, one for mass renames, and one for comments.

Mass Renames

  • Rename types
  • Rename methods and their arguments

Make a list of renames and then do a mass rename:
https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/mass-renames.md#universal-renames-with-sed

Don't rename the database column families, because that requires a state upgrade, and they are technically correct (every value is an index to a subtree):
https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/state-db-upgrades.md#current-state-database-format

Comments

Update the comments of each subtree type and method to make it clear that the subtree indexes contain subtree heights and roots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-docsArea: DocumentationA-stateArea: State / database changesC-cleanupCategory: This is a cleanupC-trivialCategory: A trivial change that is not worth mentioning in the CHANGELOG

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions