# \[PASSED\] OP-PIP-83: Upgrade Entropy contracts on all mainnet chains

**URL:** <https://forum.pyth.network/t/passed-op-pip-83-upgrade-entropy-contracts-on-all-mainnet-chains/2239>\
**Category:** Proposals\
**Tags:** operational-pip\
**Created:** [October 8, 2025, 6:16pm UTC](https://forum.pyth.network/t/passed-op-pip-83-upgrade-entropy-contracts-on-all-mainnet-chains/2239 "2025-10-08T18:16:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KemarTiti](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.pyth.network/kemartiti/32/5_2.png) [@KemarTiti](https://forum.pyth.network/u/KemarTiti)\
**Post date:** [October 8, 2025, 6:16pm UTC](https://forum.pyth.network/t/passed-op-pip-83-upgrade-entropy-contracts-on-all-mainnet-chains/2239/1 "2025-10-08T18:16:05Z")

</div>

## Abstract

Upgrade the Entropy contracts to fix a bug in the callback gas handling logic. This fix ensures that callbacks are only marked as failed when sufficient gas was provided, regardless of the revert code returned.

## Rationale

The previous implementation would mark callbacks as failed based on the return value (`ret.length > 0`) or gas consumption. However, some user contracts catch out-of-gas errors and revert with a different error message, which could lead to incorrect failure marking.

## Description

The bug fix modifies the Entropy contract’s callback handling logic to remove the dependency on the revert return data (`ret.length`). Instead, it relies solely on whether sufficient gas was provided to the callback execution.

**Key changes:**

- Removed the `ret.length > 0` condition from the callback failure check
- Now only checks if `(startingGas * 31) / 32 > uint256(req.gasLimit10k) * TEN_THOUSAND` to determine if enough gas was provided
- This ensures consistent behavior regardless of how user contracts handle out-of-gas conditions

This change prevents false positives where callbacks might be incorrectly marked as failed when user contracts catch and re-throw errors with different messages.

## Implementation Plan

- Relevant commits:

- Pull Request:

- Proposal Id:

- Verify the implementation following the guide below:

1. Make sure you have node-js, forge and jq installed.
  1. node-js: install `nvm` from [here](https://github.com/nvm-sh/nvm). Install node-js 22 (`nvm install 22; nvm use 22`).

  2. forge: install it from [here](https://getfoundry.sh/)

  3. jq: install it from [here](https://jqlang.github.io/jq/)

2. Clone the `pyth-crosschain` repo (`git clone <`[`https://github.com/pyth-network/pyth-crosschain.git`](https://github.com/pyth-network/pyth-crosschain.git)\>). Go to the `pyth-crosschain` directory and run the following command: `pnpm i && pnpm turbo build`
3. Get the on-chain implementation code digest by going to the `contract_manager` directory and running `npx ts-node scripts/check_proposal.ts --cluster mainnet-beta --proposal 6wkDQxQDgaEoDD3XJAyvZmRkPaKfU9jueembJ8XghCZ`
4. Get the source code digest by going to the `target_chains/ethereum/contracts` directory and running `forge build && cat `  
`out/EntropyUpgradable.sol/EntropyUpgradable.json | jq -r .deployedBytecode.object | tr -d '\r\n' | cast keccak`
5. Check the hash digest from the on-chain implementation (from step 3) matches the hash digest from the source code (from step 4).
