Jelajahi Sumber

removed slots strict function

Ayush Suresh 5 bulan lalu
induk
melakukan
660717e2ae

+ 5 - 2
target_chains/ethereum/contracts/contracts/pulse/Scheduler.sol

@@ -308,11 +308,14 @@ abstract contract Scheduler is IScheduler, SchedulerState {
         (
             PythStructs.PriceFeed[] memory priceFeeds,
             uint64[] memory slots
-        ) = pyth.parsePriceFeedUpdatesWithSlotsStrict{value: pythFee}(
+        ) = pyth.parsePriceFeedUpdatesWithConfig{value: pythFee}(
                 updateData,
                 params.priceIds,
                 0, // We enforce the past max validity ourselves in _validateShouldUpdatePrices
-                curTime + FUTURE_TIMESTAMP_MAX_VALIDITY_PERIOD
+                curTime + FUTURE_TIMESTAMP_MAX_VALIDITY_PERIOD,
+                false,
+                true,
+                false
             );
 
         // Verify all price feeds have the same Pythnet slot.

+ 2 - 28
target_chains/ethereum/contracts/contracts/pyth/Pyth.sol

@@ -411,36 +411,10 @@ abstract contract Pyth is
             maxPublishTime,
             false,
             false,
-            true
+            false
         );
     }
 
-    function parsePriceFeedUpdatesWithSlotsStrict(
-        bytes[] calldata updateData,
-        bytes32[] calldata priceIds,
-        uint64 minPublishTime,
-        uint64 maxPublishTime
-    )
-        external
-        payable
-        override
-        returns (
-            PythStructs.PriceFeed[] memory priceFeeds,
-            uint64[] memory slots
-        )
-    {
-        return
-            parsePriceFeedUpdatesWithConfig(
-                updateData,
-                priceIds,
-                minPublishTime,
-                maxPublishTime,
-                false,
-                true,
-                true
-            );
-    }
-
     function extractTwapPriceInfos(
         bytes calldata updateData
     )
@@ -648,7 +622,7 @@ abstract contract Pyth is
             maxPublishTime,
             true,
             false,
-            true
+            false
         );
     }
 

+ 2 - 2
target_chains/ethereum/contracts/forge-test/GasBenchmark.t.sol

@@ -251,7 +251,7 @@ contract GasBenchmark is Test, WormholeTestUtils, PythTestUtils {
             50,
             false,
             true,  // check minimal
-            true
+            false
         );
     }
 
@@ -266,7 +266,7 @@ contract GasBenchmark is Test, WormholeTestUtils, PythTestUtils {
             50,
             false,
             true,  // check minimal
-            true
+            false
         );
     }
 

+ 15 - 6
target_chains/ethereum/contracts/forge-test/Pyth.t.sol

@@ -361,11 +361,14 @@ contract PythTest is Test, WormholeTestUtils, PythTestUtils {
         (
             PythStructs.PriceFeed[] memory priceFeeds,
             uint64[] memory slots
-        ) = pyth.parsePriceFeedUpdatesWithSlotsStrict{value: updateFee}(
+        ) = pyth.parsePriceFeedUpdatesWithConfig{value: updateFee}(
                 updateData,
                 priceIds,
                 0,
-                MAX_UINT64
+                MAX_UINT64,
+                false,
+                true,
+                false
             );
 
         assertEq(priceFeeds.length, numMessages);
@@ -527,11 +530,14 @@ contract PythTest is Test, WormholeTestUtils, PythTestUtils {
 
         // Should revert in strict mode
         vm.expectRevert(PythErrors.InvalidArgument.selector);
-        pyth.parsePriceFeedUpdatesWithSlotsStrict{value: updateFee}(
+        pyth.parsePriceFeedUpdatesWithConfig{value: updateFee}(
             updateData,
             requestedPriceIds,
             0,
-            MAX_UINT64
+            MAX_UINT64,
+            false,
+            true,
+            false
         );
     }
 
@@ -564,11 +570,14 @@ contract PythTest is Test, WormholeTestUtils, PythTestUtils {
 
         // Should revert in strict mode because we have fewer updates than price IDs
         vm.expectRevert(PythErrors.InvalidArgument.selector);
-        pyth.parsePriceFeedUpdatesWithSlotsStrict{value: updateFee}(
+        pyth.parsePriceFeedUpdatesWithConfig{value: updateFee}(
             updateData,
             requestedPriceIds,
             0,
-            MAX_UINT64
+            MAX_UINT64,
+            false,
+            true,
+            false
         );
     }
 

+ 1 - 1
target_chains/ethereum/contracts/forge-test/utils/MockPriceFeedTestUtils.sol

@@ -187,7 +187,7 @@ abstract contract MockPriceFeedTestUtils is Test {
             pyth,
             expectedFee,
             abi.encodeWithSelector(
-                IPyth.parsePriceFeedUpdatesWithSlotsStrict.selector
+                IPyth.parsePriceFeedUpdatesWithConfig.selector
             ),
             abi.encode(priceFeeds, slots)
         );

+ 0 - 15
target_chains/ethereum/sdk/solidity/AbstractPyth.sol

@@ -136,21 +136,6 @@ abstract contract AbstractPyth is IPyth {
         override
         returns (PythStructs.PriceFeed[] memory priceFeeds);
 
-    function parsePriceFeedUpdatesWithSlotsStrict(
-        bytes[] calldata updateData,
-        bytes32[] calldata priceIds,
-        uint64 minPublishTime,
-        uint64 maxPublishTime
-    )
-        external
-        payable
-        virtual
-        override
-        returns (
-            PythStructs.PriceFeed[] memory priceFeeds,
-            uint64[] memory slots
-        );
-
     function parseTwapPriceFeedUpdates(
         bytes[] calldata updateData,
         bytes32[] calldata priceIds

+ 0 - 20
target_chains/ethereum/sdk/solidity/IPyth.sol

@@ -202,24 +202,4 @@ interface IPyth is IPythEvents {
         uint64 minPublishTime,
         uint64 maxPublishTime
     ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);
-
-    /// @dev Same as `parsePriceFeedUpdates`, but checks that the updateData is minimal and also returns the Pythnet slots.
-    /// @param updateData Array of price update data.
-    /// @param priceIds Array of price ids.
-    /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
-    /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
-    /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
-    /// @return slots Array of the Pythnet slot corresponding to the given `priceIds` (with the same order).
-    function parsePriceFeedUpdatesWithSlotsStrict(
-        bytes[] calldata updateData,
-        bytes32[] calldata priceIds,
-        uint64 minPublishTime,
-        uint64 maxPublishTime
-    )
-        external
-        payable
-        returns (
-            PythStructs.PriceFeed[] memory priceFeeds,
-            uint64[] memory slots
-        );
 }

+ 3 - 26
target_chains/ethereum/sdk/solidity/MockPyth.sol

@@ -86,7 +86,7 @@ contract MockPyth is AbstractPyth {
         return singleUpdateFeeInWei * updateData.length;
     }
 
-       function parsePriceFeedUpdatesWithConfig(
+    function parsePriceFeedUpdatesWithConfig(
         bytes[] calldata updateData,
         bytes32[] calldata priceIds,
         uint64 minAllowedPublishTime,
@@ -159,7 +159,7 @@ contract MockPyth is AbstractPyth {
             maxPublishTime,
             false,
             true,
-            true
+            false
         );
     }
 
@@ -176,30 +176,7 @@ contract MockPyth is AbstractPyth {
             maxPublishTime,
             false,
             true,
-            true
-        );
-    }
-
-    function parsePriceFeedUpdatesWithSlotsStrict(
-        bytes[] calldata updateData,
-        bytes32[] calldata priceIds,
-        uint64 minPublishTime,
-        uint64 maxPublishTime
-    )
-        external
-        payable
-        override
-        returns (PythStructs.PriceFeed[] memory feeds, uint64[] memory slots)
-    {
-        return
-            parsePriceFeedUpdatesWithConfig(
-            updateData,
-            priceIds,
-            minPublishTime,
-            maxPublishTime,
-            false,
-            true,
-            true
+            false
         );
     }