Skip to content

feat: adopt PriceFeedRegistry (Chainlink Data Streams) for RON/USD - #316

Open
dwi wants to merge 5 commits into
axieinfinity:mainnetfrom
dwi:feat/upgrade-chainlink-price-feed
Open

dwi wants to merge 5 commits into
axieinfinity:mainnetfrom
dwi:feat/upgrade-chainlink-price-feed

Conversation

@dwi

@dwi dwi commented Sep 7, 2026 •

Copy link
Copy Markdown

Description

Problem. Chainlink deprecated the RON/USD AggregatorV3 proxy (0x0B6074F21488B95945989E513EFEA070096d931D) on 2026-08-26. RNSDomainPrice still reads it, so convertUSDToRON reverts and every registration and renewal quote on mainnet fails. Saigon has the same problem with its aggregator.

Fix. Read RON/USD from the Ronin PriceFeedRegistry (Chainlink Data Streams) instead. Mainnet: registry 0x7D21f62Da4ab252159bD865F3E3144B1D94E544D, feed 0x0003892129eeb6c0d5d33bd734b0ca0d409130f5984d6051452a777f103ce628, 18 decimals, 24h max age. Saigon: registry 0xd3Aa8f60553cE9Cb9FDE7dDC3F796D15dc8B87B3, feed 0x000348db760241ba2b0c3a81e6da756208d658ac20ebd82e291c2f08d1d33f96.

Contract changes

  • RNSDomainPrice inherits PriceFeedRegistryConsumerUpgradeable instead of contract-libs' ChainlinkPriceFeedConsumer. convertUSDToRON and convertRONToUSD now go through the registry; nothing else in the pricing logic changes.
  • New initializeV3(registry, feedId, maxAcceptableAge) under reinitializer(3). initializeV2 stays as an empty stub so the deployment kit's initializer count matches the version; it cannot be called on the live proxies.
  • setPriceFeedData / getPriceFeedData are replaced by setPriceFeedRegistry(...) (admin only) and the inherited priceRegistryData() getter. Event ChainlinkPriceFeedUpdated is replaced by PriceFeedRegistryUpdated and PriceFeedUpdated. Off-chain readers of the oracle config need to switch.
  • The consumer, library and interface (src/extensions/PriceFeedRegistryConsumerUpgradeable.sol, src/libraries/LibChainlinkDataStreamFeed.sol, src/interfaces/IPriceFeedRegistryConsumer.sol) are copied unchanged from axieinfinity/chainlink-data-stream-relayer at aee68ba, apart from import paths.
  • Storage layout is unchanged. The old and new consumers each keep their state in their own ERC-7201 slot; the linear slots 0-63 match the deployed logic.

Migration. script/20260904-upgrade-rns-domain-price-adopt-price-feed-registry/ upgrades the proxy through ProxyAdmin.upgradeAndCall with the initializeV3 calldata. Pre-check: feed whitelisted and price positive. Post-check: registry config, both conversions and rentPrice against the live price. Shared arguments gain priceFeedRegistry and ronUsdFeedId for both networks.

Verification

  • test/RNSDomainPrice/RNSDomainPrice.priceFeedRegistry.t.sol: unit tests for init, replay protection, conversions at 18 and 8 decimals, stale and missing price reverts, admin gating.
  • test/RNSDomainPrice/RNSDomainPrice.upgradeFork.t.sol (RUN_FORK_TESTS=true): runs the Safe-executed upgradeAndCall on mainnet and Saigon forks; passes on both.
  • On a mainnet fork: rentPrice reverts before the upgrade and returns 5.00 USD / 91.93 RON for a 1-year 5-letter name after it. Roles and renewal fees are unchanged.
  • The one CI failure (RNSCommission.test_setCommissionInfo_Success) is a pre-existing fuzz test that also fails on mainnet.

Deployment. Execute the upgrade as a single upgradeAndCall from the Safe. initializeV3 has no caller check (the Transparent proxy pattern, as initializeV2 before it), so a separate upgrade() followed by initializeV3() would leave a window in which anyone could set the registry.

Checklist

  • I have clearly commented on all the main functions following the NatSpec Format
  • The box that allows repo maintainers to update this PR is checked
  • I tested locally to make sure this feature/fix works

…D pricing

- Added priceFeedRegistry and ronUsdFeedId to ISharedArgument interface.
- Updated Migration script to initialize new price feed configuration.
- Implemented PriceFeedRegistryConsumerUpgradeable for handling price feeds.
- Modified RNSDomainPrice contract to support new price feed initialization and conversion methods.
- Added tests to validate new price feed functionality and ensure correct price conversions.
@dwi dwi changed the title BREAKING_CHANGE(RNSDomainPrice): adopt PriceFeedRegistry (Chainlink Data Streams) for RON/USD feat: adopt PriceFeedRegistry (Chainlink Data Streams) for RON/USD Sep 7, 2026
dwi added 2 commits September 9, 2026 08:19
- Added "dependencies" to the libs array.
- Updated RPC endpoint URLs for Ronin mainnet and testnet.
@skymavis-org-wiz

skymavis-org-wiz Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data 1 Medium
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

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.

1 participant