Skip to content

Instantly share code, notes, and snippets.

@vmx
Created September 20, 2023 13:57
Show Gist options
  • Save vmx/2b7164f30067e919428c8a3814e824db to your computer and use it in GitHub Desktop.
Save vmx/2b7164f30067e919428c8a3814e824db to your computer and use it in GitHub Desktop.
Running lotus-bench for 2KiB sector
#!/bin/sh
# `OUT_DIR` determines where to put the files generated by this script.
# The default directory is `/tmp/lotusbenchdata`
${OUT_DIR:=/tmp/lotusbenchdata}
mkdir -p "${OUT_DIR}"
# Create unsealed sector file
./lotus-bench simple addpiece --sector-size 2K /dev/zero "${OUT_DIR}/unsealed"
# Run PreCommit1
./lotus-bench simple precommit1 --sector-size 2k "${OUT_DIR}/unsealed" "${OUT_DIR}/sealed" "${OUT_DIR}/cache" baga6ea4seaqpy7usqklokfx2vxuynmupslkeutzexe2uqurdg5vhtebhxqmpqmy 2048
# Run PreCommit2
./lotus-bench simple precommit2 --sector-size 2k "${OUT_DIR}/sealed" "${OUT_DIR}/cache" eyJfbG90dXNfU2VhbFJhbmRvbW5lc3MiOiJBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBPSIsImNvbW1fZCI6WzI1MiwxMjYsMTQ2LDEzMCwxNTAsMjI5LDIyLDI1MCwxNzMsMjMzLDEzNCwxNzgsMTQzLDE0NiwyMTIsNzQsNzksMzYsMTg1LDUzLDcyLDgyLDM1LDU1LDEwNiwxMjEsMTQ0LDM5LDE4OCwyNCwyNDgsNTFdLCJjb25maWciOnsiaWQiOiJ0cmVlLWQiLCJwYXRoIjoiLi4vY2FjaGUiLCJyb3dzX3RvX2Rpc2NhcmQiOjUsInNpemUiOjEyN30sImxhYmVscyI6eyJTdGFja2VkRHJnMktpQlYxIjp7Il9oIjpudWxsLCJsYWJlbHMiOlt7ImlkIjoibGF5ZXItMSIsInBhdGgiOiIuLi9jYWNoZSIsInJvd3NfdG9fZGlzY2FyZCI6NSwic2l6ZSI6NjR9LHsiaWQiOiJsYXllci0yIiwicGF0aCI6Ii4uL2NhY2hlIiwicm93c190b19kaXNjYXJkIjo1LCJzaXplIjo2NH1dfX0sInJlZ2lzdGVyZWRfcHJvb2YiOiJTdGFja2VkRHJnMktpQlYxXzEifQ==
# Run Commit1
./lotus-bench simple commit1 --sector-size 2k "${OUT_DIR}/sealed" "${OUT_DIR}/cache" baga6ea4seaqpy7usqklokfx2vxuynmupslkeutzexe2uqurdg5vhtebhxqmpqmy bagboea4b5abcbrshxgmmpaucffwp2elaofbcrvb7hmcu3653o4lsw2arlor4hn3c "${OUT_DIR}/c1.json"
# Run Commit2
./lotus-bench simple commit2 "${OUT_DIR}/c1.json"
# Make the cache directory read-only, that triggers the bug
chmod -R -w "${OUT_DIR}/cache"
# Try window-post
./lotus-bench simple window-post --sector-size 2k "${OUT_DIR}/sealed" "${OUT_DIR}/cache" bagboea4b5abcbrshxgmmpaucffwp2elaofbcrvb7hmcu3653o4lsw2arlor4hn3c 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment