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

Scripts to generate payloads needed to do administrative config changes on dvn #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MohammadChavosh
Copy link

No description provided.

Copy link

socket-security bot commented Dec 13, 2024

Copy link

socket-security bot commented Dec 13, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
High CVE npm/[email protected] ⚠︎
Critical CVE npm/[email protected] 🚫
Unstable ownership npm/[email protected] ⚠︎

View full report↗︎

Next steps

What is a CVE?

Contains a high severity Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known high severity CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

What is a critical CVE?

Contains a Critical Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

What is unstable ownership?

A new collaborator has begun publishing package versions. Package stability and security risk may be elevated.

Try to reduce the number of authors you depend on to reduce the risk to malicious actors gaining access to your supply chain. Packages should remove inactive collaborators with publishing rights from packages on npm.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@MohammadChavosh MohammadChavosh marked this pull request as ready for review December 16, 2024 22:01
@@ -0,0 +1,143 @@
import { ethers } from 'ethers'
import { GcpKmsSigner } from 'ethers-gcp-kms-signer'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good enough for now but this wont be extensible for non evm chains

@@ -0,0 +1,16 @@
[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add README for dvn-addresses-testnet.json and kms-keyids-testnet.json and also comments in the script code so developers know what they need to prepare to run the script

await Promise.all(
availableChainNames.map(async (chainName) => {
results[chainName] = results[chainName] || {}
const vId = getChainIdForNetwork(chainName, environment, '2')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will break if monorepo does not have that chain for ulnv2 which is the case for some of the newer endpoints that only has 302.

we use this in offchain-monorepo:

export const getVId = (chainName: string, environment: string): string => {
    // By convention the vid is alwayd the endpointV1 chainId
    // TODO: Monorepo doesnt have these chains for EndpointVersion.V1
    if (['solana', 'ton', 'initia', 'movement'].includes(chainName)) {
        const eid = getChainIdForEndpointVersion(
            chainName,
            environment,
            EndpointVersion.V2,
        )
        return (parseInt(eid) % 30000).toString()
    }
    return getChainIdForEndpointVersion(
        chainName,
        environment,
        EndpointVersion.V1,
    )
}

await Promise.all(
availableChainNames.map(async (chainName) => {
results[chainName] = results[chainName] || {}
const vId = getChainIdForNetwork(chainName, environment, '2')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

availableChainNames.map(async (chainName) => {
results[chainName] = results[chainName] || {}
const vId = getChainIdForNetwork(chainName, environment, '2')
const callData = getCallData(newQuorum)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of duplicate code here that can probably benefit from just a function that iterates and generates signatures based on callbacks. i don't mind this for now but if we add more dvn signer functions this will get a bit error-prone to manual update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants