@inco/lightning 1.0.0-devnet-3 → 1.0.0-devnet-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/manifest.yaml CHANGED
@@ -9,6 +9,21 @@ incoLightning_devnet_v12_873394282:
9
9
  salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00f5bad44b2a772fe6ca626a"
10
10
  verifierAddress: "0x75dE330840A8ff79C8a71b0b9bA2cAd635D1Fd88"
11
11
  deployments:
12
+ - name: incoLightning_12_0_1__873394282
13
+ chainId: "84532"
14
+ chainName: Base Sepolia
15
+ version:
16
+ major: 12
17
+ minor: 0
18
+ patch: 1
19
+ shortSalt: "873394282"
20
+ blockNumber: "41493080"
21
+ deployDate: 2026-05-14T10:27:30.920Z
22
+ commit: v1.0.0-devnet-4
23
+ active: true
24
+ includesPreviewFeatures: false
25
+ executorImpl: "0xb8f7a440Ba8D1d43eD0223C27Be0259Ed0bD7183"
26
+ verifierImpl: "0x05d35BeA5a24fAd016FB08192c8769D1804DFA40"
12
27
  - name: incoLightning_12_0_0__873394282
13
28
  chainId: "84532"
14
29
  chainName: Base Sepolia
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inco/lightning",
3
- "version": "1.0.0-devnet-3",
3
+ "version": "1.0.0-devnet-5",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
5
  "files": [
6
6
  "src/",
package/src/Types.sol CHANGED
@@ -256,6 +256,7 @@ error SliceOutOfRange(uint16 start, uint16 end, uint16 len);
256
256
  error ZeroLength();
257
257
  error ListTooLong(uint32 provided, uint16 max);
258
258
  error InvalidRange(uint16 start, uint16 end);
259
+ error ListRangeExceedsType(uint16 end, ETypes listType);
259
260
  error ListTypeMismatch(ETypes lhs, ETypes rhs);
260
261
  error UnsupportedListType(ETypes listType);
261
262
  error UnsupportedType(ETypes actual);
@@ -9,6 +9,7 @@ import {
9
9
  isTypeSupported,
10
10
  IndexOutOfRange,
11
11
  InvalidRange,
12
+ ListRangeExceedsType,
12
13
  ListTypeMismatch,
13
14
  ListTooLong,
14
15
  UnsupportedType,
@@ -332,6 +333,11 @@ abstract contract EList is IEList, EncryptedOperations, EncryptedInput, EListHan
332
333
  returns (elist result)
333
334
  {
334
335
  require(start <= end, InvalidRange(start, end));
336
+ // Range values [start, end) must fit within listType's bit width.
337
+ uint256 bitWidth = typeBitSize(listType);
338
+ if (bitWidth < 16) {
339
+ require(uint256(end) <= (uint256(1) << bitWidth), ListRangeExceedsType(end, listType));
340
+ }
335
341
 
336
342
  result =
337
343
  elist.wrap(createListResultHandle(EOps.EListRange, listType, end - start, abi.encodePacked(start, end)));
@@ -3,7 +3,7 @@ pragma solidity ^0.8;
3
3
 
4
4
  import {IncoTest} from "../../test/IncoTest.sol";
5
5
  import {ElistTester} from "../../test/EListTester.sol";
6
- import {ETypes, ListTooLong, elist, typeBitSize} from "../../Types.sol";
6
+ import {ETypes, ListRangeExceedsType, ListTooLong, elist, typeBitSize} from "../../Types.sol";
7
7
  import {inco} from "../../Lib.sol";
8
8
  import {FEE, BIT_FEE, Fee} from "../Fee.sol";
9
9
  import {EList, MAX_LIST_LENGTH} from "../EList.sol";
@@ -136,6 +136,34 @@ contract TestEList is IncoTest {
136
136
  assert(elist.unwrap(maxList) != bytes32(0));
137
137
  }
138
138
 
139
+ // Range values [start, end) must fit within listType's bit width.
140
+ // Bool fits values 0..1; end=3 would include value 2 which doesn't fit.
141
+ function testListRange_RevertsOnBoolEndExceedsBitWidth() public {
142
+ vm.expectRevert(abi.encodeWithSelector(ListRangeExceedsType.selector, uint16(3), ETypes.Bool));
143
+ _listRange(0, 3, ETypes.Bool);
144
+ }
145
+
146
+ // Range values [start, end) must fit within listType's bit width.
147
+ // end=2 produces {0, 1} — both fit in 1 bit.
148
+ function testListRange_BoolBoundaryAccepted() public {
149
+ elist boolList = _listRange(0, 2, ETypes.Bool);
150
+ assert(elist.unwrap(boolList) != bytes32(0));
151
+ }
152
+
153
+ // Range values [start, end) must fit within listType's bit width.
154
+ // Empty range with end at the type's max-exclusive boundary stays valid.
155
+ function testListRange_BoolEmptyRangeAtMaxAccepted() public {
156
+ elist empty = _listRange(2, 2, ETypes.Bool);
157
+ assert(elist.unwrap(empty) != bytes32(0));
158
+ }
159
+
160
+ // Range values [start, end) must fit within listType's bit width.
161
+ // uint16 always fits in 160 bits; the new check must not narrow this path.
162
+ function testListRange_Uint160LargeEndAccepted() public {
163
+ elist list = _listRange(0, MAX_LIST_LENGTH, ETypes.AddressOrUint160OrBytes20);
164
+ assert(elist.unwrap(list) != bytes32(0));
165
+ }
166
+
139
167
  // ==================== Overflow Tests ====================
140
168
  // These tests verify that exceeding MAX_LIST_LENGTH reverts appropriately.
141
169
  // Operations use uint16 arithmetic which auto-reverts on overflow in Solidity 0.8+.
@@ -13,6 +13,6 @@ uint8 constant MINOR_VERSION = 0;
13
13
  // otherwise make test_upgrade will fail
14
14
  // consequently, when we do a patch release, we don't need to pump it as it's already pumped
15
15
  // when the previous release was done
16
- uint8 constant PATCH_VERSION = 1;
16
+ uint8 constant PATCH_VERSION = 2;
17
17
 
18
18
  string constant VERIFIER_NAME = "incoVerifier";