-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Invalid witness address when the localwitness is null #6281
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
Comments
Discovering this question is really great, and looking forward to solving it! No address should be generated when no localwitness is provided. |
@abc-x-t Yes, we will solve it after discussion. |
I also found this issue when upgrading the BCP-related dependencies of java.lang.IllegalArgumentException: Scalar is not in the interval [1, n - 1] |
@halibobo1205 Yes, the current BC version 1.69 is incomplete, so the exception is not thrown out explicitly. We should consider upgrading the BC. |
Currently, the bouncycastle version of java-tron is
@halibobo1205 Do you think is it necessary to upgrade the bouncycastle version? |
Upgrade the Bouncycastle version to 1.8.0? @Federico2014 |
I just consider keeping the same version with libp2p. Upgrading to version 1.80 is ok. |
Yes, I think keep same version with libp2p is better, because we are not sure whether higher version is compatible with libp2p |
Software Versions
OS : Mac OS
JVM : Oracle Corporation 1.8.0_161 amd64
Version : 4.7.7
Expected behavior
When launching the full-node with the null localwitness config, the node should run normally without an witness address .
Actual behavior
It generates an invalid witness address:
41dcc703c0e500b653ca82273b7bfad8045d85a470
even when the private key is null.After analysis, I find that even if the localwitness is null, it will still execute
initWitnessAccountAddress
function.From the
initWitnessAccountAddress
function, it will invoke thefromPrivate
function.In this case, the
privKeyBytes
is [] instead of null, so it continues to executefromPrivate(new BigInteger(1, privKeyBytes))
. So, the empty private key is finally passed to the Bouncycastle library, which leads to an implicit error and outputs an invalid address.The text was updated successfully, but these errors were encountered: