Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulate all methods against builtin actor #8483

Closed
jennijuju opened this issue Apr 13, 2022 · 6 comments
Closed

simulate all methods against builtin actor #8483

jennijuju opened this issue Apr 13, 2022 · 6 comments
Assignees
Labels
P1 P1: Must be resolved
Milestone

Comments

@jennijuju
Copy link
Member

while the test coverage continues to increase, we also have a better understanding whether the builtin actor works fully with the current mainnet, and will continue work with after nv16 migration

Currently, there are two potential ways we can do that:

  • lotus-sim: is a tooling that tests how the VM and actors work as the network grows & network upgrade. (see more in feat: implement lotus-sim #6406 - steb has volunteered to give a walk through on how this thing works if you wanna explore this option); to hopefully catch state mismatch, you will need to do some tweaking to run both VM
  • creates a series of lotus-shed tooling for constructing the messages and send it to the chain
@arajasek
Copy link
Contributor

arajasek commented Apr 19, 2022

I think lotus-sim is good for seeing how things scale, but doesn't capture the full range of possible messages. I think we should also do the following against a testnet:

  • - Make a deal (lotus client import, then lotus client deal)
    • perform a PAID retrieval for the data (tests payment channels)
    • settle and collect payment channel
  • - Invoke CompactPartitions, which is rarely used on mainnet
  • This probably requires adding some large number of sectors, and then terminating (say) 50% of them. The preminers on catterpillarnet are a good candidate.
  • Also definitely needs a shed command, because nothing invokes this yet afaik
  • - Dispute WindowedPost
  • Run a lotus disputer
  • Either write a shed command that intentionally sends a bad PoSt, or hack the Lotus miner to send garbage posts
  • Check that the disputer catches this bad post, and successfully disputes it
  • - Report a consensus fault successfully:
  • Easiest way to do this is to take the worker key of a miner that has power in the network
  • (Write a shed command to) "Sign" 2 blocks at the same height -- easiest way to do that is probably to find a block already mined by the miner, and sign a slightly different second block based on that
  • Marshal these signed blocks into the params for a VerifyConsensusFault message, and send it (any sender)
  • - Make a verified deal (requires access to the VRK, creating verifier & verified client)
  • - Snap a deal
  • - ExtendSectorExpiration for any sector

@geoff-vball
Copy link
Contributor

geoff-vball commented May 11, 2022

Calling paych collect seemed to hang when called by the miner on the cli, the message was correctly processed and successfully executed. I'll re-run this test to see if it's a real issue.

Update: seems to be fine

@geoff-vball
Copy link
Contributor

geoff-vball commented May 13, 2022

Running a disputer did not seem to catch an invalid windowed-post. Calling dispute from the cli also errored out for some reason.

This should be fixed by a PR by @Stebalien

@geoff-vball
Copy link
Contributor

geoff-vball commented May 23, 2022

"lotus state compute-state --html" Issue found here #8636

Edit: Issue has been fixed

@jennijuju jennijuju added this to the Network v16 milestone May 23, 2022
@geoff-vball
Copy link
Contributor

geoff-vball commented May 23, 2022

Isuee found with snapping deals: #8703

Edit: Issue has been fixed

@arajasek arajasek reopened this Jun 1, 2022
@geoff-vball
Copy link
Contributor

geoff-vball commented Jun 1, 2022

Steps for each test conducted:

  • Make a deal and perform a paid retrieval for the data

    • You may need to edit the miner's config to allow for online deals. Usually located in /var/lib/
    • lotus client import <file> , then lotus client deal
    • sudo lotus-miner storage-deals pending-publish --publish-now
    • Wait for new sector to show up in lotus-miner sectors list
    • lotus-miner sectors seal <sector num>
    • Wait for sector to enter the state SubmitPreCommitBatch
    • lotus-miner sectors batching precommit --publish-now
    • Wait for sector to enter the state SubmitCommitAggregate
    • lotus-miner sectors batching commit --publish-now
    • Wait for sector to become active.
    • perform a PAID retrieval for the data (tests payment channels)
      • You may need to set a retrieval price on the SP sudo lotus-miner retrieval-deals set-ask --price <price>
      • lotus client retrieve --maxPrice <price> <data CID> retr.txt
      • Get the CID of the payment channel: lotus paych list
      • lotus paych settle <paych CID>
      • Wait 12 hours, then lotus paych collect <paych CID>
  • Invoke CompactPartitions, which has never been used on mainnet

    • Add some large number of sectors, and then terminate (say) 50% of them.
    • Compact the partitions: lotus-miner sectors compact-partitions --really-do-it --deadline <deadline num> --partitions={0,1,2} --actor <miner addr>
    • All terminated sectors in the partitions specified should be gone. Partitions should be packed as tightly as allowed.
  • Dispute WindowedPost

    • Start a disputer: lotus chain disputer start
    • Submit a bad windowed post: lotus-shed send-invalid-windowed-post --really-do-it --partitions={0,1,2} --actor <Miner addr>
      • This command probably needs to be run on a loop. It need to be sent at the beginning of the challenge window, before the miner gets a chance to send their correct post. Any partitions in the deadline not included in the bad post will probably be marked for not submitting a post during the challenge window, because the post from the miner will be rejected for having some partitions that have already been "proved".
    • Check that the disputer catches this bad post, and successfully disputes it.
  • Report a consensus fault successfully:

    • lotus-shed generate-and-send-consensus-fault <block CID>
      • This command takes the CID of a block won by a miner you have the key for (so they can sign another block and create a consensus fault). To get this you can run lotus chain list and pick a block mined by the miner you own.
  • Extend a sector expiration

    • sudo lotus-miner sectors extend --new-expiration <expiration epoch> <sector num>
    • lotus-miner sectors list to check if sector expiration has been updated
  • Make a verified deal

    • Add verified data to your client
      • You may need Travis to add the verifreg key to the wallet in the toolshed
      • ssh [email protected]
      • sudo lotus-shed add-verifier <VRK signer> <notary> <allowance>
      • sudo lotus filplus grant-datacap --from=<notary> <client> <allowance>
    • make a deal with your client while choosing verified = yes
    • check that the resulting deal uses verified data
  • Snap a deal

    • Create a CC sector on your miner
    • make a deal from your client
    • sudo lotus-miner sectors snap-up <sector num>
    • sudo lotus-miner storage-deals pending-publish --publish-now
    • sudo lotus-miner sectors seal <sector num>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 P1: Must be resolved
Projects
None yet
Development

No branches or pull requests

3 participants