filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.85k stars 1.27k forks source link

lotus is sealing sectors with invalid deals and precommit it #5381

Closed s0nik42 closed 2 years ago

s0nik42 commented 3 years ago

Describe the bug Lotus client doesn't use the right expiration date in PreCommit when sealing a sector and failed is the calculated expiration date is closed to 1555200

Expected behavior ~Sealing succeed~

Edited by @jennijuju in actor publishstorgaedeal checks deal duration against max allowed duration(540) which means these deals fail to publish in the first place. That being said, lotus should not even attempt to seal a deal that failed publishment..

To Reproduce Steps to reproduce the behavior:

  1. lotus client deal --verified-deal --from=f3waqhsynu4a3w2a4mcwfaprd4fu6rgd3uuvt7mwj5v24br7u6vcb37xbvgbdgekaav3vcc3m6spz6etuh4aja bafykbzaced7dfy74aw5ueqoijcup7j3qzxtejuov3p7dor3mgwfdd75c3nhsm f010479 0 1545000
  2. lotus client get-deal bafyreighd7ur5uyyepv3kxbjblbjpwozzvxiaos45kwqio65wbln4kykoa
    {
    "DealInfo: ": {
    "ProposalCid": {
      "/": "bafyreighd7ur5uyyepv3kxbjblbjpwozzvxiaos45kwqio65wbln4kykoa"
    },
    "State": 29,
    "Message": "",
    "Provider": "f010479",
    "DataRef": {
      "TransferType": "graphsync",
      "Root": {
        "/": "bafykbzaced7dfy74aw5ueqoijcup7j3qzxtejuov3p7dor3mgwfdd75c3nhsm"
      },
      "PieceCid": null,
      "PieceSize": 0
    },
    "PieceCID": {
      "/": "baga6ea4seaqor6p6gk5voxr25gnrxn34ldmupkhmegtwkwohoyan3ads7uenyfa"
    },
    "Size": 34091302912,
    "PricePerEpoch": "0",
    "Duration": 1549699,
    "DealID": 1526855,
    "CreationTime": "2021-01-18T18:26:40.814774993+01:00",
    "Verified": true,
    "TransferChannelID": {
      "Initiator": "12D3KooWHbDdMYHPzGMToDMJcC4Mr9cVp6ja4vqMFCXG3Hvy6yGa",
      "Responder": "12D3KooWHZeU9K4FQ5YYNavdnuajopXWZaH39xm3QkmPYvj48M91",
      "ID": 101
    },
    "DataTransfer": {
      "TransferID": 101,
      "Status": 6,
      "BaseCID": {
        "/": "bafykbzaced7dfy74aw5ueqoijcup7j3qzxtejuov3p7dor3mgwfdd75c3nhsm"
      },
      "IsInitiator": true,
      "IsSender": true,
      "Voucher": "{\"Proposal\":{\"/\":\"bafyreighd7ur5uyyepv3kxbjblbjpwozzvxiaos45kwqio65wbln4kykoa\"}}",
      "Message": "",
      "OtherPeer": "12D3KooWHZeU9K4FQ5YYNavdnuajopXWZaH39xm3QkmPYvj48M91",
      "Transferred": 33829647889
    }
    },
    "OnChain": {
    "Proposal": {
      "PieceCID": {
        "/": "baga6ea4seaqor6p6gk5voxr25gnrxn34ldmupkhmegtwkwohoyan3ads7uenyfa"
      },
      "PieceSize": 34359738368,
      "VerifiedDeal": true,
      "Client": "f08391",
      "Provider": "f010479",
      "Label": "mAXCg5AIg/jLj/AW7QkHISKj/p3DN5kTR1dv+N0dsNYox/6LbTyY",
      "StartEpoch": 428657,
      "EndEpoch": 1978356,
      "StoragePricePerEpoch": "0",
      "ProviderCollateral": "14072259607917016",
      "ClientCollateral": "0"
    },
    "State": {
      "SectorStartEpoch": -1,
      "LastUpdatedEpoch": -1,
      "SlashEpoch": -1
    }
    }
    }
  3. See error msector 1672 --log|tail -3
  4. 2021-01-19 11:15:26 +0100 CET: [event;sealing.SectorRetryPreCommit] {"User":{}}
  5. 2021-01-19 11:15:26 +0100 CET: [event;sealing.SectorChainPreCommitFailed] {"User":{}} pushing message to mpool: GasEstimateMessageGas error: estimating gas used: message execution failed: exit 16, reason: invalid expiration 1981236, cannot be more than 1555200 past current epoch 424831 (RetCode=16)

Screenshots If applicable, add screenshots to help explain your problem.

Version (run lotus version): Daemon: 1.4.0+git.e9989d0e4+api1.0.0 Local: lotus version 1.4.0+git.e9989d0e4

Additional context Add any other context about the problem here.

benjaminh83 commented 3 years ago

I got the same error while trying to seal an offline-deal (same settings as s0nik42). Error reported in miner log, when PC2 is done: submitting precommit for sector 3268 (deposit: 857506149729424052):

2021-01-18T21:47:17.702+0100 WARN sectors storage-sealing/fsm.go:511 sector 3268 got error event sealing.SectorChainPreCommitFailed: pushing message to mpool: GasEstimateMessageGas error: estimating gas used: message execution failed: exit 16, reason: invalid expiration 1985032, cannot be more than 1555200 past current epoch 423215 (RetCode=16)

jennijuju commented 3 years ago

For example(from @raulk ):

rjan90 commented 2 years ago

I think this issue can be closed now? #rengjøring

Reiers commented 2 years ago

Merged,

Closing ticket.