Skip to content

rbac/registration endpoint invalid RBAC transactions info in the response #3048

@Mr-Leshiy

Description

@Mr-Leshiy

Summary

Modify the current response from the rbac/registration to also provide an information about invalid RBAC transactions.

Description

Add a new response type

struct InvalidRBACInfo {
   /// Hash of the transaction which contains this RBAC metadata
   txn_id: TransactionId
   /// Block's slot number which contain the transaction with RBAC metadata
  slot: Slot,
  report: common::types::generic::error_msg::ErrorMessage
}

Update the current ChainInfo structure to:

pub struct ChainInfo {
    /// A RBAC registration chain.
    pub chain: RegistrationChain,
    /// The latest persistent transaction ID of the chain.
    pub last_persistent_txn: Option<TransactionId>,
    /// The latest volatile transaction ID of the chain.
    pub last_volatile_txn: Option<TransactionId>,
    /// A slot number of the latest persistent registration.
    pub last_persistent_slot: Slot,
    /// A list of invalid RBAC registrations
    pub invalids: Vec<InvalidRBACInfo>,
}

Collect all necessary information about invalid registrations:

  1. Update build_reg_chain function and also return all invalid registrations
  2. Collect all corresponding invalid RBAC transaction from the rbac_invalid_registration table

Acceptance Criteria:

  • The endpoint has a parameter to list all invalid registrations (defaults to false if not present).
  • Unless the parameter above is set, only invalid registrations that occur AFTER the latest good registration are listed.
  • The invalids set is sorted most recent (largest slot#) first, descending.

Metadata

Metadata

Labels

squad: gatekeepersCatalyst App Backend, System Development & Integration Team

Type

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions