Skip to content

Commit

Permalink
more logging & fix signature bug
Browse files Browse the repository at this point in the history
  • Loading branch information
krehermann committed Oct 21, 2024
1 parent 87c7a21 commit 8546727
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 12 additions & 2 deletions integration-tests/deployment/keystone/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

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

"github.com/smartcontractkit/chainlink/integration-tests/deployment"
Expand Down Expand Up @@ -267,7 +268,7 @@ func ConfigureForwardContracts(env *deployment.Environment, dons []RegisteredDon
return fmt.Errorf("no forwarder contract found for chain %d", chain.Selector)
}

err := configureForwarder(chain, fwrd, dons)
err := configureForwarder(env.Logger, chain, fwrd, dons)
if err != nil {
return fmt.Errorf("failed to configure forwarder for chain selector %d: %w", chain.Selector, err)
}
Expand Down Expand Up @@ -768,7 +769,7 @@ func registerDons(lggr logger.Logger, req registerDonsRequest) (*registerDonsRes

// configureForwarder sets the config for the forwarder contract on the chain for all Dons that accept workflows
// dons that don't accept workflows are not registered with the forwarder
func configureForwarder(chain deployment.Chain, fwdr *kf.KeystoneForwarder, dons []RegisteredDon) error {
func configureForwarder(lggr logger.Logger, chain deployment.Chain, fwdr *kf.KeystoneForwarder, dons []RegisteredDon) error {
if fwdr == nil {
return errors.New("nil forwarder contract")
}
Expand All @@ -787,10 +788,19 @@ func configureForwarder(chain deployment.Chain, fwdr *kf.KeystoneForwarder, dons
err = DecodeErr(kf.KeystoneForwarderABI, err)
return fmt.Errorf("failed to confirm SetConfig for forwarder %s: %w", fwdr.Address().String(), err)
}
lggr.Debugw("configured forwarder", "forwarder", fwdr.Address().String(), "donId", dn.Info.Id, "version", ver, "f", dn.Info.F, "signersAddrs", dn.signers(), "signersStr", signersToAddresses(dn.signers()))
}
return nil
}

func signersToAddresses(signers []common.Address) []string {
var addrs []string
for _, s := range signers {
addrs = append(addrs, s.String())
}
return addrs
}

type configureOCR3Request struct {
cfg *OracleConfigSource
chain deployment.Chain
Expand Down
7 changes: 6 additions & 1 deletion integration-tests/deployment/keystone/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ type ocr2Node struct {
}

func (o *ocr2Node) signerAddress() common.Address {
return common.BytesToAddress(o.Signer[:])
// eth address is the first 20 bytes of the Signer
return common.BytesToAddress(o.Signer[:20])
}

func (o *ocr2Node) toNodeKeys() NodeKeys {
Expand Down Expand Up @@ -128,6 +129,10 @@ func newOcr2Node(id string, ccfgs map[chaintype.ChainType]*v1.ChainConfig, csaPu
}

var sigb [32]byte
// initialize sigb to 0s
for i := range sigb {
sigb[i] = 0
}
copy(sigb[:], signerB)

n := &ocr2Node{
Expand Down

0 comments on commit 8546727

Please sign in to comment.