@aztec/stdlib 5.0.0-nightly.20260413 → 5.0.0-nightly.20260415
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/abi/authorization_selector.d.ts +3 -6
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/event_selector.d.ts +3 -6
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +3 -6
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +1 -3
- package/dest/abi/note_selector.d.ts +3 -6
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.js +1 -3
- package/dest/aztec-address/index.d.ts +3 -6
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +2 -4
- package/dest/block/block_data.d.ts +8 -8
- package/dest/block/block_data.d.ts.map +1 -1
- package/dest/block/block_data.js +2 -2
- package/dest/block/block_hash.d.ts +11 -10
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +10 -9
- package/dest/block/l2_block_info.d.ts +6 -5
- package/dest/block/l2_block_info.d.ts.map +1 -1
- package/dest/block/l2_block_info.js +6 -5
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.js +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +1 -1
- package/dest/config/chain-config.d.ts +1 -1
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +7 -1
- package/dest/config/sequencer-config.js +4 -4
- package/dest/ha-signing/index.d.ts +2 -2
- package/dest/ha-signing/index.d.ts.map +1 -1
- package/dest/ha-signing/index.js +1 -1
- package/dest/ha-signing/local_config.js +1 -1
- package/dest/ha-signing/types.d.ts +37 -32
- package/dest/ha-signing/types.d.ts.map +1 -1
- package/dest/ha-signing/types.js +13 -6
- package/dest/interfaces/merkle_tree_operations.d.ts +4 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +1 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +0 -3
- package/dest/interfaces/validator.d.ts +7 -7
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +1 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +1 -2
- package/dest/logs/siloed_tag.d.ts +5 -7
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +4 -0
- package/dest/logs/tag.d.ts +5 -6
- package/dest/logs/tag.d.ts.map +1 -1
- package/dest/logs/tag.js +4 -0
- package/dest/p2p/block_proposal.d.ts +6 -8
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +4 -9
- package/dest/p2p/checkpoint_attestation.d.ts +4 -6
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +2 -7
- package/dest/p2p/checkpoint_proposal.d.ts +8 -10
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +4 -11
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +2 -2
- package/dest/tx/block_header.d.ts +2 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +1 -1
- package/dest/tx/indexed_tx_effect.d.ts +1 -1
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +1 -2
- package/dest/tx/tx.d.ts +3 -3
- package/dest/tx/tx.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/abi/authorization_selector.ts +2 -8
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_selector.ts +3 -12
- package/src/abi/note_selector.ts +3 -12
- package/src/aztec-address/index.ts +4 -10
- package/src/block/block_data.ts +3 -4
- package/src/block/block_hash.ts +21 -14
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_stream/l2_tips_store_base.ts +1 -1
- package/src/block/test/l2_tips_store_test_suite.ts +1 -1
- package/src/config/chain-config.ts +7 -1
- package/src/config/sequencer-config.ts +4 -4
- package/src/ha-signing/index.ts +3 -1
- package/src/ha-signing/local_config.ts +1 -1
- package/src/ha-signing/types.ts +48 -34
- package/src/interfaces/merkle_tree_operations.ts +3 -2
- package/src/interfaces/prover-client.ts +2 -5
- package/src/interfaces/validator.ts +14 -4
- package/src/logs/log_id.ts +1 -2
- package/src/logs/siloed_tag.ts +8 -9
- package/src/logs/tag.ts +8 -8
- package/src/p2p/block_proposal.ts +13 -9
- package/src/p2p/checkpoint_attestation.ts +5 -9
- package/src/p2p/checkpoint_proposal.ts +12 -11
- package/src/p2p/gossipable.ts +4 -4
- package/src/tests/mocks.ts +2 -0
- package/src/tx/block_header.ts +2 -2
- package/src/tx/indexed_tx_effect.ts +1 -2
- package/src/tx/tx.ts +2 -2
package/src/logs/log_id.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
2
2
|
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
3
3
|
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
4
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
4
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
6
5
|
|
|
7
6
|
import { z } from 'zod';
|
|
@@ -83,7 +82,7 @@ export class LogId {
|
|
|
83
82
|
const reader = BufferReader.asReader(buffer);
|
|
84
83
|
|
|
85
84
|
const blockNumber = BlockNumber(reader.readNumber());
|
|
86
|
-
const blockHash =
|
|
85
|
+
const blockHash = BlockHash.fromBuffer(reader);
|
|
87
86
|
const txHash = reader.readObject(TxHash);
|
|
88
87
|
const txIndex = reader.readNumber();
|
|
89
88
|
const logIndex = reader.readNumber();
|
package/src/logs/siloed_tag.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DomainSeparator } from '@aztec/constants';
|
|
2
|
-
import
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
4
4
|
|
|
5
5
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
@@ -8,19 +8,14 @@ import { schemas } from '../schemas/schemas.js';
|
|
|
8
8
|
import type { PreTag } from './pre_tag.js';
|
|
9
9
|
import { Tag } from './tag.js';
|
|
10
10
|
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
12
|
-
|
|
13
|
-
/** Branding to ensure fields are not interchangeable types. */
|
|
14
|
-
export interface SiloedTag {
|
|
15
|
-
/** Brand. */
|
|
16
|
-
_branding: 'SiloedTag';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
11
|
/**
|
|
20
12
|
* Represents a tag used in private log as it "appears on the chain" - that is the tag is siloed with a contract
|
|
21
13
|
* address that emitted the log.
|
|
22
14
|
*/
|
|
23
15
|
export class SiloedTag {
|
|
16
|
+
/** Branding for nominal typing. */
|
|
17
|
+
declare private readonly _branding: 'SiloedTag';
|
|
18
|
+
|
|
24
19
|
constructor(public readonly value: Fr) {}
|
|
25
20
|
|
|
26
21
|
static async compute(preTag: PreTag): Promise<SiloedTag> {
|
|
@@ -49,6 +44,10 @@ export class SiloedTag {
|
|
|
49
44
|
return this.value.equals(other.value);
|
|
50
45
|
}
|
|
51
46
|
|
|
47
|
+
static random(): SiloedTag {
|
|
48
|
+
return new SiloedTag(Fr.random());
|
|
49
|
+
}
|
|
50
|
+
|
|
52
51
|
static get schema(): ZodFor<SiloedTag> {
|
|
53
52
|
return schemas.Fr.transform((fr: Fr) => new SiloedTag(fr));
|
|
54
53
|
}
|
package/src/logs/tag.ts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
|
|
2
|
-
import
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
4
4
|
|
|
5
5
|
import { schemas } from '../schemas/schemas.js';
|
|
6
6
|
import type { PreTag } from './pre_tag.js';
|
|
7
7
|
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
9
|
-
|
|
10
|
-
export interface Tag {
|
|
11
|
-
/** Brand. */
|
|
12
|
-
_branding: 'Tag';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
8
|
/**
|
|
16
9
|
* Represents a tag of a private log. This is not the tag that "appears" on the chain as this tag is first siloed
|
|
17
10
|
* with a contract address by kernels before being included in the final log.
|
|
18
11
|
*/
|
|
19
12
|
export class Tag {
|
|
13
|
+
/** Branding for nominal typing. */
|
|
14
|
+
declare private readonly _branding: 'Tag';
|
|
15
|
+
|
|
20
16
|
constructor(public readonly value: Fr) {}
|
|
21
17
|
|
|
22
18
|
static async compute(preTag: PreTag): Promise<Tag> {
|
|
@@ -36,6 +32,10 @@ export class Tag {
|
|
|
36
32
|
return this.value.equals(other.value);
|
|
37
33
|
}
|
|
38
34
|
|
|
35
|
+
static random(): Tag {
|
|
36
|
+
return new Tag(Fr.random());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
39
|
static get schema(): ZodFor<Tag> {
|
|
40
40
|
return schemas.Fr.transform((fr: Fr) => new Tag(fr));
|
|
41
41
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
BlockNumber,
|
|
3
|
+
BlockProposalHash,
|
|
4
|
+
type CheckpointNumber,
|
|
5
|
+
IndexWithinCheckpoint,
|
|
6
|
+
SlotNumber,
|
|
7
|
+
} from '@aztec/foundation/branded-types';
|
|
8
|
+
import { type BaseBuffer32, Buffer32 } from '@aztec/foundation/buffer';
|
|
3
9
|
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
4
10
|
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
5
11
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -23,11 +29,7 @@ import {
|
|
|
23
29
|
import { SignedTxs } from './signed_txs.js';
|
|
24
30
|
import { TopicType } from './topic_type.js';
|
|
25
31
|
|
|
26
|
-
export
|
|
27
|
-
constructor(hash: Buffer) {
|
|
28
|
-
super(hash);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
32
|
+
export type { BlockProposalHash } from '@aztec/foundation/branded-types';
|
|
31
33
|
|
|
32
34
|
export type BlockProposalOptions = {
|
|
33
35
|
/**
|
|
@@ -77,8 +79,8 @@ export class BlockProposal extends Gossipable {
|
|
|
77
79
|
super();
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
override generateP2PMessageIdentifier(): Promise<
|
|
81
|
-
return Promise.resolve(
|
|
82
|
+
override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
|
|
83
|
+
return Promise.resolve(BlockProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
get archive(): Fr {
|
|
@@ -126,6 +128,7 @@ export class BlockProposal extends Gossipable {
|
|
|
126
128
|
|
|
127
129
|
static async createProposalFromSigner(
|
|
128
130
|
blockHeader: BlockHeader,
|
|
131
|
+
checkpointNumber: CheckpointNumber,
|
|
129
132
|
indexWithinCheckpoint: IndexWithinCheckpoint,
|
|
130
133
|
inHash: Fr,
|
|
131
134
|
archiveRoot: Fr,
|
|
@@ -147,6 +150,7 @@ export class BlockProposal extends Gossipable {
|
|
|
147
150
|
const blockContext: SigningContext = {
|
|
148
151
|
slot: blockHeader.globalVariables.slotNumber,
|
|
149
152
|
blockNumber: blockHeader.globalVariables.blockNumber,
|
|
153
|
+
checkpointNumber,
|
|
150
154
|
blockIndexWithinCheckpoint: indexWithinCheckpoint,
|
|
151
155
|
dutyType: DutyType.BLOCK_PROPOSAL,
|
|
152
156
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import {
|
|
1
|
+
import { CheckpointAttestationHash, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { BaseBuffer32 } from '@aztec/foundation/buffer';
|
|
3
3
|
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
4
4
|
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
5
5
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -16,11 +16,7 @@ import { Gossipable } from './gossipable.js';
|
|
|
16
16
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
|
|
17
17
|
import { TopicType } from './topic_type.js';
|
|
18
18
|
|
|
19
|
-
export
|
|
20
|
-
constructor(hash: Buffer) {
|
|
21
|
-
super(hash);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
19
|
+
export type { CheckpointAttestationHash } from '@aztec/foundation/branded-types';
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* CheckpointAttestation
|
|
@@ -57,8 +53,8 @@ export class CheckpointAttestation extends Gossipable {
|
|
|
57
53
|
.transform(obj => new CheckpointAttestation(obj.payload, obj.signature, obj.proposerSignature));
|
|
58
54
|
}
|
|
59
55
|
|
|
60
|
-
override generateP2PMessageIdentifier(): Promise<
|
|
61
|
-
return Promise.resolve(
|
|
56
|
+
override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
|
|
57
|
+
return Promise.resolve(CheckpointAttestationHash.fromBuffer(keccak256(this.signature.toBuffer())));
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
get archive(): Fr {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
type CheckpointNumber,
|
|
3
|
+
CheckpointProposalHash,
|
|
4
|
+
IndexWithinCheckpoint,
|
|
5
|
+
SlotNumber,
|
|
6
|
+
} from '@aztec/foundation/branded-types';
|
|
7
|
+
import { type BaseBuffer32, Buffer32 } from '@aztec/foundation/buffer';
|
|
3
8
|
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
4
9
|
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
5
10
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -24,12 +29,7 @@ import {
|
|
|
24
29
|
import { SignedTxs } from './signed_txs.js';
|
|
25
30
|
import { TopicType } from './topic_type.js';
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
export class CheckpointProposalHash extends Buffer32 {
|
|
29
|
-
constructor(hash: Buffer) {
|
|
30
|
-
super(hash);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
32
|
+
export type { CheckpointProposalHash } from '@aztec/foundation/branded-types';
|
|
33
33
|
|
|
34
34
|
export type CheckpointProposalOptions = {
|
|
35
35
|
/**
|
|
@@ -93,8 +93,8 @@ export class CheckpointProposal extends Gossipable {
|
|
|
93
93
|
super();
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
override generateP2PMessageIdentifier(): Promise<
|
|
97
|
-
return Promise.resolve(
|
|
96
|
+
override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
|
|
97
|
+
return Promise.resolve(CheckpointProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
get slotNumber(): SlotNumber {
|
|
@@ -160,6 +160,7 @@ export class CheckpointProposal extends Gossipable {
|
|
|
160
160
|
static async createProposalFromSigner(
|
|
161
161
|
checkpointHeader: CheckpointHeader,
|
|
162
162
|
archiveRoot: Fr,
|
|
163
|
+
checkpointNumber: CheckpointNumber,
|
|
163
164
|
feeAssetPriceModifier: bigint,
|
|
164
165
|
lastBlockProposal: BlockProposal | undefined,
|
|
165
166
|
payloadSigner: (payload: Buffer32, context: SigningContext) => Promise<Signature>,
|
|
@@ -175,7 +176,7 @@ export class CheckpointProposal extends Gossipable {
|
|
|
175
176
|
|
|
176
177
|
const checkpointContext: SigningContext = {
|
|
177
178
|
slot: checkpointHeader.slotNumber,
|
|
178
|
-
|
|
179
|
+
checkpointNumber,
|
|
179
180
|
dutyType: DutyType.CHECKPOINT_PROPOSAL,
|
|
180
181
|
};
|
|
181
182
|
|
package/src/p2p/gossipable.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseBuffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
3
|
|
|
4
4
|
import type { TopicType } from './topic_type.js';
|
|
@@ -46,7 +46,7 @@ export class P2PMessage {
|
|
|
46
46
|
* Any class which extends gossipable will be able to be Gossiped over the p2p network
|
|
47
47
|
*/
|
|
48
48
|
export abstract class Gossipable {
|
|
49
|
-
private cachedId:
|
|
49
|
+
private cachedId: BaseBuffer32 | undefined;
|
|
50
50
|
/** The p2p topic identifier, this determines how the message is handled */
|
|
51
51
|
static p2pTopic: TopicType;
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ export abstract class Gossipable {
|
|
|
54
54
|
* A digest of the message information **used for logging only**.
|
|
55
55
|
* The identifier used for deduplication is `getMsgIdFn` as defined in `encoding.ts` which is a hash over topic and data.
|
|
56
56
|
*/
|
|
57
|
-
async p2pMessageLoggingIdentifier(): Promise<
|
|
57
|
+
async p2pMessageLoggingIdentifier(): Promise<BaseBuffer32> {
|
|
58
58
|
if (this.cachedId) {
|
|
59
59
|
return this.cachedId;
|
|
60
60
|
}
|
|
@@ -62,7 +62,7 @@ export abstract class Gossipable {
|
|
|
62
62
|
return this.cachedId;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
abstract generateP2PMessageIdentifier(): Promise<
|
|
65
|
+
abstract generateP2PMessageIdentifier(): Promise<BaseBuffer32>;
|
|
66
66
|
|
|
67
67
|
abstract toBuffer(): Buffer;
|
|
68
68
|
|
package/src/tests/mocks.ts
CHANGED
|
@@ -587,6 +587,7 @@ export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<B
|
|
|
587
587
|
|
|
588
588
|
return BlockProposal.createProposalFromSigner(
|
|
589
589
|
blockHeader,
|
|
590
|
+
CheckpointNumber(1),
|
|
590
591
|
indexWithinCheckpoint,
|
|
591
592
|
inHash,
|
|
592
593
|
archiveRoot,
|
|
@@ -618,6 +619,7 @@ export const makeCheckpointProposal = async (options?: MakeCheckpointProposalOpt
|
|
|
618
619
|
return CheckpointProposal.createProposalFromSigner(
|
|
619
620
|
checkpointHeader,
|
|
620
621
|
archiveRoot,
|
|
622
|
+
CheckpointNumber(1),
|
|
621
623
|
feeAssetPriceModifier,
|
|
622
624
|
lastBlockProposal,
|
|
623
625
|
payload => Promise.resolve(signer.signMessage(payload)),
|
package/src/tx/block_header.ts
CHANGED
|
@@ -172,8 +172,8 @@ export class BlockHeader {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/** Manually set the hash for this block header if already computed */
|
|
175
|
-
setHash(hashed:
|
|
176
|
-
this._cachedHash = Promise.resolve(
|
|
175
|
+
setHash(hashed: BlockHash) {
|
|
176
|
+
this._cachedHash = Promise.resolve(hashed);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
/** Recomputes the cached hash. Used for testing when header fields are mutated via unfreeze. */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
4
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
4
|
|
|
@@ -27,7 +26,7 @@ export function serializeIndexedTxEffect(effect: IndexedTxEffect): Buffer {
|
|
|
27
26
|
export function deserializeIndexedTxEffect(buffer: Buffer): IndexedTxEffect {
|
|
28
27
|
const reader = BufferReader.asReader(buffer);
|
|
29
28
|
|
|
30
|
-
const l2BlockHash =
|
|
29
|
+
const l2BlockHash = BlockHash.fromBuffer(reader);
|
|
31
30
|
const l2BlockNumber = BlockNumber(reader.readNumber());
|
|
32
31
|
const txIndexInBlock = reader.readNumber();
|
|
33
32
|
const data = reader.readObject(TxEffect);
|
package/src/tx/tx.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DA_GAS_PER_FIELD, TX_DA_GAS_OVERHEAD } from '@aztec/constants';
|
|
2
|
-
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { type BaseBuffer32, Buffer32 } from '@aztec/foundation/buffer';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
5
5
|
import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -64,7 +64,7 @@ export class Tx extends Gossipable {
|
|
|
64
64
|
// docs:end:tx_class
|
|
65
65
|
|
|
66
66
|
// Gossipable method
|
|
67
|
-
override generateP2PMessageIdentifier(): Promise<
|
|
67
|
+
override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
|
|
68
68
|
return Promise.resolve(new Buffer32(this.getTxHash().toBuffer()));
|
|
69
69
|
}
|
|
70
70
|
|