ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
638 stars 160 forks source link

feat(cli): forest-cli f3 certs get #4953

Closed hanabi1224 closed 3 weeks ago

hanabi1224 commented 3 weeks ago

Summary of changes

Closes of #4934

Changes introduced in this pull request:

-

Forest output:

➜  lotus git:(master) ✗ forest-cli f3 certs get 1
Instance:     1
Power Table:
  Next:       bafy2bzaceab236vmmb3n4q4tkvua2n4dphcbzzxerxuey3mot4g3cov5j3r2c
  Delta:      None
Finalized Chain:
  Length:     100
  Epochs:     2080774-2080875
  Chain:
    ├──2080774 (length: 4): [bafy2bzacedkl7pbti6lapivwkuhtspffsts2axnkcamatkmkclfk63ay2nzo4, bafy2bzacedh2x5sftutfzv26jmn227pmqh4uotgd23xmkjmz266qoblsgom3e, ...]
    ├──2080775 (length: 3): [bafy2bzacearf6rm6gw6l6msik7rsshkmqovtq3kw3o5lhqesbff3f46bcpjes, bafy2bzacebu6nrrwuej2qzjxbsgzomojfchsu3utaxobuoulf3mcc6fdx5mlo, ...]
    ├──2080776 (length: 1): [bafy2bzacecinm7enz5o6oemtw7b33m6xwyjsqk2gnmnvz3kz2bqaxkkozfl7c]
    ├──2080777 (length: 1): [bafy2bzacedldqk5p337fwumsojan764thnpz5jqx6hhmdb22nhrg2yhcic4jk]
    ├──2080778 (length: 1): [bafy2bzaceatu5wskku4c3wz5lrosqrl7frnd25qrahdbhpkmlhjjaqarlu4co]
    ├──2080779 (length: 3): [bafy2bzacecxypz43k4ek3e53psgwvv5go6slwgpi6zvns4666jj3t5czh3tae, bafy2bzacecfrwaj2w5gjyejgzpclphocfevs644pozosljm62npdaupso56s2, ...]
    ├──2080780 (length: 1): [bafy2bzacecgrfojpau3pslyke2zdod5a2m2g4g6lpe2izdjplou5lkmjnnsgq]
    ├──2080781 (length: 2): [bafy2bzacednauafqofj322umzub66ttjuz6vorgmdq4lszcyotvvywazwdc66, bafy2bzaceb4hqatypg5lzgtgsfuwoqr7imuacy4mpuhb7asdldxxwuz5ec2vk]
    ├──2080782 (length: 1): [bafy2bzacebisoykvveptxeqinmglknaggafdzdkw65aaxc6z7zqnoc4ogzypo]
    ├──2080783 (length: 2): [bafy2bzacea4kr4ekohspkkjrdvye2ao7g5nlmx6vngclpkhmhled2kbss5gpg, bafy2bzacecwmgmn2ukaqon55lchre25cjxpsho3ntggxotnfyroqd6f4qpn2y]
    └──...omitted the remaining 90 tipsets.
Signed by 4 miner(s).
➜  lotus git:(master) ✗ forest-cli f3 certs get 100
Instance:     100
Power Table:
  Next:       bafy2bzaceczg4sjwr5jaq4orehcnfzt25hbuxg5q6c2w55nwr3wnik245273q
  Delta:      Total of 206158430208 storage power across 1 miner(s).
Finalized Chain:
  Length:     2
  Epochs:     2082729-2082730
  Chain:
    ├──2082729 (length: 3): [bafy2bzacebu3nmlvq2cxcdgtshixiz255w6byzmnv4lk236dixxq3dtu5pfcw, bafy2bzacecbpc4kymogbll4wgyvfueckh7iqlojf5s26wxjpjoxwabstje4bg, ...]
    └──2082730 (length: 2): [bafy2bzacebo6prqingkkyusdannazaj2a4cgss3srhqo763izly4yye7efcd4, bafy2bzacecntatbsppnu6lvhgyxcboximozgu7nxptq5z6dyoku3ne2g7ouke]
Signed by 4 miner(s).
➜  lotus git:(master) ✗                                                  

Lotus output:

➜  forest git:(hm/cli-f3-cert-get) lotus f3 certs get 1
Instance:     1
Power Table:
  Next:       bafy2bzaceab236vmmb3n4q4tkvua2n4dphcbzzxerxuey3mot4g3cov5j3r2c
  Delta:      None
Finalized Chain:
  Length:     100
  Epochs:     2080774-2080875
  Chain:
    ├──2080774 (length: 4): [bafy2bzacedkl7pbti6lapivwkuhtspffsts2axnkcamatkmkclfk63ay2nzo4, bafy2bzacedh2x5sftutfzv26jmn227pmqh4uotgd23xmkjmz266qoblsgom3e, ...]
    ├──2080775 (length: 3): [bafy2bzacearf6rm6gw6l6msik7rsshkmqovtq3kw3o5lhqesbff3f46bcpjes, bafy2bzacebu6nrrwuej2qzjxbsgzomojfchsu3utaxobuoulf3mcc6fdx5mlo, ...]
    ├──2080776 (length: 1): [bafy2bzacecinm7enz5o6oemtw7b33m6xwyjsqk2gnmnvz3kz2bqaxkkozfl7c]
    ├──2080777 (length: 1): [bafy2bzacedldqk5p337fwumsojan764thnpz5jqx6hhmdb22nhrg2yhcic4jk]
    ├──2080778 (length: 1): [bafy2bzaceatu5wskku4c3wz5lrosqrl7frnd25qrahdbhpkmlhjjaqarlu4co]
    ├──2080779 (length: 3): [bafy2bzacecxypz43k4ek3e53psgwvv5go6slwgpi6zvns4666jj3t5czh3tae, bafy2bzacecfrwaj2w5gjyejgzpclphocfevs644pozosljm62npdaupso56s2, ...]
    ├──2080780 (length: 1): [bafy2bzacecgrfojpau3pslyke2zdod5a2m2g4g6lpe2izdjplou5lkmjnnsgq]
    ├──2080781 (length: 2): [bafy2bzacednauafqofj322umzub66ttjuz6vorgmdq4lszcyotvvywazwdc66, bafy2bzaceb4hqatypg5lzgtgsfuwoqr7imuacy4mpuhb7asdldxxwuz5ec2vk]
    ├──2080782 (length: 1): [bafy2bzacebisoykvveptxeqinmglknaggafdzdkw65aaxc6z7zqnoc4ogzypo]
    ├──2080783 (length: 2): [bafy2bzacea4kr4ekohspkkjrdvye2ao7g5nlmx6vngclpkhmhled2kbss5gpg, bafy2bzacecwmgmn2ukaqon55lchre25cjxpsho3ntggxotnfyroqd6f4qpn2y]
    └──...omitted the remaining 90 tipsets.
Signed by 4 miner(s).
➜  forest git:(hm/cli-f3-cert-get) lotus f3 certs get 100
Instance:     100
Power Table:
  Next:       bafy2bzaceczg4sjwr5jaq4orehcnfzt25hbuxg5q6c2w55nwr3wnik245273q
  Delta:      Total of 206158430208 storage power across 1 miner(s).
Finalized Chain:
  Length:     2
  Epochs:     2082729-2082730
  Chain:
    ├──2082729 (length: 3): [bafy2bzacebu3nmlvq2cxcdgtshixiz255w6byzmnv4lk236dixxq3dtu5pfcw, bafy2bzacecbpc4kymogbll4wgyvfueckh7iqlojf5s26wxjpjoxwabstje4bg, ...]
    └──2082730 (length: 2): [bafy2bzacebo6prqingkkyusdannazaj2a4cgss3srhqo763izly4yye7efcd4, bafy2bzacecntatbsppnu6lvhgyxcboximozgu7nxptq5z6dyoku3ne2g7ouke]
Signed by 4 miner(s).

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

ruseinov commented 3 weeks ago

Can't help but wonder if we should use rust-f3 struct definitions, but then again it's not necessarily for the scope of this PR/issue.