From fa59cdc2add8221b49c41c4b6906183555cbce42 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Tue, 5 May 2020 17:04:25 -0700 Subject: [PATCH] update to specs-actors code with faster publish deals --- api/test/deals.go | 1 + chain/stmgr/utils.go | 10 +++++++++- chain/validation/applier.go | 2 ++ chain/validation/factories.go | 2 ++ chain/vm/validation_test.go | 2 ++ go.mod | 4 ++-- go.sum | 4 ++++ markets/storageadapter/client.go | 2 +- 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/api/test/deals.go b/api/test/deals.go index 2414d3fe2..49d168512 100644 --- a/api/test/deals.go +++ b/api/test/deals.go @@ -13,6 +13,7 @@ import ( "github.com/ipfs/go-cid" + "github.com/ipfs/go-car" files "github.com/ipfs/go-ipfs-files" logging "github.com/ipfs/go-log/v2" "github.com/ipld/go-car" diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index ce9326e0a..a216df23e 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -289,11 +289,19 @@ func GetStorageDeal(ctx context.Context, sm *StateManager, dealId abi.DealID, ts return nil, err } - st, err := sa.Get(dealId) + st, found, err := sa.Get(dealId) if err != nil { return nil, err } + if !found { + st = &market.DealState{ + SectorStartEpoch: -1, + LastUpdatedEpoch: -1, + SlashEpoch: -1, + } + } + return &api.MarketDeal{ Proposal: dp, State: *st, diff --git a/chain/validation/applier.go b/chain/validation/applier.go index 89924ebee..34cc8b54c 100644 --- a/chain/validation/applier.go +++ b/chain/validation/applier.go @@ -1,5 +1,6 @@ package validation +/* import ( "context" @@ -185,3 +186,4 @@ func toLotusSignedMsg(msg *vtypes.SignedMessage) *types.SignedMessage { Signature: msg.Signature, } } +*/ diff --git a/chain/validation/factories.go b/chain/validation/factories.go index 223382538..b01243d1c 100644 --- a/chain/validation/factories.go +++ b/chain/validation/factories.go @@ -1,5 +1,6 @@ package validation +/* import ( "context" @@ -45,3 +46,4 @@ func (f *Factories) NewValidationConfig() vstate.ValidationConfig { checkState := true return NewConfig(trackGas, checkExit, checkRet, checkState) } +*/ diff --git a/chain/vm/validation_test.go b/chain/vm/validation_test.go index c84cb4adc..fdd5cdd18 100644 --- a/chain/vm/validation_test.go +++ b/chain/vm/validation_test.go @@ -1,5 +1,6 @@ package vm_test +/* import ( "fmt" "reflect" @@ -67,3 +68,4 @@ func caseName(testCase suites.TestCase) string { toks := strings.Split(fqName, ".") return toks[len(toks)-1] } +*/ diff --git a/go.mod b/go.mod index c294c6dd6..a95c179dd 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/filecoin-project/chain-validation v0.0.6-0.20200430201010-ce84f6e96519 github.com/filecoin-project/filecoin-ffi v0.0.0-20200427223233-a0014b17f124 github.com/filecoin-project/go-address v0.0.2-0.20200504173055-8b6f2fb2b3ef - github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e + github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200424220931-6263827e49f2 github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060 github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 @@ -28,7 +28,7 @@ require ( github.com/filecoin-project/go-statestore v0.1.0 github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b github.com/filecoin-project/sector-storage v0.0.0-20200501181153-e4a9a16161e9 - github.com/filecoin-project/specs-actors v0.3.0 + github.com/filecoin-project/specs-actors v0.3.2-0.20200506000243-d5e9b63cb877 github.com/filecoin-project/specs-storage v0.0.0-20200417134612-61b2d91a6102 github.com/filecoin-project/storage-fsm v0.0.0-20200427182014-01487d5ad3c8 github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 diff --git a/go.sum b/go.sum index a8b1374b1..4a70cd2ec 100644 --- a/go.sum +++ b/go.sum @@ -148,6 +148,8 @@ github.com/filecoin-project/go-amt-ipld v0.0.0-20191205011053-79efc22d6cdc/go.mo github.com/filecoin-project/go-amt-ipld/v2 v2.0.0/go.mod h1:PAZ5tvSfMfWE327osqFXKm7cBpCpBk2Nh0qKsJUmjjk= github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e h1:IOoff6yAZSJ5zHCPY2jzGNwQYQU6ygsRVe/cSnJrY+o= github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200131012142-05d80eeccc5e/go.mod h1:boRtQhzmxNocrMxOXo1NYn4oUc1NGvR8tEa79wApNXg= +github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200424220931-6263827e49f2 h1:jamfsxfK0Q9yCMHt8MPWx7Aa/O9k2Lve8eSc6FILYGQ= +github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200424220931-6263827e49f2/go.mod h1:boRtQhzmxNocrMxOXo1NYn4oUc1NGvR8tEa79wApNXg= github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw= github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060 h1:/3qjGMn6ukXgZJHsIbuwGL7ipla8DOV3uHZDBJkBYfU= github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw= @@ -189,6 +191,8 @@ github.com/filecoin-project/specs-actors v0.2.0/go.mod h1:nQYnFbQ7Y0bHZyq6HDEuVl github.com/filecoin-project/specs-actors v0.2.0/go.mod h1:nQYnFbQ7Y0bHZyq6HDEuVlCPR+U3z5Q3wMOQ+2aiV+Y= github.com/filecoin-project/specs-actors v0.3.0 h1:QxgAuTrZr5TPqjyprZk0nTYW5o0JWpzbb5v+4UHHvN0= github.com/filecoin-project/specs-actors v0.3.0/go.mod h1:nQYnFbQ7Y0bHZyq6HDEuVlCPR+U3z5Q3wMOQ+2aiV+Y= +github.com/filecoin-project/specs-actors v0.3.2-0.20200506000243-d5e9b63cb877 h1:oui5QOuA5EIIcVEr9gcz2hPGGHQgQ6/IBgf4m10xnis= +github.com/filecoin-project/specs-actors v0.3.2-0.20200506000243-d5e9b63cb877/go.mod h1:UW3ft23q6VS8wQoNqLWjENsu9gu1uh6lxOd+H8cwhT8= github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275 h1:6OTcpsTQBQM0f/A67oEi4E4YtYd6fzkMqbU8cPIWMMs= github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275/go.mod h1:xJ1/xl9+8zZeSSSFmDC3Wr6uusCTxyYPI0VeNVSFmPE= github.com/filecoin-project/specs-storage v0.0.0-20200417134612-61b2d91a6102 h1:T3f/zkuvgtgqcXrb0NO3BicuveGOxxUAMPa/Yif2kuE= diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go index 0cc0a4311..754327076 100644 --- a/markets/storageadapter/client.go +++ b/markets/storageadapter/client.go @@ -233,7 +233,7 @@ func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider if err != nil { // TODO: This may be fine for some errors - return false, false, xerrors.Errorf("failed to look up deal on chain: %w", err) + return false, false, xerrors.Errorf("client: failed to look up deal on chain: %w", err) } if sd.State.SectorStartEpoch > 0 {