From 7874dd3ff8a6053da8c09377b52c83e7a506f45f Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:10:50 +0800 Subject: [PATCH] chore(protocol): fix lint issue in SP1Verifier (#18213) --- packages/protocol/.solhint.json | 1 + .../contracts/layer1/verifiers/SP1Verifier.sol | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/protocol/.solhint.json b/packages/protocol/.solhint.json index ee0c7f96812..add6256b711 100644 --- a/packages/protocol/.solhint.json +++ b/packages/protocol/.solhint.json @@ -13,6 +13,7 @@ "no-global-import": "off", "no-inline-assembly": "off", "not-rely-on-time": "off", + "gas-custom-errors": "off", "one-contract-per-file": "off" } } diff --git a/packages/protocol/contracts/layer1/verifiers/SP1Verifier.sol b/packages/protocol/contracts/layer1/verifiers/SP1Verifier.sol index c9f9e2aca8b..185f4a9523e 100644 --- a/packages/protocol/contracts/layer1/verifiers/SP1Verifier.sol +++ b/packages/protocol/contracts/layer1/verifiers/SP1Verifier.sol @@ -84,21 +84,21 @@ contract SP1Verifier is EssentialContract, IVerifier { { require(_ctxs.length != 0 && _proof.data.length > 64, SP1_INVALID_PARAMS()); // Extract the necessary data - bytes32 aggregation_program = bytes32(_proof.data[0:32]); - bytes32 block_proving_program = bytes32(_proof.data[32:64]); + bytes32 aggregationProgram = bytes32(_proof.data[0:32]); + bytes32 blockProvingProgram = bytes32(_proof.data[32:64]); // Check if the aggregation program is trusted - require(isProgramTrusted[aggregation_program], SP1_INVALID_AGGREGATION_VKEY()); + require(isProgramTrusted[aggregationProgram], SP1_INVALID_AGGREGATION_VKEY()); // Check if the block proving program is trusted - require(isProgramTrusted[block_proving_program], SP1_INVALID_PROGRAM_VKEY()); + require(isProgramTrusted[blockProvingProgram], SP1_INVALID_PROGRAM_VKEY()); // Collect public inputs - bytes32[] memory public_inputs = new bytes32[](_ctxs.length + 1); + bytes32[] memory publicInputs = new bytes32[](_ctxs.length + 1); // First public input is the block proving program key - public_inputs[0] = block_proving_program; + publicInputs[0] = blockProvingProgram; // All other inputs are the block program public inputs (a single 32 byte value) for (uint256 i; i < _ctxs.length; ++i) { - public_inputs[i + 1] = LibPublicInput.hashPublicInputs( + publicInputs[i + 1] = LibPublicInput.hashPublicInputs( _ctxs[i].tran, address(this), address(0), @@ -112,7 +112,7 @@ contract SP1Verifier is EssentialContract, IVerifier { (bool success,) = sp1RemoteVerifier().staticcall( abi.encodeCall( ISP1Verifier.verifyProof, - (aggregation_program, abi.encodePacked(public_inputs), _proof.data[64:]) + (aggregationProgram, abi.encodePacked(publicInputs), _proof.data[64:]) ) );