async def _get_rev_reg_def(self, rr_id: str) -> str:
LOGGER.debug('<STR_LIT>', rr_id)<EOL>rv_json = json.dumps({})<EOL>with REVO_CACHE.lock:<EOL><INDENT>revo_cache_entry = REVO_CACHE.get(rr_id, None)<EOL>rr_def = revo_cache_entry.rev_reg_def if revo_cache_entry else None<EOL>if rr_def:<EOL><INDENT>LOGGER.info('<STR_LIT>', rr_id)<EOL>rv_json = json.dumps(rr_def)<EOL><DEDENT>else:<EOL><INDENT>get_rrd_req_json = await ledger.build_get_revoc_reg_def_request(self.did, rr_id)<EOL>resp_json = await self._submit(get_rrd_req_json)<EOL>try:<EOL><INDENT>(_, rv_json) = await ledger.parse_get_revoc_reg_def_response(resp_json)<EOL>rr_def = json.loads(rv_json)<EOL><DEDENT>except IndyError:  <EOL><INDENT>LOGGER.debug('<STR_LIT>', rr_id)<EOL>raise AbsentRevReg('<STR_LIT>'.format(rr_id))<EOL><DEDENT>if revo_cache_entry is None:<EOL><INDENT>REVO_CACHE[rr_id] = RevoCacheEntry(rr_def, None)<EOL><DEDENT>else:<EOL><INDENT>REVO_CACHE[rr_id].rev_reg_def = rr_def<EOL><DEDENT><DEDENT><DEDENT>LOGGER.debug('<STR_LIT>', rv_json)<EOL>return rv_json<EOL>
Get revocation registry definition from ledger by its identifier. Raise AbsentRevReg
for no such revocation registry, logging any error condition and raising BadLedgerTxn
on bad request.

Retrieve the revocation registry definition from the agent's revocation cache if it has it;
cache it en passant if it does not (and such a revocation registry definition exists on the ledger).

:param rr_id: (revocation registry) identifier string, of the format
    '<issuer-did>:4:<issuer-did>:3:CL:<schema-seq-no>:<tag>:CL_ACCUM:<tag>'
:return: revocation registry definition json as retrieved from ledger