Abstract:
Upgrade the current Pyth oracle contract on Blast Mainnet to:
- Add a fee manager role that simplifies operations for randomness providers by letting their keeper wallet withdraw accrued fees
- Collect a share of the gas fees spent when interacting with Entropy
This PIP is the mainnet version of PIP 11: [PASSED] OP-PIP-11: Upgrade Blast Entropy Contract (Testnet)
Rationale:
Running an Entropy keeper should be easy. At the moment, there is a significant pain point in maintaining the wallet balance for the keeper, because the keeper isn’t authorized to withdraw fees from the contract to recoup it’s gas expenses.
The gas fee collection change is additional Pyth revenue generated from usage of the oracle by downstream at no extra cost to users — it’s paid out from the centralized sequencer revenue.
Description:
The first change in this proposal updates the Blast Mainnet Entropy contract to add a fee manager role. The fee manager is authorized by a provider to (1) set its fee, and (2) withdraw accrued fees. Providers can set the fee manager to their keeper wallet, which will enable their keeper service to better manage its gas.
The second change in this proposal updates the Blast Mainnet contract to enable gas fee claims (as part of sequencer revenue sharing of this protocol). After upgrading the contract to this version, anyone can call the newly added function to enable the gas fee sharing. A further contract upgrade can add functionality to withdraw the accrued gas fees.
Proposal: CP4kcXd5zLVaKzbf3N6N4D6y1w1BNpChMSKPd4SyYidU
Code changes:
- [entropy] Add Fee Manager Role by jayantk · Pull Request #1623 · pyth-network/pyth-crosschain · GitHub
- https://github.com/pyth-network/pyth-crosschain/pull/1645 (see also blast docs for this change and gas sharing contract address)
branch: entropy_blast
(the blast gas claim code is not merged into main
because it’s a one-off that doesn’t fit in the generic smart contract)
Verification:
- Make sure you node-js and forge installed.
a. node-js: installnvm
from here
b. forge: install it from here - Clone pyth-crosschain repo
- Checkout the proposal code branch
- Run the following command from the root dir:
npm ci && npx lerna run build
- Get the on-chain implementation code digest by going to the
contract_manager
directory and running this command:npx 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
and runningnpx truffle compile --all && cat build/contracts/EntropyUpgradable.json | jq -r .deployedBytecode | tr -d '\n' | cast keccak
- Match the of the on-chain digest with the source code digest.
- Both digests should also equal
0x00796fddbb5c438e486af88939daaaade9560d659124099113b05c9fb5c82fb1
, which is the digest from the corresponding testnet proposal [PASSED] OP-PIP-11: Upgrade Blast Entropy Contract (Testnet)