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

Draft | Fix #638 | v8+ conformance tests #906

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

shamb0
Copy link

@shamb0 shamb0 commented Sep 27, 2022

Draft | Fix for #638

Signed-off-by: shamb0 <r.raajey@gmail.com>
@shamb0
Copy link
Author

shamb0 commented Sep 27, 2022

Hello @Stebalien,

Attempted quick shot, to fix #638, like to align on solution approach ...

Looking for following inputs ...

  1. How to resolve actor-xx cargo dependency, specific to network calibrationnet & mainnet

  2. How to generate the test-vector for specs-actor v8 nv(16).


Steps Tried

01.01 Cargo dependency mapping ...

actors-v8 = { git = "https://github.com/filecoin-project/builtin-actors.git", package = "fil_builtin_actors_bundle", tag = "v8.0.0" }

01.02 Can find bundle.car file got generated, looks like by default build for mainnet ...

find ../../target -type f -iname '*.car'
../../target/debug/build/fil_builtin_actors_bundle-2ed62aafa77e77e2/out/bundle/bundle.car

01.03 execution with sample test vector | ext-0007-fil_7_storagemarket-AddBalance-SysErrInsufficientFunds-5.json

clear && \
RUST_LOG=fvm=trace \
VECTOR="test-vectors/corpus/extracted/0006-ohsnap-01/fil_7_storagemarket/AddBalance/SysErrInsufficientFunds/ext-0007-fil_7_storagemarket-AddBalance-SysErrInsufficientFunds-5.json" \
    cargo test -j$(nproc) \
    -- \
    conformance \
    --nocapture

01.04 As expected execution got panic due to wrong nv version ...

 Running tests/runner.rs (/home/popoyi/dscbox/sun/ws-020-blocks/ws-030-filecoin-project/dev-030-01-fvm/ref-fvm/target/debug/deps/runner-ef4d5223724bd22f)

running 1 test
thread 'async-std/runtime' panicked at 'no builtin actors index for nv', testing/conformance/src/vm.rs:74:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'conformance_test_runner' panicked at 'task has failed', /home/popoyi/ssdbox/fact/utilhub/rusthome/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.3.0/src/task.rs:426:45
test conformance_test_runner ... FAILED

failures:

failures:
    conformance_test_runner

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

@Stebalien
Copy link
Member

We extract test vectors from mainnet and testnets. You'll need to use the tvx tool from lotus, which is, unfortunately, kind of broken right now with the FVM (see https://github.com/filecoin-project/lotus/tree/steb/fix-tvx-fvm for an attempted fix that didn't work).

How to resolve actor-xx cargo dependency, specific to network calibrationnet & mainnet

We're going to need to fetch the bundle from https://github.com/filecoin-project/builtin-actors/releases. v8+ actors will produce different gas outputs depending on where/how they were compiled, so we can't recompile them every time.


Just so you know what you're getting into, this is a non-trivial issue. It's a good way to dig deeper into these code-bases, but this it'll require some investigation and design.

@shamb0
Copy link
Author

shamb0 commented Sep 28, 2022

Thanks for pointer, Can understand the level of difficulty & challenge, sure will try my best to take it forward.

Signed-off-by: shamb0 <r.raajey@gmail.com>
Signed-off-by: shamb0 <r.raajey@gmail.com>
Signed-off-by: shamb0 <r.raajey@gmail.com>
Signed-off-by: shamb0 <r.raajey@gmail.com>
@shamb0
Copy link
Author

shamb0 commented Oct 2, 2022

Hello @Stebalien,

Note

Sorry, looks like something went bad with `workspace re-basing`,
will try to clean-it up, for time-being, plz consider changes only in the folder `testing/conformance`

Introduced build script build.rs, to download the car file
directly from release artifacts link. bit blocked on testing.

01.01 - May I know what is the right release artifact link, equivalent to
the crate ...

actors-v7 = { version = "~7.5", package = "fil_builtin_actors_bundle" }

01.02 - based on release timeline info on crates.io registry, tried below configurations, but no-luck ...

// ============== release :: "dev/20220602" ==============
// cfg-01 | Failed
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220602";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "calibrationnet";

// cfg-02 | Failed
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220602";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "mainnet";

// cfg-03 | Failed
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220602";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "testing";

// cfg-04 | Failed
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220602";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "testing-fake-proofs";

// ============== release :: "dev%2F20220609-proofs" ==============
// cfg-01 | Failed
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220609-proofs";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "calibrationnet";

// cfg-02 | Failed
const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220609-proofs";
const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "mainnet";

// cfg-03 |
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220609-proofs";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "testing";

// cfg-04 | Failed
// const DEFAULT_FIL_BUILDIN_ACTORS_RELEASE_VERSION: &str = "dev%2F20220609-proofs";
// const DEFAULT_FIL_BUILDIN_ACTORS_BUILD_NETWORK: &str = "testing-fake-proofs";

01.03 - Hit with error message of ...

|> reason: exit code of msg 0 did not match; expected: ExitCode { value: 6 }, got ExitCode { value: 1 }. Error: pre-validation failed: Send not from account actor


conformance tests result: 0/1 tests passed (0 skipped)
Error: some vectors failed
thread 'conformance_test_runner' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /rustc/cb121987158d69bb894ba1bcc21dc45d1e0a488f/library/test/src/lib.rs:185:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test conformance_test_runner ... FAILED

image

01.04 - One observation w.r.to size of car file, almost all published
release artifact car file sizes are in the ranges from 5.x MB to 6.x MB, but
`car`` file created using the dependency is in the range of 28 MB, and
the test is passing. Is there any thing wrong with published artifacts ?

actors-v7 = { version = "~7.5", package = "fil_builtin_actors_bundle" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants