File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,8 @@ abstract contract LCPClientZKDCAPBase is LCPClientBase {
279
279
if (uint8 (verifierInfo[0 ]) != ZKVM_TYPE_RISC_ZERO) {
280
280
revert LCPClientZKDCAPInvalidVerifierInfoZKVMType ();
281
281
}
282
- if (vlen < 64 ) {
282
+ // risc0 verifier info should be 64 bytes
283
+ if (vlen != 64 ) {
283
284
revert LCPClientZKDCAPInvalidVerifierInfoLength ();
284
285
}
285
286
// 32..64 bytes: image ID
Original file line number Diff line number Diff line change @@ -670,6 +670,7 @@ contract LCPClientZKDCAPTest is BasicTest {
670
670
vm.warp (ZKDCAPTestHelper.TEST_TIMESTAMP);
671
671
bytes memory consensusStateBytes = LCPProtoMarshaler.marshal (defaultConsensusState ());
672
672
IbcLightclientsLcpV1ClientState.Data memory clientState = defaultClientState ();
673
+ bytes memory valid_zkdcap_verifier_info = clientState.zkdcap_verifier_infos[0 ];
673
674
clientState.zkdcap_verifier_infos[0 ] = new bytes (0 );
674
675
bytes memory clientStateBytes = LCPProtoMarshaler.marshal (clientState);
675
676
vm.expectRevert ();
@@ -689,6 +690,12 @@ contract LCPClientZKDCAPTest is BasicTest {
689
690
clientStateBytes = LCPProtoMarshaler.marshal (clientState);
690
691
vm.expectRevert ();
691
692
lc.initializeClient (clientId, clientStateBytes, consensusStateBytes);
693
+
694
+ clientState.zkdcap_verifier_infos = new bytes [](1 );
695
+ clientState.zkdcap_verifier_infos[0 ] = abi.encodePacked (valid_zkdcap_verifier_info, bytes1 (0x0 ));
696
+ clientStateBytes = LCPProtoMarshaler.marshal (clientState);
697
+ vm.expectRevert ();
698
+ lc.initializeClient (clientId, clientStateBytes, consensusStateBytes);
692
699
}
693
700
694
701
function testInitializeClientInvalidValues () public {
You can’t perform that action at this time.
0 commit comments