Port a Pyth-style consumer
RUFF’s current hub implements the request, fee, and callback call set recorded against the Pyth Entropy Solidity SDK 2.2.1. This is interface compatibility, with RUFF’s own provider, verification, and delivery model.
Compatible call set
Section titled “Compatible call set”requestV2() payable returns (uint64)requestV2(uint32 gasLimit) payable returns (uint64)requestV2(address provider, uint32 gasLimit) payable returns (uint64)requestV2(address provider, bytes32 userRandomNumber, uint32 gasLimit) payable returns (uint64)
getFeeV2() view returns (uint128)getFeeV2(uint32 gasLimit) view returns (uint128)getFeeV2(address provider, uint32 gasLimit) view returns (uint128)getDefaultProvider() view returns (address)
_entropyCallback(uint64 sequence, address provider, bytes32 random)The downloaded compatibility interface is the source reference for the overloads and event shapes.
Adapt the behavior
Section titled “Adapt the behavior”| Topic | RUFF behavior |
|---|---|
| Provider | The hub proxy itself; another provider address is rejected. |
| Request origin | Deployed contracts only. |
| Contribution omitted | Uses bytes32(0). |
| Gas limit zero | Resolves to the consumer tariff’s default callback budget. |
| Excessive gas limit | Reverts; the hub does not round or clamp it. |
| Fee quote | Consumer-specific; use quote(consumer, gasLimit) off-chain. |
| Excess payment | Kept as fee. Send the exact quote. |
| Callback failure | Result stays stored; no automatic callback retry. |
| Expiry | Public cleanup after more than 8191 blocks, without a result. The request fee pays for the delivery attempt and is not refunded on expiry. |
| Request inspection | Use requestOf and randomOf. |
| Provider inspection | Use laneOf, tariffOf, limits, and quote. |
getRequestV2 and getProviderInfoV2 are not implemented. Do not point a client at the hub solely because one request selector matches.
Update callback and recovery handling
Section titled “Update callback and recovery handling”Set getEntropy() to the hub proxy. Confirm the callback’s provider is that hub and bind the sequence to your own request. Preserve idempotence and the ability to recover a fulfilled result after a callback failure.
Reassess the trust model
Section titled “Reassess the trust model”Delivery is limited to authorized relayers at every request age. Results become knowable before callback execution in the circumstances described by the trust model.
Port the consumer’s assumptions along with its calls. The consumer guide shows the complete integration pattern.
