Skip to content

Commit

Permalink
fixed generate_slashings task
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Dec 21, 2023
1 parent 8e9479b commit 68c5e77
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 0 additions & 5 deletions pkg/coordinator/tasks/generate_slashings/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Config struct {
Mnemonic string `yaml:"mnemonic" json:"mnemonic"`
StartIndex int `yaml:"startIndex" json:"startIndex"`
IndexCount int `yaml:"indexCount" json:"indexCount"`
TargetAddress string `yaml:"targetAddress" json:"targetAddress"`
ClientPattern string `yaml:"clientPattern" json:"clientPattern"`
}

Expand All @@ -30,9 +29,5 @@ func (c *Config) Validate() error {
return errors.New("mnemonic must be set")
}

if c.TargetAddress == "" {
return errors.New("targetAddress must be set")
}

return nil
}
8 changes: 1 addition & 7 deletions pkg/coordinator/tasks/generate_slashings/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type Task struct {
withdrSeed []byte
nextIndex uint64
lastIndex uint64
targetAddr common.Eth1Address
}

func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error) {
Expand Down Expand Up @@ -101,11 +100,6 @@ func (t *Task) LoadConfig() error {
return err
}

err = t.targetAddr.UnmarshalText([]byte(config.TargetAddress))
if err != nil {
return fmt.Errorf("cannot decode execution addr: %w", err)
}

t.config = config

return nil
Expand Down Expand Up @@ -351,7 +345,7 @@ func (t *Task) generateSurroundAttesterSlashing(validatorIndex uint64, validator
signingRoot1 := common.ComputeSigningRoot(msgRoot1, dom)
sig1 := secKey.SignHash(signingRoot1[:])

msgRoot2, err := attestationData1.HashTreeRoot()
msgRoot2, err := attestationData2.HashTreeRoot()
if err != nil {
return nil, fmt.Errorf("cannot build attestation2 data tree root: %v", err)
}
Expand Down

0 comments on commit 68c5e77

Please sign in to comment.