ワンクリックで
add-pointer-mapping
Add a missing pointer address mapping to hacks.rs by looking up the stake credential in DBSync
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Add a missing pointer address mapping to hacks.rs by looking up the stake credential in DBSync
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Update hardcoded Conway governance proposal mappings in hacks.rs by querying DBSync
Reconcile the user-facing documentation under docs/content/ with the current source-of-truth in the codebase. Use whenever code changes touched config fields, CLI subcommands/args, MiniBF routes, MiniKupo routes, or any other user-visible behavior whose docs may now be stale.
Systematic workflow for debugging Cardano ledger epoch pots mismatches in Dolos. Use when an epoch test fails or treasury/reserves/rewards diverge from DBSync.
Set up a new epoch_pots integration test with ground truth fixtures from DBSync
Architecture of the Dolos processing pipeline — WorkUnit lifecycle, executor modes, CardanoWorkUnit variants, WorkBuffer state machine, and sequencing. Reference when debugging execution ordering, understanding phase boundaries, or adding new work unit types.
Reference of non-obvious Cardano ledger behaviors that have caused bugs in Dolos. Consult when debugging epoch pots mismatches or implementing new ledger logic.
| name | add-pointer-mapping |
| description | Add a missing pointer address mapping to hacks.rs by looking up the stake credential in DBSync |
Cardano pointer addresses reference a stake credential by the location of its registration certificate: (slot, tx_idx, cert_idx). Dolos resolves these via a hardcoded lookup table in crates/cardano/src/hacks.rs (pointers::pointer_to_cred). When a new unmapped pointer is encountered, dolos panics with "missing pointer mapping".
The user provides or the panic log shows three values: slot, tx_idx, cert_idx.
Get the DBSync connection URL from xtask.toml ([dbsync] section), then run:
SELECT sa.view,
substring(encode(sa.hash_raw, 'hex') from 3) AS cred_hash
FROM stake_registration sr
JOIN tx t ON t.id = sr.tx_id
JOIN block b ON b.id = t.block_id
JOIN stake_address sa ON sa.id = sr.addr_id
WHERE b.slot_no = <SLOT> AND t.block_index = <TX_IDX> AND sr.cert_index = <CERT_IDX>;
Interpreting the result:
None.stake1u... prefix (key hash): Use StakeCredential::AddrKeyhash("<cred_hash>").stake1s... prefix (script hash): Use StakeCredential::ScriptHash("<cred_hash>").cred_hash column strips the 1-byte header (e0/e1/f0/f1) from hash_raw, yielding the raw 28-byte credential hash.Use the slot number to figure out which network section to place the entry near:
The entries in hacks.rs are loosely grouped by network with comments.
Edit crates/cardano/src/hacks.rs, function pointer_to_cred. Insert the new arm before the catch-all panic at the bottom.
For a valid credential (has a row in DBSync):
(SLOT, TX_IDX, CERT_IDX) => Some(StakeCredential::AddrKeyhash(
"CRED_HASH"
.parse()
.unwrap(),
)),
For an invalid/garbage pointer (no row in DBSync):
(SLOT, TX_IDX, CERT_IDX) => None,
cargo check -p dolos-cardano
A pointer address encodes (slot, tx_idx, cert_idx) as variable-length integers in the address bytes. This triple uniquely identifies a stake registration certificate on-chain. The Cardano node resolves the pointer to the stake credential registered at that location.
Some pointers are intentionally invalid (garbage values like (12, 12, 12)) — these appear in on-chain addresses but point to nonexistent registrations. They map to None, meaning the address has no stake rights.
| Table | Join | Purpose |
|---|---|---|
stake_registration | primary | Certificate registrations, has cert_index |
tx | sr.tx_id = t.id | Transaction, has block_index (= tx_idx within block) |
block | t.block_id = b.id | Block, has slot_no |
stake_address | sr.addr_id = sa.id | Stake address, has view (bech32) and hash_raw (with header byte) |