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

List community RPC nodes #470

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

shazarre
Copy link
Contributor

@shazarre shazarre commented Dec 3, 2024

Description

This PR adds a command to list (all/from elected validator groups) community RPC node URLs.

Other changes

None.

Tested

Tested locally, CI tests are passing.

How to QA

  1. Run anvil (from repository root dir)
anvil --port 8545 --load-state node_modules/@celo/devchain-anvil/l2-devchain.json --balance 100000 --base-fee 0  --timestamp 1718872285 --mnemonic "concert load couple harbor equip island argue ramp clarify fence smart topic"
  1. Impersonate a validator (you can list all devchain validators first by running NO_SYNCCHECK=1 yarn workspace @celo/celocli run dev validator:list --node local, add --csv flag if you cannot copy the full validator address)
cast rpc anvil_impersonateAccount "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65"
  1. The validator account should have sufficient balance, but just make sure by running:
cast balance 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
  1. Register metadata using an existing one already
NO_SYNCCHECK=1 yarn workspace @celo/celocli run dev account:register-metadata --url https://gist.githubusercontent.com/shazarre/dc6e3c2b44abccbb5af0fba1f519dde7/raw/7014424afd11c0ba0c93d36284d19beeb3d0a962/metadata-test.json --node local --from 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
  1. Run the command and verify that it displays a table with RPC URLs and associated group names and addresses (if oclif doesn't recognize the command run yarn workspace @celo/celocli run prepack first)
$ NO_SYNCCHECK=1 yarn workspace @celo/celocli run dev validatorgroup:rpc-urls --node local

Running in development mode
 Validator Group Name RPC URL                  Validator Address
 ──────────────────── ──────────────────────── ─────────────────────────────
 cLabs                https://example.com:8545 0x15d34AAf54267DB7D7c367839A…

Related issues


PR-Codex overview

This PR introduces a new command to list community RPC nodes and enhances backwards compatibility for certain claims related to the ATTESTATION_SERVICE_URL. It also updates documentation and tests accordingly.

Detailed summary

  • Added validatorgroup:rpc-urls command to list community RPC nodes.
  • Implemented backwards compatibility for ATTESTATION_SERVICE_URL claims.
  • Updated metadata.ts to throw an error for unsupported claims.
  • Enhanced tests for adding and handling claims.
  • Improved documentation for CLI commands related to RPC nodes.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@shazarre shazarre self-assigned this Dec 3, 2024
Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: b9a0ad8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@celo/metadata-claims Patch
@celo/celocli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 92.98246% with 4 lines in your changes missing coverage. Please review.

Project coverage is 73.64%. Comparing base (913961e) to head (b9a0ad8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #470      +/-   ##
==========================================
+ Coverage   73.44%   73.64%   +0.19%     
==========================================
  Files         240      241       +1     
  Lines       10180    10237      +57     
  Branches     1619     1630      +11     
==========================================
+ Hits         7477     7539      +62     
+ Misses       2636     2578      -58     
- Partials       67      120      +53     
Components Coverage Δ
celocli 85.59% <94.11%> (+0.36%) ⬆️
sdk 68.96% <83.33%> (+0.01%) ⬆️
wallets 52.72% <ø> (ø)
viem-sdks 95.08% <ø> (ø)

@shazarre shazarre marked this pull request as ready for review December 3, 2024 13:15
@shazarre shazarre requested a review from a team as a code owner December 3, 2024 13:15
@shazarre shazarre changed the title [WIP] List community RPC nodes List community RPC nodes Dec 4, 2024
@aaronmgdr
Copy link
Member

im getting huge errors when i run this on alfajores (and mainnet)

Copy link
Member

@aaronmgdr aaronmgdr left a comment

Choose a reason for hiding this comment

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

looks like some case that needs to be handled.

yarn celocli network:rpc-urls --node alfajores --all

Received an error during command execution, if you believe this is a bug you can create an issue here:

https://github.com/celo-org/developer-tooling/issues/new?assignees=&labels=bug+report&projects=&template=BUG-FORM.yml

 Error: Invalid value "ATTESTATION_SERVICE_URL" supplied to : { claims: Array<(AccountClaimType | { type: "DOMAIN", timestamp: number, domain: string } | { type: "RPC_URL", timestamp: number, rpcUrl: string } | { type: "KEYBASE", timestamp: number, username: string } | { type: "NAME", timestamp: number, name: string } | { type: "STORAGE", timestamp: number, address: string, filteredDataPaths: string })>, meta: { address: Address, signature: string } }/claims: Array<(AccountClaimType | { type: "DOMAIN", timestamp: number, domain: string } | { type: "RPC_URL", timestamp: number, rpcUrl: string } | { type: "KEYBASE", timestamp: number, username: string } | { type: "NAME", timestamp: number, name: string } | { type: "STORAGE", timestamp: number, address: string, filteredDataPaths: string })>/1: (AccountClaimType | { type: "DOMAIN", timestamp: number, domain: string } | { type: "RPC_URL", timestamp: number, rpcUrl: string } | { type: "KEYBASE", timestamp: number, username: string } 

packages/cli/src/commands/validatorgroup/rpc-urls.ts Outdated Show resolved Hide resolved
packages/cli/src/commands/validatorgroup/rpc-urls.ts Outdated Show resolved Hide resolved
@aaronmgdr aaronmgdr self-requested a review December 6, 2024 16:15
Copy link

gitguardian bot commented Dec 9, 2024

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
14107626 Triggered Generic High Entropy Secret b9a0ad8 packages/cli/src/commands/account/new.test.ts View secret
14107627 Triggered Generic High Entropy Secret b9a0ad8 packages/cli/src/commands/account/new.test.ts View secret
14107624 Ignored Generic High Entropy Secret b9a0ad8 packages/cli/src/commands/account/new.test.ts View secret
14107625 Triggered Generic High Entropy Secret b9a0ad8 packages/cli/src/commands/account/new.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@shazarre shazarre enabled auto-merge (squash) December 9, 2024 15:19
@shazarre shazarre disabled auto-merge December 10, 2024 07:09
Copy link
Member

@aaronmgdr aaronmgdr left a comment

Choose a reason for hiding this comment

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

beautiful PR. but we are putting it on hold for until next year

@shazarre shazarre marked this pull request as draft December 10, 2024 11:46
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.

new cli commands for viewing registered rpc urls
2 participants