whats-new-entropyv2.mdx 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. title: What's New in Entropy v2
  3. description: New features and improvements in Entropy v2
  4. icon: Sparkle
  5. ---
  6. ## Key Improvements
  7. Pyth Entropy v2 brings new features and improvements that make random number generation more flexible, efficient, and easier to integrate.
  8. ### 1. Multiple Request Variants
  9. Entropy v2 provides multiple ways to request random numbers:
  10. - **Basic Request**: Simplest implementation with default settings
  11. - **Custom Gas Limit**: Specify gas limits for complex callbacks
  12. - **Custom Provider**: Choose specific entropy providers
  13. - **Full Control**: Specify all parameters (provider, gas limit, user random number)
  14. Each of these request types is described in more detail with examples in [Request Callback Variants](./entropy/request-callback-variants).
  15. ### 2. Enhanced Callback Status
  16. Entropy V2 introduces callback statuses, which allow users to track the status of their callbacks.
  17. [Pyth Dev-Forum Announcement](https://dev-forum.pyth.network/t/announcing-entropy-v2/324#p-649-enhanced-callback-statuses-2) provides more details on enhanced callback statuses.
  18. ### 3. Entropy Explorer
  19. Entropy V2 includes a public Entropy Explorer, that lets teams easily track the status of their callbacks and re-request them if they fail on-chain.
  20. See [Entropy Explorer](https://entropy-explorer.pyth.network/) to search and debug your callbacks.
  21. ## Migration Guide
  22. If you're upgrading from Entropy v1 to v2:
  23. 1. Update your imports to use [`IEntropyV2`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol).
  24. 2. Replace `request()` calls with [`requestV2()`](https://github.com/pyth-network/pyth-crosschain/blob/f5402df8e44158c519496bcd2fac5d3afe856a0e/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol#L26)
  25. 3. Update fee calculation to use [`getFeeV2()`](https://github.com/pyth-network/pyth-crosschain/blob/f5402df8e44158c519496bcd2fac5d3afe856a0e/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol#L135)
  26. 4. Test thoroughly with the new interface
  27. ## Backward Compatibility
  28. Entropy v2 maintains backward compatibility with v1 for existing applications. However, we recommend migrating to v2 for new applications to take advantage of the improved features.