Skip to content

Commit

Permalink
adds checkdouble sign flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Dec 5, 2024
1 parent 7e4ed59 commit 309d847
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 190 deletions.
9 changes: 8 additions & 1 deletion finality-provider/cmd/fpd/daemon/daemon_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ func CommandAddFinalitySig() *cobra.Command {
}
cmd.Flags().String(fpdDaemonAddressFlag, defaultFpdDaemonAddress, "The RPC server address of fpd")
cmd.Flags().String(appHashFlag, defaultAppHashStr, "The last commit hash of the chain block")
cmd.Flags().Bool(checkDoubleSignFlag, true, "If 'true', uses anti-slashing protection when doing EOTS sign")

return cmd
}

Expand All @@ -383,6 +385,11 @@ func runCommandAddFinalitySig(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to read flag %s: %w", appHashFlag, err)
}

checkDoubleSign, err := flags.GetBool(checkDoubleSignFlag)
if err != nil {
return fmt.Errorf("failed to read flag %s: %w", checkDoubleSignFlag, err)
}

client, cleanUp, err := dc.NewFinalityProviderServiceGRpcClient(daemonAddress)
if err != nil {
return err
Expand All @@ -398,7 +405,7 @@ func runCommandAddFinalitySig(cmd *cobra.Command, args []string) error {
return err
}

res, err := client.AddFinalitySignature(context.Background(), fpPk.MarshalHex(), blkHeight, appHash)
res, err := client.AddFinalitySignature(context.Background(), fpPk.MarshalHex(), blkHeight, appHash, checkDoubleSign)
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions finality-provider/cmd/fpd/daemon/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const (
hdPathFlag = "hd-path"
chainIDFlag = "chain-id"
signedFlag = "signed"
checkDoubleSignFlag = "check-double-sign"

// flags for description
monikerFlag = "moniker"
Expand Down
Loading

0 comments on commit 309d847

Please sign in to comment.