[Discussion] New FIP: Multicall as a Built-In Actor #560
Replies: 3 comments 4 replies
-
For public view, or pure functions - does the FEVM take a potential block height as an argument? Obviously for write calls you wouldn't be able to specify a block height other than the current tipset, but I'm wondering if, instead of doing the looping/scaling execution cost on a node that happened to get a multi-call, we simply allow the caller to provide a tip-set height that the read-only request is run at. This has a few benefits:
I might be missing something in the proposal that invalidates the above. Willing to understand more how we are solving this problem (either for contract actors or clients). |
Beta Was this translation helpful? Give feedback.
-
I don't quite understand the motivations cited here, but I do think multicall would be really valuable (especially in combination with #388 - see the Discussion section). In brief, my proposal would be
Then everyone gets multicalls, with a standard that wallet software can build to. This is unrelated to anything about off-chain queries, JSON-RPC etc, for which I think the problem is already sufficiently solved or solveable. |
Beta Was this translation helpful? Give feedback.
-
Strongly backing the @anorth suggestion... there's also an easy/totally separate Lotus API lift of supporting JSON-RPC batch- currently, I don't think lotus supports this. @amiller68 IIRC you ran into this, could you confirm? @scotthconner that sounds sort of like Flashbots bundles- in Ethereum that's done at the block preparer level, I think that kind of feature might be the right move for Filecoin too once the ecosystem reaches MEV-tier maturity. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a proposal to add multicall as a built-in actor on the FEVM.
Motivation
In a nutshell, multicall enables calling multiple methods in a single call to the contract.
An example use case might be, you might need to gather synchronized data from the blockchain. A good example is querying token prices from Uniswap. You don't want to have the price for one token from block x and a price for another token at block y. Your data is thus guaranteed to be from one block.
Additionally, this reduces the number of separate JSON RPC requests that need to be sent over the network if using a remote node, and provides the guarantee that all values returned are from the same block. The latest block number is also returned along with the aggregated results.
Proposal
Multicall has the following key functionality, which accepts an input array of calls and simply iterates through these calls, reverting the whole batch call on any call that fails. The following Solidity snippet should be considered as a goal for what we want to have.
Discussion
Beta Was this translation helpful? Give feedback.
All reactions