Skip to content

Commit

Permalink
release (#249)
Browse files Browse the repository at this point in the history
* fix: don't attempt to fetch prices from before a chain existed (#228)

* fix: avoid filling cache directory (#232)

* feat: add support for gitcoinvote token (#235)

* Revert "fix: avoid filling cache directory (#232)" (#238)

This reverts commit aabeb89.

* Revert "feat: add support for gitcoinvote token (#235)"

This reverts commit 0864431.

* fix: increase debug & temporarily disable goerli (#241)

* enh: increase debugging for price updater

* fix: disable goerli temporarily

* feat: add support for gitcoinvote token (#235)

* fix: fix uniqueContributors for vote coming from MRC (#237)

* enh: wait between passport page requests (#245)

* enh: update chainsauce (#242)

* fix: update fantom contracts (#248)

* fix: update fantom contracts

* fix: restore ProjectRegistry configuration
  • Loading branch information
bard authored Aug 22, 2023
1 parent 2fa244f commit 1a27483
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
15 changes: 13 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"pino-pretty": "^10.0.1",
"pluralistic": "github:gitcoinco/pluralistic.js#644d14fff65100f005d7afc18799b0f99b72ae24",
"serve-index": "^1.9.1",
"sleep-promise": "^9.1.0",
"statuses-bitmap": "github:gitcoinco/statuses-bitmap#f123d7778e42e16adb98fff2b2ba18c0fee57227",
"write-file-atomic": "^5.0.1",
"zod": "^3.21.4"
Expand Down
26 changes: 16 additions & 10 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,30 @@ export const CHAINS: Chain[] = [
address: "0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E",
},
},
{
code: "Unknown",
address: "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",
decimals: 18,
priceSource: {
chainId: 250,
address: "0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E",
},
},
],
subscriptions: [
{
address: "0x8e1bD5Da87C14dd8e08F7ecc2aBf9D1d558ea174",
abi: "#abis/v1/ProjectRegistry.json",
abi: "#abis/v2/ProjectRegistry.json",
},
{
address: "0x3e7f72DFeDF6ba1BcBFE77A94a752C529Bb4429E",
abi: "#abis/v1/RoundFactory.json",
events: {
RoundCreated: "RoundCreatedV1",
},
fromBlock: 55528191,
address: "0xfb08d1fD3a7c693677eB096E722ABf4Ae63B0B95",
abi: "#abis/v2/RoundFactory.json",
fromBlock: 66509340,
},
{
address: "0x06A6Cc566c5A88E77B1353Cdc3110C2e6c828e38",
abi: "#abis/v1/QuadraticFundingVotingStrategyFactory.json",
fromBlock: 55528191,
address: "0x534d2AAc03dCd0Cb3905B591BAf04C14A95426AB",
abi: "#abis/v2/QuadraticFundingVotingStrategyFactory.json",
fromBlock: 66509340,
},
],
},
Expand Down
9 changes: 6 additions & 3 deletions src/passport/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
import sleep from "sleep-promise";
import { ethers } from "ethers";
import fetch from "make-fetch-happen";
import { Logger } from "pino";

const PASSPORT_API_MAX_ITEMS_LIMIT = 1000;
const DELAY_BETWEEN_UPDATES_MS = 60 * 1000;
const DELAY_BETWEEN_FULL_UPDATES_MS = 60 * 1000;
const DELAY_BETWEEN_PAGE_REQUESTS_MS = 60 * 50;

export type PassportScore = {
address: string;
Expand Down Expand Up @@ -65,7 +67,7 @@ export const createPassportUpdater = (
}

if (opts.watch) {
setTimeout(poll, DELAY_BETWEEN_UPDATES_MS);
setTimeout(poll, DELAY_BETWEEN_FULL_UPDATES_MS);
}
};

Expand All @@ -74,7 +76,7 @@ export const createPassportUpdater = (
const poll = async (): Promise<void> => {
// Can be switched to incremental updates once https://github.com/gitcoinco/passport/issues/1414 is fixed
await updateEntireDataset();
setTimeout(poll, DELAY_BETWEEN_UPDATES_MS);
setTimeout(poll, DELAY_BETWEEN_FULL_UPDATES_MS);
};

const updateEntireDataset = async (): Promise<void> => {
Expand Down Expand Up @@ -121,6 +123,7 @@ export const createPassportUpdater = (
passports.push(...passportBatch);

offset += PASSPORT_API_MAX_ITEMS_LIMIT;
await sleep(DELAY_BETWEEN_PAGE_REQUESTS_MS);
}
}

Expand Down

0 comments on commit 1a27483

Please sign in to comment.