Skip to content

Commit

Permalink
Do not truncate non-EVM keys
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Nov 22, 2024
1 parent 31de9e5 commit 73835e1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion deployment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package deployment
import (
"bytes"
"context"
"encoding/hex"
"errors"
"fmt"
"math/big"
Expand Down Expand Up @@ -346,9 +347,17 @@ func NodeInfo(nodeIDs []string, oc NodeChainConfigsLister) (Nodes, error) {
var cpk types3.ConfigEncryptionPublicKey
copy(cpk[:], b)

var pubkey types3.OnchainPublicKey
if chainConfig.Chain.Type == nodev1.ChainType_CHAIN_TYPE_EVM {
// convert from pubkey to address
pubkey = common.HexToAddress(chainConfig.Ocr2Config.OcrKeyBundle.OnchainSigningAddress).Bytes()
} else {
pubkey = common.Hex2Bytes(chainConfig.Ocr2Config.OcrKeyBundle.OnchainSigningAddress)
}

ocrConfig := OCRConfig{
OffchainPublicKey: opk,
OnchainPublicKey: common.HexToAddress(chainConfig.Ocr2Config.OcrKeyBundle.OnchainSigningAddress).Bytes(),
OnchainPublicKey: pubkey,
PeerID: MustPeerIDFromString(chainConfig.Ocr2Config.P2PKeyBundle.PeerId),
TransmitAccount: types2.Account(chainConfig.AccountAddress),
ConfigEncryptionPublicKey: cpk,
Expand Down

0 comments on commit 73835e1

Please sign in to comment.