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

There's no way of telling why a polNode is supposed to be remembered #287

Open
kcalvinalvin opened this issue Jul 7, 2021 · 0 comments
Open

Comments

@kcalvinalvin
Copy link
Member

The problem

To remember a polNode, we set the niece[0] of the polNode to itself. Telling whether a leaf is supposed to be remembered or not can be figured out by polNode.niece[0] == polNode.

There's two cases where a polNode needs to be remembered:

1: The leaf will be spent soon and is therefore cached.
2: The leaf is a sibling of the leaf to be deleted soon and is therefore cached. Important to note that the leaf by itself doesn't necessarily need to be cached as it'll stick around for a while.

These two cases need to be handled differently. Before decision tree shows how each case should be handled.
Screen Shot 2021-07-07 at 3 13 37 PM

However, since there's only one way of remembering polNode.niece[0] = polNode, there's no way of doing this.

Suggestion

Easiest way to solve this would be to denote case 2 as polNode.niece[1] = polNode. This might be a good stopgap until we have a swapless accumulator design working.

But in my opinion, I think maybe separating out the roots and leaves as different structs might work better. A polNode could be an interface and we can have root, leaf and node as this is how we're treating the polNodes anyways. This is a bigger change.

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

No branches or pull requests

1 participant