Verify EulerChains.json is in sync with addresses#215
Merged
Conversation
Add a PR-gating workflow that regenerates EulerChains.json via 'node chains.js' and fails the check if the committed file does not match the generator's output against the current addresses/ and config/addresses/ trees. This catches two error modes that have no other guard today: - A contributor hand-edits EulerChains.json without updating the underlying addresses files. - A contributor updates an addresses file but forgets to re-run chains.js before committing. The job runs on pull_request and push to master, scoped to changes that could affect the output (chains.js, EulerChains.json, and the two address directories). No npm install step is needed — chains.js uses only Node built-ins. To actually block merges, configure 'verify-chains-manifest' as a required status check in the master branch protection rules.
This commit intentionally hand-edits EulerChains.json so that it no longer matches the output of chains.js. The verify-chains-manifest workflow must fail on this commit. A revert commit follows immediately to restore the green state.
This reverts commit dd41c5f.
dglowinski
approved these changes
Apr 23, 2026
VSBDev
approved these changes
Apr 23, 2026
kanvgupta
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
node chains.jsand fails if the committedEulerChains.jsondiffers from what the generator produces against the currentaddresses/andconfig/addresses/trees.EulerChains.jsonis a generated artifact, but nothing stops it from drifting from its source of truth. A contributor can hand-edit the manifest, or update an addresses file and forget to re-run the generator. Both are silent today.Changes
.github/workflows/verify-chains-manifest.ymlruns onpull_requestandpushtomaster, scoped viapathsto changes that could affect the output:chains.js,EulerChains.json,addresses/**,config/addresses/**. Also exposesworkflow_dispatchfor manual re-runs.node chains.js, and then runsgit diff --quiet -- EulerChains.json. On drift, emits a GitHub::error::annotation pointing contributors to runnode chains.jslocally, then prints the diff for context and exits 1.npm installstep —chains.jsuses only Node built-ins (fs), so there are no dependencies to cache or pin.node chains.jsproduces a byte-identicalEulerChains.jsonright now, so the check starts green.Required follow-up (repo admin)
verify-chains-manifestas a required status check in the branch protection rule formaster. Without that, the workflow will report status but will not prevent merging.Test plan
addresses/1/LensAddresses.json) without re-runningchains.js— workflow must fail with the "out of sync" error and show the diff in the job log.node chains.jslocally, commit the updatedEulerChains.json, push — workflow must pass.EulerChains.jsononly — workflow must fail (the regenerated file will overwrite the hand-edit and the diff will surface).workflow_dispatchonmaster— must report "EulerChains.json matches the output of chains.js."