@aztec/stdlib 0.85.0 → 0.86.0-nightly.20250425
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/l2_block.js +1 -1
- package/dest/interfaces/aztec-node-admin.d.ts +3 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +1 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/prover-coordination.d.ts +4 -9
- package/dest/interfaces/prover-coordination.d.ts.map +1 -1
- package/dest/interfaces/prover-coordination.js +1 -7
- package/dest/kernel/private_kernel_data.d.ts +3 -3
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +8 -8
- package/dest/kernel/private_kernel_prover_output.d.ts +6 -2
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.js +17 -1
- package/dest/kernel/private_kernel_simulated_output.d.ts +3 -3
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/p2p/block_attestation.d.ts +4 -3
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +4 -4
- package/dest/p2p/block_proposal.d.ts +4 -3
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +5 -5
- package/dest/p2p/consensus_payload.d.ts +1 -1
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +2 -3
- package/dest/p2p/gossipable.d.ts +2 -1
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/interface.d.ts +0 -13
- package/dest/p2p/interface.d.ts.map +1 -1
- package/dest/p2p/interface.js +1 -19
- package/dest/p2p/signature_utils.d.ts +3 -3
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +4 -4
- package/dest/p2p/topic_type.d.ts +2 -2
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +4 -4
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts +0 -16
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.js +2 -10
- package/dest/rollup/block_root_rollup.d.ts +9 -1
- package/dest/rollup/block_root_rollup.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup.js +6 -1
- package/dest/rollup/root_rollup.d.ts +2 -4
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +3 -9
- package/dest/snapshots/download.d.ts +1 -1
- package/dest/snapshots/download.d.ts.map +1 -1
- package/dest/snapshots/download.js +3 -3
- package/dest/snapshots/index.d.ts +1 -1
- package/dest/snapshots/index.d.ts.map +1 -1
- package/dest/snapshots/index.js +1 -1
- package/dest/snapshots/types.d.ts +27 -4
- package/dest/snapshots/types.d.ts.map +1 -1
- package/dest/snapshots/types.js +8 -0
- package/dest/snapshots/upload.d.ts +6 -3
- package/dest/snapshots/upload.d.ts.map +1 -1
- package/dest/snapshots/upload.js +10 -6
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +3 -3
- package/dest/tests/mocks.d.ts +2 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +6 -6
- package/dest/tx/block_header.d.ts +1 -0
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +3 -0
- package/dest/tx/profiled_tx.d.ts.map +1 -1
- package/dest/tx/profiled_tx.js +2 -1
- package/dest/tx/tx.d.ts +2 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +2 -6
- package/package.json +7 -8
- package/src/block/l2_block.ts +1 -1
- package/src/interfaces/aztec-node-admin.ts +1 -1
- package/src/interfaces/aztec-node.ts +1 -3
- package/src/interfaces/prover-coordination.ts +6 -16
- package/src/kernel/private_kernel_data.ts +6 -6
- package/src/kernel/private_kernel_prover_output.ts +18 -2
- package/src/kernel/private_kernel_simulated_output.ts +3 -3
- package/src/p2p/block_attestation.ts +5 -8
- package/src/p2p/block_proposal.ts +5 -8
- package/src/p2p/consensus_payload.ts +3 -9
- package/src/p2p/gossipable.ts +3 -1
- package/src/p2p/interface.ts +0 -24
- package/src/p2p/signature_utils.ts +6 -9
- package/src/p2p/topic_type.ts +4 -4
- package/src/rollup/block_root_or_block_merge_public_inputs.ts +0 -12
- package/src/rollup/block_root_rollup.ts +6 -0
- package/src/rollup/root_rollup.ts +0 -8
- package/src/snapshots/download.ts +3 -4
- package/src/snapshots/index.ts +1 -1
- package/src/snapshots/types.ts +12 -0
- package/src/snapshots/upload.ts +19 -11
- package/src/tests/factories.ts +11 -14
- package/src/tests/mocks.ts +6 -6
- package/src/tx/block_header.ts +4 -0
- package/src/tx/profiled_tx.ts +1 -0
- package/src/tx/tx.ts +2 -7
package/dest/tests/factories.js
CHANGED
|
@@ -426,7 +426,7 @@ export function makeScopedL2ToL1Message(seed = 1) {
|
|
|
426
426
|
* @param blockNumber - The block number to use for generating the block merge or block root rollup circuit public inputs.
|
|
427
427
|
* @returns A block merge or block root rollup circuit public inputs.
|
|
428
428
|
*/ export function makeBlockRootOrBlockMergeRollupPublicInputs(seed = 0, globalVariables = undefined) {
|
|
429
|
-
return new BlockRootOrBlockMergePublicInputs(makeAppendOnlyTreeSnapshot(seed + 0x200), makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
429
|
+
return new BlockRootOrBlockMergePublicInputs(makeAppendOnlyTreeSnapshot(seed + 0x200), makeAppendOnlyTreeSnapshot(seed + 0x300), globalVariables ?? makeGlobalVariables(seed + 0x400), globalVariables ?? makeGlobalVariables(seed + 0x500), fr(seed + 0x600), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeFeeRecipient(seed), 0x700), fr(seed + 0x800), fr(seed + 0x801), fr(seed + 0x900), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeBlockBlobPublicInputs(seed), 0x100));
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
432
432
|
* Makes arbitrary previous rollup data.
|
|
@@ -456,7 +456,7 @@ export function makeScopedL2ToL1Message(seed = 1) {
|
|
|
456
456
|
], fr(seed + 0x2000));
|
|
457
457
|
}
|
|
458
458
|
function makeBlockRootRollupData(seed = 0) {
|
|
459
|
-
return new BlockRootRollupData(makeRootParityInput(NESTED_RECURSIVE_PROOF_LENGTH, seed + 0x2000), makeTuple(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, fr, 0x2100), makeTuple(ARCHIVE_HEIGHT, fr, 0x2200), makeHeader(seed +
|
|
459
|
+
return new BlockRootRollupData(makeRootParityInput(NESTED_RECURSIVE_PROOF_LENGTH, seed + 0x2000), makeTuple(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, fr, 0x2100), makeTuple(ARCHIVE_HEIGHT, fr, 0x2200), makeTuple(ARCHIVE_HEIGHT, fr, 0x2300), makeHeader(seed + 0x2400), fr(seed + 0x2500));
|
|
460
460
|
}
|
|
461
461
|
function makeBlockRootRollupBlobData(seed = 0) {
|
|
462
462
|
return new BlockRootRollupBlobData(makeTuple(FIELDS_PER_BLOB * BLOBS_PER_BLOCK, fr, 0x2500), makeTuple(BLOBS_PER_BLOCK, ()=>makeTuple(2, fr, 0x2600)), fr(seed + 0x2700));
|
|
@@ -503,7 +503,7 @@ export function makeRootParityInputs(seed = 0) {
|
|
|
503
503
|
* @param blockNumber - The block number to use in the global variables of a header.
|
|
504
504
|
* @returns A root rollup public inputs.
|
|
505
505
|
*/ export function makeRootRollupPublicInputs(seed = 0) {
|
|
506
|
-
return new RootRollupPublicInputs(makeAppendOnlyTreeSnapshot(seed +
|
|
506
|
+
return new RootRollupPublicInputs(makeAppendOnlyTreeSnapshot(seed + 0x100), makeAppendOnlyTreeSnapshot(seed + 0x200), fr(seed + 0x300), fr(seed + 0x400), fr(seed + 0x500), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeFeeRecipient(seed), 0x600), fr(seed + 0x700), fr(seed + 0x701), fr(seed + 0x702), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeBlockBlobPublicInputs(seed), 0x800));
|
|
507
507
|
}
|
|
508
508
|
/**
|
|
509
509
|
* Makes content commitment
|
package/dest/tests/mocks.d.ts
CHANGED
|
@@ -40,6 +40,6 @@ export interface MakeConsensusPayloadOptions {
|
|
|
40
40
|
archive?: Fr;
|
|
41
41
|
txHashes?: TxHash[];
|
|
42
42
|
}
|
|
43
|
-
export declare const makeBlockProposal: (options?: MakeConsensusPayloadOptions) =>
|
|
44
|
-
export declare const makeBlockAttestation: (options?: MakeConsensusPayloadOptions) =>
|
|
43
|
+
export declare const makeBlockProposal: (options?: MakeConsensusPayloadOptions) => BlockProposal;
|
|
44
|
+
export declare const makeBlockAttestation: (options?: MakeConsensusPayloadOptions) => BlockAttestation;
|
|
45
45
|
//# sourceMappingURL=mocks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/tests/mocks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAS7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MA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Y,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,gBAqDF,CAAC;AAEF,eAAO,MAAM,eAAe,gCAC2E,CAAC;AAkBxG,eAAO,MAAM,eAAe,gDAgB3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,gBAWxC,CAAC;AAEH,eAAO,MAAM,iCAAiC,UACtC;IAAE,eAAe,CAAC,EAAE,EAAE,CAAA;CAAE,YACpB,YAAY,KACrB,QAAQ,2BAA2B,CAUrC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;EAIlC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,EAAE,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAyBD,eAAO,MAAM,iBAAiB,aAAc,2BAA2B,KAAG,aAGzE,CAAC;AAGF,eAAO,MAAM,oBAAoB,aAAc,2BAA2B,KAAG,gBAG5E,CAAC"}
|
package/dest/tests/mocks.js
CHANGED
|
@@ -117,7 +117,7 @@ export const randomDeployedContract = async ()=>{
|
|
|
117
117
|
})
|
|
118
118
|
};
|
|
119
119
|
};
|
|
120
|
-
const makeAndSignConsensusPayload =
|
|
120
|
+
const makeAndSignConsensusPayload = (domainSeparator, options)=>{
|
|
121
121
|
const { signer = Secp256k1Signer.random(), header = makeHeader(1), archive = Fr.random(), txHashes = [
|
|
122
122
|
0,
|
|
123
123
|
1,
|
|
@@ -131,19 +131,19 @@ const makeAndSignConsensusPayload = async (domainSeparator, options)=>{
|
|
|
131
131
|
archive,
|
|
132
132
|
txHashes
|
|
133
133
|
});
|
|
134
|
-
const hash =
|
|
134
|
+
const hash = getHashedSignaturePayloadEthSignedMessage(payload, domainSeparator);
|
|
135
135
|
const signature = signer.sign(hash);
|
|
136
136
|
return {
|
|
137
137
|
payload,
|
|
138
138
|
signature
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
export const makeBlockProposal =
|
|
142
|
-
const { payload, signature } =
|
|
141
|
+
export const makeBlockProposal = (options)=>{
|
|
142
|
+
const { payload, signature } = makeAndSignConsensusPayload(SignatureDomainSeparator.blockProposal, options);
|
|
143
143
|
return new BlockProposal(payload, signature);
|
|
144
144
|
};
|
|
145
145
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8028)
|
|
146
|
-
export const makeBlockAttestation =
|
|
147
|
-
const { payload, signature } =
|
|
146
|
+
export const makeBlockAttestation = (options)=>{
|
|
147
|
+
const { payload, signature } = makeAndSignConsensusPayload(SignatureDomainSeparator.blockAttestation, options);
|
|
148
148
|
return new BlockAttestation(payload, signature);
|
|
149
149
|
};
|
|
@@ -41,6 +41,7 @@ export declare class BlockHeader {
|
|
|
41
41
|
static getFields(fields: FieldsOf<BlockHeader>): readonly [AppendOnlyTreeSnapshot, ContentCommitment, StateReference, GlobalVariables, Fr, Fr];
|
|
42
42
|
static from(fields: FieldsOf<BlockHeader>): BlockHeader;
|
|
43
43
|
getSlot(): bigint;
|
|
44
|
+
getBlockNumber(): number;
|
|
44
45
|
getSize(): number;
|
|
45
46
|
toBuffer(): Buffer;
|
|
46
47
|
toFields(): Fr[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_header.d.ts","sourceRoot":"","sources":["../../src/tx/block_header.ts"],"names":[],"mappings":";;;AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,sBAAsB,EAAE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BAAiB,EAAE,iBAAiB;IAC3C,uBAAuB;IAChB,KAAK,EAAE,cAAc;IAC5B,uCAAuC;IAChC,eAAe,EAAE,eAAe;IACvC,mEAAmE;IAC5D,SAAS,EAAE,EAAE;IACpB,wEAAwE;IACjE,aAAa,EAAE,EAAE;IAG1B,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,WAAW,CAAC,CAWvC;IAED,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC;IAY9C,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC;IAIzC,OAAO;IAIP,cAAc;IAId,OAAO;IAWP,QAAQ;IAIR,QAAQ,IAAI,EAAE,EAAE;IAQhB,KAAK,IAAI,WAAW;IAIpB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,WAAW;IAa7D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,WAAW;IAa1D,MAAM,CAAC,KAAK,CAAC,MAAM,GAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAM,GAAG,WAAW;IAYtE,OAAO,IAAI,OAAO;IAWlB;;;OAGG;IACI,QAAQ;IAIf,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAI3C,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;IAInB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWT,CAAC,OAAO,CAAC,MAAM,CAAC;IAiBT,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAUpC"}
|
package/dest/tx/block_header.js
CHANGED
|
@@ -52,6 +52,9 @@ import { StateReference } from './state_reference.js';
|
|
|
52
52
|
getSlot() {
|
|
53
53
|
return this.globalVariables.slotNumber.toBigInt();
|
|
54
54
|
}
|
|
55
|
+
getBlockNumber() {
|
|
56
|
+
return this.globalVariables.blockNumber.toNumber();
|
|
57
|
+
}
|
|
55
58
|
getSize() {
|
|
56
59
|
return this.lastArchive.getSize() + this.contentCommitment.getSize() + this.state.getSize() + this.globalVariables.getSize() + this.totalFees.size + this.totalManaUsed.size;
|
|
57
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiled_tx.d.ts","sourceRoot":"","sources":["../../src/tx/profiled_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,2CAA2C,CAAC;AAElH,qBAAa,eAAe;IACP,cAAc,EAAE,oBAAoB,EAAE;gBAAtC,cAAc,EAAE,oBAAoB,EAAE;IAEzD,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,eAAe,CAAC,CAM3C;IAED,MAAM,CAAC,MAAM,IAAI,eAAe;
|
|
1
|
+
{"version":3,"file":"profiled_tx.d.ts","sourceRoot":"","sources":["../../src/tx/profiled_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,2CAA2C,CAAC;AAElH,qBAAa,eAAe;IACP,cAAc,EAAE,oBAAoB,EAAE;gBAAtC,cAAc,EAAE,oBAAoB,EAAE;IAEzD,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,eAAe,CAAC,CAM3C;IAED,MAAM,CAAC,MAAM,IAAI,eAAe;CAUjC"}
|
package/dest/tx/profiled_tx.js
CHANGED
package/dest/tx/tx.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { ScopedLogHash } from '../kernel/log_hash.js';
|
|
|
12
12
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
13
13
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
14
14
|
import { Gossipable } from '../p2p/gossipable.js';
|
|
15
|
+
import { TopicType } from '../p2p/topic_type.js';
|
|
15
16
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
16
17
|
import type { TxStats } from '../stats/stats.js';
|
|
17
18
|
import { HashedValues } from './hashed_values.js';
|
|
@@ -39,7 +40,7 @@ export declare class Tx extends Gossipable {
|
|
|
39
40
|
* An array of calldata for the enqueued public function calls and the teardown function call.
|
|
40
41
|
*/
|
|
41
42
|
publicFunctionCalldata: HashedValues[];
|
|
42
|
-
static p2pTopic:
|
|
43
|
+
static p2pTopic: TopicType;
|
|
43
44
|
private txHash;
|
|
44
45
|
private calldataMap;
|
|
45
46
|
constructor(
|
package/dest/tx/tx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../src/tx/tx.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAyD,MAAM,6BAA6B,CAAC;AAClH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tx.d.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I,EAAE,MAAM;IAItB,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC;IAUnC,mCAAmC;IAC7B,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAmBlC,OAAO;IASP;;;OAGG;IACH,gCAAgC;IAShC;;;;OAIG;WACU,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD;;;;OAIG;WACU,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIhE;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE;IAaxB;;;;OAIG;WACU,MAAM,CAAC,WAAW,UAAQ;IASvC;;;;;;;;;;;;;OAaG;IACU,kBAAkB;CAWhC;AAED,uEAAuE;AACvE,KAAK,OAAO,GAAG;IAAqB,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dest/tx/tx.js
CHANGED
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
7
7
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
8
8
|
import { Gossipable } from '../p2p/gossipable.js';
|
|
9
|
-
import { TopicType
|
|
9
|
+
import { TopicType } from '../p2p/topic_type.js';
|
|
10
10
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
11
11
|
import { HashedValues } from './hashed_values.js';
|
|
12
12
|
import { PublicCallRequestWithCalldata } from './public_call_request_with_calldata.js';
|
|
@@ -18,7 +18,7 @@ import { TxHash } from './tx_hash.js';
|
|
|
18
18
|
clientIvcProof;
|
|
19
19
|
contractClassLogs;
|
|
20
20
|
publicFunctionCalldata;
|
|
21
|
-
static p2pTopic;
|
|
21
|
+
static p2pTopic = TopicType.tx;
|
|
22
22
|
// For memoization
|
|
23
23
|
txHash;
|
|
24
24
|
calldataMap;
|
|
@@ -35,10 +35,6 @@ import { TxHash } from './tx_hash.js';
|
|
|
35
35
|
super(), this.data = data, this.clientIvcProof = clientIvcProof, this.contractClassLogs = contractClassLogs, this.publicFunctionCalldata = publicFunctionCalldata;
|
|
36
36
|
}
|
|
37
37
|
// Gossipable method
|
|
38
|
-
static{
|
|
39
|
-
this.p2pTopic = createTopicString(TopicType.tx);
|
|
40
|
-
}
|
|
41
|
-
// Gossipable method
|
|
42
38
|
async p2pMessageIdentifier() {
|
|
43
39
|
return new Buffer32((await this.getTxHash()).toBuffer());
|
|
44
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0-nightly.20250425",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -63,16 +63,15 @@
|
|
|
63
63
|
"generate": "./scripts/copy-contracts.sh",
|
|
64
64
|
"build:dev": "tsc -b --watch",
|
|
65
65
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
66
|
-
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
67
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
68
66
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
69
67
|
},
|
|
70
68
|
"dependencies": {
|
|
71
|
-
"@aztec/bb.js": "0.
|
|
72
|
-
"@aztec/blob-lib": "0.
|
|
73
|
-
"@aztec/constants": "0.
|
|
74
|
-
"@aztec/ethereum": "0.
|
|
75
|
-
"@aztec/foundation": "0.
|
|
69
|
+
"@aztec/bb.js": "0.86.0-nightly.20250425",
|
|
70
|
+
"@aztec/blob-lib": "0.86.0-nightly.20250425",
|
|
71
|
+
"@aztec/constants": "0.86.0-nightly.20250425",
|
|
72
|
+
"@aztec/ethereum": "0.86.0-nightly.20250425",
|
|
73
|
+
"@aztec/foundation": "0.86.0-nightly.20250425",
|
|
74
|
+
"@aztec/noir-noirc_abi": "0.86.0-nightly.20250425",
|
|
76
75
|
"@google-cloud/storage": "^7.15.0",
|
|
77
76
|
"lodash.chunk": "^4.2.0",
|
|
78
77
|
"lodash.isequal": "^4.5.0",
|
package/src/block/l2_block.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface AztecNodeAdmin {
|
|
|
15
15
|
* Updates the configuration of this node.
|
|
16
16
|
* @param config - Updated configuration to be merged with the current one.
|
|
17
17
|
*/
|
|
18
|
-
setConfig(config: Partial<SequencerConfig & ProverConfig>): Promise<void>;
|
|
18
|
+
setConfig(config: Partial<SequencerConfig & ProverConfig & { maxTxPoolSize: number }>): Promise<void>;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Forces the next block to be built bypassing all time and pending checks.
|
|
@@ -56,7 +56,6 @@ import {
|
|
|
56
56
|
type GetPublicLogsResponse,
|
|
57
57
|
GetPublicLogsResponseSchema,
|
|
58
58
|
} from './get_logs_response.js';
|
|
59
|
-
import type { ProverCoordination } from './prover-coordination.js';
|
|
60
59
|
import { type WorldStateSyncStatus, WorldStateSyncStatusSchema } from './world_state.js';
|
|
61
60
|
|
|
62
61
|
/**
|
|
@@ -64,8 +63,7 @@ import { type WorldStateSyncStatus, WorldStateSyncStatusSchema } from './world_s
|
|
|
64
63
|
* We will probably implement the additional interfaces by means other than Aztec Node as it's currently a privacy leak
|
|
65
64
|
*/
|
|
66
65
|
export interface AztecNode
|
|
67
|
-
extends
|
|
68
|
-
Pick<L2BlockSource, 'getBlocks' | 'getPublishedBlocks' | 'getBlockHeader' | 'getL2Tips'> {
|
|
66
|
+
extends Pick<L2BlockSource, 'getBlocks' | 'getPublishedBlocks' | 'getBlockHeader' | 'getL2Tips'> {
|
|
69
67
|
/**
|
|
70
68
|
* Returns the tips of the L2 chain.
|
|
71
69
|
*/
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
import type { ApiSchemaFor } from '../schemas/index.js';
|
|
4
1
|
import { Tx } from '../tx/tx.js';
|
|
5
2
|
import { TxHash } from '../tx/tx_hash.js';
|
|
3
|
+
import type { P2PClient } from './p2p.js';
|
|
6
4
|
|
|
7
5
|
/** Provides basic operations for ProverNodes to interact with other nodes in the network. */
|
|
8
6
|
export interface ProverCoordination {
|
|
9
|
-
/**
|
|
10
|
-
* Returns a transaction given its hash if available.
|
|
11
|
-
* @param txHash - The hash of the transaction, used as an ID.
|
|
12
|
-
* @returns The transaction, if found, 'undefined' otherwise.
|
|
13
|
-
*/
|
|
14
|
-
getTxByHash(txHash: TxHash): Promise<Tx | undefined>;
|
|
15
|
-
|
|
16
7
|
/**
|
|
17
8
|
* Returns a set of transactions given their hashes if available.
|
|
18
9
|
* @param txHashes - The hashes of the transactions, used as an ID.
|
|
19
|
-
* @returns The transactions
|
|
10
|
+
* @returns The transactions found, no necessarily in the same order as the hashes.
|
|
20
11
|
*/
|
|
21
12
|
getTxsByHash(txHashes: TxHash[]): Promise<Tx[]>;
|
|
22
|
-
}
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
14
|
+
gatherTxs(txHashes: TxHash[]): Promise<void>;
|
|
15
|
+
|
|
16
|
+
getP2PClient(): P2PClient | undefined;
|
|
17
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
5
|
|
|
6
6
|
import type { UInt32 } from '../types/shared.js';
|
|
7
|
-
import {
|
|
7
|
+
import { VerificationKeyData } from '../vks/verification_key.js';
|
|
8
8
|
import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -21,7 +21,7 @@ export class PrivateKernelData {
|
|
|
21
21
|
/**
|
|
22
22
|
* Verification key of the previous kernel.
|
|
23
23
|
*/
|
|
24
|
-
public
|
|
24
|
+
public verificationKey: VerificationKeyData,
|
|
25
25
|
/**
|
|
26
26
|
* Index of the previous kernel's vk in a tree of vks.
|
|
27
27
|
*/
|
|
@@ -37,14 +37,14 @@ export class PrivateKernelData {
|
|
|
37
37
|
* @returns The buffer.
|
|
38
38
|
*/
|
|
39
39
|
toBuffer() {
|
|
40
|
-
return serializeToBuffer(this.publicInputs, this.
|
|
40
|
+
return serializeToBuffer(this.publicInputs, this.verificationKey, this.vkIndex, this.vkPath);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelData {
|
|
44
44
|
const reader = BufferReader.asReader(buffer);
|
|
45
45
|
return new this(
|
|
46
46
|
reader.readObject(PrivateKernelCircuitPublicInputs),
|
|
47
|
-
reader.readObject(
|
|
47
|
+
reader.readObject(VerificationKeyData),
|
|
48
48
|
reader.readNumber(),
|
|
49
49
|
reader.readArray(VK_TREE_HEIGHT, Fr),
|
|
50
50
|
);
|
|
@@ -53,7 +53,7 @@ export class PrivateKernelData {
|
|
|
53
53
|
static empty(): PrivateKernelData {
|
|
54
54
|
return new PrivateKernelData(
|
|
55
55
|
PrivateKernelCircuitPublicInputs.empty(),
|
|
56
|
-
|
|
56
|
+
VerificationKeyData.empty(),
|
|
57
57
|
0,
|
|
58
58
|
makeTuple(VK_TREE_HEIGHT, Fr.zero),
|
|
59
59
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { bufferSchema, mapSchema } from '@aztec/foundation/schemas';
|
|
2
2
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
3
|
+
import { serializeWitness } from '@aztec/noir-noirc_abi';
|
|
3
4
|
|
|
5
|
+
import { Encoder } from 'msgpackr';
|
|
4
6
|
import { z } from 'zod';
|
|
5
7
|
|
|
6
8
|
import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
7
|
-
import type { VerificationKeyAsFields } from '../vks/verification_key.js';
|
|
8
9
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
9
10
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
10
11
|
|
|
@@ -13,6 +14,7 @@ export const PrivateExecutionStepSchema = z.object({
|
|
|
13
14
|
gateCount: z.number().optional(),
|
|
14
15
|
bytecode: bufferSchema,
|
|
15
16
|
witness: mapSchema(z.number(), z.string()),
|
|
17
|
+
vk: bufferSchema,
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -23,6 +25,8 @@ export interface PrivateExecutionStep {
|
|
|
23
25
|
gateCount?: number;
|
|
24
26
|
bytecode: Buffer;
|
|
25
27
|
witness: WitnessMap;
|
|
28
|
+
/* TODO(https://github.com/AztecProtocol/barretenberg/issues/1328) this should get its own proper class. */
|
|
29
|
+
vk: Buffer;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
/** Represents the output of proven PrivateKernelSimulateOutput.*/
|
|
@@ -34,7 +38,7 @@ export interface PrivateKernelExecutionProofOutput<
|
|
|
34
38
|
/** The private IVC proof optimized for user devices. It will be consumed by an Aztec prover,
|
|
35
39
|
* which recursively verifies it through the "tube" circuit.*/
|
|
36
40
|
clientIvcProof: ClientIvcProof;
|
|
37
|
-
|
|
41
|
+
vk: Buffer;
|
|
38
42
|
/**
|
|
39
43
|
* The trace the clientIvcProof corresponds to.
|
|
40
44
|
* A trace of app circuits interleaved with private kernel circuits.
|
|
@@ -42,3 +46,15 @@ export interface PrivateKernelExecutionProofOutput<
|
|
|
42
46
|
*/
|
|
43
47
|
executionSteps: PrivateExecutionStep[];
|
|
44
48
|
}
|
|
49
|
+
|
|
50
|
+
export function serializePrivateExecutionSteps(steps: PrivateExecutionStep[]) {
|
|
51
|
+
const stepToStruct = (step: PrivateExecutionStep) => {
|
|
52
|
+
return {
|
|
53
|
+
bytecode: step.bytecode,
|
|
54
|
+
witness: serializeWitness(step.witness),
|
|
55
|
+
vk: step.vk,
|
|
56
|
+
functionName: step.functionName,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
return new Encoder({ useRecords: false }).pack(steps.map(stepToStruct));
|
|
60
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { VerificationKeyData } from '../vks/verification_key.js';
|
|
4
4
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
5
5
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ export interface PrivateKernelSimulateOutput<
|
|
|
14
14
|
/** The public inputs required for the proof generation process. */
|
|
15
15
|
publicInputs: PublicInputsType;
|
|
16
16
|
outputWitness: WitnessMap;
|
|
17
|
-
verificationKey:
|
|
17
|
+
verificationKey: VerificationKeyData;
|
|
18
18
|
bytecode: Buffer;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -22,5 +22,5 @@ export interface PrivateKernelSimulateOutput<
|
|
|
22
22
|
* Represents the output of the circuit simulation process for init and inner private kernel circuit.
|
|
23
23
|
*/
|
|
24
24
|
export type AppCircuitSimulateOutput = {
|
|
25
|
-
verificationKey:
|
|
25
|
+
verificationKey: VerificationKeyData;
|
|
26
26
|
};
|
|
@@ -11,7 +11,7 @@ import type { ZodFor } from '../schemas/index.js';
|
|
|
11
11
|
import { ConsensusPayload } from './consensus_payload.js';
|
|
12
12
|
import { Gossipable } from './gossipable.js';
|
|
13
13
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
|
|
14
|
-
import { TopicType
|
|
14
|
+
import { TopicType } from './topic_type.js';
|
|
15
15
|
|
|
16
16
|
export class BlockAttestationHash extends Buffer32 {
|
|
17
17
|
constructor(hash: Buffer) {
|
|
@@ -26,7 +26,7 @@ export class BlockAttestationHash extends Buffer32 {
|
|
|
26
26
|
* will produce a block attestation over the header of the block
|
|
27
27
|
*/
|
|
28
28
|
export class BlockAttestation extends Gossipable {
|
|
29
|
-
static override p2pTopic =
|
|
29
|
+
static override p2pTopic = TopicType.block_attestation;
|
|
30
30
|
|
|
31
31
|
private sender: EthAddress | undefined;
|
|
32
32
|
|
|
@@ -70,13 +70,10 @@ export class BlockAttestation extends Gossipable {
|
|
|
70
70
|
* Lazily evaluate and cache the sender of the attestation
|
|
71
71
|
* @returns The sender of the attestation
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
getSender(): EthAddress {
|
|
74
74
|
if (!this.sender) {
|
|
75
75
|
// Recover the sender from the attestation
|
|
76
|
-
const hashed =
|
|
77
|
-
this.payload,
|
|
78
|
-
SignatureDomainSeparator.blockAttestation,
|
|
79
|
-
);
|
|
76
|
+
const hashed = getHashedSignaturePayloadEthSignedMessage(this.payload, SignatureDomainSeparator.blockAttestation);
|
|
80
77
|
// Cache the sender for later use
|
|
81
78
|
this.sender = recoverAddress(hashed, this.signature);
|
|
82
79
|
}
|
|
@@ -84,7 +81,7 @@ export class BlockAttestation extends Gossipable {
|
|
|
84
81
|
return this.sender;
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
getPayload():
|
|
84
|
+
getPayload(): Buffer {
|
|
88
85
|
return this.payload.getPayloadToSign(SignatureDomainSeparator.blockAttestation);
|
|
89
86
|
}
|
|
90
87
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getHashedSignaturePayload,
|
|
13
13
|
getHashedSignaturePayloadEthSignedMessage,
|
|
14
14
|
} from './signature_utils.js';
|
|
15
|
-
import { TopicType
|
|
15
|
+
import { TopicType } from './topic_type.js';
|
|
16
16
|
|
|
17
17
|
export class BlockProposalHash extends Buffer32 {
|
|
18
18
|
constructor(hash: Buffer) {
|
|
@@ -27,7 +27,7 @@ export class BlockProposalHash extends Buffer32 {
|
|
|
27
27
|
* be included in the head of the chain
|
|
28
28
|
*/
|
|
29
29
|
export class BlockProposal extends Gossipable {
|
|
30
|
-
static override p2pTopic =
|
|
30
|
+
static override p2pTopic = TopicType.block_proposal;
|
|
31
31
|
|
|
32
32
|
private sender: EthAddress | undefined;
|
|
33
33
|
|
|
@@ -61,7 +61,7 @@ export class BlockProposal extends Gossipable {
|
|
|
61
61
|
payload: ConsensusPayload,
|
|
62
62
|
payloadSigner: (payload: Buffer32) => Promise<Signature>,
|
|
63
63
|
) {
|
|
64
|
-
const hashed =
|
|
64
|
+
const hashed = getHashedSignaturePayload(payload, SignatureDomainSeparator.blockProposal);
|
|
65
65
|
const sig = await payloadSigner(hashed);
|
|
66
66
|
|
|
67
67
|
return new BlockProposal(payload, sig);
|
|
@@ -70,12 +70,9 @@ export class BlockProposal extends Gossipable {
|
|
|
70
70
|
/**Get Sender
|
|
71
71
|
* Lazily evaluate the sender of the proposal; result is cached
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
getSender() {
|
|
74
74
|
if (!this.sender) {
|
|
75
|
-
const hashed =
|
|
76
|
-
this.payload,
|
|
77
|
-
SignatureDomainSeparator.blockProposal,
|
|
78
|
-
);
|
|
75
|
+
const hashed = getHashedSignaturePayloadEthSignedMessage(this.payload, SignatureDomainSeparator.blockProposal);
|
|
79
76
|
// Cache the sender for later use
|
|
80
77
|
this.sender = recoverAddress(hashed, this.signature);
|
|
81
78
|
}
|
|
@@ -38,18 +38,12 @@ export class ConsensusPayload implements Signable {
|
|
|
38
38
|
return [fields.header, fields.archive, fields.txHashes] as const;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
const abi = parseAbiParameters('uint8, (bytes32,
|
|
41
|
+
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
|
|
42
|
+
const abi = parseAbiParameters('uint8, (bytes32, (uint256), bytes, bytes32[])');
|
|
43
43
|
const txArray = this.txHashes.map(tx => tx.toString());
|
|
44
44
|
const encodedData = encodeAbiParameters(abi, [
|
|
45
45
|
domainSeparator,
|
|
46
|
-
[
|
|
47
|
-
this.archive.toString(),
|
|
48
|
-
(await this.header.hash()).toString(),
|
|
49
|
-
[0n] /* @todo See #9963 */,
|
|
50
|
-
this.header.toString(),
|
|
51
|
-
txArray,
|
|
52
|
-
],
|
|
46
|
+
[this.archive.toString(), [0n] /* @todo See #9963 */, this.header.toString(), txArray],
|
|
53
47
|
] as const);
|
|
54
48
|
|
|
55
49
|
return hexToBuffer(encodedData);
|
package/src/p2p/gossipable.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
|
|
3
|
+
import type { TopicType } from './topic_type.js';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Gossipable
|
|
5
7
|
*
|
|
@@ -10,7 +12,7 @@ export abstract class Gossipable {
|
|
|
10
12
|
*
|
|
11
13
|
* - The p2p topic identifier, this determines how the message is handled
|
|
12
14
|
*/
|
|
13
|
-
static p2pTopic:
|
|
15
|
+
static p2pTopic: TopicType;
|
|
14
16
|
|
|
15
17
|
/** p2p Message Identifier
|
|
16
18
|
*
|
package/src/p2p/interface.ts
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import { Tx } from '../tx/tx.js';
|
|
2
|
-
import { BlockAttestation } from './block_attestation.js';
|
|
3
|
-
import { BlockProposal } from './block_proposal.js';
|
|
4
|
-
import type { Gossipable } from './gossipable.js';
|
|
5
|
-
import { TopicType } from './topic_type.js';
|
|
6
|
-
|
|
7
1
|
export interface RawGossipMessage {
|
|
8
2
|
topic: string;
|
|
9
3
|
data: Uint8Array;
|
|
10
4
|
}
|
|
11
|
-
|
|
12
|
-
// Force casts as we know that each field here extends Gossipable, and we just want types from Gossipable
|
|
13
|
-
export const TopicTypeMap: Record<string, typeof Gossipable> = {
|
|
14
|
-
[TopicType.tx]: Tx as unknown as typeof Gossipable,
|
|
15
|
-
[TopicType.block_proposal]: BlockProposal as unknown as typeof Gossipable,
|
|
16
|
-
[TopicType.block_attestation]: BlockAttestation as unknown as typeof Gossipable,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Map from topic to deserialiser
|
|
21
|
-
*
|
|
22
|
-
* Used in msgIdFn libp2p to get the p2pMessageIdentifier from a message
|
|
23
|
-
*/
|
|
24
|
-
export const TopicToDeserializer = {
|
|
25
|
-
[Tx.p2pTopic]: Tx.fromBuffer,
|
|
26
|
-
[BlockProposal.p2pTopic]: BlockProposal.fromBuffer,
|
|
27
|
-
[BlockAttestation.p2pTopic]: BlockAttestation.fromBuffer,
|
|
28
|
-
};
|
|
@@ -7,7 +7,7 @@ export enum SignatureDomainSeparator {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface Signable {
|
|
10
|
-
getPayloadToSign(domainSeparator: SignatureDomainSeparator):
|
|
10
|
+
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -15,11 +15,8 @@ export interface Signable {
|
|
|
15
15
|
* @param s - The `Signable` to sign
|
|
16
16
|
* @returns The hashed payload for the signature of the `Signable`
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
19
|
-
s
|
|
20
|
-
domainSeparator: SignatureDomainSeparator,
|
|
21
|
-
): Promise<Buffer32> {
|
|
22
|
-
return Buffer32.fromBuffer(keccak256(await s.getPayloadToSign(domainSeparator)));
|
|
18
|
+
export function getHashedSignaturePayload(s: Signable, domainSeparator: SignatureDomainSeparator): Buffer32 {
|
|
19
|
+
return Buffer32.fromBuffer(keccak256(s.getPayloadToSign(domainSeparator)));
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
/**
|
|
@@ -27,10 +24,10 @@ export async function getHashedSignaturePayload(
|
|
|
27
24
|
* @param s - the `Signable` to sign
|
|
28
25
|
* @returns The hashed payload for the signature of the `Signable` as an Ethereum signed message
|
|
29
26
|
*/
|
|
30
|
-
export
|
|
27
|
+
export function getHashedSignaturePayloadEthSignedMessage(
|
|
31
28
|
s: Signable,
|
|
32
29
|
domainSeparator: SignatureDomainSeparator,
|
|
33
|
-
):
|
|
34
|
-
const payload =
|
|
30
|
+
): Buffer32 {
|
|
31
|
+
const payload = getHashedSignaturePayload(s, domainSeparator);
|
|
35
32
|
return makeEthSignDigest(payload);
|
|
36
33
|
}
|