Skip to content

feat: Defender Action to update Votemarket epochs for Curve Pool Booster campaigns#2845

Merged
sparrowDom merged 5 commits intomasterfrom
clement/votemarket-epoch-update-defender-action
Apr 8, 2026
Merged

feat: Defender Action to update Votemarket epochs for Curve Pool Booster campaigns#2845
sparrowDom merged 5 commits intomasterfrom
clement/votemarket-epoch-update-defender-action

Conversation

@clement-ux
Copy link
Copy Markdown
Collaborator

@clement-ux clement-ux commented Mar 19, 2026

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 the CurvePoolBoosterBribesModule on Mainnet, checks the current epoch on the Arbitrum Votemarket contract, and calls updateEpoch for 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 via event.secrets.PROVIDER_URL. dryRun can be controlled via event.request.body.dryRun (defaults to false in production).
  • rollup.config.cjs: Added updateVotemarketEpochs to the build.
  • tasks/tasks.js: Registered updateVotemarketEpochs hardhat task (dry-run by default).

How it works

  1. Fetch pool boosters from CurvePoolBoosterBribesModule (Mainnet)
  2. Read campaignId() from each pool booster (skip if 0)
  3. Read currentEpoch() from Votemarket (Arbitrum)
  4. For each campaign, call getPeriodPerCampaign(campaignId, epoch) — if updated === false, call updateEpoch(campaignId, epoch, "0x")
  5. Individual campaign failures are caught and logged without blocking others

Test plan

  • Dry-run via hardhat task: ARBITRUM_PROVIDER_URL=... DEBUG=origin:task:votemarket npx hardhat updateVotemarketEpochs --network mainnet
  • Deploy Defender Action with Arbitrum relayer and PROVIDER_URL secret set to a Mainnet RPC
  • Trigger manually via Defender and confirm epochs are updated on-chain

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.21%. Comparing base (f880ea7) to head (5a6f4c7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2845      +/-   ##
==========================================
- Coverage   50.94%   49.21%   -1.74%     
==========================================
  Files         112      112              
  Lines        4844     4844              
  Branches     1343     1343              
==========================================
- Hits         2468     2384      -84     
- Misses       2372     2456      +84     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@notion-workspace
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@sparrowDom sparrowDom left a comment

Choose a reason for hiding this comment

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

LGTM

@sparrowDom sparrowDom merged commit 10b029e into master Apr 8, 2026
16 of 18 checks passed
@sparrowDom sparrowDom deleted the clement/votemarket-epoch-update-defender-action branch April 8, 2026 11:22
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.

2 participants