Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Using staticcall for builtIn actors readonly APIs #289

Closed
longfeiWan9 opened this issue Feb 22, 2023 · 3 comments
Closed

Using staticcall for builtIn actors readonly APIs #289

longfeiWan9 opened this issue Feb 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@longfeiWan9
Copy link
Contributor

longfeiWan9 commented Feb 22, 2023

This concern is raised in Slack.

Currently, Filecoin.solidity invokes builtIn Actor using DelegateCall() for both readOnly APIs and APIs which might change the state of the blockchain. For readOnly APIs, solidity devs might want to write their solidity functions as view to simple read without sending transactions. But they cannot because it is not allowed to declare functions as view if DelegateCall is used to read data on-chain.

So we would suggest trying to use staticcall to invoke readOnly APIs from builtIn actors and provide those API as view functions.

🔗 zboto Link

@rllola
Copy link
Contributor

rllola commented Feb 22, 2023

@Stebalien
Copy link
Contributor

Stebalien commented Feb 22, 2023

However, we can set the read-only flag in these cases, just to be safe.

@ainhoa-a ainhoa-a added the enhancement New feature or request label Feb 22, 2023
@emmanuelm41
Copy link
Member

emmanuelm41 commented Feb 22, 2023

Read only flags for methods that don't change the state have been set. So I think this issue can be closed, as we are doing the best we can (use the read only flag)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants