Merge pull request #4243 from filecoin-project/conformance/rm-faked-syscalls
This commit is contained in:
commit
4c8084dcb0
@ -14,6 +14,9 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
|
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
|
||||||
"github.com/filecoin-project/lotus/lib/blockstore"
|
"github.com/filecoin-project/lotus/lib/blockstore"
|
||||||
|
|
||||||
|
_ "github.com/filecoin-project/lotus/lib/sigs/bls" // enable bls signatures
|
||||||
|
_ "github.com/filecoin-project/lotus/lib/sigs/secp" // enable secp signatures
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-state-types/big"
|
"github.com/filecoin-project/go-state-types/big"
|
||||||
"github.com/filecoin-project/go-state-types/crypto"
|
"github.com/filecoin-project/go-state-types/crypto"
|
||||||
@ -81,7 +84,7 @@ type ExecuteTipsetResult struct {
|
|||||||
// and reward withdrawal per miner.
|
// and reward withdrawal per miner.
|
||||||
func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, preroot cid.Cid, parentEpoch abi.ChainEpoch, tipset *schema.Tipset) (*ExecuteTipsetResult, error) {
|
func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, preroot cid.Cid, parentEpoch abi.ChainEpoch, tipset *schema.Tipset) (*ExecuteTipsetResult, error) {
|
||||||
var (
|
var (
|
||||||
syscalls = mkFakedSigSyscalls(vm.Syscalls(ffiwrapper.ProofVerifier))
|
syscalls = vm.Syscalls(ffiwrapper.ProofVerifier)
|
||||||
vmRand = NewFixedRand()
|
vmRand = NewFixedRand()
|
||||||
|
|
||||||
cs = store.NewChainStore(bs, ds, syscalls)
|
cs = store.NewChainStore(bs, ds, syscalls)
|
||||||
@ -173,7 +176,7 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP
|
|||||||
StateBase: params.Preroot,
|
StateBase: params.Preroot,
|
||||||
Epoch: params.Epoch,
|
Epoch: params.Epoch,
|
||||||
Bstore: bs,
|
Bstore: bs,
|
||||||
Syscalls: mkFakedSigSyscalls(vm.Syscalls(ffiwrapper.ProofVerifier)), // TODO always succeeds; need more flexibility.
|
Syscalls: vm.Syscalls(ffiwrapper.ProofVerifier),
|
||||||
CircSupplyCalc: func(_ context.Context, _ abi.ChainEpoch, _ *state.StateTree) (abi.TokenAmount, error) {
|
CircSupplyCalc: func(_ context.Context, _ abi.ChainEpoch, _ *state.StateTree) (abi.TokenAmount, error) {
|
||||||
return params.CircSupply, nil
|
return params.CircSupply, nil
|
||||||
},
|
},
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
package conformance
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/specs-actors/actors/runtime/proof"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/state"
|
|
||||||
"github.com/filecoin-project/lotus/chain/vm"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/crypto"
|
|
||||||
"github.com/filecoin-project/specs-actors/actors/runtime"
|
|
||||||
|
|
||||||
cbor "github.com/ipfs/go-ipld-cbor"
|
|
||||||
)
|
|
||||||
|
|
||||||
type testSyscalls struct {
|
|
||||||
runtime.Syscalls
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO VerifySignature this will always succeed; but we want to be able to test failures too.
|
|
||||||
func (fss *testSyscalls) VerifySignature(_ crypto.Signature, _ address.Address, _ []byte) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO VerifySeal this will always succeed; but we want to be able to test failures too.
|
|
||||||
func (fss *testSyscalls) VerifySeal(_ proof.SealVerifyInfo) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO VerifyPoSt this will always succeed; but we want to be able to test failures too.
|
|
||||||
func (fss *testSyscalls) VerifyPoSt(_ proof.WindowPoStVerifyInfo) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func mkFakedSigSyscalls(base vm.SyscallBuilder) vm.SyscallBuilder {
|
|
||||||
return func(ctx context.Context, cstate *state.StateTree, cst cbor.IpldStore) runtime.Syscalls {
|
|
||||||
return &testSyscalls{
|
|
||||||
base(ctx, cstate, cst),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
2
extern/test-vectors
vendored
2
extern/test-vectors
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 7471e2805fc3e459e4ee325775633e8ec76cb7c6
|
Subproject commit a8f968adeba1995f161f7be0048188affc425079
|
Loading…
Reference in New Issue
Block a user