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

FEVM: Integrate IPC agent with IPC Solidity actors #419

Closed
6 tasks done
adlrocha opened this issue May 29, 2023 · 1 comment
Closed
6 tasks done

FEVM: Integrate IPC agent with IPC Solidity actors #419

adlrocha opened this issue May 29, 2023 · 1 comment
Assignees
Labels

Comments

@adlrocha
Copy link
Contributor

adlrocha commented May 29, 2023

Background

The deployment of IPC over Filecoin mainnet will be done through Solidity contracts. The following repo (and this internal fork) include the implementation of these actors. The IPC agent should be able to interact seamlessly with Solidity actors the same way that it does with the wasm-based native actors.

Goal

The goal is to implement the SubnetManager that target Solidity contracts, so in the agent we can determine if the subnet is a Solidity or native-based subnet. This will allow users to deploy their own custom subnet actors also written in Solidity (the only option currently available in subnet, deploying native actors is a bit more messy as it requires including the code as part of the builtin actor bundle).

Implementation

Deployment of gateway

The deployment of the gateway will be performed through any of the Solidity frameworks. This is done just once for every subnet. Ideally, if we want to support the Solidity subnet in child subnets we may need to deploy the contract in genesis (or as close as possible to genesis) to provide it with the required funds to mint new funds in the subnet. We have tested the deployment of the gateway with Foundry and hardhat, and while the Limechain team has been using Foundry for the development, hardhat has a better compatibility with Filecoin (Foundry has some unresolved issues that has made deploying the contracts a bit of an overhead).

Deployment of subnet actor

Ideally, for the deployment of the subnet actor I wanted the reference implementation of a subnet actor to be deployable from the agent directly without having to interact with any framework. This may be harder than expected, as the subnet actor requires that several libraries are already deployed and are linked in the bytecode. We may still be able to do this leveraging a factory contract, but worst case scenario, we delegate the deployment of subnet actors to be done through hardhat and foundry (even if the user is looking to deploy the reference subnet actor code, without modifications).

Interaction with Solidity contracts.

For the interaction of solidity contracts (calls and transactions) required to implement the operation of IPC I recommend using Rust ethers crate. I've done some tests with this crate and it has all the features needed for code-gen, type bindings, and interaction with deployed Solidity contracts

Note: For now, we will implement the integration assuming the the Solidity gateway contract will only be deployed in Filecoin mainnet, and child subnets will still use custom builtin bundles including a "native gateway". For subnet actors, we initially assume that in mainnet subnet actors are Solidity-based, and in child subnet wasm-based. That being said, in the near future we want to support the deployment of custom Solidity-based subnet actors in child subnets (although this may require some changes in the internal calls between the subnet actor and the gateway in order for them to target a native FVM builtin actors instead of an FEVM contract

Tasks

  • Script and docs to deploy the IPC gateway with hardhat/foundry.
  • Script and docs to deploy the IPC subnet actor with hardhat/foundry.
  • Evaluate if it is possible to deploy subnet actors through a factory contract or directly through a Rust script.
  • Implement subnet manager for solidity contracts (this may require bug fixes et. al.).
  • Test IPC agent integration and spawn a Solidity-based subnet.
  • Plan future work (interaction of Solidity-based subnet actors with a native wasm-based gateway actor).
@adlrocha adlrocha changed the title FEVM: Integrate IPC agent with Solidity actors FEVM: Integrate IPC agent with IPC Solidity actors May 29, 2023
@adlrocha
Copy link
Contributor Author

Implemented in consensus-shipyard/ipc-libs#221

@jsoares jsoares transferred this issue from consensus-shipyard/ipc-libs Dec 19, 2023
@jsoares jsoares added the s:ipc label Dec 19, 2023
@jsoares jsoares closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants