feat: Defender Action to update Votemarket epochs for Curve Pool Booster campaigns#2845
Open
clement-ux wants to merge 3 commits intomasterfrom
Open
feat: Defender Action to update Votemarket epochs for Curve Pool Booster campaigns#2845clement-ux wants to merge 3 commits intomasterfrom
clement-ux wants to merge 3 commits intomasterfrom
Conversation
…Booster campaigns on Arbitrum
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2845 +/- ##
=======================================
Coverage 44.57% 44.57%
=======================================
Files 112 112
Lines 4835 4835
Branches 1338 1338
=======================================
Hits 2155 2155
Misses 2677 2677
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Adds automation to keep Votemarket campaign epochs up to date on Arbitrum.
contracts/tasks/votemarket.js: Core logic that reads all Curve Pool Booster campaign IDs from theCurvePoolBoosterBribesModuleon Mainnet, checks the current epoch on the Arbitrum Votemarket contract, and callsupdateEpochfor any campaign whose period has not yet been updated.contracts/scripts/defender-actions/updateVotemarketEpochs.js: Defender Action entry point. The relayer is on Arbitrum (chain 42161); Mainnet data is read viaevent.secrets.PROVIDER_URL.dryRuncan be controlled viaevent.request.body.dryRun(defaults tofalsein production).rollup.config.cjs: AddedupdateVotemarketEpochsto the build.tasks/tasks.js: RegisteredupdateVotemarketEpochshardhat task (dry-run by default).How it works
CurvePoolBoosterBribesModule(Mainnet)campaignId()from each pool booster (skip if 0)currentEpoch()from Votemarket (Arbitrum)getPeriodPerCampaign(campaignId, epoch)— ifupdated === false, callupdateEpoch(campaignId, epoch, "0x")Test plan
ARBITRUM_PROVIDER_URL=... DEBUG=origin:task:votemarket npx hardhat updateVotemarketEpochs --network mainnetPROVIDER_URLsecret set to a Mainnet RPC