chainlink icon indicating copy to clipboard operation
chainlink copied to clipboard

Draft contract change for no native billing in data streams

Open ad0ll opened this issue 1 year ago • 11 comments

Problem

  • A report's nativeFee amount is in ETH.
  • You can pay the nativeFee with either native (msg.value) or an ERC20 token
  • Paying with msg.value is a problem on chains where ETH isn't the native token. For instance, on Avalanche, because AVAX is worth several thousands of percent less than ETH,
  • The nativeFee amount is tightly bound to the feed. If you wanted a nativeFee amount in say, AVAX, you would require a second feed
  • Since Data Streams is only confirmed to be able to support 30 feeds (as of writing this), we can't affort to literally double our feed count so we can bill on both Avalanche and chains where ETH is native

Short term solution

  • This PR contains a variation of the FeeManager contract, "FeeManagerNoNative". In this contract, we revert when msg.value != 0. Code relating to msg.value (like returning change) has been removed as well.
  • This contract should only ever be deployed to chains where ETH isn't the native token
    • Currently this is only Avalanche, but (for example) if we deployed to Polygon later, we'd deploy this to Polygon as well since MATIC is the native token, but if we deployed to Arbitrum, we wouldn't, since ETH is native there

ad0ll avatar Feb 03 '24 00:02 ad0ll

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

github-actions[bot] avatar Feb 03 '24 00:02 github-actions[bot]

Go solidity wrappers are out-of-date, regenerate them via the make wrappers-all command

github-actions[bot] avatar Feb 05 '24 13:02 github-actions[bot]

@ad0ll could you also generate geth wrapper for this contract and commit it in this PR (core/gethwrappers/llo-feeds/generated/fee_manager_no_native/fee_manager_no_native.go)? I will need it for E2E tests

lukaszcl avatar Feb 12 '24 15:02 lukaszcl

I've hardcoded the solc path for FeeManagerNoNative in this PR, but have made the compile script more generic in this one: feature/dynamic-llo-feed-solc-compile-script (https://github.com/smartcontractkit/chainlink/pull/12002)

ad0ll avatar Feb 12 '24 20:02 ad0ll

@ad0ll I added https://github.com/smartcontractkit/chainlink/pull/11928/commits/05044ccb9658d8e16d653acf73c68b5d388bca7d with test code updates needed for new E2E tests (https://smartcontract-it.atlassian.net/browse/MERC-3499)

lukaszcl avatar Feb 14 '24 10:02 lukaszcl

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 25 '24 00:04 github-actions[bot]

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

github-actions[bot] avatar May 14 '24 20:05 github-actions[bot]