Skip to content

Instantly share code, notes, and snippets.

@ZenGround0
Last active November 25, 2020 01:09
Show Gist options
  • Save ZenGround0/715e3b4a45285b956209c248098b0748 to your computer and use it in GitHub Desktop.
Save ZenGround0/715e3b4a45285b956209c248098b0748 to your computer and use it in GitHub Desktop.
Use ent for post-upgrade validation

Run a lotus node and sync the filecoin blockchain up to the height you want to validate

One way to see how far you've synced is to inspect the output of ./lotus sync wait

Get the inspection-cid

"inspection-cid" is the cid of the block header at inspection-epoch, the epoch whose parent state you want to validate.

By Using the lotus daemon

  1. ./lotus chain head to get your node's current head if inspection-epoch is head height. A list of cids is output, copy one of them.
  2. ./lotus chain list --height=<inspection-epoch> --count=1 if head is above inspection epoch. A list of cid to miner mappings is output, copy one of them.

By Using filfox

Navigate to https://filfox.info/en/tipset/<inspection-height>

Note

If inspection-height is not simply head height there could be a null block at this height and you will need to try another epoch

Shut down lotus node

You need to do this so that ent can get access to the lotus datastore.

Use ent to get (epoch, state-root) pairs

ent info roots <inspection-cid> 1 Note this will take a few seconds. It will output Epoch <epoch>: <state-root>

validate state using ent

ent validate v2 <state-root> <epoch> Note this can take several minutes. Depending on hardware and current state size > 10 minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment