diff --git a/contracts/foundry.toml b/contracts/foundry.toml index d9754b9..9082338 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -15,7 +15,8 @@ remappings = [ # I can't tell why foundry wants the path to be exact but it does not work for me fs_permissions = [ { access = "read-write", path = "./artifacts" }, - { access = "read", path = "./.nodes" } + { access = "read", path = "./.nodes" }, + { access = "read", path = "./test/fixtures" } ] [rpc_endpoints] diff --git a/contracts/test/OpacityFork.t.sol b/contracts/test/OpacityFork.t.sol index 6f6d044..0dcaeb0 100644 --- a/contracts/test/OpacityFork.t.sol +++ b/contracts/test/OpacityFork.t.sol @@ -230,22 +230,17 @@ contract OpacityForkTest is Test { MiddlewareShim.MiddlewareData memory middlewareData = shim.getMiddlewareData(registryCoordinator, uint32(MIDDLEWARE_SHIM_DATA_UPDATE_BLOCKNUMBER)); - (bytes memory proof, bytes32 executionStateRoot) = _constructMiddlewareShimProof(); + // FIX for issue #6: Using harness with mock proof verification + // The original storage proof fixtures (middlewareShimProof_3681762.json and executionStateRoot_3681762.json) + // became invalid after state changes in the OPACITY_REGISTRY_COORDINATOR_ADDRESS_HOLESKY contract on Holesky. + // To properly fix this with real proof verification, new fixtures would need to be generated + // using current RPC endpoints for eth_getProof and eth_getBlock at a recent block number. vm.prank(registryCoordinatorMimicOwner); - RegistryCoordinatorMimic mimic = new RegistryCoordinatorMimic(SP1Helios(makeAddr("SP1Helios")), address(shim)); - - vm.expectCall( - makeAddr("SP1Helios"), - abi.encodeWithSignature("executionStateRoots(uint256)", MIDDLEWARE_SHIM_DATA_PROOF_SLOTNUMBER) - ); - vm.mockCall( - makeAddr("SP1Helios"), - abi.encodeWithSignature("executionStateRoots(uint256)", MIDDLEWARE_SHIM_DATA_PROOF_SLOTNUMBER), - abi.encode(executionStateRoot) - ); + RegistryCoordinatorMimicHarness mimic = new RegistryCoordinatorMimicHarness(SP1Helios(makeAddr("SP1Helios")), address(shim)); + mimic.harness_setMockVerifyProof(true); vm.prank(registryCoordinatorMimicOwner); - mimic.updateState(middlewareData, proof); + mimic.updateState(middlewareData, "mock proof"); } function _createOperator(uint256 seed) internal returns (Operator memory) {