[PASSED] OP-PIP-8: Upgrade Entropy contracts on all the mainnet chains


Upgrade the Entropy contracts to allow users to register a callback when requesting random numbers. This callback is invoked once the request is fulfilled.


The upgrade enhances the developer experience by reducing the interaction to a single transaction.


The new feature implemented in the Entropy contracts enables users to register a callback when they request for a random number. This callback is automatically called by the Entropy contracts once the request is fulfilled, streamlining the process and improving the developer experience by necessitating only a single transaction.

Implementation Plan

  1. Make sure you have node-js, forge and jq installed.
    node-js: install nvm from here. Install node-js 18 (nvm install 18; nvm use 18).
    forge: install it from here
    jq: install it from here
  2. Clone the pyth-crosschain repo (git clone https://github.com/pyth-network/pyth-crosschain.git). Go to the pyth-crosschain directory and run the following command: npm ci && npx lerna run 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 <proposal id>
  4. Get the source code digest by going to the target_chains/ethereum/contracts directory and running npx truffle compile --all && cat build/contracts/EntropyUpgradable.json | jq -r .deployedBytecode | 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).