-
Notifications
You must be signed in to change notification settings - Fork 520
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
Possible endorsement processing bug -- RevRegEntry transaction not being signed #2441
Comments
I've provided @ianco with an |
These are the tests that can be run after the rules are applied; https://github.com/hyperledger/aries-cloudagent-python/blob/main/demo/features/0586-sign-transaction.feature#L101 |
Related discord discussion can be found here. |
I've run a quick test of the test indicated by @WadeBarnes above ^^^ and it passes with a "standard" von-network, but fails with the auth rules applied, error is:
Question - is "indy" wallet supported any more? |
Re: that last question — Questions:
@WadeBarnes — is the LSBC DID on Sovrin MainNet still an Endorser? |
Reading the rules, I think there is a bug in the rules. Note the rules for Add RevRegDef and Add RevRegEntry, below. For Add RevRegDef, the Endorser/Trustee/Steward does not have to be the owner, for Add RevRegEntry, the Endorser/Trustee/Steward does have to be owner. @ianco — could you please do a change to the rules to change the highlighted “true” to “false” and see if that fixes the error. I still would like to have confirmation that the Endorser signature is on the transaction — so we can confirm it is not a bug in ACA-Py. Add Revocation Registry Definition- Require 1 Endorser signatureledger auth-rule txn_type=REVOC_REG_DEF action=ADD field=* old_value=* new_value=* constraint="{"constraint_id":"OR","auth_constraints":[{"sig_count":1,"role":"101","constraint_id":"ROLE","need_to_be_owner":false}]}" Add Revocation Registry Entry- Require 1 Owner signatureledger auth-rule txn_type=REVOC_REG_ENTRY action=ADD field=* old_value=* new_value=* constraint="{"constraint_id":"OR","auth_constraints":[{"sig_count":1,"role":"0","constraint_id":"ROLE","need_to_be_owner":true},{"sig_count":1,"role":"2","constraint_id":"ROLE","need_to_be_owner":true},{"sig_count":1,"role":"101","constraint_id":"ROLE","need_to_be_owner":true}]}" |
Of course not, but it matters if it works with an indy wallet but not with an askar wallet. (Helps to isolate where the problem is.) FYI I checked with a couple of older aca-py versions and neither indy nor askar works.
Yes as I mentioned - it passes with a "standard" von-network (no updates to the auth rules) but fails with the new rules applied (matching sovrin mainnet)
I've attached the log of the integration test - it looks to me like the transaction isn't getting endorsed.
I agree it looks like the rule is incorrect:
|
I'll give this a try |
Sorry — I’m not being clear. Does the test fail with Indy, pass with Askar with the same Auth Rules? From what I think you are saying, the tests are failing when the auth_rules change, regardless of whether Indy or Askar are used. If the transaction is not being endorsed, that sounds like a bug in ACA-Py, doesn’t it? Assuming the endorser requirement to ACA-Py is that every transaction to be written to a ledger must be endorsed. AFAIK — that was the intention, to assume that the ledgers all require an Endorser signature. |
I made the change to the auth rules and the test still fails. (I'm not sure about the syntax of the rules, if the endorser is required then the transaction still must be signed by the "owner" of the revocation registry, I'm not sure how that is reflected in the rule.) It looks to me like aca-py isn't endorsing this transaction, so any ledger constraints on this type of transaction will make the test fail. FYI to run the test |
OK thanks. Confirms this is a bug in ACA-Py. Now to get it fixed… @ianco, would you be able to do a scan of the code and see if you see anything obvious? Sorry to ask, but you know this code the best... |
I suspect endorsement is just not implemented for this type of transaction, but I'll take a look and provide some pointers one way or the other (how to fix or implement). As an aside I don't think this transaction should require endorsing. It introduces a potential impediment to the issuer, if they have a need to quickly revoke a credential, but they're dependant on an endorser who may or may not have specific service levels that they are supporting. |
The fix for this is (potentially) fairly straightforward. The same ledger entry (txn type 114) is used for both the initial revocation registry accumulator txn (published when the revocation registry is created) as well as any updates (published as credentials are revoked). The first transaction is sent to the endorser, the second isn't. In the revocation
... however when a credential is revoked, the code in the revocation
... which defaults to writing the txn to the ledger directly, rather than using an endorser (if configured). To have the subsequent revocation entries use the endorser, the two parameters ( Additionally the unit and integration tests need to be updated. |
One other thing to consider - since most ledgers don't require this transaction to be endorsed, I suggest either aca-py check the ledger config to check if these transactions need to be endorsed or not, or an additional aca-py parameter added to specify to endorse these transactions (so they do not get endorsed if not required by the ledger). |
Thanks, @ianco — much appreciated!! We could add (yet another!!) configuration parameter. But I think it be best that we just use the same pattern for these transactions. We assumed this was already there, and is a topic we have been talking about from the Endorser side — e.g. the Endorser wanting to control over whether it will still endorse the transactions. |
assigned to @shaangill025 and ready to go |
The fixes in #2558 do not seem to be working. I built ghcr.io/hyperledger/aries-cloudagent-python:py3.9-pr2558-pre0 off commit cfd9aed and deployed into our Shared Services Testing was done with the BC VC Pilot agent that is connected to an endorser service. I revoked this credential before deploying the pre-release image; https://candyscan.idlab.org/tx/CANDY_DEV/domain/33483
I then deployed the pre-release image and revoked this credential; https://candyscan.idlab.org/tx/CANDY_DEV/domain/33484
Logs from an additional revocation attempt:
|
Mind posting what the startup arguments or ENV settings are for the BC VC Pilot agent? |
I've run through this a number of times and these are my current observations:
I'm not entirely sure what could be failing without understanding which settings were used for the scenario described above for the BC VC Pilot agent. In terms of running the BDD test @T002.1-RFC0586:
I may be overlooking something obvious here. |
I'm going to test this again with the 0.12.0rc0 release, in case there was something wrong with the prerelease image I created. |
Closing this as 0.12.0rc0 resolves the issues. |
YAY!!! |
A team has reported that there might be a problem with the RevRegEntry endorsement process -- the transaction is not being properly signed by the Endorser when requested by the Author. The problem is only apparent on ledgers where the RevRegEntry transactions must be signed by an Endorser, and not all Indy ledgers require such a signature. The Sovrin MainNet does require it. It appears when the first RevRegEntry is processed (along with the RevRegDef), the transaction is signed (or perhaps it is part of the RevRegDef transaction?), but subsequent RevRegEntry transactions are not signed by the Endorser.
The first part of this task is to review the code and see if the endorser flow for a RevRegEntry is indeed processed in the same way as all other transactions. This may be through inspection or by observing the Author-Endorser interactions for publishing the RevRegs.
If the issue is confirmed, a fix would be appreciated.
This is an urgent issue for the team facing the problem and any help from the community would be appreciated.
The text was updated successfully, but these errors were encountered: