@aztec/p2p 0.0.1-commit.358457c → 0.0.1-commit.3895657bc
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/client/factory.d.ts +5 -6
- package/dest/client/factory.d.ts.map +1 -1
- package/dest/client/factory.js +7 -6
- package/dest/client/interface.d.ts +4 -4
- package/dest/client/interface.d.ts.map +1 -1
- package/dest/client/p2p_client.d.ts +4 -4
- package/dest/client/p2p_client.d.ts.map +1 -1
- package/dest/client/p2p_client.js +1 -25
- package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +1 -2
- package/dest/config.d.ts +20 -11
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +66 -32
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
- package/dest/mem_pools/attestation_pool/attestation_pool.js +5 -1
- package/dest/mem_pools/instrumentation.d.ts +4 -2
- package/dest/mem_pools/instrumentation.d.ts.map +1 -1
- package/dest/mem_pools/instrumentation.js +16 -14
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +2 -0
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +7 -1
- package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +8 -6
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +2 -2
- package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -2
- package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/index.js +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +3 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +32 -10
- package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_metadata.js +62 -16
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +26 -44
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +3 -0
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +2 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
- package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +41 -23
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +6 -4
- package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/block_proposal_validator.js +10 -2
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +6 -4
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +16 -2
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +13 -8
- package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator.js +48 -36
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts +2 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/allowed_public_setup.js +24 -20
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts +17 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts.map +1 -0
- package/dest/msg_validators/tx_validator/allowed_setup_helpers.js +24 -0
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/fee_payer_balance.js +6 -2
- package/dest/msg_validators/tx_validator/index.d.ts +2 -1
- package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/index.js +1 -0
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/metadata_validator.js +4 -4
- package/dest/msg_validators/tx_validator/phases_validator.d.ts +2 -2
- package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
- package/dest/msg_validators/tx_validator/phases_validator.js +44 -23
- package/dest/services/encoding.d.ts +2 -2
- package/dest/services/encoding.d.ts.map +1 -1
- package/dest/services/encoding.js +7 -7
- package/dest/services/libp2p/libp2p_service.d.ts +6 -7
- package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
- package/dest/services/libp2p/libp2p_service.js +22 -19
- package/dest/services/peer-manager/metrics.d.ts +3 -1
- package/dest/services/peer-manager/metrics.d.ts.map +1 -1
- package/dest/services/peer-manager/metrics.js +6 -0
- package/dest/services/peer-manager/peer_manager.d.ts +1 -1
- package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
- package/dest/services/peer-manager/peer_manager.js +2 -1
- package/dest/services/reqresp/reqresp.d.ts +1 -1
- package/dest/services/reqresp/reqresp.d.ts.map +1 -1
- package/dest/services/reqresp/reqresp.js +2 -1
- package/dest/test-helpers/make-test-p2p-clients.d.ts +5 -6
- package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
- package/dest/test-helpers/make-test-p2p-clients.js +1 -2
- package/dest/test-helpers/mock-pubsub.d.ts +2 -3
- package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
- package/dest/test-helpers/mock-pubsub.js +2 -2
- package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
- package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
- package/dest/test-helpers/reqresp-nodes.js +2 -2
- package/dest/testbench/p2p_client_testbench_worker.js +7 -6
- package/dest/testbench/worker_client_manager.d.ts +3 -1
- package/dest/testbench/worker_client_manager.d.ts.map +1 -1
- package/dest/testbench/worker_client_manager.js +6 -2
- package/dest/util.d.ts +1 -1
- package/package.json +14 -14
- package/src/client/factory.ts +10 -14
- package/src/client/interface.ts +3 -9
- package/src/client/p2p_client.ts +2 -34
- package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +2 -3
- package/src/config.ts +91 -34
- package/src/mem_pools/attestation_pool/attestation_pool.ts +5 -4
- package/src/mem_pools/instrumentation.ts +17 -13
- package/src/mem_pools/tx_pool_v2/README.md +9 -1
- package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +3 -0
- package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +11 -1
- package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +15 -6
- package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +2 -1
- package/src/mem_pools/tx_pool_v2/index.ts +1 -1
- package/src/mem_pools/tx_pool_v2/interfaces.ts +3 -0
- package/src/mem_pools/tx_pool_v2/tx_metadata.ts +91 -19
- package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +29 -43
- package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +3 -0
- package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +48 -21
- package/src/msg_validators/proposal_validator/block_proposal_validator.ts +14 -4
- package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +20 -7
- package/src/msg_validators/proposal_validator/proposal_validator.ts +63 -40
- package/src/msg_validators/tx_validator/allowed_public_setup.ts +22 -27
- package/src/msg_validators/tx_validator/allowed_setup_helpers.ts +31 -0
- package/src/msg_validators/tx_validator/fee_payer_balance.ts +6 -2
- package/src/msg_validators/tx_validator/index.ts +1 -0
- package/src/msg_validators/tx_validator/metadata_validator.ts +12 -4
- package/src/msg_validators/tx_validator/phases_validator.ts +51 -26
- package/src/services/encoding.ts +5 -6
- package/src/services/libp2p/libp2p_service.ts +20 -17
- package/src/services/peer-manager/metrics.ts +7 -0
- package/src/services/peer-manager/peer_manager.ts +2 -1
- package/src/services/reqresp/reqresp.ts +3 -1
- package/src/test-helpers/make-test-p2p-clients.ts +1 -3
- package/src/test-helpers/mock-pubsub.ts +3 -6
- package/src/test-helpers/reqresp-nodes.ts +3 -6
- package/src/testbench/p2p_client_testbench_worker.ts +4 -7
- package/src/testbench/worker_client_manager.ts +13 -5
- package/src/util.ts +1 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +0 -23
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +0 -1
- package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +0 -212
- package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +0 -230
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { NULL_MSG_SENDER_CONTRACT_ADDRESS } from '@aztec/constants';
|
|
1
2
|
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
3
|
import { PublicContractsDB, getCallRequestsWithCalldataByPhase } from '@aztec/simulator/server';
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
5
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
4
6
|
import type { AllowedElement } from '@aztec/stdlib/interfaces/server';
|
|
5
7
|
import {
|
|
6
8
|
type PublicCallRequestWithCalldata,
|
|
7
9
|
TX_ERROR_DURING_VALIDATION,
|
|
8
10
|
TX_ERROR_SETUP_FUNCTION_NOT_ALLOWED,
|
|
11
|
+
TX_ERROR_SETUP_FUNCTION_UNKNOWN_CONTRACT,
|
|
12
|
+
TX_ERROR_SETUP_NULL_MSG_SENDER,
|
|
13
|
+
TX_ERROR_SETUP_ONLY_SELF_WRONG_SENDER,
|
|
14
|
+
TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH,
|
|
9
15
|
Tx,
|
|
10
16
|
TxExecutionPhase,
|
|
11
17
|
type TxValidationResult,
|
|
@@ -45,7 +51,8 @@ export class PhasesTxValidator implements TxValidator<Tx> {
|
|
|
45
51
|
|
|
46
52
|
const setupFns = getCallRequestsWithCalldataByPhase(tx, TxExecutionPhase.SETUP);
|
|
47
53
|
for (const setupFn of setupFns) {
|
|
48
|
-
|
|
54
|
+
const rejectionReason = await this.checkAllowList(setupFn, this.setupAllowList);
|
|
55
|
+
if (rejectionReason) {
|
|
49
56
|
this.#log.verbose(
|
|
50
57
|
`Rejecting tx ${tx.getTxHash().toString()} because it calls setup function not on allow list: ${
|
|
51
58
|
setupFn.request.contractAddress
|
|
@@ -53,7 +60,7 @@ export class PhasesTxValidator implements TxValidator<Tx> {
|
|
|
53
60
|
{ allowList: this.setupAllowList },
|
|
54
61
|
);
|
|
55
62
|
|
|
56
|
-
return { result: 'invalid', reason: [
|
|
63
|
+
return { result: 'invalid', reason: [rejectionReason] };
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
|
|
@@ -66,53 +73,71 @@ export class PhasesTxValidator implements TxValidator<Tx> {
|
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
|
|
69
|
-
|
|
76
|
+
/** Returns a rejection reason if the call is not on the allow list, or undefined if it is allowed. */
|
|
77
|
+
private async checkAllowList(
|
|
70
78
|
publicCall: PublicCallRequestWithCalldata,
|
|
71
79
|
allowList: AllowedElement[],
|
|
72
|
-
): Promise<
|
|
80
|
+
): Promise<string | undefined> {
|
|
73
81
|
if (publicCall.isEmpty()) {
|
|
74
|
-
return
|
|
82
|
+
return undefined;
|
|
75
83
|
}
|
|
76
84
|
|
|
77
85
|
const contractAddress = publicCall.request.contractAddress;
|
|
78
86
|
const functionSelector = publicCall.functionSelector;
|
|
79
87
|
|
|
80
|
-
//
|
|
88
|
+
// Check address-based entries first since they don't require the contract class.
|
|
81
89
|
for (const entry of allowList) {
|
|
82
|
-
if ('address' in entry
|
|
83
|
-
if (contractAddress.equals(entry.address)) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if ('address' in entry && 'selector' in entry) {
|
|
90
|
+
if ('address' in entry) {
|
|
89
91
|
if (contractAddress.equals(entry.address) && entry.selector.equals(functionSelector)) {
|
|
90
|
-
|
|
92
|
+
if (entry.calldataLength !== undefined && publicCall.calldata.length !== entry.calldataLength) {
|
|
93
|
+
return TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH;
|
|
94
|
+
}
|
|
95
|
+
if (entry.onlySelf && !publicCall.request.msgSender.equals(contractAddress)) {
|
|
96
|
+
return TX_ERROR_SETUP_ONLY_SELF_WRONG_SENDER;
|
|
97
|
+
}
|
|
98
|
+
if (
|
|
99
|
+
entry.rejectNullMsgSender &&
|
|
100
|
+
publicCall.request.msgSender.equals(AztecAddress.fromBigInt(NULL_MSG_SENDER_CONTRACT_ADDRESS))
|
|
101
|
+
) {
|
|
102
|
+
return TX_ERROR_SETUP_NULL_MSG_SENDER;
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
91
105
|
}
|
|
92
106
|
}
|
|
107
|
+
}
|
|
93
108
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
109
|
+
// Check class-based entries. Fetch the contract instance lazily (only once).
|
|
110
|
+
let contractClassId: undefined | { value: string | undefined };
|
|
111
|
+
for (const entry of allowList) {
|
|
112
|
+
if (!('classId' in entry)) {
|
|
113
|
+
continue;
|
|
98
114
|
}
|
|
99
115
|
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
116
|
+
if (contractClassId === undefined) {
|
|
117
|
+
const instance = await this.contractsDB.getContractInstance(contractAddress, this.timestamp);
|
|
118
|
+
contractClassId = { value: instance?.currentContractClassId.toString() };
|
|
119
|
+
if (!contractClassId.value) {
|
|
120
|
+
return TX_ERROR_SETUP_FUNCTION_UNKNOWN_CONTRACT;
|
|
103
121
|
}
|
|
104
122
|
}
|
|
105
123
|
|
|
106
|
-
if (
|
|
124
|
+
if (contractClassId.value === entry.classId.toString() && entry.selector.equals(functionSelector)) {
|
|
125
|
+
if (entry.calldataLength !== undefined && publicCall.calldata.length !== entry.calldataLength) {
|
|
126
|
+
return TX_ERROR_SETUP_WRONG_CALLDATA_LENGTH;
|
|
127
|
+
}
|
|
128
|
+
if (entry.onlySelf && !publicCall.request.msgSender.equals(contractAddress)) {
|
|
129
|
+
return TX_ERROR_SETUP_ONLY_SELF_WRONG_SENDER;
|
|
130
|
+
}
|
|
107
131
|
if (
|
|
108
|
-
|
|
109
|
-
|
|
132
|
+
entry.rejectNullMsgSender &&
|
|
133
|
+
publicCall.request.msgSender.equals(AztecAddress.fromBigInt(NULL_MSG_SENDER_CONTRACT_ADDRESS))
|
|
110
134
|
) {
|
|
111
|
-
return
|
|
135
|
+
return TX_ERROR_SETUP_NULL_MSG_SENDER;
|
|
112
136
|
}
|
|
137
|
+
return undefined;
|
|
113
138
|
}
|
|
114
139
|
}
|
|
115
140
|
|
|
116
|
-
return
|
|
141
|
+
return TX_ERROR_SETUP_FUNCTION_NOT_ALLOWED;
|
|
117
142
|
}
|
|
118
143
|
}
|
package/src/services/encoding.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Taken from lodestar: https://github.com/ChainSafe/lodestar
|
|
2
|
-
import { sha256 } from '@aztec/foundation/crypto/sha256';
|
|
3
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
3
|
import { MAX_TX_SIZE_KB, TopicType, getTopicFromString } from '@aztec/stdlib/p2p';
|
|
5
4
|
|
|
6
5
|
import type { RPC } from '@chainsafe/libp2p-gossipsub/message';
|
|
7
6
|
import type { DataTransform } from '@chainsafe/libp2p-gossipsub/types';
|
|
8
7
|
import type { Message } from '@libp2p/interface';
|
|
8
|
+
import { webcrypto } from 'node:crypto';
|
|
9
9
|
import { compressSync, uncompressSync } from 'snappy';
|
|
10
10
|
import xxhashFactory from 'xxhash-wasm';
|
|
11
11
|
|
|
@@ -44,11 +44,10 @@ export function msgIdToStrFn(msgId: Uint8Array): string {
|
|
|
44
44
|
* @param message - The libp2p message
|
|
45
45
|
* @returns The message identifier
|
|
46
46
|
*/
|
|
47
|
-
export function getMsgIdFn(
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return sha256(Buffer.concat(vec)).subarray(0, 20);
|
|
47
|
+
export async function getMsgIdFn({ topic, data }: Message): Promise<Uint8Array> {
|
|
48
|
+
const buffer = Buffer.concat([Buffer.from(topic), data]);
|
|
49
|
+
const hash = await webcrypto.subtle.digest('SHA-256', buffer);
|
|
50
|
+
return Buffer.from(hash.slice(0, 20));
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
const DefaultMaxSizesKb: Record<TopicType, number> = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
2
2
|
import { BlockNumber, type SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { maxBy } from '@aztec/foundation/collection';
|
|
3
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
5
|
import { type Logger, createLibp2pComponentLogger, createLogger } from '@aztec/foundation/log';
|
|
5
6
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
@@ -16,13 +17,13 @@ import {
|
|
|
16
17
|
CheckpointProposal,
|
|
17
18
|
type CheckpointProposalCore,
|
|
18
19
|
type Gossipable,
|
|
19
|
-
P2PClientType,
|
|
20
20
|
P2PMessage,
|
|
21
21
|
type ValidationResult as P2PValidationResult,
|
|
22
22
|
PeerErrorSeverity,
|
|
23
|
+
PeerErrorSeverityByHarshness,
|
|
23
24
|
TopicType,
|
|
24
25
|
createTopicString,
|
|
25
|
-
|
|
26
|
+
getTopicsForConfig,
|
|
26
27
|
metricsTopicStrToLabels,
|
|
27
28
|
} from '@aztec/stdlib/p2p';
|
|
28
29
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
@@ -135,7 +136,7 @@ type ReceivedMessageValidationResult<T, M = undefined> =
|
|
|
135
136
|
/**
|
|
136
137
|
* Lib P2P implementation of the P2PService interface.
|
|
137
138
|
*/
|
|
138
|
-
export class LibP2PService
|
|
139
|
+
export class LibP2PService extends WithTracer implements P2PService {
|
|
139
140
|
private discoveryRunningPromise?: RunningPromise;
|
|
140
141
|
private msgIdSeenValidators: Record<TopicType, MessageSeenValidator> = {} as Record<TopicType, MessageSeenValidator>;
|
|
141
142
|
|
|
@@ -182,7 +183,6 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
182
183
|
protected logger: Logger;
|
|
183
184
|
|
|
184
185
|
constructor(
|
|
185
|
-
private clientType: T,
|
|
186
186
|
private config: P2PConfig,
|
|
187
187
|
protected node: PubSubLibp2p,
|
|
188
188
|
private peerDiscoveryService: PeerDiscoveryService,
|
|
@@ -224,10 +224,12 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
224
224
|
this.protocolVersion,
|
|
225
225
|
);
|
|
226
226
|
|
|
227
|
-
|
|
228
|
-
this.checkpointProposalValidator = new CheckpointProposalValidator(epochCache, {
|
|
227
|
+
const proposalValidatorOpts = {
|
|
229
228
|
txsPermitted: !config.disableTransactions,
|
|
230
|
-
|
|
229
|
+
maxTxsPerBlock: config.validateMaxTxsPerBlock,
|
|
230
|
+
};
|
|
231
|
+
this.blockProposalValidator = new BlockProposalValidator(epochCache, proposalValidatorOpts);
|
|
232
|
+
this.checkpointProposalValidator = new CheckpointProposalValidator(epochCache, proposalValidatorOpts);
|
|
231
233
|
this.checkpointAttestationValidator = config.fishermanMode
|
|
232
234
|
? new FishermanAttestationValidator(epochCache, mempools.attestationPool, telemetry)
|
|
233
235
|
: new CheckpointAttestationValidator(epochCache);
|
|
@@ -262,8 +264,7 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
262
264
|
* @param txPool - The transaction pool to be accessed by the service.
|
|
263
265
|
* @returns The new service.
|
|
264
266
|
*/
|
|
265
|
-
public static async new
|
|
266
|
-
clientType: T,
|
|
267
|
+
public static async new(
|
|
267
268
|
config: P2PConfig,
|
|
268
269
|
peerId: PeerId,
|
|
269
270
|
deps: {
|
|
@@ -475,7 +476,6 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
475
476
|
peerManager.shouldDisableP2PGossip(peerId) ? -Infinity : peerManager.getPeerScore(peerId);
|
|
476
477
|
|
|
477
478
|
return new LibP2PService(
|
|
478
|
-
clientType,
|
|
479
479
|
config,
|
|
480
480
|
node,
|
|
481
481
|
peerDiscoveryService,
|
|
@@ -549,7 +549,7 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
549
549
|
await this.node.start();
|
|
550
550
|
|
|
551
551
|
// Subscribe to standard GossipSub topics by default
|
|
552
|
-
for (const topic of
|
|
552
|
+
for (const topic of getTopicsForConfig(this.config.disableTransactions)) {
|
|
553
553
|
this.subscribeToTopic(this.topicStrings[topic]);
|
|
554
554
|
}
|
|
555
555
|
|
|
@@ -818,9 +818,7 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
818
818
|
if (msg.topic === this.topicStrings[TopicType.tx]) {
|
|
819
819
|
await this.handleGossipedTx(p2pMessage.payload, msgId, source);
|
|
820
820
|
} else if (msg.topic === this.topicStrings[TopicType.checkpoint_attestation]) {
|
|
821
|
-
|
|
822
|
-
await this.processCheckpointAttestationFromPeer(p2pMessage.payload, msgId, source);
|
|
823
|
-
}
|
|
821
|
+
await this.processCheckpointAttestationFromPeer(p2pMessage.payload, msgId, source);
|
|
824
822
|
} else if (msg.topic === this.topicStrings[TopicType.block_proposal]) {
|
|
825
823
|
await this.processBlockFromPeer(p2pMessage.payload, msgId, source);
|
|
826
824
|
} else if (msg.topic === this.topicStrings[TopicType.checkpoint_proposal]) {
|
|
@@ -1623,7 +1621,10 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
1623
1621
|
nextSlotTimestamp: UInt64,
|
|
1624
1622
|
): Promise<Record<string, TransactionValidator>> {
|
|
1625
1623
|
const gasFees = await this.getGasFees(currentBlockNumber);
|
|
1626
|
-
const allowedInSetup =
|
|
1624
|
+
const allowedInSetup = [
|
|
1625
|
+
...(await getDefaultAllowedSetupFunctions()),
|
|
1626
|
+
...(this.config.txPublicSetupAllowListExtend ?? []),
|
|
1627
|
+
];
|
|
1627
1628
|
const blockNumber = BlockNumber(currentBlockNumber + 1);
|
|
1628
1629
|
|
|
1629
1630
|
return createFirstStageTxValidationsForGossipedTransactions(
|
|
@@ -1663,8 +1664,10 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
|
|
|
1663
1664
|
|
|
1664
1665
|
// A promise that resolves when all validations have been run
|
|
1665
1666
|
const allValidations = await Promise.all(validationPromises);
|
|
1666
|
-
const
|
|
1667
|
-
if (
|
|
1667
|
+
const failures = allValidations.filter(x => !x.isValid);
|
|
1668
|
+
if (failures.length > 0) {
|
|
1669
|
+
// Pick the most severe failure (lowest tolerance = harshest penalty)
|
|
1670
|
+
const failed = maxBy(failures, f => PeerErrorSeverityByHarshness.indexOf(f.severity))!;
|
|
1668
1671
|
return {
|
|
1669
1672
|
allPassed: false,
|
|
1670
1673
|
failure: {
|
|
@@ -18,6 +18,7 @@ export class PeerManagerMetrics {
|
|
|
18
18
|
private sentGoodbyes: UpDownCounter;
|
|
19
19
|
private receivedGoodbyes: UpDownCounter;
|
|
20
20
|
private peerCount: Gauge;
|
|
21
|
+
private healthyPeerCount: Gauge;
|
|
21
22
|
private lowScoreDisconnects: UpDownCounter;
|
|
22
23
|
private peerConnectionDuration: Histogram;
|
|
23
24
|
|
|
@@ -49,6 +50,7 @@ export class PeerManagerMetrics {
|
|
|
49
50
|
goodbyeReasonAttrs,
|
|
50
51
|
);
|
|
51
52
|
this.peerCount = meter.createGauge(Metrics.PEER_MANAGER_PEER_COUNT);
|
|
53
|
+
this.healthyPeerCount = meter.createGauge(Metrics.PEER_MANAGER_HEALTHY_PEER_COUNT);
|
|
52
54
|
this.lowScoreDisconnects = createUpDownCounterWithDefault(meter, Metrics.PEER_MANAGER_LOW_SCORE_DISCONNECTS, {
|
|
53
55
|
[Attributes.P2P_PEER_SCORE_STATE]: ['Banned', 'Disconnect'],
|
|
54
56
|
});
|
|
@@ -67,6 +69,10 @@ export class PeerManagerMetrics {
|
|
|
67
69
|
this.peerCount.record(count);
|
|
68
70
|
}
|
|
69
71
|
|
|
72
|
+
public recordHealthyPeerCount(count: number) {
|
|
73
|
+
this.healthyPeerCount.record(count);
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
public recordLowScoreDisconnect(scoreState: 'Banned' | 'Disconnect') {
|
|
71
77
|
this.lowScoreDisconnects.add(1, { [Attributes.P2P_PEER_SCORE_STATE]: scoreState });
|
|
72
78
|
}
|
|
@@ -79,6 +85,7 @@ export class PeerManagerMetrics {
|
|
|
79
85
|
const connectedAt = this.peerConnectedAt.get(id.toString());
|
|
80
86
|
if (connectedAt) {
|
|
81
87
|
this.peerConnectionDuration.record(Date.now() - connectedAt);
|
|
88
|
+
this.peerConnectedAt.delete(id.toString());
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
}
|
|
@@ -515,7 +515,8 @@ export class PeerManager implements PeerManagerInterface {
|
|
|
515
515
|
...this.peerScoring.getStats(),
|
|
516
516
|
});
|
|
517
517
|
|
|
518
|
-
this.metrics.recordPeerCount(
|
|
518
|
+
this.metrics.recordPeerCount(connections.length);
|
|
519
|
+
this.metrics.recordHealthyPeerCount(healthyConnections.length);
|
|
519
520
|
|
|
520
521
|
// Exit if no peers to connect
|
|
521
522
|
if (peersToConnect <= 0) {
|
|
@@ -627,7 +627,9 @@ export class ReqResp implements ReqRespInterface {
|
|
|
627
627
|
// and that this stream should be dropped
|
|
628
628
|
const isMessageToNotWarn =
|
|
629
629
|
err instanceof Error &&
|
|
630
|
-
['stream reset', 'Cannot push value onto an ended pushable'].some(msg =>
|
|
630
|
+
['stream reset', 'Cannot push value onto an ended pushable', 'read ECONNRESET'].some(msg =>
|
|
631
|
+
err.message.includes(msg),
|
|
632
|
+
);
|
|
631
633
|
const level = isMessageToNotWarn ? 'debug' : 'warn';
|
|
632
634
|
this.logger[level]('Unknown stream error while handling the stream, aborting', {
|
|
633
635
|
protocol,
|
|
@@ -4,10 +4,9 @@ import { SecretValue } from '@aztec/foundation/config';
|
|
|
4
4
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
5
5
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
6
6
|
import { sleep } from '@aztec/foundation/sleep';
|
|
7
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
8
7
|
import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
9
8
|
import type { WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
10
|
-
import {
|
|
9
|
+
import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
11
10
|
|
|
12
11
|
import { createP2PClient } from '../client/index.js';
|
|
13
12
|
import type { P2PClient } from '../client/p2p_client.js';
|
|
@@ -98,7 +97,6 @@ export async function makeTestP2PClient(
|
|
|
98
97
|
const kvStore = await openTmpStore('test');
|
|
99
98
|
|
|
100
99
|
const client = await createP2PClient(
|
|
101
|
-
P2PClientType.Full,
|
|
102
100
|
config,
|
|
103
101
|
l2BlockSource,
|
|
104
102
|
proofVerifier,
|
|
@@ -4,7 +4,6 @@ import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
|
4
4
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
5
5
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
6
6
|
import type { ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
7
|
-
import { P2PClientType } from '@aztec/stdlib/p2p';
|
|
8
7
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
9
8
|
|
|
10
9
|
import type { GossipsubEvents, GossipsubMessage } from '@chainsafe/libp2p-gossipsub';
|
|
@@ -42,11 +41,10 @@ type GossipSubService = PubSubLibp2p['services']['pubsub'];
|
|
|
42
41
|
* Given a mock gossip sub network, returns a factory function that creates an instance LibP2PService connected to it.
|
|
43
42
|
* Designed to be used in tests in P2PClientDeps.p2pServiceFactory.
|
|
44
43
|
*/
|
|
45
|
-
export function getMockPubSubP2PServiceFactory
|
|
44
|
+
export function getMockPubSubP2PServiceFactory(
|
|
46
45
|
network: MockGossipSubNetwork,
|
|
47
|
-
): (...args: Parameters<(typeof LibP2PService
|
|
46
|
+
): (...args: Parameters<(typeof LibP2PService)['new']>) => Promise<LibP2PService> {
|
|
48
47
|
return (
|
|
49
|
-
clientType: P2PClientType,
|
|
50
48
|
config: P2PConfig,
|
|
51
49
|
peerId: PeerId,
|
|
52
50
|
deps: {
|
|
@@ -66,8 +64,7 @@ export function getMockPubSubP2PServiceFactory<T extends P2PClientType>(
|
|
|
66
64
|
const peerManager = new DummyPeerManager(peerId, network);
|
|
67
65
|
const reqresp: ReqRespInterface = new MockReqResp(peerId, network);
|
|
68
66
|
const peerDiscoveryService = new DummyPeerDiscoveryService();
|
|
69
|
-
const service = new LibP2PService
|
|
70
|
-
clientType as T,
|
|
67
|
+
const service = new LibP2PService(
|
|
71
68
|
config,
|
|
72
69
|
libp2p,
|
|
73
70
|
peerDiscoveryService,
|
|
@@ -2,7 +2,6 @@ import type { EpochCache } from '@aztec/epoch-cache';
|
|
|
2
2
|
import { timesParallel } from '@aztec/foundation/collection';
|
|
3
3
|
import { SecretValue } from '@aztec/foundation/config';
|
|
4
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
6
5
|
import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
7
6
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
8
7
|
import { type ChainConfig, emptyChainConfig } from '@aztec/stdlib/config';
|
|
@@ -12,7 +11,7 @@ import type {
|
|
|
12
11
|
IVCProofVerificationResult,
|
|
13
12
|
WorldStateSynchronizer,
|
|
14
13
|
} from '@aztec/stdlib/interfaces/server';
|
|
15
|
-
import type {
|
|
14
|
+
import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
16
15
|
import type { Tx } from '@aztec/stdlib/tx';
|
|
17
16
|
import { compressComponentVersions } from '@aztec/stdlib/versioning';
|
|
18
17
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -107,8 +106,7 @@ export async function createLibp2pNode(
|
|
|
107
106
|
*
|
|
108
107
|
*
|
|
109
108
|
*/
|
|
110
|
-
export async function createTestLibP2PService
|
|
111
|
-
clientType: T,
|
|
109
|
+
export async function createTestLibP2PService(
|
|
112
110
|
boostrapAddrs: string[] = [],
|
|
113
111
|
archiver: L2BlockSource & ContractDataSource,
|
|
114
112
|
worldStateSynchronizer: WorldStateSynchronizer,
|
|
@@ -159,8 +157,7 @@ export async function createTestLibP2PService<T extends P2PClientType>(
|
|
|
159
157
|
p2pNode.services.pubsub.score.params.appSpecificScore = (peerId: string) =>
|
|
160
158
|
peerManager.shouldDisableP2PGossip(peerId) ? -Infinity : peerManager.getPeerScore(peerId);
|
|
161
159
|
|
|
162
|
-
return new LibP2PService
|
|
163
|
-
clientType,
|
|
160
|
+
return new LibP2PService(
|
|
164
161
|
config,
|
|
165
162
|
p2pNode as PubSubLibp2p,
|
|
166
163
|
discoveryService,
|
|
@@ -12,14 +12,14 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
12
12
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
13
13
|
import { sleep } from '@aztec/foundation/sleep';
|
|
14
14
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
15
|
-
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
16
15
|
import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
17
16
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
18
17
|
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
19
18
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
20
19
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
21
20
|
import type { ClientProtocolCircuitVerifier, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
22
|
-
import
|
|
21
|
+
import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
22
|
+
import { type BlockProposal, P2PMessage } from '@aztec/stdlib/p2p';
|
|
23
23
|
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
24
24
|
import { makeAztecAddress, makeBlockHeader, makeBlockProposal, mockTx } from '@aztec/stdlib/testing';
|
|
25
25
|
import { Tx, TxHash, type TxValidationResult } from '@aztec/stdlib/tx';
|
|
@@ -86,12 +86,11 @@ export interface BenchReadyMessage {
|
|
|
86
86
|
}
|
|
87
87
|
const txCache = new Map<number, Tx[]>();
|
|
88
88
|
|
|
89
|
-
class TestLibP2PService
|
|
89
|
+
class TestLibP2PService extends LibP2PService {
|
|
90
90
|
private disableTxValidation: boolean;
|
|
91
91
|
private gossipMessageCount = 0;
|
|
92
92
|
|
|
93
93
|
constructor(
|
|
94
|
-
clientType: T,
|
|
95
94
|
config: P2PConfig,
|
|
96
95
|
node: PubSubLibp2p,
|
|
97
96
|
peerDiscoveryService: PeerDiscoveryService,
|
|
@@ -107,7 +106,6 @@ class TestLibP2PService<T extends P2PClientType = P2PClientType.Full> extends Li
|
|
|
107
106
|
disableTxValidation = true,
|
|
108
107
|
) {
|
|
109
108
|
super(
|
|
110
|
-
clientType,
|
|
111
109
|
config,
|
|
112
110
|
node,
|
|
113
111
|
peerDiscoveryService,
|
|
@@ -342,6 +340,7 @@ process.on('message', async msg => {
|
|
|
342
340
|
const config: P2PConfig = {
|
|
343
341
|
...rawConfig,
|
|
344
342
|
peerIdPrivateKey: rawConfig.peerIdPrivateKey ? new SecretValue(rawConfig.peerIdPrivateKey) : undefined,
|
|
343
|
+
priceBumpPercentage: 10n,
|
|
345
344
|
} as P2PConfig;
|
|
346
345
|
|
|
347
346
|
workerConfig = config;
|
|
@@ -365,7 +364,6 @@ process.on('message', async msg => {
|
|
|
365
364
|
};
|
|
366
365
|
|
|
367
366
|
const client = await createP2PClient(
|
|
368
|
-
P2PClientType.Full,
|
|
369
367
|
config as P2PConfig & DataStoreConfig,
|
|
370
368
|
l2BlockSource,
|
|
371
369
|
proofVerifier as ClientProtocolCircuitVerifier,
|
|
@@ -378,7 +376,6 @@ process.on('message', async msg => {
|
|
|
378
376
|
);
|
|
379
377
|
|
|
380
378
|
const testService = new TestLibP2PService(
|
|
381
|
-
P2PClientType.Full,
|
|
382
379
|
config,
|
|
383
380
|
(client as any).p2pService.node,
|
|
384
381
|
(client as any).p2pService.peerDiscoveryService,
|
|
@@ -81,13 +81,15 @@ class WorkerClientManager {
|
|
|
81
81
|
* Note: We send the raw peerIdPrivateKey string instead of SecretValue
|
|
82
82
|
* because SecretValue.toJSON() returns '[Redacted]', losing the value.
|
|
83
83
|
* The worker must re-wrap it in SecretValue.
|
|
84
|
+
* We also omit priceBumpPercentage since it's a bigint and can't be
|
|
85
|
+
* serialized over IPC (which uses JSON under the hood).
|
|
84
86
|
*/
|
|
85
87
|
private createClientConfig(
|
|
86
88
|
clientIndex: number,
|
|
87
89
|
port: number,
|
|
88
90
|
otherNodes: string[],
|
|
89
|
-
): Omit<P2PConfig, 'peerIdPrivateKey'> & { peerIdPrivateKey: string } & Partial<ChainConfig> {
|
|
90
|
-
|
|
91
|
+
): Omit<P2PConfig, 'peerIdPrivateKey' | 'priceBumpPercentage'> & { peerIdPrivateKey: string } & Partial<ChainConfig> {
|
|
92
|
+
const { priceBumpPercentage: _, ...config } = {
|
|
91
93
|
...getP2PDefaultConfig(),
|
|
92
94
|
p2pEnabled: true,
|
|
93
95
|
peerIdPrivateKey: this.peerIdPrivateKeys[clientIndex],
|
|
@@ -96,7 +98,10 @@ class WorkerClientManager {
|
|
|
96
98
|
p2pPort: port,
|
|
97
99
|
bootstrapNodes: [...otherNodes],
|
|
98
100
|
...this.p2pConfig,
|
|
99
|
-
}
|
|
101
|
+
};
|
|
102
|
+
return config as Omit<P2PConfig, 'peerIdPrivateKey' | 'priceBumpPercentage'> & {
|
|
103
|
+
peerIdPrivateKey: string;
|
|
104
|
+
} & Partial<ChainConfig>;
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
/**
|
|
@@ -104,7 +109,9 @@ class WorkerClientManager {
|
|
|
104
109
|
* Config uses raw string for peerIdPrivateKey (not SecretValue) for IPC serialization.
|
|
105
110
|
*/
|
|
106
111
|
private spawnWorkerProcess(
|
|
107
|
-
config: Omit<P2PConfig, 'peerIdPrivateKey'> & {
|
|
112
|
+
config: Omit<P2PConfig, 'peerIdPrivateKey' | 'priceBumpPercentage'> & {
|
|
113
|
+
peerIdPrivateKey: string;
|
|
114
|
+
} & Partial<ChainConfig>,
|
|
108
115
|
clientIndex: number,
|
|
109
116
|
): [ChildProcess, Promise<void>] {
|
|
110
117
|
const useCompiled = existsSync(workerJsPath);
|
|
@@ -483,7 +490,8 @@ class WorkerClientManager {
|
|
|
483
490
|
};
|
|
484
491
|
|
|
485
492
|
this.processes[0].send(aggregatorCmd);
|
|
486
|
-
const
|
|
493
|
+
const aggregatorBudgetMs = config.timeoutMs + BENCHMARK_CONSTANTS.MAX_PEER_WAIT_MS + 30000;
|
|
494
|
+
const result = await this.waitForBenchResult(0, aggregatorBudgetMs);
|
|
487
495
|
|
|
488
496
|
this.logger.info(
|
|
489
497
|
`Benchmark complete: fetched=${result.fetchedCount}/${config.txCount}, duration=${result.durationMs.toFixed(0)}ms, success=${result.success}`,
|
package/src/util.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SecretValue } from '@aztec/foundation/config';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
3
|
import type { AztecAsyncKVStore, AztecAsyncSingleton } from '@aztec/kv-store';
|
|
4
|
-
import type { DataStoreConfig } from '@aztec/kv-store
|
|
4
|
+
import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
5
5
|
|
|
6
6
|
import type { GossipSub } from '@chainsafe/libp2p-gossipsub';
|
|
7
7
|
import { generateKeyPair, marshalPrivateKey, unmarshalPrivateKey } from '@libp2p/crypto/keys';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
2
|
-
import type { Secp256k1Signer } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
3
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
-
import { type BlockProposal, type CheckpointProposal, type ValidationResult } from '@aztec/stdlib/p2p';
|
|
5
|
-
import type { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { MockProxy } from 'jest-mock-extended';
|
|
7
|
-
export interface ProposalValidatorTestParams<TProposal extends BlockProposal | CheckpointProposal> {
|
|
8
|
-
validatorFactory: (epochCache: EpochCacheInterface, opts: {
|
|
9
|
-
txsPermitted: boolean;
|
|
10
|
-
}) => {
|
|
11
|
-
validate: (proposal: TProposal) => Promise<ValidationResult>;
|
|
12
|
-
};
|
|
13
|
-
makeProposal: (options?: any) => Promise<TProposal>;
|
|
14
|
-
makeHeader: (epochNumber: number | bigint, slotNumber: number | bigint, blockNumber: number | bigint) => any;
|
|
15
|
-
getSigner: () => Secp256k1Signer;
|
|
16
|
-
getAddress: (signer?: Secp256k1Signer) => EthAddress;
|
|
17
|
-
getSlot: (slot: number | bigint) => any;
|
|
18
|
-
getTxHashes: (n: number) => TxHash[];
|
|
19
|
-
getTxs: () => any[];
|
|
20
|
-
epochCacheMock: () => MockProxy<EpochCacheInterface>;
|
|
21
|
-
}
|
|
22
|
-
export declare function sharedProposalValidatorTests<TProposal extends BlockProposal | CheckpointProposal>(params: ProposalValidatorTestParams<TProposal>): void;
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvcG9zYWxfdmFsaWRhdG9yX3Rlc3Rfc3VpdGUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tc2dfdmFsaWRhdG9ycy9wcm9wb3NhbF92YWxpZGF0b3IvcHJvcG9zYWxfdmFsaWRhdG9yX3Rlc3Rfc3VpdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUM5RCxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUNqRixPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUNoRSxPQUFPLEVBQ0wsS0FBSyxhQUFhLEVBQ2xCLEtBQUssa0JBQWtCLEVBRXZCLEtBQUssZ0JBQWdCLEVBQ3RCLE1BQU0sbUJBQW1CLENBQUM7QUFDM0IsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFL0MsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFcEQsTUFBTSxXQUFXLDJCQUEyQixDQUFDLFNBQVMsU0FBUyxhQUFhLEdBQUcsa0JBQWtCO0lBQy9GLGdCQUFnQixFQUFFLENBQ2hCLFVBQVUsRUFBRSxtQkFBbUIsRUFDL0IsSUFBSSxFQUFFO1FBQUUsWUFBWSxFQUFFLE9BQU8sQ0FBQTtLQUFFLEtBQzVCO1FBQUUsUUFBUSxFQUFFLENBQUMsUUFBUSxFQUFFLFNBQVMsS0FBSyxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FBQTtLQUFFLENBQUM7SUFDdEUsWUFBWSxFQUFFLENBQUMsT0FBTyxDQUFDLEVBQUUsR0FBRyxLQUFLLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztJQUNwRCxVQUFVLEVBQUUsQ0FBQyxXQUFXLEVBQUUsTUFBTSxHQUFHLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxHQUFHLE1BQU0sRUFBRSxXQUFXLEVBQUUsTUFBTSxHQUFHLE1BQU0sS0FBSyxHQUFHLENBQUM7SUFDN0csU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0lBQ2pDLFVBQVUsRUFBRSxDQUFDLE1BQU0sQ0FBQyxFQUFFLGVBQWUsS0FBSyxVQUFVLENBQUM7SUFDckQsT0FBTyxFQUFFLENBQUMsSUFBSSxFQUFFLE1BQU0sR0FBRyxNQUFNLEtBQUssR0FBRyxDQUFDO0lBQ3hDLFdBQVcsRUFBRSxDQUFDLENBQUMsRUFBRSxNQUFNLEtBQUssTUFBTSxFQUFFLENBQUM7SUFDckMsTUFBTSxFQUFFLE1BQU0sR0FBRyxFQUFFLENBQUM7SUFDcEIsY0FBYyxFQUFFLE1BQU0sU0FBUyxDQUFDLG1CQUFtQixDQUFDLENBQUM7Q0FDdEQ7QUFFRCx3QkFBZ0IsNEJBQTRCLENBQUMsU0FBUyxTQUFTLGFBQWEsR0FBRyxrQkFBa0IsRUFDL0YsTUFBTSxFQUFFLDJCQUEyQixDQUFDLFNBQVMsQ0FBQyxRQXdNL0MifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proposal_validator_test_suite.d.ts","sourceRoot":"","sources":["../../../src/msg_validators/proposal_validator/proposal_validator_test_suite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,WAAW,2BAA2B,CAAC,SAAS,SAAS,aAAa,GAAG,kBAAkB;IAC/F,gBAAgB,EAAE,CAChB,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE;QAAE,YAAY,EAAE,OAAO,CAAA;KAAE,KAC5B;QAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;KAAE,CAAC;IACtE,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,KAAK,GAAG,CAAC;IAC7G,SAAS,EAAE,MAAM,eAAe,CAAC;IACjC,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,UAAU,CAAC;IACrD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,KAAK,GAAG,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACrC,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC;IACpB,cAAc,EAAE,MAAM,SAAS,CAAC,mBAAmB,CAAC,CAAC;CACtD;AAED,wBAAgB,4BAA4B,CAAC,SAAS,SAAS,aAAa,GAAG,kBAAkB,EAC/F,MAAM,EAAE,2BAA2B,CAAC,SAAS,CAAC,QAwM/C"}
|