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

Ease passing data from before to after hooks #3636

Open
dk1a opened this issue Mar 22, 2025 · 0 comments
Open

Ease passing data from before to after hooks #3636

dk1a opened this issue Mar 22, 2025 · 0 comments

Comments

@dk1a
Copy link
Contributor

dk1a commented Mar 22, 2025

I need both the previous and the current value of an arbitrary table in a hook

  • Then I either form the updated value in onBefore using hook arguments, which can get very complex with splices and all the different hooks
  • Or I pass the previous value from onBefore to onAfter using some storage stack, which can get gas intensive (and possibly leaky?)

I think having onBefore return a memory blob, and onAfter accept it as an argument would significantly improve this issue.
It's simple enough and I can PR it if you agree with the idea

On the other hand it's not a significant issue, especially if you think this solution would cause more problems

Perhaps this could apply to system hook too, but I don't have a use-case in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant