hyperledger / aries-vcx

aries-vcx is set of crates to work with DIDs, DID Documents, DIDComm, Verifiable Credentials and Hyperledger Aries.
https://didcomm.org
Apache License 2.0
125 stars 83 forks source link

Expose/propagate PoolTimeout errors from indy-vdr #973

Open gmulhearn-anonyome opened 1 year ago

gmulhearn-anonyome commented 1 year ago

It would be nice if aries_vcx_core/src/errors/mapping_indyvdr.rs propagated more error information. Currently, most indy-vdr errors are being mapped into Unknown vcx core errors, so we lose information. there is a TODO in this file which notes this, however I'm creating a github issue for it as a reminder.

I came across this when attempting to wrap the IndyVdrLedgeRead impl with some additional "retry X times on pool timeout errors" logic, since i was encountering some flakey ledger issues that a simple retry would fix.

But there is no ideal way of identifying a pool timeout error, since error details are hidden behind UnknownError. IMO we should at least propagate pool timeout errors as a new vcx-core error type.

Patrik-Stas commented 1 year ago

Yeah that sounds fair

That being said, I want to note that indy-vdr implementation a lot more sensitive to 1) outdated genesis files and 2) misbehaving nodes compared to the one from indy-sdk/vdrtools - in both cases you might get timeout.

In Absa we have rust script to built up latest genesis files & tool to check for misbehaving nodes (and you can then tell indy-vdr to exclude them) - these can help getting indy-vdr working smoothly. I'll be sharing those. Ideally some changes would be done to improve indy-vdr to make it more resistant towards this sort of conditions

gmulhearn commented 5 months ago

~closing, as this seems to be fixed with the move to aries_vcx_ledger~

issue still present, but should be more easy to solve. mapping to unknown occurs here: https://github.com/hyperledger/aries-vcx/blob/main/aries/aries_vcx_ledger/src/errors/mapping_indyvdr.rs#L21