filecoin-project / filecoin-project/builtin-actors

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

Open
#1,066 0 comments 0 reactions 0 assignees View on GitHub
optimisation
Dominant language
Rust
Stars
96
Forks
94
Avg merge
6d 17h
Merged PRs (30d)
3

Description

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](https://github.com/filecoin-project/builtin-actors/issues/1020#issuecomment-1384731819))). 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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.