Skip to content

Commit

Permalink
chore(protocol): fix lint issue in SP1Verifier (#18213)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Oct 8, 2024
1 parent 219a7e8 commit 7874dd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/protocol/.solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
16 changes: 8 additions & 8 deletions packages/protocol/contracts/layer1/verifiers/SP1Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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:])
)
);

Expand Down

0 comments on commit 7874dd3

Please sign in to comment.