filecoin-project / fvm-workbench

Tooling for developing actors on the FVM
Other
6 stars 0 forks source link

WIP: Valid precommits test #5

Closed alexytsu closed 1 year ago

alexytsu commented 1 year ago

Trying to port over https://github.com/filecoin-project/builtin-actors/blob/88f756e87f929a8e2ccf95ca4caf1efae2a808a2/actors/miner/tests/aggregate_prove_commit.rs to run on the workbench.

alexytsu commented 1 year ago

Currently blocked by error during Miner::PreCommitSector which returns a "01: f05 (method 5) -- no such deal 1 (17)" when calling Market::VerifyDealsForActivation

[TRACE]<Init::1> called exec; params.code_cid: Cid(bafk2bzacec6sykulnq44efhcn2jfekmti2fug7waof5thf4dniuyavdxvmnlm)
[TRACE]<Init::1> caller code CID: Cid(bafk2bzacebxvjahynn7vz4vr5js53j2cdzrmpytlrli5ozaq3n6m2olwcj26u)
[TRACE]<Init::1> robust address: Address { payload: Actor([51, 44, 129, 84, 73, 102, 255, 106, 12, 70, 241, 144, 131, 131, 127, 153, 236, 106, 30, 86]) }
State { info: Cid(bafy2bzaceaydzvgduxyqp4lbigckegscs6fmlwyzddy7je6p54rtz7hlsc27m), pre_commit_deposits: TokenAmount(0.0), locked_funds: TokenAmount(0.0), vesting_funds: Cid(bafy2bzacealbq6s7ptdud6gvpc2yv54opwotncjlqjxmzb2q2rnjxv753rwdc), fee_debt: TokenAmount(0.0), initial_pledge: TokenAmount(0.0), pre_committed_sectors: Cid(bafy2bzaceamp42wmmgr2g2ymg46euououzfyck7szknvfacqscohrvaikwfay), pre_committed_sectors_cleanup: Cid(bafy2bzaceaa2jny7gkgdwnid4kuldau6bnvgyss5bszo4uy6uikrncvdu5mc2), allocated_sectors: Cid(bafy2bzacea456askyutsf7uk4ta2q5aojrlcji4mhaqokbfalgvoq4ueeh4l2), sectors: Cid(bafy2bzaceacu3yonapahihxmnhzuvk76yupwjmyeymd2l5n6xfs5st52shm6a), proving_period_start: -612, current_deadline: 11, deadlines: Cid(bafy2bzacebx7jpdhnsrri7womvthfo6xlhpavdabnlsguhahje35pm3ankpiy), early_terminations: BitField { ranges: [], set: {}, unset: {} }, deadline_cron_active: false }
precommitting
test valid_precommits_then_aggregate_provecommit has been running for over 60 seconds
GasCharge { name: "none", compute_milli: 0, other_milli: 0 }
Call { from: 102, to: Address { payload: ID(103) }, method: 6, params: Some(IpldBlock { codec: 51, data: [8a0800d82a5829000182e20381e80220b2ac656c8877b35686ae4190eb2506babc4f958d1e8b64c0a902716e3c9734eb186481011a0009b3dbf4000000] }), value: TokenAmount(0.0) }
GasCharge { name: "OnMethodInvocation", compute_milli: 75000000, other_milli: 0 }
GasCharge { name: "wasm_memory_init", compute_milli: 471859200, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 620000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 404000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnMessageContext", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 4574400, other_milli: 0 }
GasCharge { name: "wasm_memory_grow", compute_milli: 26214400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockStat", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 1280000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 24400, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 10644000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetActorCodeCid", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 9700400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetBuiltinActorType", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 23566400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnNetworkContext", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 11443600, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
Call { from: 103, to: Address { payload: ID(2) }, method: 3, params: None, value: TokenAmount(0.0) }
GasCharge { name: "OnMethodInvocation", compute_milli: 75000000, other_milli: 0 }
GasCharge { name: "wasm_memory_init", compute_milli: 445644800, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 564000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 404000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnMessageContext", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 15118400, other_milli: 0 }
GasCharge { name: "wasm_memory_grow", compute_milli: 26214400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetActorCodeCid", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 9700400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetBuiltinActorType", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 1160000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 7137600, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockOpenBase", compute_milli: 0, other_milli: 187440000 }
GasCharge { name: "OnBlockOpenPerByte", compute_milli: 280800, other_milli: 889200 }
GasCharge { name: "wasm_exec", compute_milli: 1112000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 46800, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 116397600, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockCreate", compute_milli: 151200, other_milli: 478800 }
GasCharge { name: "wasm_exec", compute_milli: 5376000, other_milli: 0 }
CallReturn { return_value: Some(IpldBlock { codec: 51, data: [8282581a0001f74ba39a79deb04500000000000000000000000000000000560119966ab72d000000000000000000000000000000004900281765215ff9dfff] }), exit_code: ExitCode { value: 0 } }
GasCharge { name: "wasm_exec", compute_milli: 2484000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 25200, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 39295200, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
Call { from: 103, to: Address { payload: ID(4) }, method: 9, params: None, value: TokenAmount(0.0) }
GasCharge { name: "OnMethodInvocation", compute_milli: 75000000, other_milli: 0 }
GasCharge { name: "wasm_memory_init", compute_milli: 445644800, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 640000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 404000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnMessageContext", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 14826400, other_milli: 0 }
GasCharge { name: "wasm_memory_grow", compute_milli: 26214400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetActorCodeCid", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 9700400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetBuiltinActorType", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 1448000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 6554400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockOpenBase", compute_milli: 0, other_milli: 187440000 }
GasCharge { name: "OnBlockOpenPerByte", compute_milli: 360000, other_milli: 1140000 }
GasCharge { name: "wasm_exec", compute_milli: 1112000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 60000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 99518400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockCreate", compute_milli: 132000, other_milli: 418000 }
GasCharge { name: "wasm_exec", compute_milli: 5128000, other_milli: 0 }
CallReturn { return_value: Some(IpldBlock { codec: 51, data: [844040408258180002dc6c0000000000000000000000000000000000000000570003c00000000000000000000000000000000000000000] }), exit_code: ExitCode { value: 0 } }
GasCharge { name: "wasm_exec", compute_milli: 2344000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 22000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 47892400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockCreate", compute_milli: 26400, other_milli: 83600 }
GasCharge { name: "wasm_exec", compute_milli: 1008000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
Call { from: 103, to: Address { payload: ID(5) }, method: 5, params: Some(IpldBlock { codec: 51, data: [818183081a0009b3db8101] }), value: TokenAmount(0.0) }
GasCharge { name: "OnMethodInvocation", compute_milli: 75000000, other_milli: 0 }
GasCharge { name: "wasm_memory_init", compute_milli: 445644800, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 564000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 404000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnMessageContext", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 4574400, other_milli: 0 }
GasCharge { name: "wasm_memory_grow", compute_milli: 26214400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockStat", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 1280000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 4400, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 10808000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetActorCodeCid", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 9700400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetBuiltinActorType", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 11329600, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetActorCodeCid", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 9700400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnGetBuiltinActorType", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 1696000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
 .g/COMMIT_EDITMSG
GasCharge { name: "OnNetworkContext", compute_milli: 0, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 560000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 6554400, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockOpenBase", compute_milli: 0, other_milli: 187440000 }
GasCharge { name: "OnBlockOpenPerByte", compute_milli: 736800, other_milli: 2333200 }
GasCharge { name: "wasm_exec", compute_milli: 1456000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 122800, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 61229200, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockOpenBase", compute_milli: 0, other_milli: 187440000 }
GasCharge { name: "OnBlockOpenPerByte", compute_milli: 28800, other_milli: 91200 }
GasCharge { name: "wasm_exec", compute_milli: 1112000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "OnBlockRead", compute_milli: 4800, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 37132000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 0, other_milli: 0 }
CallReturn { return_value: None, exit_code: ExitCode { value: 17 } }
GasCharge { name: "wasm_exec", compute_milli: 23520000, other_milli: 0 }
GasCharge { name: "OnSyscall", compute_milli: 14000000, other_milli: 0 }
GasCharge { name: "wasm_exec", compute_milli: 0, other_milli: 0 }
CallReturn { return_value: None, exit_code: ExitCode { value: 17 } }
thread 'valid_precommits_then_aggregate_provecommit' panicked at 'assertion failed: `(left == right)`
  left: `ExitCode { value: 0 }`,
 right: `ExitCode { value: 17 }`: expected code 0, got 17 (message failed with backtrace:
00: f0103 (method 6) -- send aborted with code 17 (17)
01: f05 (method 5) -- no such deal 1 (17)
)', builtin/tests/util/mod.rs:48:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test valid_precommits_then_aggregate_provecommit ... FAILED

The issue comes from porting this snippet from the builtin-actors repo test which hard codes vec![1].

    let mut precommits = vec![];
    let mut sector_nos_bf = BitField::new();
    for i in 0..10u64 {
        sector_nos_bf.set(i);
        let precommit_params =
            actor.make_pre_commit_params(i, precommit_epoch - 1, expiration, vec![1]);
        let config = PreCommitConfig::new(Some(make_piece_cid("1".as_bytes())));
        let precommit = actor.pre_commit_sector_and_get(&rt, precommit_params, config, i == 0);
        precommits.push(precommit);
    }

I'm not too sure what is going on here.