Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
77361d8
chore: upgrade outcomes package version and setup access urls
emmanuel-musau Feb 6, 2025
bff72ae
Merge pull request #2918 from emmanuel-musau/chore/bumb-outcomes-version
MSzalowski Feb 10, 2025
6efcec5
fix: lint issue on unused import; update package-lock
MSzalowski Feb 10, 2025
9713fb5
Merge pull request #2939 from IntersectMBO/fix/lint-issues-on-outcome…
MSzalowski Feb 10, 2025
bfbc9ff
Merge pull request #2938 from IntersectMBO/develop
MSzalowski Feb 10, 2025
109b36d
Merge pull request #2940 from IntersectMBO/test
MSzalowski Feb 10, 2025
94fdb4a
fix: update intercept logic for usersnap and bucket
kneerose Feb 11, 2025
d7a16a8
chore: remove sensitive AWS credentials from user snap test
kneerose Feb 11, 2025
deb388b
Merge pull request #2947 from IntersectMBO/fix/user-snap-issue
kneerose Feb 11, 2025
beb6448
feat(#2258): add support for submitting all governance action types
MSzalowski Feb 5, 2025
b2a8233
feat(#2258): add support for submitting new governance actions inside…
MSzalowski Feb 7, 2025
1019178
fix: ts error on outcomes pillar
MSzalowski Feb 11, 2025
88813eb
Merge pull request #2912 from IntersectMBO/feat/2258-propose-new-cons…
MSzalowski Feb 11, 2025
495648b
chore: bump @intersect.mbo/pdf-ui to v0.6.0
MSzalowski Feb 10, 2025
d2c32d4
Merge pull request #2942 from IntersectMBO/chore/bump-pdf-ui-to-v-0.6.0
MSzalowski Feb 11, 2025
04d4e83
chore: add outcomes pillar feature flag to merge pipeline
MSzalowski Feb 11, 2025
9f5e578
Merge pull request #2950 from IntersectMBO/chore/add-outcomes-pillar-…
MSzalowski Feb 11, 2025
da8fee5
chore: commit to rebuild the frontend service
MSzalowski Feb 11, 2025
9ee4168
Merge pull request #2951 from IntersectMBO/chore/dummy-commit-to-rebu…
MSzalowski Feb 11, 2025
bd816f0
Merge pull request #2952 from IntersectMBO/staging
MSzalowski Feb 11, 2025
aa7e279
Merge pull request #2953 from IntersectMBO/test
MSzalowski Feb 11, 2025
3eeae3b
Enable VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED flag on test/qa stack
mesudip Feb 11, 2025
b0bfcff
chore: redeploy frontend
MSzalowski Feb 11, 2025
a142afd
Merge pull request #2954 from IntersectMBO/develop
MSzalowski Feb 11, 2025
738f765
Merge pull request #2956 from IntersectMBO/chore/redeploy-frontend
MSzalowski Feb 11, 2025
1e4c45e
Merge pull request #2955 from IntersectMBO/fix/pillar-flag
mesudip Feb 11, 2025
9f1157b
chore: add outcome pillars feature flag argument
MSzalowski Feb 11, 2025
610310f
Merge pull request #2957 from IntersectMBO/chore/add-missing-outcome-…
MSzalowski Feb 11, 2025
5fc1371
Merge pull request #2958 from IntersectMBO/staging
MSzalowski Feb 11, 2025
3d86187
Merge pull request #2959 from IntersectMBO/develop
MSzalowski Feb 11, 2025
6098aa8
fix(#2948): committee members calculation
MSzalowski Feb 11, 2025
93ca8ff
Merge pull request #2960 from IntersectMBO/fix/2948-default-vote-valu…
MSzalowski Feb 11, 2025
bbed5d9
Merge pull request #2961 from IntersectMBO/develop
MSzalowski Feb 12, 2025
8be0f19
Merge pull request #2962 from IntersectMBO/test
MSzalowski Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
check-build-deploy:
environment: ${{ (github.ref_name == 'main' && 'prod-govtool') || (github.ref_name == 'staging' && 'pre-prod-govtool') || (github.ref_name == 'test' && 'qa-govtool') || (github.ref_name == 'develop' && 'dev-govtool') }}
environment: ${{ (github.ref_name == 'main' && 'prod-govtool') || (github.ref_name == 'staging' && 'pre-prod-govtool') || (github.ref_name == 'test' && 'qa-govtool') || (github.ref_name == 'develop' && 'dev-govtool') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -87,7 +87,6 @@ jobs:
set -o pipefail
sudo chmod +x lint.sh && ./lint.sh 2>&1 | tee code_lint_output.txt


- name: Unit tests
id: unit_tests
run: |
Expand Down Expand Up @@ -135,6 +134,7 @@ jobs:
NPMRC_TOKEN=${{ secrets.NPMRC_TOKEN }}
VITE_USERSNAP_SPACE_API_KEY=${{ secrets.VITE_USERSNAP_SPACE_API_KEY }}
VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED=${{ secrets.VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED }}
VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED=${{ secrets.VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED }}
VITE_PDF_API_URL=${{ secrets.VITE_PDF_API_URL }}
VITE_IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }}
VITE_IPFS_PROJECT_ID=${{ secrets.IPFS_PROJECT_ID }}
Expand All @@ -151,15 +151,15 @@ jobs:
- name: Scan Docker image with Dockle
id: dockle
run: |
wget -q https://github.com/goodwithtech/dockle/releases/download/v0.4.14/dockle_0.4.14_Linux-64bit.tar.gz
tar zxf dockle_0.4.14_Linux-64bit.tar.gz
sudo mv dockle /usr/local/bin
wget -q https://github.com/goodwithtech/dockle/releases/download/v0.4.14/dockle_0.4.14_Linux-64bit.tar.gz
tar zxf dockle_0.4.14_Linux-64bit.tar.gz
sudo mv dockle /usr/local/bin

dockle --exit-code 1 --exit-level fatal --format json -ak GHC_RELEASE_KEY -ak CABAL_INSTALL_RELEASE_KEY -ak STACK_RELEASE_KEY -ak KEY_SHA512 --input '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar' --output ${{ matrix.workdir }}/dockle_scan_output.json
echo " dockle exited w/ $?"
cat ${{ matrix.workdir }}/dockle_scan_output.json
dockle --exit-code 1 --exit-level fatal --format json -ak GHC_RELEASE_KEY -ak CABAL_INSTALL_RELEASE_KEY -ak STACK_RELEASE_KEY -ak KEY_SHA512 --input '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar' --output ${{ matrix.workdir }}/dockle_scan_output.json
echo " dockle exited w/ $?"
cat ${{ matrix.workdir }}/dockle_scan_output.json

echo "outcome=success" >> $GITHUB_OUTPUT
echo "outcome=success" >> $GITHUB_OUTPUT

- name: Push Docker image to GHCR
run: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ changes.

- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)
- Add CC votes percentages, not voted and Ratification threshold
- Add support for submitting all 7 governance action types [Issue 2258](https://github.com/IntersectMBO/govtool/issues/2258)

### Fixed

- Fix calculating votes counting for governance actions
- Fix crashing backend on unhandled missing proposal from vote [Issue 2920](https://github.com/IntersectMBO/govtool/issues/2920)
- Remove abstain votes (not auto abstain) from total DRep stake
- Fix counting committee members [Issue 2948](https://github.com/IntersectMBO/govtool/issues/2948)

### Changed

- Change threshold visual representation in governance action votes
- Resize governance action details columns
- Update @intersect.mbo/pdf-ui to v0.6.0

### Removed

Expand Down
113 changes: 85 additions & 28 deletions docs/GOVERNANCE_ACTION_SUBMISSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ interface GovernanceAction {
references: [{ label: string; uri: string }];
}

interface InfoProps {
hash: string;
type VotingAnchor = {
url: string;
hash: string;
}

interface TreasuryProps {
amount: string;
hash: string;
type InfoProps = VotingAnchor;

type TreasuryProps {
withdrawals: { receivingAddress: string; amount: string }[];
}
} & VotingAnchor;

type ProtocolParamsUpdate = {
adaPerUtxo: string;
Expand Down Expand Up @@ -77,14 +77,44 @@ type ProtocolParamsUpdate = {
treasuryGrowthRate: UnitInterval;
};

interface ProtocolParameterChangeProps {
type ProtocolParameterChangeProps {
prevGovernanceActionHash: string;
prevGovernanceActionIndex: number;
url: string;
hash: string;

protocolParamsUpdate: Partial<ProtocolParamsUpdate>;
}
} & VotingAnchor;

type HardForkInitiationProps = {
prevGovernanceActionHash: string;
prevGovernanceActionIndex: number;
major: number;
minor: number;
} & VotingAnchor;

type NewConstitutionProps = {
prevGovernanceActionHash: string;
prevGovernanceActionIndex: number;
constitutionUrl: string;
constitutionHash: string;
scriptHash: string;
} & VotingAnchor;

type UpdateCommitteeProps = {
prevGovernanceActionHash?: string;
prevGovernanceActionIndex?: number;
quorumThreshold: QuorumThreshold;
newCommittee?: CommitteeToAdd[];
removeCommittee?: string[];
} & VotingAnchor;

type CommitteeToAdd = {
expiryEpoch: number;
committee: string;
};

type QuorumThreshold = {
numerator: number;
denominator: number;
};

const createGovernanceActionJsonLD: (
governanceAction: GovernanceAction
Expand All @@ -100,6 +130,22 @@ const buildTreasuryGovernanceAction: (
treasuryProps: TreasuryProps
) => Promise<VotingProposalBuilder | undefined>;

const buildProtocolParameterChangeGovernanceAction: (
protocolParameterChangeProps: ProtocolParameterChangeProps
) => Promise<VotingProposalBuilder | undefined>;

const buildHardForkInitiationGovernanceAction: (
hardForkInitiationProps: HardForkInitiationProps
) => Promise<VotingProposalBuilder | undefined>;

const buildNewConstitutionGovernanceAction: (
newConstitutionProps: NewConstitutionProps
) => Promise<VotingProposalBuilder | undefined>;

const buildUpdateCommitteeGovernanceAction: (
updateCommitteeProps: UpdateCommitteeProps
) => Promise<VotingProposalBuilder | undefined>;

const buildSignSubmitConwayCertTx: (params: {
govActionBuilder: VotingProposalBuilder;
type: "createGovAction";
Expand Down Expand Up @@ -165,44 +211,37 @@ const {
buildNewInfoGovernanceAction,
buildProtocolParameterChangeGovernanceAction,
buildHardForkInitiationGovernanceAction,
buildTreasuryGovernanceAction,
buildNewConstitutionGovernanceAction,
buildUpdateCommitteeGovernanceAction,
buildNoConfidenceGovernanceAction,
} = useCardano();

// Info Governance Action
const govActionBuilder = await buildNewInfoGovernanceAction({ hash, url });
let govActionBuilder = await buildNewInfoGovernanceAction({ hash, url });

// sign and submit the transaction
await buildSignSubmitConwayCertTx({
govActionBuilder,
type: "createGovAction",
});
// And for the other type of governance actions:

// Treasury Governance Action
const { buildTreasuryGovernanceAction } = useCardano();
govActionBuilder = await buildNoConfidenceGovernanceAction({ hash, url });

// hash of the generated Governance Action metadata, url of the metadata, amount of the transaction, receiving address is the stake key address
const govActionBuilder = await buildTreasuryGovernanceAction({
govActionBuilder = await buildTreasuryGovernanceAction({
hash,
url,
withdrawals: [{ amount, receivingAddress }],
});

// Protocol Parameter Change Governance Action
const { buildProtocolParameterChangeGovernanceAction } = useCardano();

// hash of the previous Governance Action, index of the previous Governance Action, url of the metadata, hash of the metadata, and the updated protocol parameters
const govActionBuilder = await buildProtocolParameterChangeGovernanceAction({
govActionBuilder = await buildProtocolParameterChangeGovernanceAction({
prevGovernanceActionHash,
prevGovernanceActionIndex,
url,
hash,
protocolParamsUpdate,
});

// Hard Fork Initiation Governance Action
const { buildHardForkInitiationGovernanceAction } = useCardano();

// hash of the previous Governance Action, index of the previous Governance Action, url of the metadata, hash of the metadata, and the major and minor numbers of the hard fork initiation
const govActionBuilder = await buildHardForkInitiationGovernanceAction({
govActionBuilder = await buildHardForkInitiationGovernanceAction({
prevGovernanceActionHash,
prevGovernanceActionIndex,
url,
Expand All @@ -211,6 +250,24 @@ const govActionBuilder = await buildHardForkInitiationGovernanceAction({
minor,
});

// hash of the previous Governance Action, index of the previous Governance Action, url of the metadata, hash of the metadata, and the constitution script hash
govActionBuilder = await buildNewConstitutionGovernanceAction({
prevGovernanceActionHash,
prevGovernanceActionIndex,
constitutionUrl,
constitutionHash,
scriptHash,
});

// hash of the previous Governance Action, index of the previous Governance Action, url of the metadata, hash of the metadata, and the quorum threshold and the new committee members
govActionBuilder = await buildUpdateCommitteeGovernanceAction({
prevGovernanceActionHash,
prevGovernanceActionIndex,
quorumThreshold,
newCommittee,
removeCommittee,
});

// sign and submit the transaction
await buildSignSubmitConwayCertTx({
govActionBuilder,
Expand Down
27 changes: 22 additions & 5 deletions govtool/backend/sql/get-network-metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ DRepDistr AS (
CurrentEpoch AS (
SELECT MAX(no) AS no FROM epoch
),
CommitteeMembers AS (
SELECT DISTINCT ON (cm.committee_hash_id)
cr.id,
block.time,
encode(cold_key_hash.raw, 'hex') cold_key,
encode(hot_key_hash.raw, 'hex') hot_key
FROM committee_registration cr
JOIN tx ON tx.id = cr.tx_id
JOIN block ON block.id = tx.block_id
JOIN committee_hash cold_key_hash ON cr.cold_key_id = cold_key_hash.id
JOIN committee_hash hot_key_hash ON cr.hot_key_id = hot_key_hash.id
JOIN committee_member cm ON cm.committee_hash_id = cold_key_hash.id OR cm.committee_hash_id = hot_key_hash.id
LEFT JOIN committee_de_registration cdr ON cdr.cold_key_id = cold_key_hash.id
CROSS JOIN CurrentEpoch
WHERE
cdr.id IS NULL AND cm.expiration_epoch > CurrentEpoch.no
),
NoOfCommitteeMembers AS (
SELECT COUNT(*) total FROM CommitteeMembers
),
ActiveDRepBoundaryEpoch AS (
SELECT epoch_no - drep_activity AS epoch_no FROM DRepActivity
),
Expand Down Expand Up @@ -187,9 +207,6 @@ AlwaysNoConfidenceVotingPower AS (
TotalDRepDistr AS (
SELECT SUM(COALESCE(amount, 0))::bigint total_drep_distr FROM drep_distr where epoch_no = (SELECT no from CurrentEpoch)
),
CommitteeMembersCount AS (
SELECT COUNT(*) AS no_of_committee_members FROM committee_member
),
LatestGovAction AS (
SELECT gap.id, gap.enacted_epoch
FROM gov_action_proposal gap
Expand Down Expand Up @@ -223,7 +240,7 @@ SELECT
AlwaysAbstainVotingPower.amount AS always_abstain_voting_power,
AlwaysNoConfidenceVotingPower.amount AS always_no_confidence_voting_power,
meta.network_name,
CommitteeMembersCount.no_of_committee_members,
NoOfCommitteeMembers.total no_of_committee_members,
CommitteeThreshold.quorum_numerator,
CommitteeThreshold.quorum_denominator
FROM CurrentEpoch
Expand All @@ -242,6 +259,6 @@ CROSS JOIN TotalActiveCIP119CompliantDReps
CROSS JOIN TotalRegisteredDirectVoters
CROSS JOIN AlwaysAbstainVotingPower
CROSS JOIN AlwaysNoConfidenceVotingPower
CROSS JOIN CommitteeMembersCount
CROSS JOIN NoOfCommitteeMembers
CROSS JOIN CommitteeThreshold
CROSS JOIN meta;
2 changes: 2 additions & 0 deletions govtool/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG VITE_SENTRY_DSN
ARG NPMRC_TOKEN
ARG VITE_USERSNAP_SPACE_API_KEY
ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
ARG VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED='false'
ARG VITE_PDF_API_URL
ARG VITE_IPFS_GATEWAY
ARG VITE_IPFS_PROJECT_ID
Expand All @@ -26,6 +27,7 @@ RUN \
: "${NPMRC_TOKEN:?Build argument NPMRC_TOKEN is not set}" && \
: "${VITE_USERSNAP_SPACE_API_KEY:?Build argument VITE_USERSNAP_SPACE_API_KEY is not set}" && \
: "${VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED:?Build argument VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED is not set}" && \
: "${VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED:?Build argument VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED is not set}" && \
: "${VITE_IPFS_GATEWAY:?Build argument VITE_IPFS_GATEWAY is not set}" && \
: "${VITE_IPFS_PROJECT_ID:?Build argument VITE_IPFS_PROJECT_ID is not set}"

Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG VITE_SENTRY_DSN
ARG NPMRC_TOKEN
ARG VITE_USERSNAP_SPACE_API_KEY
ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED
ARG VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED
ARG VITE_PDF_API_URL
ARG VITE_IPFS_GATEWAY
ARG VITE_IPFS_PROJECT_ID
Expand Down
Loading