Skip to content

Commit

Permalink
Merge pull request #1042 from ethereum/staging
Browse files Browse the repository at this point in the history
Quick Release
  • Loading branch information
kuzdogan authored May 30, 2023
2 parents d62b630 + af3f617 commit 964f9cb
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 24 deletions.
6 changes: 4 additions & 2 deletions package-lock.json

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

52 changes: 30 additions & 22 deletions scripts/check-s3-backup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,50 @@ const jobsWithArtifacts = [
"verification-e2e-goerli",
];
const circleCIJobsUrl = `https://circleci.com/api/v2/workflow/${workflowId}/job`;
console.log("Fetching jobs from: ", circleCIJobsUrl);
const circleCIJobsUrlResult = await fetch(circleCIJobsUrl);
const circleCIJobsUrlJson = await circleCIJobsUrlResult.json();
const jobIds = circleCIJobsUrlJson.items
.filter((job) => jobsWithArtifacts.includes(job.name))
.map((job) => job.id);
const jobs = circleCIJobsUrlJson.items.filter((job) =>
jobsWithArtifacts.includes(job.name)
);

// for each job id get the artifact and check the existance on s3
let existance = false;
for (const jobId of jobIds) {
const circleCIArtifactVerifiedContractUrl = `https://dl.circleci.com/private/output/job/${jobId}/artifacts/0/verified-contracts/saved.json`;
for (const job of jobs) {
console.log(`Checking job with name: ${job.name} and id: ${job.id}`);
const circleCIArtifactVerifiedContractUrl = `https://dl.circleci.com/private/output/job/${job.id}/artifacts/0/verified-contracts/saved.json`;
console.log("Fetching artifact from: ", circleCIArtifactVerifiedContractUrl);
const circleCIArtifactVerifiedContractResult = await fetch(
circleCIArtifactVerifiedContractUrl
);
const circleCIArtifactVerifiedContractJson =
await circleCIArtifactVerifiedContractResult.json();
const { deploymentAddress, deploymentChain } =
circleCIArtifactVerifiedContractJson;
if (deploymentAddress && deploymentChain) {
try {
const s3Object = await bareBonesS3.send(
new GetObjectCommand({
Key: `stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json`,
Bucket: "sourcify-backup-s3",
})
);

if (s3Object.ETag?.length > 0) {
existance = true;
break;
}
} catch (e) {
console.log(e);
console.log(
`not in backup: stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json`
);
if (!deploymentAddress || !deploymentChain) {
throw new Error(
`Deployment address or chain not found in job ${job.id} with name ${job.name}. Deployment address: ${deploymentAddress}, Deployment chain: ${deploymentChain}`
);
}

try {
const s3Object = await bareBonesS3.send(
new GetObjectCommand({
Key: `stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json`,
Bucket: "sourcify-backup-s3",
})
);

if (s3Object.ETag?.length > 0) {
existance = true;
break;
}
} catch (e) {
console.log(e);
console.log(
`not in backup: stable/repository/contracts/full_match/${deploymentChain}/${deploymentAddress}/metadata.json`
);
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/sourcify-chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,14 @@ const sourcifyChainsExtensions: SourcifyChainsExtensionsObject = {
"https://explorer.plexfinance.us/" + BLOCKSCOUT_SUFFIX,
txRegex: getBlockscoutRegex(),
},
"2000": {
// DogeChain Mainnet
supported: true,
monitored: false,
contractFetchAddress:
"https://explorer.dogechain.dog/" + BLOCKSCOUT_SUFFIX,
txRegex: getBlockscoutRegex(),
},
};

const sourcifyChainsMap: SourcifyChainMap = {};
Expand Down
9 changes: 9 additions & 0 deletions test/chains/chain-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,15 @@ describe("Test Supported Chains", function () {
["shared/1_Storage.sol"],
"shared/1_Storage.metadata.json"
);

// DogeChain Mainnet
verifyContract(
"0x2a35F4AA0d3e417e8896E972f35dba4b39b6305e",
"2000",
"DogeChain Mainnet",
["shared/1_Storage.sol"],
"shared/1_Storage.metadata.json"
);

// Finally check if all the "supported: true" chains have been tested
it("should have tested all supported chains", function (done) {
Expand Down
4 changes: 4 additions & 0 deletions ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
var u = "https://matomo.ethereum.org/";
_paq.push(["setTrackerUrl", u + "matomo.php"]);
_paq.push(["setSiteId", "30"]);
var secondaryTracker =
"https://ethereumfoundation.matomo.cloud/matomo.php";
var secondaryWebsiteId = "15";
_paq.push(["addTracker", secondaryTracker, secondaryWebsiteId]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
Expand Down

0 comments on commit 964f9cb

Please sign in to comment.