superfluid-finance / protocol-monorepo

Superfluid Protocol Monorepo: the specification, implementations, peripherals and development kits.
https://www.superfluid.finance
Other
875 stars 239 forks source link

[ETHEREUM-CONTRACTS] proposed changes for the macro forwarder #1828

Closed d10r closed 9 months ago

d10r commented 9 months ago

Proposed changes:

github-actions[bot] commented 9 months ago

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

hellwolf commented 9 months ago

rename TrustedMacrosVanilla to MacroForwarder. Reasoning: trusted is a property not inherent to the contract, but coming into effect by registering it as trusted by gov. Vanilla isn't self-explanatory, I find it unnecessary. If we add a 712 variant, we can simply add 712 to the name. Plural -> singular because the use of a variable trustedMacros for an instance in the test seemed odd.

okay.

Removal of simulateMacro: Initially, I tried to find a better name (simulate to me suggests that it would simulate the actual execution, not just retrieve the operations), but I came to the conclusion that it's more confusing than helpful and should instead be removed. It doesn't really add anything, because it just delegates to macro.buildBatchOperations()`

I should probably still expose it, just for the merit of being able to get those batch operations call data. But it wouldn't work if it became stateful.

Added test case using StatefulMacro: https://github.com/superfluid-finance/protocol-monorepo/issues/1782 states: A user-defined macro is stateless ... - I think that's a mistake. The macro may very well have state if that helps to reduce the calldata size of the macro call. It just can't modify state in buildBatchOperations(). This test case exemplifies that, reducing the calldata to the minimum, which currently is the macro address.

Not necessarily a mistake, but it was a conscious and defensive choice.

However, we can rethink here: was the defensiveness justified?

Let me think a bit.

github-actions[bot] commented 9 months ago

XKCD Comic Relif

Link: https://xkcd.com/1828 https://xkcd.com/1828