filecoin-project / filecoin-project/actors-utils

State reloading pattern for receiver hooks

Open
#139 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
17
Forks
17
PR merge metrics
No merged PRs in 30d

Description

I don't know if it's a good idea for the library code to be doing this instead of handling state loading on the user implementation side (like we're doing for fungible tokens). It'll be ok for now since it's going into a dev branch but I think it'll cause problems in actor code that carries additional state of its own beyond the `NFTState`

It does open up one easy optimisation though: we can pass through the original `MintReturn` data in the intermediate struct and simply return that if there's no change once the hook call completes. I've been playing with the idea [here](https://github.com/helix-onchain/filecoin/commit/b0a291b700152d955ae33dc7628fa39925e0a00b) (sending original data) and [here](https://github.com/helix-onchain/filecoin/commit/27a35220b174d75f03aa20f2aff042a502a9f521) (trying to centralise the 'has state changed' check) for the fungible token

_Originally posted by @abright in https://github.com/helix-onchain/filecoin/pull/138#discussion_r1002801864_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.