penumbra
penumbra copied to clipboard
Simplify `Planner` code by making it stateful and asynchronous
Is your feature request related to a problem? Please describe.
Currently, the Planner implementation is extremely over-complicated, because it was made to contort around the requirement that it get all of its information in "one shot" from the underlying view service. That choice was originally made with the intention of being able to directly reuse the Planner code in the web extension, or across an FFI boundary. But this turned out to be impractical anyways, and now we are left with the complexity for no benefit.
This complexity also has a cost. To implement fees, we had to do a baroque method of over-estimating gas costs, then refunding them in change notes, in order to try to ensure that no matter what spends were required to satisfy the intent, we would have over-spent by sufficiently much that we could still have enough gas. This is complex and unnecessary. We should instead just add notes, then adjust the gas, then continue iterating, all within the plan method.
Describe the solution you'd like
- [ ] Eliminate
plan_with_spendable_and_votable_notes - [ ] Fold all relevant code into
plan - [ ] Simplify fee computations.
See https://github.com/penumbra-zone/web/pull/663 for reference on a new planning strategy
Superseded by https://github.com/penumbra-zone/penumbra/issues/4081