@aztec/stdlib 3.0.0-nightly.20250910 → 3.0.0-nightly.20250911
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/dest/block/index.d.ts +2 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +2 -0
- package/dest/block/l2_block.d.ts +2 -8
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +5 -3
- package/dest/block/l2_block_info.d.ts +41 -0
- package/dest/block/l2_block_info.d.ts.map +1 -0
- package/dest/block/l2_block_info.js +40 -0
- package/dest/block/l2_block_source.d.ts +1 -428
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +0 -28
- package/dest/block/published_l2_block.d.ts +25 -1
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +20 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +2 -1
- package/dest/block/validate_block_result.d.ts +222 -0
- package/dest/block/validate_block_result.d.ts.map +1 -0
- package/dest/block/validate_block_result.js +83 -0
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +2 -1
- package/dest/p2p/block_attestation.d.ts +1 -0
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +3 -0
- package/dest/p2p/block_proposal.d.ts +2 -2
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +3 -1
- package/dest/p2p/consensus_payload.d.ts +1 -0
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +6 -4
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +5 -8
- package/dest/tx/content_commitment.d.ts +1 -0
- package/dest/tx/content_commitment.d.ts.map +1 -1
- package/dest/tx/content_commitment.js +3 -0
- package/dest/tx/partial_state_reference.d.ts +1 -0
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +3 -0
- package/dest/tx/proposed_block_header.d.ts +1 -0
- package/dest/tx/proposed_block_header.d.ts.map +1 -1
- package/dest/tx/proposed_block_header.js +3 -0
- package/dest/tx/state_reference.d.ts +1 -0
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +3 -0
- package/dest/update-checker/update-checker.d.ts +1 -1
- package/dest/update-checker/update-checker.d.ts.map +1 -1
- package/dest/update-checker/update-checker.js +1 -1
- package/package.json +8 -8
- package/src/block/index.ts +2 -0
- package/src/block/l2_block.ts +6 -11
- package/src/block/l2_block_info.ts +63 -0
- package/src/block/l2_block_source.ts +1 -51
- package/src/block/published_l2_block.ts +38 -5
- package/src/block/test/l2_tips_store_test_suite.ts +7 -6
- package/src/block/validate_block_result.ts +122 -0
- package/src/interfaces/archiver.ts +2 -1
- package/src/p2p/block_attestation.ts +4 -0
- package/src/p2p/block_proposal.ts +5 -3
- package/src/p2p/consensus_payload.ts +7 -4
- package/src/tests/mocks.ts +5 -5
- package/src/tx/content_commitment.ts +4 -0
- package/src/tx/partial_state_reference.ts +8 -0
- package/src/tx/proposed_block_header.ts +13 -0
- package/src/tx/state_reference.ts +4 -0
- package/src/update-checker/update-checker.ts +1 -1
package/src/tests/mocks.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
6
6
|
|
|
7
7
|
import type { ContractArtifact } from '../abi/abi.js';
|
|
8
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
|
-
import { CommitteeAttestation } from '../block/index.js';
|
|
9
|
+
import { CommitteeAttestation, L1PublishedData } from '../block/index.js';
|
|
10
10
|
import { L2Block } from '../block/l2_block.js';
|
|
11
11
|
import type { CommitteeAttestationsAndSigners } from '../block/proposal/attestations_and_signers.js';
|
|
12
|
-
import
|
|
12
|
+
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
13
13
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
14
14
|
import { getContractClassFromArtifact } from '../contract/contract_class.js';
|
|
15
15
|
import { SerializableContractInstance } from '../contract/contract_instance.js';
|
|
@@ -318,16 +318,16 @@ export async function randomPublishedL2Block(
|
|
|
318
318
|
opts: { signers?: Secp256k1Signer[] } = {},
|
|
319
319
|
): Promise<PublishedL2Block> {
|
|
320
320
|
const block = await L2Block.random(l2BlockNumber);
|
|
321
|
-
const l1 = {
|
|
321
|
+
const l1 = L1PublishedData.fromFields({
|
|
322
322
|
blockNumber: BigInt(block.number),
|
|
323
323
|
timestamp: block.header.globalVariables.timestamp,
|
|
324
324
|
blockHash: Buffer32.random().toString(),
|
|
325
|
-
};
|
|
325
|
+
});
|
|
326
326
|
|
|
327
327
|
const signers = opts.signers ?? times(3, () => Secp256k1Signer.random());
|
|
328
328
|
const atts = await Promise.all(signers.map(signer => makeBlockAttestationFromBlock(block, signer)));
|
|
329
329
|
const attestations = atts.map(
|
|
330
330
|
(attestation, i) => new CommitteeAttestation(signers[i].address, attestation.signature),
|
|
331
331
|
);
|
|
332
|
-
return
|
|
332
|
+
return new PublishedL2Block(block, l1, attestations);
|
|
333
333
|
}
|
|
@@ -75,6 +75,10 @@ export class ContentCommitment {
|
|
|
75
75
|
return new ContentCommitment(reader.readField(), reader.readField(), reader.readField());
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
static random(): ContentCommitment {
|
|
79
|
+
return new ContentCommitment(Fr.random(), Fr.random(), Fr.random());
|
|
80
|
+
}
|
|
81
|
+
|
|
78
82
|
static empty(): ContentCommitment {
|
|
79
83
|
return new ContentCommitment(Fr.zero(), Fr.zero(), Fr.zero());
|
|
80
84
|
}
|
|
@@ -64,6 +64,14 @@ export class PartialStateReference {
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
static random(): PartialStateReference {
|
|
68
|
+
return new PartialStateReference(
|
|
69
|
+
AppendOnlyTreeSnapshot.random(),
|
|
70
|
+
AppendOnlyTreeSnapshot.random(),
|
|
71
|
+
AppendOnlyTreeSnapshot.random(),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
67
75
|
toViem(): ViemPartialStateReference {
|
|
68
76
|
return {
|
|
69
77
|
noteHashTree: this.noteHashTree.toViem(),
|
|
@@ -116,6 +116,19 @@ export class ProposedBlockHeader {
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
static random(): ProposedBlockHeader {
|
|
120
|
+
return new ProposedBlockHeader(
|
|
121
|
+
Fr.random(),
|
|
122
|
+
ContentCommitment.random(),
|
|
123
|
+
new Fr(BigInt(Math.floor(Math.random() * 1000) + 1)),
|
|
124
|
+
BigInt(Math.floor(Date.now() / 1000)),
|
|
125
|
+
EthAddress.random(),
|
|
126
|
+
new AztecAddress(Fr.random()),
|
|
127
|
+
GasFees.random(),
|
|
128
|
+
new Fr(BigInt(Math.floor(Math.random() * 1000000))),
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
119
132
|
isEmpty(): boolean {
|
|
120
133
|
return (
|
|
121
134
|
this.lastArchiveRoot.isZero() &&
|
|
@@ -78,6 +78,10 @@ export class StateReference {
|
|
|
78
78
|
return new StateReference(AppendOnlyTreeSnapshot.empty(), PartialStateReference.empty());
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
static random(): StateReference {
|
|
82
|
+
return new StateReference(AppendOnlyTreeSnapshot.random(), PartialStateReference.random());
|
|
83
|
+
}
|
|
84
|
+
|
|
81
85
|
toViem(): ViemStateReference {
|
|
82
86
|
return {
|
|
83
87
|
l1ToL2MessageTree: this.l1ToL2MessageTree.toViem(),
|
|
@@ -43,7 +43,7 @@ export class UpdateChecker extends EventEmitter<EventMap> {
|
|
|
43
43
|
private rollupVersion: bigint,
|
|
44
44
|
private fetch: typeof globalThis.fetch,
|
|
45
45
|
private getLatestRollupVersion: () => Promise<bigint>,
|
|
46
|
-
private checkIntervalMs = 60_000, // every
|
|
46
|
+
private checkIntervalMs = 10 * 60_000, // every 10 mins
|
|
47
47
|
private log = createLogger('foundation:update-check'),
|
|
48
48
|
) {
|
|
49
49
|
super();
|