Skip to content

fix(crypto): resolve the invalid witness #6368

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

Open
wants to merge 8 commits into
base: release_v4.8.1
Choose a base branch
from

Conversation

Federico2014
Copy link
Contributor

What does this PR do?
Closes #6281

@Federico2014 Federico2014 changed the title fix(crypto): optimize the null witness fix(crypto): resolve the invalid witness Jun 30, 2025
@kuny0707 kuny0707 linked an issue Jun 30, 2025 that may be closed by this pull request
@kuny0707 kuny0707 moved this to In Review in java-tron Jun 30, 2025
…_witness

# Conflicts:
#	framework/src/test/java/org/tron/core/zksnark/ShieldedReceiveTest.java
@@ -72,6 +72,8 @@ public void start() {
if (null == witnessCapsule) {
logger.warn("Witness {} is not in witnessStore.", Hex.toHexString(witnessAddress));
}
// In multi-signature mode, the address derived from the private key may differ from
// witnessAddress.
Miner miner = param.new Miner(privateKey, ByteString.copyFrom(privateKeyAddress),
ByteString.copyFrom(witnessAddress));
miners.add(miner);
Copy link
Contributor

Choose a reason for hiding this comment

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

How to handle it when privateKeys.size() == 0 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the privateKeys.size() == 0, miners will be empty, DposTask will not execute. So we need not to handle it.

    if (!dposService.isEnable() || ObjectUtils.isEmpty(dposService.getMiners())) {
      return;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Invalid witness address when the localwitness is null
7 participants