penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

Simplify `Planner` code by making it stateful and asynchronous

Open hdevalence opened this issue 1 year ago • 1 comments
trafficstars

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

hdevalence avatar Feb 26 '24 22:02 hdevalence

See https://github.com/penumbra-zone/web/pull/663 for reference on a new planning strategy

hdevalence avatar Mar 05 '24 22:03 hdevalence

Superseded by https://github.com/penumbra-zone/penumbra/issues/4081

TalDerei avatar Mar 26 '24 17:03 TalDerei