Skip to content

Commit

Permalink
Merge pull request #41 from siburu/fix-operator-update
Browse files Browse the repository at this point in the history
fix ComputeEIP712UpdateOperatorsHash to compute the hash using the counterparty client ID

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Feb 19, 2025
2 parents 2147215 + 2bea249 commit 214d61e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion relay/lcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func (pr *Prover) registerEnclaveKey(counterparty core.Chain, eki *enclave.Encla

func (pr *Prover) ComputeEIP712UpdateOperatorsHash(nonce uint64, newOperators []common.Address, thresholdNumerator, thresholdDenominator uint64) (common.Hash, error) {
params := pr.getDomainParams()
bz, err := lcptypes.ComputeEIP712UpdateOperators(int64(params.ChainId), params.VerifyingContractAddr, pr.computeEIP712ChainSalt(), pr.path.ClientID, nonce, newOperators, thresholdNumerator, thresholdDenominator)
bz, err := lcptypes.ComputeEIP712UpdateOperators(int64(params.ChainId), params.VerifyingContractAddr, pr.computeEIP712ChainSalt(), pr.counterpartyPath.ClientID, nonce, newOperators, thresholdNumerator, thresholdDenominator)
if err != nil {
return common.Hash{}, err
}
Expand Down
8 changes: 5 additions & 3 deletions relay/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ type Prover struct {
originChain core.Chain
originProver core.Prover

homePath string
codec codec.ProtoCodecMarshaler
path *core.PathEnd
homePath string
codec codec.ProtoCodecMarshaler
path *core.PathEnd
counterpartyPath *core.PathEnd

lcpServiceClient LCPServiceClient

Expand Down Expand Up @@ -92,6 +93,7 @@ func (pr *Prover) Init(homePath string, timeout time.Duration, codec codec.Proto
// SetRelayInfo sets source's path and counterparty's info to the chain
func (pr *Prover) SetRelayInfo(path *core.PathEnd, counterparty *core.ProvableChain, counterpartyPath *core.PathEnd) error {
pr.path = path
pr.counterpartyPath = counterpartyPath
return nil
}

Expand Down

0 comments on commit 214d61e

Please sign in to comment.