Skip to content

fix: remove yq and fix wrong ciphernode addresses in CRISP example#998

Closed
philogicae wants to merge 1 commit into
theinterfold:mainfrom
philogicae:main
Closed

fix: remove yq and fix wrong ciphernode addresses in CRISP example#998
philogicae wants to merge 1 commit into
theinterfold:mainfrom
philogicae:main

Conversation

@philogicae

@philogicae philogicae commented Nov 11, 2025

Copy link
Copy Markdown

Same change than here #711 but for CRISP example.
Also, using yq, ciphernode addresses were wrongly parsed, including extra double quotes, raising a Hardhat error.

Summary by CodeRabbit

  • Chores
    • Updated configuration parsing method in development scripts to improve reliability and maintainability.

@vercel

vercel Bot commented Nov 11, 2025

Copy link
Copy Markdown

@philogicae is attempting to deploy a commit to the Gnosis Guild Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Modified parsing logic in examples/CRISP/scripts/dev_cipher.sh to extract CN1, CN2, and CN3 addresses from enclave.config.yaml using a grep and sed pipeline instead of yq-based YAML queries, maintaining downstream usage.

Changes

Cohort / File(s) Summary
YAML parsing refactor
examples/CRISP/scripts/dev_cipher.sh
Replaced yq YAML query commands with grep+grep+sed pipeline for extracting CN1, CN2, CN3 address values from configuration file

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that the grep+sed pipeline correctly extracts address values matching the original yq behavior
  • Confirm variable assignment and downstream ciphernode:add invocations remain functionally equivalent
  • Test edge cases around whitespace and YAML formatting in the configuration file

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • ctrlc03
  • cedoor

Poem

🐰 A rabbit swaps yq for grep so keen,
With sed's gentle touch, a cleaner scene,
No fancy tools, just pipes and flow,
The config reads, the ciphers know! 🔐

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: removing yq dependency and fixing ciphernode address parsing in the CRISP example.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed3fcb and 3dfc8b6.

📒 Files selected for processing (1)
  • examples/CRISP/scripts/dev_cipher.sh (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 107
File: tests/basic_integration/test.sh:103-114
Timestamp: 2024-09-26T04:12:09.345Z
Learning: In `tests/basic_integration/test.sh`, the user prefers not to refactor the ciphernode addition section to reduce duplication.
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 107
File: tests/basic_integration/test.sh:103-114
Timestamp: 2024-10-08T19:45:18.209Z
Learning: In `tests/basic_integration/test.sh`, the user prefers not to refactor the ciphernode addition section to reduce duplication.
📚 Learning: 2024-09-26T04:12:09.345Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 107
File: tests/basic_integration/test.sh:103-114
Timestamp: 2024-09-26T04:12:09.345Z
Learning: In `tests/basic_integration/test.sh`, the user prefers not to refactor the ciphernode addition section to reduce duplication.

Applied to files:

  • examples/CRISP/scripts/dev_cipher.sh
📚 Learning: 2024-10-23T01:59:27.215Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 156
File: tests/basic_integration/test.sh:21-21
Timestamp: 2024-10-23T01:59:27.215Z
Learning: In `tests/basic_integration/test.sh`, the hardcoded `CIPHERNODE_SECRET` is acceptable for testing purposes and does not need to be changed.

Applied to files:

  • examples/CRISP/scripts/dev_cipher.sh
🔇 Additional comments (1)
examples/CRISP/scripts/dev_cipher.sh (1)

18-20: Parsing verified; grep+sed fix is correct.

The grep+sed pipeline successfully extracts ciphernode addresses without extra quotes. The YAML format in enclave.config.yaml matches the sed pattern exactly, and all three addresses (CN1, CN2, CN3) are extracted cleanly.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@0xjei

0xjei commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

hey @philogicae tysm for your contribution - can you just expand on this?

Also, using yq, ciphernode addresses were wrongly parsed, including extra double quotes, raising a Hardhat error.

0xjei
0xjei previously approved these changes Nov 12, 2025

@0xjei 0xjei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK

@philogicae

Copy link
Copy Markdown
Author

@0xjei

Since today's rebase, this PR seems already deprecated (needed for branch: main-backup?), so it can be closed.

Hardhat error I mentionned:

[DEPLOY] > @enclave/main@0.1.5 ciphernode:add /workspace/project
[DEPLOY] > cd packages/enclave-contracts && pnpm ciphernode:add --ciphernode-address '"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"' --network localhost
[DEPLOY]
[DEPLOY]
[DEPLOY] > @enclave-e3/contracts@0.1.5 ciphernode:add /workspace/project/packages/enclave-contracts
[DEPLOY] > hardhat ciphernode:add --ciphernode-address '"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"' --network localhost
[DEPLOY]
[DEPLOY]    Compiling e3-greco-generator v0.1.0 (https://github.com/gnosisguild/greco#77ef983e)
[DEPLOY]     Blocking waiting for file lock on build directory
[DEPLOY]    Compiling e3-bfv-helpers v0.1.5 (/workspace/project/crates/bfv-helpers)
[DEPLOY]    Compiling e3-user-program v0.1.0 (/workspace/project/examples/CRISP/program)
[ANVIL] eth_accounts
[ANVIL] eth_chainId
[DEPLOY] Error HHE20000 in plugin hardhat-ethers: Method "HardhatEthersProvider.resolveName" is not implemented
[DEPLOY]
[DEPLOY] For more info go to https://hardhat.org/HHE20000 or run Hardhat with --show-stack-traces
[DEPLOY]  ELIFECYCLE  Command failed with exit code 1.

Current code / latest fix is fine, if keeping yq dependency is wanted:

root@1f61251dde16:/workspace/project/examples/CRISP# cat ./enclave.config.yaml | yq '.nodes.cn1.address'
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8" # Extra double quotes issue
root@1f61251dde16:/workspace/project/examples/CRISP# cat ./enclave.config.yaml | yq -r '.nodes.cn1.address'
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 # All good

@0xjei

0xjei commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

@0xjei

Since today's rebase, this PR seems already deprecated (needed for branch: main-backup?), so it can be closed.

Hardhat error I mentionned:

[DEPLOY] > @enclave/main@0.1.5 ciphernode:add /workspace/project
[DEPLOY] > cd packages/enclave-contracts && pnpm ciphernode:add --ciphernode-address '"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"' --network localhost
[DEPLOY]
[DEPLOY]
[DEPLOY] > @enclave-e3/contracts@0.1.5 ciphernode:add /workspace/project/packages/enclave-contracts
[DEPLOY] > hardhat ciphernode:add --ciphernode-address '"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"' --network localhost
[DEPLOY]
[DEPLOY]    Compiling e3-greco-generator v0.1.0 (https://github.com/gnosisguild/greco#77ef983e)
[DEPLOY]     Blocking waiting for file lock on build directory
[DEPLOY]    Compiling e3-bfv-helpers v0.1.5 (/workspace/project/crates/bfv-helpers)
[DEPLOY]    Compiling e3-user-program v0.1.0 (/workspace/project/examples/CRISP/program)
[ANVIL] eth_accounts
[ANVIL] eth_chainId
[DEPLOY] Error HHE20000 in plugin hardhat-ethers: Method "HardhatEthersProvider.resolveName" is not implemented
[DEPLOY]
[DEPLOY] For more info go to https://hardhat.org/HHE20000 or run Hardhat with --show-stack-traces
[DEPLOY]  ELIFECYCLE  Command failed with exit code 1.

Current code / latest fix is fine, if keeping yq dependency is wanted:

root@1f61251dde16:/workspace/project/examples/CRISP# cat ./enclave.config.yaml | yq '.nodes.cn1.address'
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8" # Extra double quotes issue
root@1f61251dde16:/workspace/project/examples/CRISP# cat ./enclave.config.yaml | yq -r '.nodes.cn1.address'
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 # All good

I think this is still valuable for current main branch, thx for the explanations!

@0xjei 0xjei changed the base branch from main-backup to main November 12, 2025 17:05
@0xjei 0xjei dismissed their stale review November 12, 2025 17:05

The base branch was changed.

- Removed yq dependency by using grep and sed for extracting node addresses
- Maintains same functionality while reducing external tool dependencies
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