ワンクリックで
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 職業分類に基づく
| 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.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, InfoActionenacted_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.enacted_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
ORDER BY gap.enacted_epoch, gap.index;
The formula is: Ratified(enacted_epoch - 1). Ratification happens one epoch before enactment in Conway governance.
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 enacted_epoch - 1.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 |
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