contracts icon indicating copy to clipboard operation
contracts copied to clipboard

feat: keeper reward for reservoir drip through token issuance

Open pcarranzav opened this issue 3 years ago • 6 comments
trafficstars

WIP as I still need to fix the tests.

This complements #571 adding a reward for whoever called drip(), to incentivise calling it and offset the gas costs. The reward is produced through additional token issuance that grows linearly with the number of blocks, after a minimum number of blocks since the last drip have passed.

Note the reward is credited on L1 if the l2RewardsFraction is set to 0. If l2RewardsFraction is nonzero, the reward will be credited in L2, and part of it will be given to the address that initiated the retryable ticket transaction, so that if a lazy or malicious keeper does not redeem the tx in L2, there is incentive for someone else to jump in and redeem it.

pcarranzav avatar Jun 05 '22 22:06 pcarranzav

Codecov Report

Merging #582 (80cc2f2) into pcv/arb-bridge (500e86b) will increase coverage by 0.18%. The diff coverage is 100.00%.

:exclamation: Current head 80cc2f2 differs from pull request most recent head b99d31f. Consider uploading reports for the commit b99d31f to get more accurate results

@@                Coverage Diff                 @@
##           pcv/arb-bridge     #582      +/-   ##
==================================================
+ Coverage           91.96%   92.14%   +0.18%     
==================================================
  Files                  44       44              
  Lines                2092     2140      +48     
  Branches              361      373      +12     
==================================================
+ Hits                 1924     1972      +48     
  Misses                168      168              
Flag Coverage Δ
unittests 92.14% <100.00%> (+0.18%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
contracts/reservoir/Reservoir.sol 100.00% <ø> (ø)
contracts/l2/reservoir/L2Reservoir.sol 100.00% <100.00%> (ø)
contracts/reservoir/L1Reservoir.sol 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jun 06 '22 22:06 codecov[bot]

(Fixed the tests, but I still need to add a test for distributing the keeper reward in L2)

pcarranzav avatar Jun 07 '22 00:06 pcarranzav

This won't work as it is, because tx.origin will be set by ArbOS to the origin from L1. We're discussing alternatives with the Offchain Labs folks, but we might have to only give rewards to the L1 keeper.

pcarranzav avatar Jun 07 '22 18:06 pcarranzav

Marking this as ready for review; it matches the latest iteration of what's described in GIP-0034 (The OP Forum post has an outdated version, latest on HackMD)

pcarranzav avatar Jun 29 '22 16:06 pcarranzav

Rebased on top of #624 to incorporate all the audit fixes. This caused lot of merge conflicts that needed to be solved...

pcarranzav avatar Jul 14 '22 15:07 pcarranzav

Socket Security Report

👍 No new dependency issues detected in pull request

Socket.dev scan summary
Issue Status
Did you mean? ✅ no new possible package typos
Install scripts ✅ no new install scripts
Telemetry ✅ no new telemetry
Troll package ✅ no new troll packages
Malware ✅ no new malware
Native code ✅ no new native modules

Powered by socket.dev

socket-security[bot] avatar Jul 28 '22 13:07 socket-security[bot]