@aztec/stdlib 1.0.0-staging.2 → 1.0.0

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.
Files changed (112) hide show
  1. package/dest/block/l2_block_stream/l2_block_stream.js +1 -1
  2. package/dest/block/proposal/committee_attestation.d.ts +3 -3
  3. package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
  4. package/dest/block/proposal/committee_attestation.js +2 -41
  5. package/dest/contract/contract_instance_update.d.ts +1 -2
  6. package/dest/contract/contract_instance_update.d.ts.map +1 -1
  7. package/dest/contract/contract_instance_update.js +6 -6
  8. package/dest/contract/interfaces/contract_data_source.d.ts +2 -5
  9. package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
  10. package/dest/contract/interfaces/contract_instance_update.d.ts +8 -9
  11. package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
  12. package/dest/contract/interfaces/contract_instance_update.js +1 -1
  13. package/dest/hash/hash.d.ts +1 -1
  14. package/dest/hash/hash.d.ts.map +1 -1
  15. package/dest/hash/hash.js +3 -7
  16. package/dest/interfaces/archiver.js +1 -1
  17. package/dest/interfaces/aztec-node.d.ts +1 -1
  18. package/dest/interfaces/client.d.ts +0 -1
  19. package/dest/interfaces/client.d.ts.map +1 -1
  20. package/dest/interfaces/client.js +0 -1
  21. package/dest/interfaces/proving-job.d.ts +1 -22
  22. package/dest/interfaces/proving-job.d.ts.map +1 -1
  23. package/dest/interfaces/proving-job.js +0 -13
  24. package/dest/interfaces/server.d.ts +0 -1
  25. package/dest/interfaces/server.d.ts.map +1 -1
  26. package/dest/interfaces/server.js +0 -1
  27. package/dest/interfaces/server_circuit_prover.d.ts +0 -2
  28. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  29. package/dest/kernel/hints/rollup_validation_requests.d.ts +10 -6
  30. package/dest/kernel/hints/rollup_validation_requests.d.ts.map +1 -1
  31. package/dest/kernel/hints/rollup_validation_requests.js +11 -9
  32. package/dest/kernel/private_circuit_public_inputs.d.ts +6 -6
  33. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  34. package/dest/kernel/private_circuit_public_inputs.js +10 -10
  35. package/dest/proofs/proving_request_type.d.ts +7 -8
  36. package/dest/proofs/proving_request_type.d.ts.map +1 -1
  37. package/dest/proofs/proving_request_type.js +7 -8
  38. package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts +9 -0
  39. package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +1 -1
  40. package/dest/rollup/base_or_merge_rollup_public_inputs.js +8 -3
  41. package/dest/rollup/empty_block_root_rollup_inputs.d.ts +3 -2
  42. package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +1 -1
  43. package/dest/rollup/empty_block_root_rollup_inputs.js +6 -3
  44. package/dest/rollup/index.d.ts +0 -1
  45. package/dest/rollup/index.d.ts.map +1 -1
  46. package/dest/rollup/index.js +0 -1
  47. package/dest/shared_mutable/scheduled_delay_change.d.ts +5 -5
  48. package/dest/shared_mutable/scheduled_delay_change.d.ts.map +1 -1
  49. package/dest/shared_mutable/scheduled_delay_change.js +5 -5
  50. package/dest/shared_mutable/scheduled_value_change.d.ts +3 -4
  51. package/dest/shared_mutable/scheduled_value_change.d.ts.map +1 -1
  52. package/dest/shared_mutable/scheduled_value_change.js +7 -7
  53. package/dest/shared_mutable/shared_mutable_values.js +7 -7
  54. package/dest/stats/stats.d.ts +1 -1
  55. package/dest/stats/stats.d.ts.map +1 -1
  56. package/dest/tests/factories.d.ts.map +1 -1
  57. package/dest/tests/factories.js +6 -6
  58. package/dest/tx/index.d.ts +1 -1
  59. package/dest/tx/index.d.ts.map +1 -1
  60. package/dest/tx/index.js +1 -1
  61. package/dest/tx/max_block_number.d.ts +54 -0
  62. package/dest/tx/max_block_number.d.ts.map +1 -0
  63. package/dest/tx/max_block_number.js +64 -0
  64. package/dest/tx/offchain_effect.d.ts.map +1 -1
  65. package/dest/tx/offchain_effect.js +0 -1
  66. package/dest/tx/validator/error_texts.d.ts +1 -1
  67. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  68. package/dest/tx/validator/error_texts.js +1 -1
  69. package/dest/types/shared.d.ts +8 -0
  70. package/dest/types/shared.d.ts.map +1 -1
  71. package/dest/types/shared.js +8 -0
  72. package/dest/vks/verification_key.d.ts +0 -1
  73. package/dest/vks/verification_key.d.ts.map +1 -1
  74. package/dest/vks/verification_key.js +0 -5
  75. package/package.json +7 -7
  76. package/src/block/l2_block_stream/l2_block_stream.ts +1 -1
  77. package/src/block/proposal/committee_attestation.ts +3 -49
  78. package/src/contract/contract_instance_update.ts +6 -7
  79. package/src/contract/interfaces/contract_data_source.ts +2 -5
  80. package/src/contract/interfaces/contract_instance_update.ts +3 -4
  81. package/src/hash/hash.ts +3 -7
  82. package/src/interfaces/archiver.ts +1 -1
  83. package/src/interfaces/aztec-node.ts +1 -1
  84. package/src/interfaces/client.ts +0 -1
  85. package/src/interfaces/proving-job.ts +0 -21
  86. package/src/interfaces/server.ts +0 -1
  87. package/src/interfaces/server_circuit_prover.ts +0 -9
  88. package/src/kernel/hints/rollup_validation_requests.ts +10 -8
  89. package/src/kernel/private_circuit_public_inputs.ts +8 -8
  90. package/src/proofs/proving_request_type.ts +0 -1
  91. package/src/rollup/base_or_merge_rollup_public_inputs.ts +8 -0
  92. package/src/rollup/empty_block_root_rollup_inputs.ts +7 -2
  93. package/src/rollup/index.ts +0 -1
  94. package/src/shared_mutable/scheduled_delay_change.ts +6 -6
  95. package/src/shared_mutable/scheduled_value_change.ts +5 -7
  96. package/src/shared_mutable/shared_mutable_values.ts +9 -9
  97. package/src/stats/stats.ts +0 -1
  98. package/src/tests/factories.ts +6 -4
  99. package/src/tx/index.ts +1 -1
  100. package/src/tx/max_block_number.ts +81 -0
  101. package/src/tx/offchain_effect.ts +0 -1
  102. package/src/tx/validator/error_texts.ts +1 -1
  103. package/src/types/shared.ts +9 -0
  104. package/src/vks/verification_key.ts +0 -6
  105. package/dest/rollup/padding_block_root_rollup_inputs.d.ts +0 -20
  106. package/dest/rollup/padding_block_root_rollup_inputs.d.ts.map +0 -1
  107. package/dest/rollup/padding_block_root_rollup_inputs.js +0 -39
  108. package/dest/tx/include_by_timestamp.d.ts +0 -54
  109. package/dest/tx/include_by_timestamp.d.ts.map +0 -1
  110. package/dest/tx/include_by_timestamp.js +0 -72
  111. package/src/rollup/padding_block_root_rollup_inputs.ts +0 -47
  112. package/src/tx/include_by_timestamp.ts +0 -90
@@ -1,39 +0,0 @@
1
- import { bufferSchemaFor } from '@aztec/foundation/schemas';
2
- import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
- import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
4
- import { EpochConstantData } from './epoch_constant_data.js';
5
- /**
6
- * Inputs of the padding block root rollup circuit.
7
- */ export class PaddingBlockRootRollupInputs {
8
- constants;
9
- constructor(constants){
10
- this.constants = constants;
11
- }
12
- static from(fields) {
13
- return new PaddingBlockRootRollupInputs(...PaddingBlockRootRollupInputs.getFields(fields));
14
- }
15
- static getFields(fields) {
16
- return [
17
- fields.constants
18
- ];
19
- }
20
- static fromBuffer(buffer) {
21
- const reader = BufferReader.asReader(buffer);
22
- return new PaddingBlockRootRollupInputs(reader.readObject(EpochConstantData));
23
- }
24
- toBuffer() {
25
- return serializeToBuffer(...PaddingBlockRootRollupInputs.getFields(this));
26
- }
27
- static fromString(str) {
28
- return PaddingBlockRootRollupInputs.fromBuffer(hexToBuffer(str));
29
- }
30
- toString() {
31
- return bufferToHex(this.toBuffer());
32
- }
33
- /** Returns a buffer representation for JSON serialization. */ toJSON() {
34
- return this.toBuffer();
35
- }
36
- static get schema() {
37
- return bufferSchemaFor(PaddingBlockRootRollupInputs);
38
- }
39
- }
@@ -1,54 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
3
- import type { FieldsOf } from '@aztec/foundation/types';
4
- import type { UInt64 } from '../types/index.js';
5
- /**
6
- * Maximum block timestamp value at which the transaction can still be included.
7
- */
8
- export declare class IncludeByTimestamp {
9
- /**
10
- * Whether max inclusion timestamp was requested.
11
- */
12
- isSome: boolean;
13
- /**
14
- * The requested max inclusion timestamp of a block, if isSome is true.
15
- */
16
- value: UInt64;
17
- constructor(
18
- /**
19
- * Whether max inclusion timestamp was requested.
20
- */
21
- isSome: boolean,
22
- /**
23
- * The requested max inclusion timestamp of a block, if isSome is true.
24
- */
25
- value: UInt64);
26
- /**
27
- * Serialize as a buffer.
28
- * @returns The buffer.
29
- */
30
- toBuffer(): Buffer<ArrayBufferLike>;
31
- toFields(): Fr[];
32
- /**
33
- * Deserializes IncludeByTimestamp from a buffer or reader.
34
- * @param buffer - Buffer to read from.
35
- * @returns The IncludeByTimestamp.
36
- */
37
- static fromBuffer(buffer: Buffer | BufferReader): IncludeByTimestamp;
38
- static fromFields(fields: Fr[] | FieldReader): IncludeByTimestamp;
39
- static empty(): IncludeByTimestamp;
40
- isEmpty(): boolean;
41
- /**
42
- * Create a new instance from a fields dictionary.
43
- * @param fields - The dictionary.
44
- * @returns A new instance.
45
- */
46
- static from(fields: FieldsOf<IncludeByTimestamp>): IncludeByTimestamp;
47
- /**
48
- * Serialize into a field array. Low-level utility.
49
- * @param fields - Object with fields.
50
- * @returns The array.
51
- */
52
- static getFields(fields: FieldsOf<IncludeByTimestamp>): readonly [boolean, bigint];
53
- }
54
- //# sourceMappingURL=include_by_timestamp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"include_by_timestamp.d.ts","sourceRoot":"","sources":["../../src/tx/include_by_timestamp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAC9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,qBAAa,kBAAkB;IAE3B;;OAEG;IACI,MAAM,EAAE,OAAO;IACtB;;OAEG;IACI,KAAK,EAAE,MAAM;;IAPpB;;OAEG;IACI,MAAM,EAAE,OAAO;IACtB;;OAEG;IACI,KAAK,EAAE,MAAM;IAQtB;;;OAGG;IACH,QAAQ;IAIR,QAAQ,IAAI,EAAE,EAAE;IAUhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB;IASpE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,kBAAkB;IAKjE,MAAM,CAAC,KAAK;IAIZ,OAAO,IAAI,OAAO;IAIlB;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,kBAAkB;IAIrE;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC;CAGtD"}
@@ -1,72 +0,0 @@
1
- import { INCLUDE_BY_TIMESTAMP_LENGTH } from '@aztec/constants';
2
- import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
3
- /**
4
- * Maximum block timestamp value at which the transaction can still be included.
5
- */ export class IncludeByTimestamp {
6
- isSome;
7
- value;
8
- constructor(/**
9
- * Whether max inclusion timestamp was requested.
10
- */ isSome, /**
11
- * The requested max inclusion timestamp of a block, if isSome is true.
12
- */ value){
13
- this.isSome = isSome;
14
- this.value = value;
15
- // For sanity we check that the value is less than 2 ** 64.
16
- if (value >= 1n << 64n) {
17
- throw new Error('Value is not a u64.');
18
- }
19
- }
20
- /**
21
- * Serialize as a buffer.
22
- * @returns The buffer.
23
- */ toBuffer() {
24
- return serializeToBuffer(...IncludeByTimestamp.getFields(this));
25
- }
26
- toFields() {
27
- const fields = serializeToFields(...IncludeByTimestamp.getFields(this));
28
- if (fields.length !== INCLUDE_BY_TIMESTAMP_LENGTH) {
29
- throw new Error(`Invalid number of fields for IncludeByTimestamp. Expected ${INCLUDE_BY_TIMESTAMP_LENGTH}, got ${fields.length}`);
30
- }
31
- return fields;
32
- }
33
- /**
34
- * Deserializes IncludeByTimestamp from a buffer or reader.
35
- * @param buffer - Buffer to read from.
36
- * @returns The IncludeByTimestamp.
37
- */ static fromBuffer(buffer) {
38
- const reader = BufferReader.asReader(buffer);
39
- const isSome = reader.readBoolean();
40
- // UInt64 is aliased to bigint in TypeScript, causing it to be serialized as a 256-bit integer.
41
- // Therefore, we must read it back using readUInt256() rather than readUInt64().
42
- const value = reader.readUInt256();
43
- return new IncludeByTimestamp(isSome, value);
44
- }
45
- static fromFields(fields) {
46
- const reader = FieldReader.asReader(fields);
47
- return new IncludeByTimestamp(reader.readBoolean(), reader.readU64());
48
- }
49
- static empty() {
50
- return new IncludeByTimestamp(false, 0n);
51
- }
52
- isEmpty() {
53
- return !this.isSome && this.value === 0n;
54
- }
55
- /**
56
- * Create a new instance from a fields dictionary.
57
- * @param fields - The dictionary.
58
- * @returns A new instance.
59
- */ static from(fields) {
60
- return new IncludeByTimestamp(...IncludeByTimestamp.getFields(fields));
61
- }
62
- /**
63
- * Serialize into a field array. Low-level utility.
64
- * @param fields - Object with fields.
65
- * @returns The array.
66
- */ static getFields(fields) {
67
- return [
68
- fields.isSome,
69
- fields.value
70
- ];
71
- }
72
- }
@@ -1,47 +0,0 @@
1
- import { bufferSchemaFor } from '@aztec/foundation/schemas';
2
- import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
- import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
4
- import type { FieldsOf } from '@aztec/foundation/types';
5
-
6
- import { EpochConstantData } from './epoch_constant_data.js';
7
-
8
- /**
9
- * Inputs of the padding block root rollup circuit.
10
- */
11
- export class PaddingBlockRootRollupInputs {
12
- constructor(public readonly constants: EpochConstantData) {}
13
-
14
- static from(fields: FieldsOf<PaddingBlockRootRollupInputs>): PaddingBlockRootRollupInputs {
15
- return new PaddingBlockRootRollupInputs(...PaddingBlockRootRollupInputs.getFields(fields));
16
- }
17
-
18
- static getFields(fields: FieldsOf<PaddingBlockRootRollupInputs>) {
19
- return [fields.constants] as const;
20
- }
21
-
22
- static fromBuffer(buffer: Buffer | BufferReader): PaddingBlockRootRollupInputs {
23
- const reader = BufferReader.asReader(buffer);
24
- return new PaddingBlockRootRollupInputs(reader.readObject(EpochConstantData));
25
- }
26
-
27
- toBuffer() {
28
- return serializeToBuffer(...PaddingBlockRootRollupInputs.getFields(this));
29
- }
30
-
31
- static fromString(str: string) {
32
- return PaddingBlockRootRollupInputs.fromBuffer(hexToBuffer(str));
33
- }
34
-
35
- toString() {
36
- return bufferToHex(this.toBuffer());
37
- }
38
-
39
- /** Returns a buffer representation for JSON serialization. */
40
- toJSON() {
41
- return this.toBuffer();
42
- }
43
-
44
- static get schema() {
45
- return bufferSchemaFor(PaddingBlockRootRollupInputs);
46
- }
47
- }
@@ -1,90 +0,0 @@
1
- import { INCLUDE_BY_TIMESTAMP_LENGTH } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
4
- import type { FieldsOf } from '@aztec/foundation/types';
5
-
6
- import type { UInt64 } from '../types/index.js';
7
-
8
- /**
9
- * Maximum block timestamp value at which the transaction can still be included.
10
- */
11
- export class IncludeByTimestamp {
12
- constructor(
13
- /**
14
- * Whether max inclusion timestamp was requested.
15
- */
16
- public isSome: boolean,
17
- /**
18
- * The requested max inclusion timestamp of a block, if isSome is true.
19
- */
20
- public value: UInt64,
21
- ) {
22
- // For sanity we check that the value is less than 2 ** 64.
23
- if (value >= 1n << 64n) {
24
- throw new Error('Value is not a u64.');
25
- }
26
- }
27
-
28
- /**
29
- * Serialize as a buffer.
30
- * @returns The buffer.
31
- */
32
- toBuffer() {
33
- return serializeToBuffer(...IncludeByTimestamp.getFields(this));
34
- }
35
-
36
- toFields(): Fr[] {
37
- const fields = serializeToFields(...IncludeByTimestamp.getFields(this));
38
- if (fields.length !== INCLUDE_BY_TIMESTAMP_LENGTH) {
39
- throw new Error(
40
- `Invalid number of fields for IncludeByTimestamp. Expected ${INCLUDE_BY_TIMESTAMP_LENGTH}, got ${fields.length}`,
41
- );
42
- }
43
- return fields;
44
- }
45
-
46
- /**
47
- * Deserializes IncludeByTimestamp from a buffer or reader.
48
- * @param buffer - Buffer to read from.
49
- * @returns The IncludeByTimestamp.
50
- */
51
- static fromBuffer(buffer: Buffer | BufferReader): IncludeByTimestamp {
52
- const reader = BufferReader.asReader(buffer);
53
- const isSome = reader.readBoolean();
54
- // UInt64 is aliased to bigint in TypeScript, causing it to be serialized as a 256-bit integer.
55
- // Therefore, we must read it back using readUInt256() rather than readUInt64().
56
- const value = reader.readUInt256();
57
- return new IncludeByTimestamp(isSome, value);
58
- }
59
-
60
- static fromFields(fields: Fr[] | FieldReader): IncludeByTimestamp {
61
- const reader = FieldReader.asReader(fields);
62
- return new IncludeByTimestamp(reader.readBoolean(), reader.readU64());
63
- }
64
-
65
- static empty() {
66
- return new IncludeByTimestamp(false, 0n);
67
- }
68
-
69
- isEmpty(): boolean {
70
- return !this.isSome && this.value === 0n;
71
- }
72
-
73
- /**
74
- * Create a new instance from a fields dictionary.
75
- * @param fields - The dictionary.
76
- * @returns A new instance.
77
- */
78
- static from(fields: FieldsOf<IncludeByTimestamp>): IncludeByTimestamp {
79
- return new IncludeByTimestamp(...IncludeByTimestamp.getFields(fields));
80
- }
81
-
82
- /**
83
- * Serialize into a field array. Low-level utility.
84
- * @param fields - Object with fields.
85
- * @returns The array.
86
- */
87
- static getFields(fields: FieldsOf<IncludeByTimestamp>) {
88
- return [fields.isSome, fields.value] as const;
89
- }
90
- }