Skip to content

chore: document bannable flag in deploy scripts - #18

Open
starknetdev wants to merge 1 commit into
mainfrom
chore/deploy-script-bannable-docs
Open

chore: document bannable flag in deploy scripts#18
starknetdev wants to merge 1 commit into
mainfrom
chore/deploy-script-bannable-docs

Conversation

@starknetdev

Copy link
Copy Markdown
Member

Summary

Updates the bannable validators' deploy scripts (opus, erc20, governance) to document the new bannable trailing config field in their post-deployment summaries and example add_config calldata.

Why

The deploy script for opus_troves was used to deploy to mainnet today (0x04229a6f53e1fb331c4b0ff77846aaf92e3288f97a77c565e9dfece904ff7f3b). Its summary still showed "Registration Only: false (allows banning)" — stale text from before #17 — and example calldata didn't include the new bannable flag.

Changes

  • opus: removed stale "Registration Only" line, added config[N+4]: bannable doc, appended 1 or 0 to all 3 example calldatas
  • erc20: added bannable to config docs, updated example calldata
  • governance: added bannable to config docs

Note

Doc/script-only changes. No contract changes.

🤖 Generated with Claude Code

Updates deploy script summaries and example add_config calldata for
the validators that support per-context banning (opus, erc20, governance):
- Adds bannable as the trailing config field in docs
- Updates example calldata to include 0/1 bannable values
- Removes stale "Registration Only: false" line from opus summary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Apr 21, 2026

Copy link
Copy Markdown

Claude finished @starknetdev's task —— View job


Claude Review - General Engineering Review

run=24710507619 attempt=1 sha=6ff6f2cebc8de3e455502468aa2d12dc97de93d8 scope=general

Todo List

  • Read and analyze the changed deploy script files
  • Check git diff to understand specific changes
  • Review script correctness and documentation accuracy
  • Provide structured review feedback

Review Findings

No issues found.

The changes are well-executed documentation updates that accurately reflect the addition of the bannable configuration flag across the three validator deploy scripts:

ERC20 Balance Validator (scripts/deploy_erc20_balance_validator.sh):

  • ✅ Added bannable field documentation in feature list
  • ✅ Updated config array format documentation to include the new field
  • ✅ Updated example calldata with trailing 1 and explanatory comment
  • ✅ Consistent with other validators' documentation patterns

Governance Validator (scripts/deploy_governance_validator.sh):

  • ✅ Added bannable field documentation in configuration list
  • ✅ Minimal change approach is appropriate (no example calldata provided in this script)

Opus Troves Validator (scripts/deploy_opus_troves_validator.sh):

  • ✅ Removed stale "Registration Only: false" text that was outdated after PR feat: make banning per-context via bannable flag #17
  • ✅ Updated to "Bannable: configured per-context" which accurately reflects the new behavior
  • ✅ Added comprehensive config[N+4]: bannable documentation with clear explanation
  • ✅ Updated all three example calldatas consistently:
    • Wildcard config: bannable=1
    • STRK-only config: bannable=1
    • Blue chip config: bannable=0 (demonstrates both options)
  • ✅ Updated deployment JSON to reflect dynamic banning behavior

The documentation changes are accurate, consistent, and improve developer experience by:

  1. Removing outdated information that could mislead developers
  2. Clearly documenting the new optional bannable parameter
  3. Providing concrete examples showing both enabled (1) and disabled (0) states
  4. Following established patterns for parameter documentation

Summary

0 CRITICAL, 0 HIGH, 0 MEDIUM, 0 LOW, 0 INFO

Job Run

@github-actions

Copy link
Copy Markdown

Codex Review - General Engineering Review

Review process failed to complete.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the deployment scripts for ERC20 balance, governance, and Opus troves validators to include a new 'bannable' flag in their configurations, enabling optional per-context banning. Several issues were identified in the example sncast commands where the required Span length prefix was missing from the calldata for the add_config function across multiple files.

echo " --contract-address \$ERC20_VALIDATOR \\"
echo " --function add_config \\"
echo " --calldata <tournament_id> <entry_limit> <token_address> 1000000000000000000000 0 0 0 0 0 0"
echo " --calldata <tournament_id> <entry_limit> <token_address> 1000000000000000000000 0 0 0 0 0 0 1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The example calldata for add_config is missing the length of the config Span. In Starknet, calldata for a Span must be preceded by its length. Since the config array now contains 9 elements (token_address, min_low, min_high, max_low, max_high, val_low, val_high, max_entries, bannable), the value 9 should be inserted before <token_address>.

Suggested change
echo " --calldata <tournament_id> <entry_limit> <token_address> 1000000000000000000000 0 0 0 0 0 0 1"
--calldata <tournament_id> <entry_limit> 9 <token_address> 1000000000000000000000 0 0 0 0 0 0 1

echo " --function add_config \\"
echo " --calldata <tournament_id> <entry_limit> 0 1000000000000000000 1000000000000000000 50"
echo " # Config: asset_count=0 (wildcard), threshold=1 yin, value_per_entry=1 yin, max=50"
echo " --calldata <tournament_id> <entry_limit> 0 1000000000000000000 1000000000000000000 50 1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The example calldata is missing the length of the config Span. For this wildcard configuration, there are 5 elements in the config array (asset_count, threshold, value_per_entry, max_entries, bannable), so the value 5 should be included before the 0.

Suggested change
echo " --calldata <tournament_id> <entry_limit> 0 1000000000000000000 1000000000000000000 50 1"
--calldata <tournament_id> <entry_limit> 5 0 1000000000000000000 1000000000000000000 50 1

echo " --function add_config \\"
echo " --calldata <tournament_id> <entry_limit> 1 \$STRK_ADDRESS 10000000000000000000 500000000000000000 20"
echo " # Config: asset_count=1, asset=STRK, threshold=10 yin, value_per_entry=0.5 yin, max=20"
echo " --calldata <tournament_id> <entry_limit> 1 \$STRK_ADDRESS 10000000000000000000 500000000000000000 20 1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The example calldata is missing the length of the config Span. For this single-asset configuration, there are 6 elements in the config array, so the value 6 should be included before the 1.

Suggested change
echo " --calldata <tournament_id> <entry_limit> 1 \$STRK_ADDRESS 10000000000000000000 500000000000000000 20 1"
--calldata <tournament_id> <entry_limit> 6 1 \$STRK_ADDRESS 10000000000000000000 500000000000000000 20 1

echo " --function add_config \\"
echo " --calldata <tournament_id> <entry_limit> 2 \$STRK_ADDRESS \$WSTETH_ADDRESS 5000000000000000000 2000000000000000000 0"
echo " # Config: asset_count=2, assets=STRK+wstETH, threshold=5 yin, value_per_entry=2 yin, max=0 (unlimited)"
echo " --calldata <tournament_id> <entry_limit> 2 \$STRK_ADDRESS \$WSTETH_ADDRESS 5000000000000000000 2000000000000000000 0 0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The example calldata is missing the length of the config Span. For this two-asset configuration, there are 7 elements in the config array, so the value 7 should be included before the 2.

Suggested change
echo " --calldata <tournament_id> <entry_limit> 2 \$STRK_ADDRESS \$WSTETH_ADDRESS 5000000000000000000 2000000000000000000 0 0"
--calldata <tournament_id> <entry_limit> 7 2 \$STRK_ADDRESS \$WSTETH_ADDRESS 5000000000000000000 2000000000000000000 0 0

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.

1 participant