这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Lazar955
Copy link
Member

V4-CORE-005

Copilot AI review requested due to automatic review settings October 13, 2025 08:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds mutex locking to the LocalEOTSManager to prevent race conditions in signing operations. The changes ensure thread-safe access to prevent double signing with the same nonce.

  • Added mutex locks to SignEOTS and SignBatchEOTS methods to protect critical sections
  • Replaced getEOTSPrivKey calls with direct key store access to avoid lock contention
  • Added detailed comments explaining the purpose of the locking mechanism

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if err != nil {
return nil, err
}
_, pubRand := lm.getRandomnessPair(privKey, chainID, height)
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getRandomnessPair method returns two values (privRand, pubRand) but only pubRand is being captured. This discards the private randomness value that may be needed elsewhere.

Copilot uses AI. Check for mistakes.
return nil, fmt.Errorf("failed to get EOTS private key: %w", err)
}

privRand, _ := lm.getRandomnessPair(privKey, chainID, height)
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getRandomnessPair method returns two values (privRand, pubRand) but only privRand is being captured. This discards the public randomness value that may be needed elsewhere.

Suggested change
privRand, _ := lm.getRandomnessPair(privKey, chainID, height)
privRand, pubRand := lm.getRandomnessPair(privKey, chainID, height)

Copilot uses AI. Check for mistakes.
if err != nil {
return nil, fmt.Errorf("failed to get private randomness: %w", err)
}
privRand, _ := lm.getRandomnessPair(privKey, chainID, height)
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getRandomnessPair method returns two values (privRand, pubRand) but only privRand is being captured. This discards the public randomness value that may be needed elsewhere.

Suggested change
privRand, _ := lm.getRandomnessPair(privKey, chainID, height)
privRand, pubRand := lm.getRandomnessPair(privKey, chainID, height)

Copilot uses AI. Check for mistakes.
return nil, fmt.Errorf("failed to get EOTS private key: %w", err)
}

privRand, _ := lm.getRandomnessPair(privKey, chainID, height)
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getRandomnessPair method returns two values (privRand, pubRand) but only privRand is being captured. This discards the public randomness value that may be needed elsewhere.

Suggested change
privRand, _ := lm.getRandomnessPair(privKey, chainID, height)
privRand, pubRand := lm.getRandomnessPair(privKey, chainID, height)

Copilot uses AI. Check for mistakes.
@Lazar955 Lazar955 merged commit 069b9ab into main Oct 15, 2025
18 checks passed
@Lazar955 Lazar955 deleted the lazar/prevent-concurent-sign branch October 15, 2025 15:00
mergify bot pushed a commit that referenced this pull request Oct 15, 2025
_V4-CORE-005_

(cherry picked from commit 069b9ab)
Lazar955 added a commit that referenced this pull request Oct 15, 2025
_V4-CORE-005_<hr>This is an automatic backport of pull request #726 done
by [Mergify](https://mergify.com).

Co-authored-by: Lazar <12626340+Lazar955@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants