Rust bindings of SP1Helios contract are out of sync
Description
In types.rs, Rust bindings for the SP1Helios contract are defined using the sol!
macro, allowing the contract's functions to be used at the Rust code level. These bindings conveniently include view functions such as getSyncCommitteePeriod
, getCurrentSlot
, and getCurrentEpoch
in addition to the update
function. However, the current SP1Helios contract does not include a getCurrentSlot()
function; instead, it defines a getStorageSlot(uint256 blockNumber, address contractAddress, bytes32 key)
function.
#[allow(missing_docs)]
#[sol(rpc)]
contract SP1Helios {
[...]
function getSyncCommitteePeriod(uint256 slot) internal view returns (uint256);
function getCurrentSlot() internal view returns (uint256);
function getCurrentEpoch() internal view returns (uint256);
}
Impact
In the project's Rust-level code, attempting to call the getCurrentSlot
function, which does not exist in the SP1Helios contract, may result in an error. Additionally, the getStorageSlot
function cannot be used because its interface is not defined.
However, this view function is currently not used anywhere within the project.
Recommendations
Update the Rust bindings for SP1Helios defined in types.rs to match the latest version of the contract.