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

chore: deps: update to FVM 3.3.1 #10786

Merged
merged 2 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/lotus-shed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func main() {
replayOfflineCmd,
msgindexCmd,
FevmAnalyticsCmd,
mismatchesCmd,
}

app := &cli.App{
Expand Down
54 changes: 54 additions & 0 deletions cmd/lotus-shed/mismatches.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package main

import (
"fmt"

"github.com/urfave/cli/v2"

lcli "github.com/filecoin-project/lotus/cli"
)

var mismatchesCmd = &cli.Command{
Name: "mismatches",
Description: "Walk up the chain, recomputing state, and reporting any mismatches",
Action: func(cctx *cli.Context) error {
srv, err := lcli.GetFullNodeServices(cctx)
if err != nil {
return err
}
defer srv.Close() //nolint:errcheck

api := srv.FullNodeAPI()
ctx := lcli.ReqContext(cctx)

checkTs, err := api.ChainHead(ctx)
if err != nil {
return err
}

for checkTs.Height() != 0 {
if checkTs.Height()%10000 == 0 {
fmt.Println("Reached height ", checkTs.Height())
}

execTsk := checkTs.Parents()
execTs, err := api.ChainGetTipSet(ctx, execTsk)
if err != nil {
return err
}

st, err := api.StateCompute(ctx, execTs.Height(), nil, execTsk)
if err != nil {
return err
}

if st.Root != checkTs.ParentState() {
fmt.Println("consensus mismatch found at height ", execTs.Height())
}

checkTs = execTs
}

return nil
},
}
2 changes: 1 addition & 1 deletion extern/filecoin-ffi