Skip to content

Commit

Permalink
chore: better variable name + natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
Julink-eth committed Jul 17, 2024
1 parent e538ec8 commit a796466
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/linea-state-verifier/contracts/EVMFetchTarget.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ abstract contract EVMFetchTarget {

/**
* @dev Internal callback function invoked by CCIP-Read in response to a `getStorageSlots` request.
* @dev Only the first 32 bytes are used for callbackData and is never longer than 32 bytes
*/
function getStorageSlotsCallback(
bytes calldata response,
Expand All @@ -33,13 +34,13 @@ abstract contract EVMFetchTarget {
(IEVMVerifier, address, bytes32[], bytes[], bytes4, bytes)
);

uint256 l2BlockRangeAccepted = uint256(bytes32(callbackData));
uint256 acceptedL2BlockRangeLength = uint256(bytes32(callbackData));
bytes[] memory values = verifier.getStorageValues(
addr,
commands,
constants,
proof,
l2BlockRangeAccepted
acceptedL2BlockRangeLength
);
if (values.length != commands.length) {
revert ResponseLengthMismatch(values.length, commands.length);
Expand Down
2 changes: 1 addition & 1 deletion packages/linea-state-verifier/contracts/IEVMVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ interface IEVMVerifier {
bytes32[] memory commands,
bytes[] memory constants,
bytes memory proof,
uint256 l2BlockRangeAccepted
uint256 acceptedL2BlockRangeLength
) external view returns (bytes[] memory values);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract LineaSparseProofVerifier is IEVMVerifier {
bytes32[] memory commands,
bytes[] memory constants,
bytes memory proof,
uint256 l2BlockRangeAccepted
uint256 acceptedL2BlockRangeLength
) external view returns (bytes[] memory values) {
(
uint256 blockNo,
Expand All @@ -40,9 +40,9 @@ contract LineaSparseProofVerifier is IEVMVerifier {
// Check that the L2 block number used is a recent one and is part of the range accepted
uint256 currentL2BlockNumber = IRollup(_rollup).currentL2BlockNumber();
require(
(currentL2BlockNumber <= l2BlockRangeAccepted &&
(currentL2BlockNumber <= acceptedL2BlockRangeLength &&
blockNo <= currentL2BlockNumber) ||
blockNo >= currentL2BlockNumber - l2BlockRangeAccepted,
blockNo >= currentL2BlockNumber - acceptedL2BlockRangeLength,
"LineaSparseProofVerifier: block not in range accepted"
);

Expand Down

0 comments on commit a796466

Please sign in to comment.