Skip to content

Commit 6a64314

Browse files
committed
Increase MAX_LIST_SIZE to 67108864 (2^26`).
1 parent 476c283 commit 6a64314

File tree

3 files changed

+54
-4
lines changed

3 files changed

+54
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# bedrock-vc-status ChangeLog
22

3+
## 1.1.0 - 2025-mm-dd
4+
5+
### Changed
6+
- Increase `MAX_LIST_SIZE` to accommodate lists of up to size `2^26`, which is
7+
how large terse bitstring status lists are by default.
8+
39
## 1.0.0 - 2024-08-02
410

511
### Added

lib/constants.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2024-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
// matching status list type => status entry type
55
export const LIST_TYPE_TO_ENTRY_TYPE = new Map([
@@ -8,6 +8,12 @@ export const LIST_TYPE_TO_ENTRY_TYPE = new Map([
88
['StatusList2021', 'StatusList2021Entry']
99
]);
1010

11-
export const MAX_LIST_SIZE = 131072;
11+
// max list size is 2^26, which is the largest size a totally random,
12+
// unencrypted list can be (8MiB) without breaking the max 10MiB storage
13+
// barrier for a single VC -- leaving 2MiB of space for other information
14+
// beyond the list in a status list credential
15+
// 2^26/2^3/2^10/2^10=2^3 = 8
16+
// 67108864 bits / 8 / 1024 / 1024 = 8MiB
17+
export const MAX_LIST_SIZE = 67108864;
1218

1319
export const serviceType = 'vc-status';

test/mocha/20-status.js

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as helpers from './helpers.js';
55
import {v4 as uuid} from 'uuid';
@@ -64,7 +64,7 @@ describe('status APIs', () => {
6464
]);
6565
});
6666

67-
it('creates a "BitstringStatusList" status list', async () => {
67+
it('creates a "BitstringStatusList" status list size=2^17', async () => {
6868
const statusListId = `${statusInstanceId}/status-lists/${uuid()}`;
6969
const statusListOptions = {
7070
credentialId: statusListId,
@@ -102,6 +102,44 @@ describe('status APIs', () => {
102102
]);
103103
});
104104

105+
it('creates a "BitstringStatusList" status list size=2^26', async () => {
106+
const statusListId = `${statusInstanceId}/status-lists/${uuid()}`;
107+
const statusListOptions = {
108+
credentialId: statusListId,
109+
type: 'BitstringStatusList',
110+
indexAllocator: `urn:uuid:${uuid()}`,
111+
length: 67108864,
112+
statusPurpose: 'revocation'
113+
};
114+
let error;
115+
let result;
116+
try {
117+
result = await helpers.createStatusList({
118+
url: statusListId,
119+
capabilityAgent,
120+
capability: statusInstanceRootZcap,
121+
statusListOptions
122+
});
123+
} catch(e) {
124+
error = e;
125+
}
126+
assertNoError(error);
127+
should.exist(result.id);
128+
result.id.should.equal(statusListId);
129+
130+
// get status list and make assertions on it
131+
const slc = await helpers.getStatusListCredential({statusListId});
132+
should.exist(slc);
133+
slc.should.include.keys([
134+
'id', 'credentialSubject', 'validFrom', 'validUntil'
135+
]);
136+
slc.id.should.equal(statusListOptions.credentialId);
137+
slc.id.should.equal(statusListId);
138+
slc.credentialSubject.should.include.keys([
139+
'id', 'type', 'encodedList', 'statusPurpose'
140+
]);
141+
});
142+
105143
it('creates a status list with non-equal credential ID', async () => {
106144
// suffix must match
107145
const suffix = `/status-lists/${uuid()}`;

0 commit comments

Comments
 (0)