Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v0.13.0 - migrate to v2 delegate contracts, use subgraph for delegate history, remove comments #944

Merged
merged 100 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
b99c4b6
Adding subgraph
adamgoth Sep 26, 2024
ba35363
Update fetch delegated to
adamgoth Sep 26, 2024
4946559
Remove comments code
adamgoth Sep 26, 2024
f2a285b
Fix build, linting
adamgoth Sep 26, 2024
a4cd9e7
Remove mock
adamgoth Sep 26, 2024
646258b
Fix type name
adamgoth Sep 26, 2024
c0c35f2
Revert to spock all delegates, fix ENS error
adamgoth Sep 26, 2024
6e5b3ba
Remove allDelegates from subgraph
adamgoth Sep 26, 2024
aa08c15
Update migration page with v2 delegate requirements
torhector2 Sep 26, 2024
8758a89
Allow delegators to select from their v2 delegates when migrating
torhector2 Sep 26, 2024
5714047
Merge pull request #919 from makerdao/develop
tyler17 Sep 26, 2024
33a5bda
Merge branch 'develop' into add-subgraph
tyler17 Sep 26, 2024
309504f
Merge branch 'develop' into new-migration-flow-v2
tyler17 Sep 26, 2024
ce44e71
add margin top
tyler17 Sep 26, 2024
32472b1
Fix fetchDelegatedTo
adamgoth Sep 27, 2024
79f646d
Fix type
adamgoth Sep 27, 2024
59d12c1
Merge pull request #916 from makerdao/remove-comments-db
adamgoth Sep 27, 2024
0800a8d
Remove unused router
adamgoth Sep 27, 2024
0282df2
Handle missing expirationDate
adamgoth Sep 27, 2024
254c45f
Fix linting
adamgoth Sep 27, 2024
058dca6
Minor var renaming
torhector2 Sep 27, 2024
a0c57f6
Merge branch 'add-subgraph' into new-migration-flow-v2
torhector2 Sep 27, 2024
ed8ef4b
Merge pull request #918 from makerdao/new-migration-flow-v2
torhector2 Sep 27, 2024
f2e640e
Fix URL
adamgoth Sep 27, 2024
c65b2ef
fix issue with delegate history events in delegated to table
tyler17 Sep 28, 2024
d2bf132
show expiration date properly in delegated to history
tyler17 Sep 28, 2024
aa71865
fetch up to 1000 entries, and use mainnet subgraph
tyler17 Sep 28, 2024
f218937
Merge pull request #923 from makerdao/im/delegated-to
adamgoth Sep 30, 2024
69d36c3
Add contract version
adamgoth Sep 30, 2024
d563231
Add version filed to delegate types
torhector2 Sep 30, 2024
89887a4
Show delegate contract information in the delegates list
torhector2 Sep 30, 2024
9ea1410
Merge pull request #915 from makerdao/add-subgraph
tyler17 Sep 30, 2024
f289485
update tenderly chain id
tyler17 Sep 30, 2024
4c9a478
update arbitrum sepolia polling address
tyler17 Sep 30, 2024
8671360
update container id
tyler17 Oct 1, 2024
9cdb6fb
use subgraph for delegate history
tyler17 Oct 1, 2024
c97c872
fix build and subgraph date handling to be isoString
tyler17 Oct 1, 2024
3f70718
Merge pull request #926 from makerdao/sep-30-vnet
tyler17 Oct 1, 2024
50e033f
Merge branch 'develop' into p1c
tyler17 Oct 1, 2024
515b38d
handle delegate links with both a new and an old for same address
tyler17 Oct 2, 2024
c562bf4
Merge pull request #928 from makerdao/delegate-history-subgraph
tyler17 Oct 2, 2024
f2c3331
update delegate factory address
tyler17 Oct 2, 2024
de21210
update version name
tyler17 Oct 2, 2024
3506f57
Merge branch 'develop' into im/version
tyler17 Oct 2, 2024
135292f
Merge pull request #932 from makerdao/new-factory
tyler17 Oct 3, 2024
0686414
get delegateVersion, expect number not string
tyler17 Oct 3, 2024
52c2084
fix build
tyler17 Oct 3, 2024
dfb66fc
Merge pull request #933 from makerdao/im/version
torhector2 Oct 3, 2024
80141ce
Merge branch 'develop' into add-contract-info
torhector2 Oct 3, 2024
21580a0
Rename version property to delegateVersion
torhector2 Oct 3, 2024
f5d9631
Merge pull request #934 from makerdao/rename-version-to-delegateversion
tyler17 Oct 3, 2024
be7b393
Merge pull request #925 from makerdao/apply-version-changes
tyler17 Oct 3, 2024
7e76411
Merge branch 'p1c' into add-contract-info
tyler17 Oct 3, 2024
7f64fcf
Merge branch 'p1c' into double-delegate-link
tyler17 Oct 3, 2024
4da248e
Merge pull request #924 from makerdao/add-contract-info
tyler17 Oct 3, 2024
67f5333
Merge branch 'p1c' into double-delegate-link
tyler17 Oct 3, 2024
678a986
update container id
tyler17 Oct 3, 2024
6119334
fix functions to not return a link if there is none
tyler17 Oct 3, 2024
e77ce69
update testing link
tyler17 Oct 4, 2024
2eec374
check v1 vote delegate factory when getting the user's delegate
tyler17 Oct 4, 2024
85aa7bd
minor copy change
tyler17 Oct 4, 2024
5d33175
fix build, and assume delegate is shadow if no data
tyler17 Oct 4, 2024
e002aa6
remove comments that don't apply anymore
tyler17 Oct 4, 2024
1ee4038
change name of owner helper functions and variables that use them
tyler17 Oct 4, 2024
5b03211
Merge pull request #930 from makerdao/double-delegate-link
tyler17 Oct 4, 2024
ec30a27
Add new hook to get total delegated from user
adamgoth Oct 8, 2024
d27a490
Fix mkr delegated to v1 check in useMigrationStatus
torhector2 Oct 8, 2024
d7712d2
Replace other instances
adamgoth Oct 8, 2024
9fad966
Change "no expiration" to "v2"
adamgoth Oct 8, 2024
2f2d164
Fix lint
adamgoth Oct 8, 2024
90c2c5c
Add disclaimer when user undelegates
torhector2 Oct 8, 2024
6dee6fc
Mark delegations that were made in the seal module
torhector2 Oct 8, 2024
f4d282c
fix test
tyler17 Oct 8, 2024
b7fd58f
fetch delegation amount from on chain if using a mock wallet, or the …
tyler17 Oct 9, 2024
52f3055
Revert "fix test"
tyler17 Oct 8, 2024
358d7c5
Merge branch 'mkr-delegated-by-user' into im/on-chain-backup
tyler17 Oct 9, 2024
e40627f
Merge pull request #936 from makerdao/mkr-delegated-by-user
adamgoth Oct 9, 2024
1b84ca6
Show all delegations source
torhector2 Oct 9, 2024
1c948d5
Merge pull request #937 from makerdao/delegation-origins
torhector2 Oct 9, 2024
ccad5cd
Merge pull request #935 from makerdao/fix-mrk-delegated-tov1-check
tyler17 Oct 9, 2024
e762441
break out seal vs direct delegation
tyler17 Oct 9, 2024
5d91fd7
shorten (Seal Module) to (Seal)
tyler17 Oct 9, 2024
5780c71
Merge branch 'breakout-delegation-amounts' into im/on-chain-backup
tyler17 Oct 9, 2024
9759270
Merge pull request #939 from makerdao/breakout-delegation-amounts
adamgoth Oct 10, 2024
a30ce69
Merge branch 'p1c' of https://github.com/makerdao/governance-portal-v…
adamgoth Oct 10, 2024
8ad4b63
Merge pull request #938 from makerdao/im/on-chain-backup
adamgoth Oct 10, 2024
c6064fd
Delete expiring delegate code, update copy, fix a couple bugs
tyler17 Oct 18, 2024
fefda2a
update v2 delegate factory address
tyler17 Oct 18, 2024
a0ab8fb
delete banner test
tyler17 Oct 18, 2024
a504de4
hide delegator migration banner for now
tyler17 Oct 18, 2024
7374d0c
Merge pull request #941 from makerdao/v2-factory-address
tyler17 Oct 18, 2024
1e62dc3
Merge pull request #940 from makerdao/migration-updates
tyler17 Oct 18, 2024
2696417
tiny copy update
tyler17 Oct 18, 2024
f48435f
use prod subgraph on production
tyler17 Oct 21, 2024
0f1225a
fix alignment issue in executive overview card
tyler17 Oct 21, 2024
ba3e93e
Merge pull request #942 from makerdao/prod-subgraph
tyler17 Oct 21, 2024
37ead16
Merge pull request #920 from makerdao/p1c
tyler17 Oct 22, 2024
99b3c84
Merge branch 'master' into develop
tyler17 Oct 22, 2024
be84f49
remove /private from the urls
tyler17 Oct 22, 2024
aadf438
Merge pull request #945 from makerdao/remove-private
tyler17 Oct 23, 2024
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
2 changes: 0 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ALCHEMY_KEY=
ETHERSCAN_KEY=
POCKET_KEY=
GITHUB_TOKEN=
MONGODB_URI=
MONGODB_COMMENTS_DB=
USE_CACHE=true
REDIS_URL=
MIGRATION_WEBHOOK_URL=
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
runs-on: ubuntu-latest
env:
INFURA_KEY: ${{ secrets.INFURA_KEY }}
MONGODB_COMMENTS_DB: ${{ secrets.MONGODB_COMMENTS_DB }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
POCKET_KEY: ${{ secrets.POCKET_KEY }}
Expand All @@ -43,7 +41,7 @@ jobs:
- name: Build sdk
run: yarn build-sdk

- run: yarn exec playwright install --with-deps
- run: yarn exec playwright install --with-deps

- name: Run E2E Test
run: yarn run e2e ${{ matrix.test }}
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ The tag and versioning should be done on develop, and then merged to master thro
The portal seeks to rely on on-chain data as much as possible and to minimize reliance on data stored on centralized servers. However, due to the large volume of data that is relevant to Maker governance, fetching this data from on-chain is both time and resource-intensive. In order to improve the user's experience, some reliance on third-party services has been added, and we recommend a few configuration steps for optimal use. These services include:

- [GitHub](https://github.com/makerdao/community/tree/master/governance) for storing markdown related to [polls](https://github.com/makerdao/community/tree/master/governance/polls), [executives](https://github.com/makerdao/community/tree/master/governance/votes), and [aligned delegates](https://github.com/makerdao/community/tree/master/governance/delegates)
- MongoDB for storing comments related to votes on polls and executives

#### Network providers

Expand All @@ -87,10 +86,6 @@ The following configuration values can be added to the `.env` file:

- Set `GITHUB_TOKEN` to fetch polls, executives, and aligned delegates information from GitHub (optionally set `GITHUB_TOKEN_2` and `GITHUB_TOKEN_3`)

- Set `MONGODB_URI` to a full MongoDB uri (ex: `mongodb+srv://...`)

- Set `MONGODB_COMMENTS_DB` the MongoDB db name to be used for vote comments

- Set `USE_CACHE` to true if you want to use cache, if `REDIS_URL` is set it will use REDIS otherwise filesystem cache

- Set `GASLESS_DISABLED` to `true` to disable gasless voting in UI (pre-check endpoint will fail)
Expand Down
4 changes: 0 additions & 4 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type SystemConfig = {
ETHERSCAN_KEY: string;
POCKET_KEY: string;
TRACING_RPC_NODE: string;
MONGODB_URI: string;
MONGODB_COMMENTS_DB: string;
NODE_ENV: 'development' | 'production' | 'test';
GITHUB_TOKEN: string;
GITHUB_TOKEN_2: string;
Expand Down Expand Up @@ -44,8 +42,6 @@ export const config: SystemConfig = {
ETHERSCAN_KEY: process.env.ETHERSCAN_KEY || '',
POCKET_KEY: process.env.POCKET_KEY || '',
TRACING_RPC_NODE: process.env.TRACING_RPC_NODE || '',
MONGODB_URI: process.env.MONGODB_URI || '',
MONGODB_COMMENTS_DB: process.env.MONGODB_COMMENTS_DB || '',
NODE_ENV: process.env.NODE_ENV || 'development',
GITHUB_TOKEN: process.env.GITHUB_TOKEN || '',
GITHUB_TOKEN_2: process.env.GITHUB_TOKEN_2 || '',
Expand Down
23 changes: 0 additions & 23 deletions lib/theme/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,29 +1338,6 @@ export const icons = {
</g>
)
},
yourComment: {
viewBox: '0 0 12 12',
path: (
<g>
<path
d="M8.90692 0.887358H3.54629C2.13911 0.887358 1 2.02654 1 3.43365V6.51601C1 7.82934 2.00512 8.91489 3.27824 9.04891L3.30507 10.8447C3.30507 10.9519 3.3721 11.0323 3.45249 11.0859C3.49269 11.0992 3.53289 11.1127 3.57308 11.1127C3.62665 11.1127 3.69368 11.0993 3.73387 11.0591L6.32037 9.06228H8.90687C10.3141 9.06228 11.4532 7.9231 11.4532 6.51598V3.43362C11.4532 2.02644 10.3141 0.887329 8.90687 0.887329L8.90692 0.887358ZM10.9171 6.51601C10.9171 7.62834 10.0192 8.52624 8.90692 8.52624H6.22661C6.17304 8.52624 6.10601 8.53961 6.06582 8.57981L3.84113 10.2952L3.8143 8.79426C3.8143 8.64684 3.69371 8.52625 3.5463 8.52625C2.43397 8.52625 1.53606 7.62835 1.53606 6.51602V3.43366C1.53606 2.32133 2.43397 1.42343 3.5463 1.42343H8.90692C10.0192 1.42343 10.9172 2.32133 10.9172 3.43366L10.9171 6.51601Z"
fill="currentColor"
stroke="currentColor"
strokeWidth="0.7"
/>
<path
d="M1.5 7.88733V3.7793C1.5 2.71783 2.32923 1.84126 3.38906 1.78238L10.5 1.38733L11 8.38733H6L4 9.88733V8.38733L1.5 7.88733Z"
fill="currentColor"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M8.84898 3.0992C9.02933 3.24824 9.05126 3.51119 8.89797 3.68653L5.25512 7.85319C5.17438 7.94553 5.0563 7.99912 4.93164 7.99999C4.80699 8.00086 4.68813 7.94892 4.60604 7.85771L3.10604 6.19105C2.95018 6.01787 2.96823 5.75463 3.14636 5.6031C3.32449 5.45156 3.59525 5.46911 3.75111 5.64229L4.92387 6.94536L8.24488 3.14682C8.39817 2.97149 8.66864 2.95016 8.84898 3.0992Z"
fill="white"
/>
</g>
)
},
'Gnosis Safe': {
viewBox: '0 0 20 20',
path: (
Expand Down
7 changes: 5 additions & 2 deletions modules/address/components/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { formatAddress } from 'lib/utils';
import { useWeb3 } from 'modules/web3/hooks/useWeb3';
import { getENS } from 'modules/web3/helpers/ens';
import React, { useEffect, useState } from 'react';
import { getDefaultProvider } from 'modules/web3/helpers/getDefaultProvider';
import { SupportedNetworks } from 'modules/web3/constants/networks';

export const Address = React.memo(function Address({
address,
Expand All @@ -19,14 +21,15 @@ export const Address = React.memo(function Address({
address: string;
maxLength?: number;
}): React.ReactElement {
const { provider } = useWeb3();
const [addressFormated, setAddressFormatted] = useState(formatAddress(address || '').toLowerCase());

async function fetchENSName() {
if (!address || !provider) {
if (!address) {
return;
}

const provider = getDefaultProvider(SupportedNetworks.MAINNET);

const ens = await getENS({ address, provider });

ens ? setAddressFormatted(ens) : setAddressFormatted(formatAddress(address).toLowerCase());
Expand Down
8 changes: 6 additions & 2 deletions modules/address/components/AddressDelegatedTo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const CollapsableRow = ({ delegate, network, bpi, totalDelegated }: CollapsableR
const { address, lockAmount, events } = delegate;
const sortedEvents = events.sort((prev, next) => (prev.blockTimestamp > next.blockTimestamp ? -1 : 1));

const formattedDate = formatDateWithTime(delegate.expirationDate);
const formattedDate = delegate.expirationDate ? formatDateWithTime(delegate.expirationDate) : '';
const dateText = delegate.isExpired
? `This contract expired ${formattedDate}`
: `This contract will expire ${formattedDate}`;
Expand Down Expand Up @@ -84,7 +84,7 @@ const CollapsableRow = ({ delegate, network, bpi, totalDelegated }: CollapsableR
</Text>
{expanded && (
<Flex sx={{ flexDirection: 'column' }}>
{sortedEvents.map(({ blockTimestamp, lockAmount }) => {
{sortedEvents.map(({ blockTimestamp, lockAmount, isLockstake }) => {
return (
<Flex
key={blockTimestamp}
Expand All @@ -104,6 +104,10 @@ const CollapsableRow = ({ delegate, network, bpi, totalDelegated }: CollapsableR
parseUnits(lockAmount.indexOf('-') === 0 ? lockAmount.substring(1) : lockAmount)
)}${bpi > 0 ? ' MKR' : ''}`}
</Text>

<Text key={blockTimestamp} variant="smallCaps" sx={{ pl: 2 }}>
{isLockstake ? '(Seal)' : ''}
</Text>
</Flex>
);
})}
Expand Down
6 changes: 1 addition & 5 deletions modules/address/components/AddressDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { AddressMKRDelegatedStats } from './AddressMKRDelegatedStats';
import AddressIconBox from './AddressIconBox';
import { useWeb3 } from 'modules/web3/hooks/useWeb3';
import { ErrorBoundary } from 'modules/app/components/ErrorBoundary';
import AccountComments from 'modules/comments/components/AccountComments';
import Tabs from 'modules/app/components/Tabs';
import { useDelegatedTo } from 'modules/delegates/hooks/useDelegatedTo';
import { InternalLink } from 'modules/app/components/InternalLink';
Expand All @@ -43,7 +42,7 @@ export function AddressDetail({ addressInfo }: { addressInfo: AddressApiResponse

const { data: delegatedToData } = useDelegatedTo(addressInfo.address, network);

const tabTitles = ['Account Details', 'Comments'];
const tabTitles = ['Account Details'];

const tabPanels = [
<Box key="account-detail">
Expand Down Expand Up @@ -134,9 +133,6 @@ export function AddressDetail({ addressInfo }: { addressInfo: AddressApiResponse
<PollingParticipationOverview votes={statsData.pollVoteHistory} />
</ErrorBoundary>
)}
</Box>,
<Box key="account-comments" sx={{ p: [3, 4] }}>
<AccountComments address={addressInfo.address} />
</Box>
];

Expand Down
7 changes: 5 additions & 2 deletions modules/app/components/DateWithHover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ export function DateWithHover({
timeago,
label
}: {
date: Date | string | number;
date?: Date | string | number | null;
timeago?: boolean;
label?: string;
}): React.ReactElement {
if (!date) {
return <Text>N/A</Text>;
}
return (
<Tooltip label={label ? label : formatDateWithTime(date ?? '')}>
<Tooltip label={label ? label : formatDateWithTime(date)}>
<Text>{timeago ? `${formatTimeAgo(date ?? '')}` : `${formatDateWithTime(date ?? '')}`}</Text>
</Tooltip>
);
Expand Down
45 changes: 0 additions & 45 deletions modules/comments/api/getCommentTransaction.ts

This file was deleted.

73 changes: 0 additions & 73 deletions modules/comments/api/getCommentsByAddress.ts

This file was deleted.

72 changes: 0 additions & 72 deletions modules/comments/api/getExecutiveComments.ts

This file was deleted.

Loading
Loading