Skip to content

templates: replace dead witnessprotocol with witness.enable hint#2204

Open
apetro2 wants to merge 2 commits into0xPolygon:developfrom
apetro2:fix-template-witness-enable-hint
Open

templates: replace dead witnessprotocol with witness.enable hint#2204
apetro2 wants to merge 2 commits into0xPolygon:developfrom
apetro2:fix-template-witness-enable-hint

Conversation

@apetro2
Copy link
Copy Markdown

@apetro2 apetro2 commented Apr 29, 2026

• # Description

This PR fixes a configuration template correctness issue where witnessprotocol was still shown as a top-level key in Bor config templates.
That key is no longer consumed by the current CLI config parser path for template TOML usage; witness protocol enablement is now controlled via [witness].enable.

What was done:

  1. Replaced commented legacy key # witnessprotocol = false with:
    • # [witness]
    • # enable = false
  2. Applied the minimal change only in the requested template/builder files (10 files).
  3. Kept behavior unchanged for existing running nodes; this is a template guidance fix to prevent silent misconfiguration for new or regenerated configs.

Updated files:

  • packaging/templates/mainnet-v1/without-sentry/bor/config.toml
  • packaging/templates/mainnet-v1/without-sentry/bor/pbss_config.toml
  • packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml
  • packaging/templates/mainnet-v1/sentry/sentry/bor/pbss_config.toml
  • packaging/templates/mainnet-v1/sentry/validator/bor/config.toml
  • packaging/templates/mainnet-v1/sentry/validator/bor/pbss_config.toml
  • packaging/templates/testnet-amoy/without-sentry/bor/config.toml
  • packaging/templates/testnet-amoy/sentry/sentry/bor/config.toml
  • packaging/templates/testnet-amoy/sentry/validator/bor/config.toml
  • builder/files/config.toml

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Nodes audience

This change affects node operators who use these packaging/builder templates to generate or update config.toml.
Existing nodes that do not regenerate config from these templates are not impacted.
No runtime flag behavior was changed; this PR only corrects template guidance to the valid [witness].enable path.

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

  1. Verified config mapping in internal/cli/server/config.go confirms witness protocol derives from c.Witness.Enable.
  2. Verified all target files no longer contain witnessprotocol and now contain commented [witness] + enable.
  3. Verified diff scope is minimal and limited to the requested 10 files.

Note: attempted Go test execution, but local environment could not download required Go toolchain (go1.26.2) due network timeout, so automated test execution could not be completed in this environment.

Additional comments

There are additional non-target files in the repository that still reference witnessprotocol (e.g. some pbss/archive templates and docs examples).
They were intentionally left out to keep this PR scoped to the requested files.

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

kamuikatsurgi
kamuikatsurgi previously approved these changes Apr 30, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Comment thread .github/workflows/ci.yml
path: cover.out

codecov:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these changes are irrelevant to the PR, please merge/rebase the latest develop

Comment thread builder/files/config.toml
# snapshot = true
# "bor.logs" = false
# ethstats = ""
# witnessprotocol = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

better to remove it from here and add it in it's original place somewhere below in the config. bor dumpconfig command will help

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