Skip to content

Commit

Permalink
feat(catalyst-gateway): add draft schema for RBAC registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku committed Sep 22, 2024
1 parent b96002e commit e2e2001
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Index of CIP-509 registrations. Valid.
CREATE TABLE IF NOT EXISTS cip509_registration (
-- Primary Key Data
vote_key blob, -- 32 Bytes of Vote Key.
stake_address blob, -- 32 Bytes of Stake Address.
nonce varint, -- Nonce that has been slot corrected.
slot_no varint, -- slot number when the key_was_registered/re-registered.
txn smallint, -- Index of the TX which holds the registration data.

-- Non-Key Data
purpose blob, -- 16 Bytes of UUIDv4 Purpose.
txn_inputs_hash blob, -- 16 Bytes of TX inputs hash.
prv_txn_id blob,
-- WIP: what data is relevant for indexing
-- x509_chunks list<blob>, -- x509 chunks.
validation_signature blob, -- Validation signature.

PRIMARY KEY ((vote_key, stake_address), nonce, slot_no, txn)
)
WITH CLUSTERING ORDER BY (nonce DESC, slot_no DESC, txn DESC);
5 changes: 5 additions & 0 deletions catalyst-gateway/bin/src/db/index/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ const SCHEMAS: &[(&str, &str)] = &[
include_str!("./cql/cip36_registration_for_vote_key.cql"),
"Create Table CIP-36 Registration For a stake address",
),
(
// CIP-509 Registration Table Schema
include_str!("./cql/cip509_registration.cql"),
"Create Table CIP-509 Registration",
),
];

/// Get the namespace for a particular db configuration
Expand Down

0 comments on commit e2e2001

Please sign in to comment.