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

Add 'fvm' backend in parallel to our native backend. #1403

Merged
merged 159 commits into from
Mar 9, 2022
Merged

Add 'fvm' backend in parallel to our native backend. #1403

merged 159 commits into from
Mar 9, 2022

Conversation

lemmih
Copy link
Contributor

@lemmih lemmih commented Jan 28, 2022

Summary of changes
Changes introduced in this pull request:

  • Depend on 'fvm' crate and make sure everything builds.
  • Use VM from 'fvm' instead of internal actors.
  • Pass conformance tests.
  • Resolve all warnings and lints.
  • Sync to mainnet (with actors_v6).
  • Sync to mainnet including nv15 (actors_v7)

Reference issue to close (if applicable)

Closes #1409
Closes #1441

Other information and links

Putting here the link to the Hook up code of the FVM on Lotus.

@lemmih
Copy link
Contributor Author

lemmih commented Jan 28, 2022

OpenCL is now a dependency and it is not available on the CI machines, apparently.

@q9f
Copy link
Contributor

q9f commented Jan 28, 2022

OpenCL is now a dependency and it is not available on the CI machines, apparently.

Could you try adding

sudo apt install ocl-icd-opencl-dev

to the CI?

@lemmih
Copy link
Contributor Author

lemmih commented Jan 28, 2022

MacOS doesn't like that, unsurprisingly. :)

@lemmih
Copy link
Contributor Author

lemmih commented Jan 31, 2022

I've verified that this branch can still sync to mainnet (with updated dependencies, not using the FVM actors).

@lerajk lerajk added the FVM Filecoin Virtual Machine label Jan 31, 2022
@lemmih lemmih changed the title [WIP] Use 'fvm' crate Add 'fvm' backend in parallel to our native backend. Mar 4, 2022
Copy link
Contributor

@noot noot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you update the docs or makefile to include rustup target add wasm32-unknown-unknown? I had to do this to get make release to work. can you also document the BACKEND=native/fvm/both env variable somewhere?

@lemmih
Copy link
Contributor Author

lemmih commented Mar 4, 2022

could you update the docs or makefile to include rustup target add wasm32-unknown-unknown? I had to do this to get make release to work. can you also document the BACKEND=native/fvm/both env variable somewhere?

Not sure where to document the BACKEND environment variable. It's basically an internal detail that will go away as soon as the v7 actors are merged into builtin-actors (hopefully a few days from now). Would it worthwhile to keep the native backend around for longer than that?

@noot
Copy link
Contributor

noot commented Mar 4, 2022

@lemmih makes sense, feel free to leave that out for now then

.github/workflows/rust.yml Outdated Show resolved Hide resolved
Comment on lines 660 to 663
panic!("FVM doesn't support older networks")
// self.rand
// .get_chain_randomness_v1(personalization, rand_epoch, entropy)
// .map_err(|e| e.downcast_fatal("could not get randomness"))?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are using BACKEND=native are the older versions supported? I thought they were still, is that not the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only nv14 is supported in this branch - regardless of which backend is used. The native backend could possibly sync from older network versions but not as far back as genesis.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, we can prioritize adding the previous versions to the FVM then, since that's handy to have

Copy link
Contributor

@noot noot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worked for me with nv14! could you remove the commented out code before merging and make issues if needed?

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #1403 (6de6cf2) into main (845aa6b) will decrease coverage by 1.98%.
The diff coverage is 2.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1403      +/-   ##
==========================================
- Coverage   26.25%   24.27%   -1.99%     
==========================================
  Files         312      311       -1     
  Lines       23786    23896     +110     
==========================================
- Hits         6245     5800     -445     
- Misses      17541    18096     +555     
Impacted Files Coverage Δ
blockchain/beacon/src/drand.rs 15.51% <0.00%> (-0.62%) ⬇️
blockchain/blocks/src/header/mod.rs 38.12% <0.00%> (-1.01%) ⬇️
blockchain/chain/src/store/chain_store.rs 18.63% <0.00%> (-6.05%) ⬇️
blockchain/chain_sync/src/tipset_syncer.rs 0.00% <0.00%> (ø)
blockchain/chain_sync/src/validation.rs 17.64% <ø> (+8.82%) ⬆️
blockchain/message_pool/src/msgpool/utils.rs 62.50% <0.00%> (ø)
blockchain/state_manager/src/chain_rand.rs 0.00% <0.00%> (ø)
blockchain/state_manager/src/utils.rs 0.00% <0.00%> (ø)
blockchain/state_manager/src/vm_circ_supply.rs 0.00% <0.00%> (ø)
forest/src/daemon.rs 87.50% <ø> (-5.84%) ⬇️
... and 114 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 845aa6b...6de6cf2. Read the comment docs.

@LesnyRumcajs
Copy link
Member

@lemmih seems this got merged filecoin-project/ref-fvm#326, would be nice to use stable here as well.

@@ -69,7 +70,8 @@ jobs:
- name: Install Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly-2021-12-14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use stable now? filecoin-project/ref-fvm#326

Or is there anything else missing in stable?

README.md Outdated
@@ -29,14 +29,17 @@ Our crates:


## Dependencies
`rustc >= 1.57.0`
`rustc >= nightly-2022-02-14`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, 1.58.1?

@lemmih lemmih merged commit a3c4bf2 into main Mar 9, 2022
@lemmih lemmih deleted the lemmih/fvm branch March 9, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FVM Filecoin Virtual Machine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update bls-signatures integrate FVM with Forest
6 participants