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

Fix(core/scripts): removes panic and adds node public keys to peer #15950

Merged
merged 2 commits into from
Jan 16, 2025
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
7 changes: 7 additions & 0 deletions .changeset/eight-meals-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"chainlink": patch
---

Prevents a panic in test helper for confirming transaction
and adds encrypted public key to a peer before calling addNodes
on CapabilitiesRegistry
5 changes: 5 additions & 0 deletions core/scripts/common/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ func TenderlySimLink(simID string) string {

// ConfirmTXMined confirms that the given transaction is mined and prints useful execution information.
func ConfirmTXMined(context context.Context, client *ethclient.Client, transaction *types.Transaction, chainID int64, txInfo ...string) (receipt *types.Receipt) {
if transaction == nil {
fmt.Println("No transaction to confirm")
return
}

fmt.Println("Executing TX", ExplorerLink(chainID, transaction.Hash()), txInfo)
receipt, err := bind.WaitMined(context, client, transaction)
PanicErr(err)
Expand Down
16 changes: 13 additions & 3 deletions core/scripts/keystone/src/88_capabilities_registry_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,23 @@ func peerToNode(nopID uint32, p peer) (kcr.CapabilitiesRegistryNodeParams, error
return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert signer: %w", err)
}

epk := strings.TrimPrefix(p.EncryptionPublicKey, "0x")
epkB, err := hex.DecodeString(epk)
if err != nil {
return kcr.CapabilitiesRegistryNodeParams{}, fmt.Errorf("failed to convert encryptionPublicKey: %w", err)
}

var epkb [32]byte
copy(epkb[:], epkB)

var sigb [32]byte
copy(sigb[:], signerB)

return kcr.CapabilitiesRegistryNodeParams{
NodeOperatorId: nopID,
P2pId: peerIDB,
Signer: sigb,
NodeOperatorId: nopID,
P2pId: peerIDB,
Signer: sigb,
EncryptionPublicKey: epkb,
}, nil
}

Expand Down
Loading