Skip to content

Limit RewardsUpdated scan to last month - #851

Merged
evgeny-stakewise merged 1 commit into
masterfrom
limit-rewards-updated-scan
Sep 22, 2026
Merged

evgeny-stakewise merged 1 commit into
masterfrom
limit-rewards-updated-scan

Conversation

@evgeny-stakewise

Copy link
Copy Markdown
Contributor

KeeperContract.get_last_rewards_update scanned RewardsUpdated logs all the way back to KEEPER_GENESIS_BLOCK. Since _get_last_event walks chunks newest-first and aborts on the first hit, this is usually cheap, but when no event is found in the recent range it keeps sweeping to genesis.

Rewards are updated regularly, so a one-month lookback is enough. This mirrors how v3-oracle does it (APPROX_BLOCKS_PER_MONTH in src/rewards/execution.py): from_block = max(KEEPER_GENESIS_BLOCK, to_block - SECONDS_PER_MONTH // SECONDS_PER_BLOCK), still clamped at the keeper genesis block.

Adds SECONDS_PER_MONTH to src/config/settings.py.

@evgeny-stakewise
evgeny-stakewise merged commit 02da396 into master Sep 22, 2026
10 checks passed
@evgeny-stakewise
evgeny-stakewise deleted the limit-rewards-updated-scan branch September 22, 2026 16:34
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