From 4e41479464aeaea59991dc7512dc54622b3697e9 Mon Sep 17 00:00:00 2001 From: frrist Date: Wed, 4 Mar 2020 17:15:35 -0800 Subject: [PATCH] bls key deterministic, enable paych test --- chain/validation/factories.go | 2 +- chain/validation/keymanager.go | 4 ++-- chain/vm/validation_test.go | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/chain/validation/factories.go b/chain/validation/factories.go index 2b5291426..d91af2b98 100644 --- a/chain/validation/factories.go +++ b/chain/validation/factories.go @@ -39,7 +39,7 @@ func (f *Factories) NewRandomnessSource() vstate.RandomnessSource { } func (f *Factories) NewValidationConfig() vstate.ValidationConfig { - trackGas := false + trackGas := true checkExit := false checkRet := false // ignore gas and return value assertions diff --git a/chain/validation/keymanager.go b/chain/validation/keymanager.go index a0ae8478b..3161883b9 100644 --- a/chain/validation/keymanager.go +++ b/chain/validation/keymanager.go @@ -8,7 +8,6 @@ import ( "github.com/filecoin-project/go-crypto" acrypto "github.com/filecoin-project/specs-actors/actors/crypto" - ffi "github.com/filecoin-project/filecoin-ffi" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" ) @@ -87,7 +86,8 @@ func (k *KeyManager) newBLSKey() *wallet.Key { // FIXME: bls needs deterministic key generation //sk := ffi.PrivateKeyGenerate(s.blsSeed) // s.blsSeed++ - sk := ffi.PrivateKeyGenerate() + sk := [32]byte{} + sk[0] = uint8(k.blsSeed+1) // hack to keep gas values determinist key, err := wallet.NewKey(types.KeyInfo{ Type: wallet.KTBLS, PrivateKey: sk[:], diff --git a/chain/vm/validation_test.go b/chain/vm/validation_test.go index 408144cda..79e7dee18 100644 --- a/chain/vm/validation_test.go +++ b/chain/vm/validation_test.go @@ -36,8 +36,6 @@ func init() { // initialize the test skipper with tests being skipped TestSuiteSkipper = TestSkipper{testSkips: []suites.TestCase{ - // Fails due to gas mismatches - message.TestPaych, // Fails due to state initialization message.TestMultiSigActor,