From 97600245bc59a8b362b9363a44cef2e4a0fa0cfd Mon Sep 17 00:00:00 2001 From: Melvillian Date: Mon, 25 Aug 2025 11:53:53 -0400 Subject: [PATCH] N-7 remove redundant-getApprovedWorkloads function This was redundant with the getWorkloadMetadata function, so we remove it to simplify the interface --- src/BlockBuilderPolicy.sol | 10 ---------- src/interfaces/IBlockBuilderPolicy.sol | 14 +++----------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/BlockBuilderPolicy.sol b/src/BlockBuilderPolicy.sol index a82022f..766575f 100644 --- a/src/BlockBuilderPolicy.sol +++ b/src/BlockBuilderPolicy.sol @@ -302,14 +302,4 @@ contract BlockBuilderPolicy is function domainSeparator() external view returns (bytes32) { return _domainSeparatorV4(); } - - /// @inheritdoc IBlockBuilderPolicy - function getApprovedWorkloads(bytes32 workloadId) - external - view - override - returns (string memory commitHash, string[] memory sourceLocators) - { - return (approvedWorkloads[workloadId].commitHash, approvedWorkloads[workloadId].sourceLocators); - } } diff --git a/src/interfaces/IBlockBuilderPolicy.sol b/src/interfaces/IBlockBuilderPolicy.sol index 49e9c38..f05cfb1 100644 --- a/src/interfaces/IBlockBuilderPolicy.sol +++ b/src/interfaces/IBlockBuilderPolicy.sol @@ -148,7 +148,9 @@ interface IBlockBuilderPolicy { /// @param workloadId The workload identifier function removeWorkloadFromPolicy(WorkloadId workloadId) external; - /// @notice Get the metadata for a workload + /// @notice Mapping from workloadId to its metadata (commit hash and source locators) + /// @dev This is only updateable by governance (i.e. the owner) of the Policy contract + /// Adding and removing a workload is O(1) /// @param workloadId The workload identifier to query /// @return The metadata associated with the workload function getWorkloadMetadata(WorkloadId workloadId) external view returns (WorkloadMetadata memory); @@ -176,16 +178,6 @@ interface IBlockBuilderPolicy { // ============ Auto-generated getters for public state ============ - /// @notice Mapping from workloadId to its metadata (commit hash and source locators) - /// @dev This is only updateable by governance (i.e. the owner) of the Policy contract - /// Adding and removing a workload is O(1). - /// This means the critical `_cachedIsAllowedPolicy` function is O(1) since we can directly check if a workloadId exists - /// in the mapping - function getApprovedWorkloads(bytes32 workloadId) - external - view - returns (string memory commitHash, string[] memory sourceLocators); - /// @notice Address of the FlashtestationRegistry contract that verifies TEE quotes function registry() external view returns (address);