Abstract
Upgrade the Entropy contracts to add additional functionality for reducing gas costs on reveal transactions.
Rationale
The upgrade aims to reduce the number of hashes required for each reveal by allowing the provider to advance their commitment to a a more recent sequence number that is already used.
Description
The new feature implemented in the Entropy contracts is accompanied by the changes in Fortuna service that periodically checks the on-chain state and advances the commitment if necessary.
Implementation Plan
-
Discuss Proposal:
qwtDtozGqtq9dkH6CGa8AszgfjL9xgTeffgZ22PUVNw
with Pyth community. -
Relevant commits:
-
Proposal Ids:
-
Verify the implementation following the guide below:
- Make sure you have node-js, forge and jq installed.
a. node-js: installnvm
from here. Install node-js 18 (nvm install 18; nvm use 18
).
b. forge: install it from here
c. jq: install it from here - Clone the
pyth-crosschain
repo (git clone https://github.com/pyth-network/pyth-crosschain.git
). Go to thepyth-crosschain
directory and run the following command:pnpm i && npx lerna run build
- Get the on-chain implementation code digest by going to the
contract_manager
directory and runningnpx ts-node scripts/check_proposal.ts --cluster mainnet-beta --proposal <proposal id>
- Get the source code digest by going to the
target_chains/ethereum/contracts
directory and runningnpx truffle compile --all && cat build/contracts/EntropyUpgradable.json | jq -r .deployedBytecode | tr -d '\r\n' | cast keccak
- Check the hash digest from the on-chain implementation (from step 3) matches the hash digest from the source code (from step 4).