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

Defer loading and decoding the parameters block until it's actually used #1066

Open
Tracked by #1020
anorth opened this issue Jan 17, 2023 · 0 comments
Open
Tracked by #1020

Comments

@anorth
Copy link
Member

anorth commented Jan 17, 2023

The trampoline reads the parameters block from storage before consulting whether the method will use it. Even if the method is unimplemented. This is a legitimate use case, e.g.

  • notification systems like MarketNotifyDeals
  • the token receiver hook in account and multisig that always return true

This is a non-trival waste of computation bandwidth and gas (e.g. the market notifications are ~4% of some PublishStorageDeals examples (source)). Refactor the trampoline, dispatch, and runtime to permit loading the parameters when they will actually be used. Note that this conflicts with some programming conveniences, such as the decision in #913 to require the account/multisig to take UniversalReceiverParams in their type signature, despite ignoring them (we need to allow them to specify None, and not abort if they receive not-None, or some similar alternative).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant