Skip to content

Commit 157bc19

Browse files
committed
feat: switch to an FFI-level config
This means we don't construct a v3 config at the top level, then try to convert it to a v2 config. When we do that, we run into issues if, e.g., v3 doesn't define a price-list for a version only supported by v2. This PR also has a bit of cleanup: 1. Removes the manifest CID. 2. Changes the network version from u64 to u32 (simplifies some code). 3. Deletes all the overlay blockstore logic (was only used if the manifest was explicitly passed). Actor "overrides" should now only be done via "redirects".
1 parent f294254 commit 157bc19

File tree

7 files changed

+144
-330
lines changed

7 files changed

+144
-330
lines changed

cgo/fvm.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package cgo
88
*/
99
import "C"
1010

11-
func CreateFvmMachine(fvmVersion FvmRegisteredVersion, chainEpoch, chainTimestamp, chainId, baseFeeHi, baseFeeLo, baseCircSupplyHi, baseCircSupplyLo, networkVersion uint64, stateRoot SliceRefUint8, manifestCid SliceRefUint8, tracing bool, blockstoreId, externsId uint64) (*FvmMachine, error) {
11+
func CreateFvmMachine(fvmVersion FvmRegisteredVersion, chainEpoch, chainTimestamp, chainId, baseFeeHi, baseFeeLo, baseCircSupplyHi, baseCircSupplyLo, networkVersion uint64, stateRoot SliceRefUint8, tracing bool, blockstoreId, externsId uint64) (*FvmMachine, error) {
1212
resp := C.create_fvm_machine(
1313
fvmVersion,
1414
C.uint64_t(chainEpoch),
@@ -18,9 +18,8 @@ func CreateFvmMachine(fvmVersion FvmRegisteredVersion, chainEpoch, chainTimestam
1818
C.uint64_t(baseFeeLo),
1919
C.uint64_t(baseCircSupplyHi),
2020
C.uint64_t(baseCircSupplyLo),
21-
C.uint64_t(networkVersion),
21+
C.uint32_t(networkVersion),
2222
stateRoot,
23-
manifestCid,
2423
C.bool(tracing),
2524
C.uint64_t(blockstoreId),
2625
C.uint64_t(externsId),
@@ -47,7 +46,7 @@ func CreateFvmDebugMachine(fvmVersion FvmRegisteredVersion, chainEpoch, chainTim
4746
C.uint64_t(baseFeeLo),
4847
C.uint64_t(baseCircSupplyHi),
4948
C.uint64_t(baseCircSupplyLo),
50-
C.uint64_t(networkVersion),
49+
C.uint32_t(networkVersion),
5150
stateRoot,
5251
actorRedirect,
5352
C.bool(tracing),

fvm.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type FVMOpts struct {
4343
BaseCircSupply abi.TokenAmount
4444
NetworkVersion network.Version
4545
StateBase cid.Cid
46-
Manifest cid.Cid
4746
Tracing bool
4847

4948
Debug bool
@@ -74,7 +73,6 @@ func CreateFVM(opts *FVMOpts) (*FVM, error) {
7473
baseCircSupplyLo,
7574
uint64(opts.NetworkVersion),
7675
cgo.AsSliceRefUint8(opts.StateBase.Bytes()),
77-
cgo.AsSliceRefUint8(opts.Manifest.Bytes()),
7876
opts.Tracing,
7977
exHandle, exHandle,
8078
)

rust/src/fvm/blockstore/fake.rs

Lines changed: 0 additions & 100 deletions
This file was deleted.

rust/src/fvm/blockstore/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
mod cgo;
2-
mod fake;
3-
mod overlay;
4-
52
pub use cgo::*;
6-
pub use fake::*;
7-
pub use overlay::*;

rust/src/fvm/blockstore/overlay.rs

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)