We have deployed a new version of the oracle contract (TellorFlex) for gas optimization. As the previous oracle contracts are immutable, they remain operational and we are looking forward to the community adopting this new contract. In line with routine protocol optimizations, these changes have been applied to the TellorFlex Contract code to reduce gas usage. The gas required for the `SubmitValue` function has been reduced by 17%. This reduction is likely to result in quicker attainment of profitability for time-based rewards and tips, and faster data submissions to Tellor. Below are the changes made:
Two variables were removed to achieve gas reduction:
- One unused variable from the `submitValue` function in TellorFlex – `_staker.reportsSubmittedByQueryId`
- One redundant variable, `timestampToBlockNum`, which was used for checking a value’s existence before a dispute could be initiated in the Governance contract.
Dispute Verification Adjustment in Governance Contract
Following the removal of `timestampToBlockNum`, the Governance contract now checks if a reporter address exists for the `queryId` and `timestamp` being disputed, with the reporter now being saved to memory for cheaper referencing through the function.
Immutability Declaration Transition
Public variables that are immutable have been declared as such at the time of their definition to further reduce gas usage.
Getter and Reference Removal
Getters for the removed variables, as well as references to them on events and structs, have also been removed.
This update is part of the ongoing efforts to maintain and improve the protocol’s technical efficiency. We appreciate the community’s support and eagerly anticipate the adoption and benefits of this contract.