Skip to content

Commit

Permalink
add salt
Browse files Browse the repository at this point in the history
  • Loading branch information
fyInALT committed Apr 1, 2024
1 parent 71e723b commit 47d8dc1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion operator/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import (
"encoding/json"
"fmt"
"math/big"
"time"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"

"github.com/Layr-Labs/eigensdk-go/crypto/bls"
eigenSdkTypes "github.com/Layr-Labs/eigensdk-go/types"
Expand Down Expand Up @@ -53,7 +55,14 @@ func (o *Operator) RegisterOperatorWithAvs(
// hardcode these things for now
quorumNumbers := []byte{0}
socket := o.config.OperatorSocket
operatorToAvsRegistrationSigSalt := [32]byte{123}

// Generate salt and expiry
privateKeyBytes := []byte(o.blsKeypair.PrivKey.String())
salt := [32]byte{}
copy(salt[:], crypto.Keccak256([]byte("churn"), []byte(time.Now().String()), quorumNumbers[:], privateKeyBytes))

operatorToAvsRegistrationSigSalt := salt

curBlockNum, err := o.ethClient.BlockNumber(context.Background())
if err != nil {
o.logger.Errorf("Unable to get current block number")
Expand Down

0 comments on commit 47d8dc1

Please sign in to comment.