What's New in Entropy v2
New features and improvements in Entropy v2
Key Improvements
Pyth Entropy v2 brings new features and improvements that make random number generation more flexible, efficient, and easier to integrate.
1. Multiple Request Variants
Entropy v2 provides multiple ways to request random numbers:
- Basic Request: Simplest implementation with default settings
- Custom Gas Limit: Specify gas limits for complex callbacks
- Custom Provider: Choose specific entropy providers
- Full Control: Specify all parameters (provider, gas limit, user random number)
Each of these request types is described in more detail with examples in Request Callback Variants.
2. Enhanced Callback Status
Entropy V2 introduces callback statuses, which allow users to track the status of their callbacks. Pyth Dev-Forum Announcement provides more details on enhanced callback statuses.
3. Entropy Explorer
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. See Entropy Explorer to search and debug your callbacks.
Migration Guide
If you're upgrading from Entropy v1 to v2:
- Update your imports to use
IEntropyV2. - Replace
request()calls withrequestV2() - Update fee calculation to use
getFeeV2() - Test thoroughly with the new interface
Backward Compatibility
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.