-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(crypto): optimize zksnark config #6371
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
base: release_v4.8.1
Are you sure you want to change the base?
feat(crypto): optimize zksnark config #6371
Conversation
if (isShieldedTransaction(trx.getInstance()) && !Args.getInstance() | ||
.isFullNodeAllowShieldedTransactionArgs()) { | ||
return true; | ||
if (isShieldedTransaction(trx.getInstance()) && !chainBaseManager.getDynamicPropertiesStore() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So how can we support shielded transaction through config item committee.xxx
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support shielded transactions, we need to turn on ALLOW_SHIELDED_TRANSACTION
proposal. However, the corresponding code is commented out.
@@ -24,11 +24,6 @@ private void init() { | |||
public static void librustzcashInitZksnarkParams() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final AtomicBoolean initialized = new AtomicBoolean(false);
If (initialized.compareAndSet(false, true)){
do InitZksnark
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After optimization, the initZksnarkParams
method is invoked only 6 times during tests, significantly fewer than before.
@@ -1030,10 +1030,6 @@ public static void setParam(final Config config) { | |||
config.hasPath(Constant.NODE_SHIELDED_TRANS_IN_PENDING_MAX_COUNTS) ? config | |||
.getInt(Constant.NODE_SHIELDED_TRANS_IN_PENDING_MAX_COUNTS) : 10; | |||
|
|||
if (PARAMETER.isWitness()) { | |||
PARAMETER.fullNodeAllowShieldedTransactionArgs = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should not be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be removed. The witness can allow the shieldedTransactionApi
freely.
3a031e3
to
7676699
Compare
What does this PR do?
Close #6334