From 4c5bb3619233e59fd05dbd8764ef3ec1267c4b92 Mon Sep 17 00:00:00 2001 From: Darien Hernandez Date: Fri, 25 Jul 2025 21:56:00 +0200 Subject: [PATCH 1/3] chore(workflows): Replace inline YAML sanitization with external script --- .github/workflows/sync-docs-from-node.yml | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/workflows/sync-docs-from-node.yml b/.github/workflows/sync-docs-from-node.yml index 2bdc2da3..52275197 100644 --- a/.github/workflows/sync-docs-from-node.yml +++ b/.github/workflows/sync-docs-from-node.yml @@ -205,27 +205,7 @@ jobs: sed -i 's|zksyncwebsocketurl: *"[^"]*"|zksyncwebsocketurl: "TODO: Set your GenLayer Chain ZKSync WebSocket RPC URL here"|' "$TEMP_CONFIG" # Remove node.dev and node.admin sections using Python for reliable YAML parsing - python3 -c " -import yaml -import sys - -config_file = sys.argv[1] - -# Read the YAML file -with open(config_file, 'r') as f: - config = yaml.safe_load(f) - -# Remove node.dev and node.admin if they exist -if 'node' in config: - if 'dev' in config['node']: - del config['node']['dev'] - if 'admin' in config['node']: - del config['node']['admin'] - -# Write back to file preserving the structure -with open(config_file, 'w') as f: - yaml.dump(config, f, default_flow_style=False, sort_keys=False, allow_unicode=True) -" "$TEMP_CONFIG" + python3 .github/scripts/sanitize-config.py "$TEMP_CONFIG" # Check if the config has changed if [ -f "$DEST_CONFIG" ]; then From 7f955cbe61cc391e45d0de4827ed48c0c1922f3f Mon Sep 17 00:00:00 2001 From: Darien Hernandez Date: Fri, 25 Jul 2025 21:56:05 +0200 Subject: [PATCH 2/3] feat(workflows): add script to sanitize GenLayer node configuration --- .github/scripts/sanitize-config.py | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/scripts/sanitize-config.py diff --git a/.github/scripts/sanitize-config.py b/.github/scripts/sanitize-config.py new file mode 100644 index 00000000..dcecc520 --- /dev/null +++ b/.github/scripts/sanitize-config.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +""" +Sanitize GenLayer node configuration by removing dev and admin sections. + +This script is used by the GitHub Actions workflow to prepare the config +for documentation by removing sensitive sections. +""" + +import sys +import yaml + + +def sanitize_config(config_file_path): + """Remove node.dev and node.admin sections from config file.""" + # Read the YAML file + with open(config_file_path, 'r') as f: + config = yaml.safe_load(f) + + # Remove node.dev and node.admin if they exist + if 'node' in config: + if 'dev' in config['node']: + del config['node']['dev'] + if 'admin' in config['node']: + del config['node']['admin'] + + # Write back to file preserving the structure + with open(config_file_path, 'w') as f: + yaml.dump(config, f, default_flow_style=False, sort_keys=False, allow_unicode=True) + + +def main(): + if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} ", file=sys.stderr) + sys.exit(1) + + config_file_path = sys.argv[1] + + try: + sanitize_config(config_file_path) + except Exception as e: + print(f"Error sanitizing config: {e}", file=sys.stderr) + sys.exit(1) + + +if __name__ == "__main__": + main() \ No newline at end of file From 7103934fc8aa7b2fdd0c7409e8fadbf15af15f72 Mon Sep 17 00:00:00 2001 From: Darien Hernandez Date: Fri, 25 Jul 2025 22:14:44 +0200 Subject: [PATCH 3/3] fix(workflows): Fix Python script execution in sync-docs-from-node workflow This PR fixes a critical issue in the sync-docs-from-node workflow where the Python script for sanitizing config files was failing due to an environment variable not being accessible. The inline Python code has been refactored into a standalone script that receives the config file path as a command-line argument. --- .claude/prs/docs-node-v0.3.4.md | 39 --------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .claude/prs/docs-node-v0.3.4.md diff --git a/.claude/prs/docs-node-v0.3.4.md b/.claude/prs/docs-node-v0.3.4.md deleted file mode 100644 index c54dfb3a..00000000 --- a/.claude/prs/docs-node-v0.3.4.md +++ /dev/null @@ -1,39 +0,0 @@ -# Add v0.3.4 validator release documentation - -## Description - -This PR adds comprehensive documentation for the v0.3.4 validator release, introducing genesis block configuration support for faster node startup and GenVM diagnostics integration in the doctor command. The PR also includes development workflow improvements with command definitions for automated commit message generation, PR creation, and knowledge management. - -## Changes - -### Validator Documentation Updates -- **Added v0.3.4 changelog entry** with genesis block configuration and GenVM diagnostics features -- **Added missing v0.3.3 entry** for io.net provider support -- **Updated setup guide** with new version references (v0.3.4), consensus contract addresses, and enhanced doctor command documentation -- **Updated configuration examples** with genesis block number (817855) for faster node startup - -### Development Workflow Enhancements -- **Added CLAUDE.md** with comprehensive development guidelines and validator documentation update patterns -- **Added command definitions** for commit message generation, PR creation, and context tracking -- **Added tracking configuration** for plan analysis and development workflow management - -## Testing - -- Documentation changes are non-functional and do not require code testing -- All markdown files have been validated for proper formatting -- Version references and configuration examples have been verified for accuracy - -## Types of Changes - -- [ ] Bug fix (non-breaking change that fixes an issue) -- [ ] New feature (non-breaking change that adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [x] Documentation update (changes to documentation, guides, or help content) -- [x] Chore (maintenance tasks, refactoring, or non-functional changes like updating dependencies or improving documentation) - -## Checklist - -- [x] My changes follow the code style of this project -- [x] I have added the necessary documentation (if appropriate) -- [ ] I have added tests (if appropriate) -- [x] All files have been properly formatted and validated \ No newline at end of file