ci: add weekly on-chain LIP status reconciliation#116
Open
rickstaa wants to merge 2 commits into
Open
Conversation
Adds a scheduled job that compares each LIP's documented status against the outcome of its on-chain LIP-16 governance poll and opens a ready-to-merge PR with the suggested status edits when they diverge. Never auto-merges. - scripts/reconcile-onchain.mjs: queries the Livepeer subgraph for polls, resolves each poll to a LIP via its proposal IPFS hash (the path the Explorer uses), determines active/concluded against the L1 block, applies the LIP-16 quorum/quota pass rule, and writes the suggested edits + PR body. - .github/workflows/lip-onchain-reconcile.yml: weekly cron + manual dispatch, opens the PR via peter-evans/create-pull-request. Requires a SUBGRAPH_URL secret (Graph gateway endpoint + API key) and the repo setting allowing Actions to create pull requests. Refs #112. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011c4cuAi1T5yQ7WtCbMp3DW
actions/checkout v4 -> v7, actions/setup-node v4 -> v6, Node 20 -> 24, peter-evans/create-pull-request v6 -> v8. No breaking changes affect this workflow on hosted ubuntu-latest runners. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011c4cuAi1T5yQ7WtCbMp3DW
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.
Part of #112.
Adds a scheduled (weekly) job that compares each LIP's documented status against the outcome of its on-chain LIP-16 governance poll, and opens a ready-to-merge PR with the suggested edits when they diverge. It never auto-merges — an editor reviews and merges.
How it works (
scripts/reconcile-onchain.mjs):Pollentities (proposal IPFS hash,endBlock,quorum/quota,tally) +totalActiveStake.{ gitCommitHash, text }) and reading thelip:frontmatter — the same linkage the Livepeer Explorer uses.endBlockis an Ethereum block number even though polls live on Arbitrum).yes+no ≥ totalStake·quorum/1e6; result is yes whenyes > (yes+no)·quota/1e6.Validated against live data before submitting: it correctly flags LIP-107 → Rejected (its poll passed quorum but fell short of the 50% quota) and LIP-101 → Accepted/Final (poll passed). So once merged, the bot's first PR will likely propose fixing LIP-107, which is currently still marked
Proposed.Configuration required:
SUBGRAPH_URL— the Graph gateway endpoint incl. API key, e.g.https://gateway.thegraph.com/api/<KEY>/subgraphs/id/FE63YgkzcpVocxdCEyEYbvjYqEf2kb1A6daMYRxmejYC.Notes/limits: uses current
totalActiveStakeas the LIP-16totalStake(the exact value is the snapshot atendBlock; only matters in a knife-edge quorum case, and every result is surfaced in the PR for confirmation). A passed poll is suggested asAcceptedwith a note that it may already beFinalif executed.