원클릭으로
update-proposals
Update hardcoded Conway governance proposal mappings in hacks.rs by querying DBSync
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Update hardcoded Conway governance proposal mappings in hacks.rs by querying DBSync
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
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
Add a missing pointer address mapping to hacks.rs by looking up the stake credential in 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 | update-proposals |
| description | Update hardcoded Conway governance proposal mappings in hacks.rs by querying DBSync |
Dolos doesn't implement DRep governance voting, so Conway proposal outcomes are hardcoded in crates/cardano/src/hacks.rs. When testing advances to new epochs, missing proposals cause wrong deposit refund timing and missed treasury withdrawals, leading to pot mismatches.
This skill walks through querying DBSync and updating hacks.rs accordingly.
Read xtask.toml at the repo root. The [dbsync] section has connection URLs per network:
[dbsync]
mainnet_url = "postgresql://..."
preprod_url = "postgresql://..."
preview_url = "postgresql://..."
Use the appropriate URL for the target network.
Run this against DBSync to get the full proposal lifecycle:
SELECT
encode(tx.hash, 'hex') || '#' || gap.index::text AS proposal_id,
gap.type::text AS proposal_type,
b.epoch_no AS submitted_epoch,
gap.ratified_epoch,
gap.enacted_epoch,
gap.dropped_epoch,
gap.expired_epoch
FROM gov_action_proposal gap
JOIN tx ON tx.id = gap.tx_id
JOIN block b ON b.id = tx.block_id
ORDER BY b.epoch_no, gap.index;
Key columns:
proposal_id: The txhash#index format used in hacks.rs match armstype: TreasuryWithdrawals, NewConstitution, NewCommittee, ParameterChange, HardForkInitiation, InfoActionratified_epoch: Non-null if the proposal was ratified (enactment follows at the next epoch). Use this when enacted_epoch is still NULL — the proposal is ratified but enactment hasn't happened yet at the current DBSync tip.enacted_epoch: Non-null if the proposal was enacted on-chaindropped_epoch: Non-null if the proposal was dropped (superseded by another)expired_epoch: Non-null if the proposal expired without ratificationSELECT
encode(tx.hash, 'hex') || '#' || gap.index::text AS proposal_id,
gap.type::text AS proposal_type,
b.epoch_no AS submitted_epoch,
gap.ratified_epoch,
gap.enacted_epoch,
COALESCE(gap.ratified_epoch, gap.enacted_epoch - 1)::text AS expected_ratified
FROM gov_action_proposal gap
JOIN tx ON tx.id = gap.tx_id
JOIN block b ON b.id = tx.block_id
WHERE gap.enacted_epoch IS NOT NULL OR gap.ratified_epoch IS NOT NULL
ORDER BY COALESCE(gap.enacted_epoch, gap.ratified_epoch), gap.index;
The formula is: Ratified(enacted_epoch - 1), or equivalently Ratified(ratified_epoch). Ratification happens one epoch before enactment in Conway governance. Include proposals where ratified_epoch is non-null but enacted_epoch is still NULL — these are ratified but awaiting enactment at the current tip, and still need Ratified entries in hacks.rs.
Read crates/cardano/src/hacks.rs and find the network's outcome() function (e.g., pub mod mainnet). Compare every enacted proposal from Step 3 against existing match arms.
Check for:
Unknown, never get enacted, and eventually expire -- causing wrong deposit refund timing and missed treasury withdrawals.Ratified(N) doesn't match ratified_epoch (or enacted_epoch - 1 if ratified_epoch is NULL).ratified_epoch, enacted_epoch, dropped_epoch, or expired_epoch yet. These correctly return Unknown and will need entries added later when resolved.Check dropped/expired proposals:
SELECT
encode(tx.hash, 'hex') || '#' || gap.index::text AS proposal_id,
gap.type::text AS proposal_type,
b.epoch_no AS submitted_epoch,
gap.dropped_epoch,
gap.expired_epoch
FROM gov_action_proposal gap
JOIN tx ON tx.id = gap.tx_id
JOIN block b ON b.id = tx.block_id
WHERE gap.enacted_epoch IS NULL
AND (gap.dropped_epoch IS NOT NULL OR gap.expired_epoch IS NOT NULL)
ORDER BY b.epoch_no, gap.index;
Rules:
dropped_epoch = expired_epoch + 1 (natural expiry), no entry needed. The Unknown outcome lets them expire via max_epoch, matching DBSync timing.Canceled(epoch) if the timing differs from natural expiry.InfoAction proposals never need entries (they have no on-chain effect).Insert new match arms in the appropriate network module, before the _ => match protocol fallback. Group entries logically (by epoch or proposal type) and add a brief comment describing each:
// Treasury Withdrawal for Catalyst Fund 14
"03f671791fd97011f30e4d6b76c9a91f4f6bcfb60ee37e5399b9545bb3f2757a#0" => {
Ratified(597)
}
ProposalOutcome variants:
Ratified(epoch) -- proposal was ratified at this epoch, enacted at epoch+1Canceled(epoch) -- proposal was canceled/superseded at this epochRatifiedCurrentEpoch -- pre-Conway (protocol 0-8) proposals that ratify in the epoch they're submittedUnknown -- default for unresolved proposals; they expire naturally via max_epochcargo check -p dolos-cardano
Then run epoch tests that cover the affected epoch range:
cargo test --test epoch_pots --release -- --nocapture
| Column | Type | Description |
|---|---|---|
id | bigint | Primary key |
tx_id | bigint | FK to tx -- the transaction containing the proposal |
index | int | Index of the proposal within the transaction |
type | text | Proposal type enum |
ratified_epoch | int | Epoch when ratified (null if not ratified). May be set before enacted_epoch if enactment hasn't happened yet at the current DBSync tip. |
enacted_epoch | int | Epoch when enacted (null if not enacted) |
dropped_epoch | int | Epoch when dropped/superseded (null if not dropped) |
expired_epoch | int | Epoch when expired (null if not expired) |
Used in proposals::outcome() dispatch:
76482407312