@aztec/validator-client 1.2.1 → 2.0.0-nightly.20250813
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/config.d.ts +6 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +11 -0
- package/dest/duties/validation_service.d.ts.map +1 -1
- package/dest/duties/validation_service.js +1 -1
- package/dest/factory.d.ts +2 -2
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +3 -2
- package/dest/key_store/index.d.ts +1 -0
- package/dest/key_store/index.d.ts.map +1 -1
- package/dest/key_store/index.js +1 -0
- package/dest/key_store/interface.d.ts +3 -2
- package/dest/key_store/interface.d.ts.map +1 -1
- package/dest/key_store/local_key_store.d.ts +8 -7
- package/dest/key_store/local_key_store.d.ts.map +1 -1
- package/dest/key_store/local_key_store.js +12 -8
- package/dest/key_store/web3signer_key_store.d.ts +67 -0
- package/dest/key_store/web3signer_key_store.d.ts.map +1 -0
- package/dest/key_store/web3signer_key_store.js +153 -0
- package/dest/validator.d.ts +11 -8
- package/dest/validator.d.ts.map +1 -1
- package/dest/validator.js +96 -55
- package/package.json +10 -10
- package/src/config.ts +18 -1
- package/src/duties/validation_service.ts +2 -1
- package/src/factory.ts +8 -3
- package/src/key_store/index.ts +1 -0
- package/src/key_store/interface.ts +4 -2
- package/src/key_store/local_key_store.ts +13 -9
- package/src/key_store/web3signer_key_store.ts +195 -0
- package/src/validator.ts +115 -68
package/dest/config.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type ConfigMappingsType, type SecretValue } from '@aztec/foundation/config';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
/**
|
|
3
4
|
* The Validator Configuration
|
|
4
5
|
*/
|
|
5
6
|
export interface ValidatorClientConfig {
|
|
6
7
|
/** The private keys of the validators participating in attestation duties */
|
|
7
|
-
validatorPrivateKeys
|
|
8
|
+
validatorPrivateKeys?: SecretValue<`0x${string}`[]>;
|
|
8
9
|
/** Do not run the validator */
|
|
9
10
|
disableValidator: boolean;
|
|
10
11
|
/** Interval between polling for new attestations from peers */
|
|
@@ -13,6 +14,10 @@ export interface ValidatorClientConfig {
|
|
|
13
14
|
validatorReexecute: boolean;
|
|
14
15
|
/** Will re-execute until this many milliseconds are left in the slot */
|
|
15
16
|
validatorReexecuteDeadlineMs: number;
|
|
17
|
+
/** URL of the Web3Signer instance */
|
|
18
|
+
web3SignerUrl?: string;
|
|
19
|
+
/** List of addresses of remote signers */
|
|
20
|
+
web3SignerAddresses?: EthAddress[];
|
|
16
21
|
}
|
|
17
22
|
export declare const validatorClientConfigMappings: ConfigMappingsType<ValidatorClientConfig>;
|
|
18
23
|
/**
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAKjB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAKjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,WAAW,CAAC,KAAK,MAAM,EAAE,EAAE,CAAC,CAAC;IAEpD,+BAA+B;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,+DAA+D;IAC/D,4BAA4B,EAAE,MAAM,CAAC;IAErC,+CAA+C;IAC/C,kBAAkB,EAAE,OAAO,CAAC;IAE5B,wEAAwE;IACxE,4BAA4B,EAAE,MAAM,CAAC;IAErC,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,0CAA0C;IAC1C,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC;CACpC;AAED,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CAuCnF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, secretValueConfigHelper } from '@aztec/foundation/config';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
export const validatorClientConfigMappings = {
|
|
3
4
|
validatorPrivateKeys: {
|
|
4
5
|
env: 'VALIDATOR_PRIVATE_KEYS',
|
|
@@ -27,6 +28,16 @@ export const validatorClientConfigMappings = {
|
|
|
27
28
|
env: 'VALIDATOR_REEXECUTE_DEADLINE_MS',
|
|
28
29
|
description: 'Will re-execute until this many milliseconds are left in the slot',
|
|
29
30
|
...numberConfigHelper(6000)
|
|
31
|
+
},
|
|
32
|
+
web3SignerUrl: {
|
|
33
|
+
env: 'WEB3_SIGNER_URL',
|
|
34
|
+
description: 'URL of the Web3Signer instance',
|
|
35
|
+
parseEnv: (val)=>val.trim()
|
|
36
|
+
},
|
|
37
|
+
web3SignerAddresses: {
|
|
38
|
+
env: 'WEB3_SIGNER_ADDRESSES',
|
|
39
|
+
description: 'List of addresses of remote signers',
|
|
40
|
+
parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address))
|
|
30
41
|
}
|
|
31
42
|
};
|
|
32
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation_service.d.ts","sourceRoot":"","sources":["../../src/duties/validation_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB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GAAG,SAAS,EAC/C,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAqBzB;;;;;;;;;OASG;IACG,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAUtG"}
|
|
@@ -26,7 +26,7 @@ export class ValidationService {
|
|
|
26
26
|
}
|
|
27
27
|
// TODO: check if this is calculated earlier / can not be recomputed
|
|
28
28
|
const txHashes = await Promise.all(txs.map((tx)=>tx.getTxHash()));
|
|
29
|
-
return BlockProposal.createProposalFromSigner(blockNumber, new ConsensusPayload(header, archive, stateReference, txHashes
|
|
29
|
+
return BlockProposal.createProposalFromSigner(blockNumber, new ConsensusPayload(header, archive, stateReference), txHashes, options.publishFullTxs ? txs : undefined, payloadSigner);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Attest with selection of validators to the given block proposal, constructed by the current sequencer
|
package/dest/factory.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
2
2
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
|
-
import type {
|
|
3
|
+
import type { P2PClient } from '@aztec/p2p';
|
|
4
4
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
5
5
|
import type { IFullNodeBlockBuilder, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
6
6
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
@@ -9,7 +9,7 @@ import type { ValidatorClientConfig } from './config.js';
|
|
|
9
9
|
import { ValidatorClient } from './validator.js';
|
|
10
10
|
export declare function createValidatorClient(config: ValidatorClientConfig & Pick<SlasherConfig, 'slashInvalidBlockEnabled' | 'slashInvalidBlockPenalty' | 'slashInvalidBlockMaxPenalty'>, deps: {
|
|
11
11
|
blockBuilder: IFullNodeBlockBuilder;
|
|
12
|
-
p2pClient:
|
|
12
|
+
p2pClient: P2PClient;
|
|
13
13
|
blockSource: L2BlockSource;
|
|
14
14
|
l1ToL2MessageSource: L1ToL2MessageSource;
|
|
15
15
|
telemetry: TelemetryClient;
|
package/dest/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,GAC3B,IAAI,CAAC,aAAa,EAAE,0BAA0B,GAAG,0BAA0B,GAAG,6BAA6B,CAAC,EAC9G,IAAI,EAAE;IACJ,YAAY,EAAE,qBAAqB,CAAC;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,aAAa,CAAC;IAC3B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACxB,+BAwBF"}
|
package/dest/factory.js
CHANGED
|
@@ -5,10 +5,11 @@ export function createValidatorClient(config, deps) {
|
|
|
5
5
|
if (config.disableValidator) {
|
|
6
6
|
return undefined;
|
|
7
7
|
}
|
|
8
|
-
if (config.validatorPrivateKeys === undefined || !config.validatorPrivateKeys.getValue().length) {
|
|
8
|
+
if ((config.validatorPrivateKeys === undefined || !config.validatorPrivateKeys.getValue().length) && !config.web3SignerUrl) {
|
|
9
9
|
config.validatorPrivateKeys = new SecretValue([
|
|
10
10
|
generatePrivateKey()
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
const txProvider = deps.p2pClient.getTxProvider();
|
|
14
|
+
return ValidatorClient.new(config, deps.blockBuilder, deps.epochCache, deps.p2pClient, deps.blockSource, deps.l1ToL2MessageSource, txProvider, deps.dateProvider, deps.telemetry);
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/key_store/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/key_store/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC"}
|
package/dest/key_store/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
+
import type { TypedDataDefinition } from 'viem';
|
|
4
5
|
/** Key Store
|
|
5
6
|
*
|
|
6
7
|
* A keystore interface that can be replaced with a local keystore / remote signer service
|
|
@@ -19,8 +20,8 @@ export interface ValidatorKeyStore {
|
|
|
19
20
|
* @returns all addresses
|
|
20
21
|
*/
|
|
21
22
|
getAddresses(): EthAddress[];
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
signTypedData(typedData: TypedDataDefinition): Promise<Signature[]>;
|
|
24
|
+
signTypedDataWithAddress(address: EthAddress, typedData: TypedDataDefinition): Promise<Signature>;
|
|
24
25
|
/**
|
|
25
26
|
* Flavor of sign message that followed EIP-712 eth signed message prefix
|
|
26
27
|
* Note: this is only required when we are using ecdsa signatures over secp256k1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/key_store/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAEtC;;;;OAIG;IACH,YAAY,IAAI,UAAU,EAAE,CAAC;IAE7B,
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/key_store/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAEtC;;;;OAIG;IACH,YAAY,IAAI,UAAU,EAAE,CAAC;IAE7B,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACpE,wBAAwB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClG;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACrD,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACpF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
+
import { type TypedDataDefinition } from 'viem';
|
|
4
5
|
import type { ValidatorKeyStore } from './interface.js';
|
|
5
6
|
/**
|
|
6
7
|
* Local Key Store
|
|
@@ -26,27 +27,27 @@ export declare class LocalKeyStore implements ValidatorKeyStore {
|
|
|
26
27
|
getAddresses(): EthAddress[];
|
|
27
28
|
/**
|
|
28
29
|
* Sign a message with all keystore private keys
|
|
29
|
-
* @param
|
|
30
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
30
31
|
* @return signature
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
signTypedData(typedData: TypedDataDefinition): Promise<Signature[]>;
|
|
33
34
|
/**
|
|
34
35
|
* Sign a message with a specific address's private key
|
|
35
36
|
* @param address - The address of the signer to use
|
|
36
|
-
* @param
|
|
37
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
37
38
|
* @returns signature for the specified address
|
|
38
39
|
* @throws Error if the address is not found in the keystore
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
signTypedDataWithAddress(address: EthAddress, typedData: TypedDataDefinition): Promise<Signature>;
|
|
41
42
|
/**
|
|
42
|
-
* Sign a message with all keystore private keys
|
|
43
|
+
* Sign a message using eth_sign with all keystore private keys
|
|
43
44
|
*
|
|
44
45
|
* @param message - The message to sign
|
|
45
46
|
* @return signatures
|
|
46
47
|
*/
|
|
47
48
|
signMessage(message: Buffer32): Promise<Signature[]>;
|
|
48
49
|
/**
|
|
49
|
-
* Sign a message with a specific address's private key
|
|
50
|
+
* Sign a message using eth_sign with a specific address's private key
|
|
50
51
|
* @param address - The address of the signer to use
|
|
51
52
|
* @param message - The message to sign
|
|
52
53
|
* @returns signature for the specified address
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local_key_store.d.ts","sourceRoot":"","sources":["../../src/key_store/local_key_store.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"local_key_store.d.ts","sourceRoot":"","sources":["../../src/key_store/local_key_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,KAAK,mBAAmB,EAAiB,MAAM,MAAM,CAAC;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;GAIG;AACH,qBAAa,aAAc,YAAW,iBAAiB;IACrD,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,gBAAgB,CAAsC;gBAElD,WAAW,EAAE,QAAQ,EAAE;IAKnC;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAO5C;;;;OAIG;IACI,YAAY,IAAI,UAAU,EAAE;IAInC;;;;OAIG;IACI,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAK1E;;;;;;OAMG;IACI,wBAAwB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;IASxG;;;;;OAKG;IACI,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAI3D;;;;;;OAMG;IACI,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAO1F"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
1
2
|
import { Secp256k1Signer } from '@aztec/foundation/crypto';
|
|
3
|
+
import { hashTypedData } from 'viem';
|
|
2
4
|
/**
|
|
3
5
|
* Local Key Store
|
|
4
6
|
*
|
|
@@ -33,26 +35,28 @@ import { Secp256k1Signer } from '@aztec/foundation/crypto';
|
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Sign a message with all keystore private keys
|
|
36
|
-
* @param
|
|
38
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
37
39
|
* @return signature
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
+
*/ signTypedData(typedData) {
|
|
41
|
+
const digest = hashTypedData(typedData);
|
|
42
|
+
return Promise.all(this.signers.map((signer)=>signer.sign(Buffer32.fromString(digest))));
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
* Sign a message with a specific address's private key
|
|
43
46
|
* @param address - The address of the signer to use
|
|
44
|
-
* @param
|
|
47
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
45
48
|
* @returns signature for the specified address
|
|
46
49
|
* @throws Error if the address is not found in the keystore
|
|
47
|
-
*/
|
|
50
|
+
*/ signTypedDataWithAddress(address, typedData) {
|
|
48
51
|
const signer = this.signersByAddress.get(address.toString());
|
|
49
52
|
if (!signer) {
|
|
50
53
|
throw new Error(`No signer found for address ${address.toString()}`);
|
|
51
54
|
}
|
|
52
|
-
|
|
55
|
+
const digest = hashTypedData(typedData);
|
|
56
|
+
return Promise.resolve(signer.sign(Buffer32.fromString(digest)));
|
|
53
57
|
}
|
|
54
58
|
/**
|
|
55
|
-
* Sign a message with all keystore private keys
|
|
59
|
+
* Sign a message using eth_sign with all keystore private keys
|
|
56
60
|
*
|
|
57
61
|
* @param message - The message to sign
|
|
58
62
|
* @return signatures
|
|
@@ -60,7 +64,7 @@ import { Secp256k1Signer } from '@aztec/foundation/crypto';
|
|
|
60
64
|
return Promise.all(this.signers.map((signer)=>signer.signMessage(message)));
|
|
61
65
|
}
|
|
62
66
|
/**
|
|
63
|
-
* Sign a message with a specific address's private key
|
|
67
|
+
* Sign a message using eth_sign with a specific address's private key
|
|
64
68
|
* @param address - The address of the signer to use
|
|
65
69
|
* @param message - The message to sign
|
|
66
70
|
* @returns signature for the specified address
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
+
import type { TypedDataDefinition } from 'viem';
|
|
5
|
+
import type { ValidatorKeyStore } from './interface.js';
|
|
6
|
+
/**
|
|
7
|
+
* Web3Signer Key Store
|
|
8
|
+
*
|
|
9
|
+
* An implementation of the Key store using Web3Signer remote signing service.
|
|
10
|
+
* This implementation uses the Web3Signer JSON-RPC API for secp256k1 signatures.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Web3SignerKeyStore implements ValidatorKeyStore {
|
|
13
|
+
private addresses;
|
|
14
|
+
private baseUrl;
|
|
15
|
+
constructor(addresses: EthAddress[], baseUrl: string);
|
|
16
|
+
/**
|
|
17
|
+
* Get the address of a signer by index
|
|
18
|
+
*
|
|
19
|
+
* @param index - The index of the signer
|
|
20
|
+
* @returns the address
|
|
21
|
+
*/
|
|
22
|
+
getAddress(index: number): EthAddress;
|
|
23
|
+
/**
|
|
24
|
+
* Get all addresses
|
|
25
|
+
*
|
|
26
|
+
* @returns all addresses
|
|
27
|
+
*/
|
|
28
|
+
getAddresses(): EthAddress[];
|
|
29
|
+
/**
|
|
30
|
+
* Sign EIP-712 typed data with all keystore addresses
|
|
31
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
32
|
+
* @return signatures
|
|
33
|
+
*/
|
|
34
|
+
signTypedData(typedData: TypedDataDefinition): Promise<Signature[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Sign EIP-712 typed data with a specific address
|
|
37
|
+
* @param address - The address of the signer to use
|
|
38
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
39
|
+
* @returns signature for the specified address
|
|
40
|
+
* @throws Error if the address is not found in the keystore or signing fails
|
|
41
|
+
*/
|
|
42
|
+
signTypedDataWithAddress(address: EthAddress, typedData: TypedDataDefinition): Promise<Signature>;
|
|
43
|
+
/**
|
|
44
|
+
* Sign a message with all keystore addresses using EIP-191 prefix
|
|
45
|
+
*
|
|
46
|
+
* @param message - The message to sign
|
|
47
|
+
* @return signatures
|
|
48
|
+
*/
|
|
49
|
+
signMessage(message: Buffer32): Promise<Signature[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Sign a message with a specific address using EIP-191 prefix
|
|
52
|
+
* @param address - The address of the signer to use
|
|
53
|
+
* @param message - The message to sign
|
|
54
|
+
* @returns signature for the specified address
|
|
55
|
+
* @throws Error if the address is not found in the keystore or signing fails
|
|
56
|
+
*/
|
|
57
|
+
signMessageWithAddress(address: EthAddress, message: Buffer32): Promise<Signature>;
|
|
58
|
+
/**
|
|
59
|
+
* Make a JSON-RPC sign request to Web3Signer using eth_sign
|
|
60
|
+
* @param address - The Ethereum address to sign with
|
|
61
|
+
* @param data - The data to sign
|
|
62
|
+
* @returns The signature
|
|
63
|
+
*/
|
|
64
|
+
private makeJsonRpcSignRequest;
|
|
65
|
+
private makeJsonRpcSignTypedDataRequest;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=web3signer_key_store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3signer_key_store.d.ts","sourceRoot":"","sources":["../../src/key_store/web3signer_key_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,iBAAiB;IAExD,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;gBADP,SAAS,EAAE,UAAU,EAAE,EACvB,OAAO,EAAE,MAAM;IAGzB;;;;;OAKG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAO5C;;;;OAIG;IACI,YAAY,IAAI,UAAU,EAAE;IAInC;;;;OAIG;IACU,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAOhF;;;;;;OAMG;IACU,wBAAwB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;IAQ9G;;;;;OAKG;IACU,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAKjE;;;;;;OAMG;IACU,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAO/F;;;;;OAKG;YACW,sBAAsB;YAiDtB,+BAA+B;CA6C9C"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
2
|
+
/**
|
|
3
|
+
* Web3Signer Key Store
|
|
4
|
+
*
|
|
5
|
+
* An implementation of the Key store using Web3Signer remote signing service.
|
|
6
|
+
* This implementation uses the Web3Signer JSON-RPC API for secp256k1 signatures.
|
|
7
|
+
*/ export class Web3SignerKeyStore {
|
|
8
|
+
addresses;
|
|
9
|
+
baseUrl;
|
|
10
|
+
constructor(addresses, baseUrl){
|
|
11
|
+
this.addresses = addresses;
|
|
12
|
+
this.baseUrl = baseUrl;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the address of a signer by index
|
|
16
|
+
*
|
|
17
|
+
* @param index - The index of the signer
|
|
18
|
+
* @returns the address
|
|
19
|
+
*/ getAddress(index) {
|
|
20
|
+
if (index >= this.addresses.length) {
|
|
21
|
+
throw new Error(`Index ${index} is out of bounds.`);
|
|
22
|
+
}
|
|
23
|
+
return this.addresses[index];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get all addresses
|
|
27
|
+
*
|
|
28
|
+
* @returns all addresses
|
|
29
|
+
*/ getAddresses() {
|
|
30
|
+
return this.addresses;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Sign EIP-712 typed data with all keystore addresses
|
|
34
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
35
|
+
* @return signatures
|
|
36
|
+
*/ async signTypedData(typedData) {
|
|
37
|
+
const signatures = await Promise.all(this.addresses.map((address)=>this.makeJsonRpcSignTypedDataRequest(address, typedData)));
|
|
38
|
+
return signatures;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Sign EIP-712 typed data with a specific address
|
|
42
|
+
* @param address - The address of the signer to use
|
|
43
|
+
* @param typedData - The complete EIP-712 typed data structure (domain, types, primaryType, message)
|
|
44
|
+
* @returns signature for the specified address
|
|
45
|
+
* @throws Error if the address is not found in the keystore or signing fails
|
|
46
|
+
*/ async signTypedDataWithAddress(address, typedData) {
|
|
47
|
+
if (!this.addresses.some((addr)=>addr.equals(address))) {
|
|
48
|
+
throw new Error(`Address ${address.toString()} not found in keystore`);
|
|
49
|
+
}
|
|
50
|
+
return await this.makeJsonRpcSignTypedDataRequest(address, typedData);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sign a message with all keystore addresses using EIP-191 prefix
|
|
54
|
+
*
|
|
55
|
+
* @param message - The message to sign
|
|
56
|
+
* @return signatures
|
|
57
|
+
*/ async signMessage(message) {
|
|
58
|
+
const signatures = await Promise.all(this.addresses.map((address)=>this.makeJsonRpcSignRequest(address, message)));
|
|
59
|
+
return signatures;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Sign a message with a specific address using EIP-191 prefix
|
|
63
|
+
* @param address - The address of the signer to use
|
|
64
|
+
* @param message - The message to sign
|
|
65
|
+
* @returns signature for the specified address
|
|
66
|
+
* @throws Error if the address is not found in the keystore or signing fails
|
|
67
|
+
*/ async signMessageWithAddress(address, message) {
|
|
68
|
+
if (!this.addresses.some((addr)=>addr.equals(address))) {
|
|
69
|
+
throw new Error(`Address ${address.toString()} not found in keystore`);
|
|
70
|
+
}
|
|
71
|
+
return await this.makeJsonRpcSignRequest(address, message);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Make a JSON-RPC sign request to Web3Signer using eth_sign
|
|
75
|
+
* @param address - The Ethereum address to sign with
|
|
76
|
+
* @param data - The data to sign
|
|
77
|
+
* @returns The signature
|
|
78
|
+
*/ async makeJsonRpcSignRequest(address, data) {
|
|
79
|
+
const url = this.baseUrl;
|
|
80
|
+
// Use JSON-RPC eth_sign method which automatically applies Ethereum message prefixing
|
|
81
|
+
const body = {
|
|
82
|
+
jsonrpc: '2.0',
|
|
83
|
+
method: 'eth_sign',
|
|
84
|
+
params: [
|
|
85
|
+
address.toString(),
|
|
86
|
+
data.toString()
|
|
87
|
+
],
|
|
88
|
+
id: 1
|
|
89
|
+
};
|
|
90
|
+
const response = await fetch(url, {
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: {
|
|
93
|
+
'Content-Type': 'application/json'
|
|
94
|
+
},
|
|
95
|
+
body: JSON.stringify(body)
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
const errorText = await response.text();
|
|
99
|
+
throw new Error(`Web3Signer request failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
100
|
+
}
|
|
101
|
+
const result = await response.json();
|
|
102
|
+
// Handle JSON-RPC response format
|
|
103
|
+
if (result.error) {
|
|
104
|
+
throw new Error(`Web3Signer JSON-RPC error: ${result.error.code} - ${result.error.message}`);
|
|
105
|
+
}
|
|
106
|
+
if (!result.result) {
|
|
107
|
+
throw new Error('Invalid response from Web3Signer: no result found');
|
|
108
|
+
}
|
|
109
|
+
let signatureHex = result.result;
|
|
110
|
+
// Ensure the signature has the 0x prefix
|
|
111
|
+
if (!signatureHex.startsWith('0x')) {
|
|
112
|
+
signatureHex = '0x' + signatureHex;
|
|
113
|
+
}
|
|
114
|
+
// Parse the signature from the hex string
|
|
115
|
+
return Signature.fromString(signatureHex);
|
|
116
|
+
}
|
|
117
|
+
async makeJsonRpcSignTypedDataRequest(address, typedData) {
|
|
118
|
+
const url = this.baseUrl;
|
|
119
|
+
const body = {
|
|
120
|
+
jsonrpc: '2.0',
|
|
121
|
+
method: 'eth_signTypedData',
|
|
122
|
+
params: [
|
|
123
|
+
address.toString(),
|
|
124
|
+
JSON.stringify(typedData)
|
|
125
|
+
],
|
|
126
|
+
id: 1
|
|
127
|
+
};
|
|
128
|
+
const response = await fetch(url, {
|
|
129
|
+
method: 'POST',
|
|
130
|
+
headers: {
|
|
131
|
+
'Content-Type': 'application/json'
|
|
132
|
+
},
|
|
133
|
+
body: JSON.stringify(body)
|
|
134
|
+
});
|
|
135
|
+
if (!response.ok) {
|
|
136
|
+
const errorText = await response.text();
|
|
137
|
+
throw new Error(`Web3Signer request failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
138
|
+
}
|
|
139
|
+
const result = await response.json();
|
|
140
|
+
if (result.error) {
|
|
141
|
+
throw new Error(`Web3Signer JSON-RPC error: ${result.error.code} - ${result.error.message}`);
|
|
142
|
+
}
|
|
143
|
+
if (!result.result) {
|
|
144
|
+
throw new Error('Invalid response from Web3Signer: no result found');
|
|
145
|
+
}
|
|
146
|
+
let signatureHex = result.result;
|
|
147
|
+
// Ensure the signature has the 0x prefix
|
|
148
|
+
if (!signatureHex.startsWith('0x')) {
|
|
149
|
+
signatureHex = '0x' + signatureHex;
|
|
150
|
+
}
|
|
151
|
+
return Signature.fromString(signatureHex);
|
|
152
|
+
}
|
|
153
|
+
}
|
package/dest/validator.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
3
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
4
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
6
5
|
import type { P2P, PeerId } from '@aztec/p2p';
|
|
7
|
-
import {
|
|
6
|
+
import { TxProvider } from '@aztec/p2p';
|
|
7
|
+
import { type SlasherConfig, type WantToSlashArgs, type Watcher, type WatcherEmitter } from '@aztec/slasher/config';
|
|
8
8
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
9
|
-
import type { IFullNodeBlockBuilder, SequencerConfig
|
|
9
|
+
import type { IFullNodeBlockBuilder, SequencerConfig } from '@aztec/stdlib/interfaces/server';
|
|
10
10
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
11
11
|
import type { BlockAttestation, BlockProposal, BlockProposalOptions } from '@aztec/stdlib/p2p';
|
|
12
12
|
import { type ProposedBlockHeader, type StateReference, type Tx } from '@aztec/stdlib/tx';
|
|
13
13
|
import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
14
|
+
import type { TypedDataDefinition } from 'viem';
|
|
14
15
|
import type { ValidatorClientConfig } from './config.js';
|
|
15
16
|
import type { ValidatorKeyStore } from './key_store/interface.js';
|
|
16
17
|
export interface Validator {
|
|
@@ -32,6 +33,7 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
32
33
|
private p2pClient;
|
|
33
34
|
private blockSource;
|
|
34
35
|
private l1ToL2MessageSource;
|
|
36
|
+
private txProvider;
|
|
35
37
|
private config;
|
|
36
38
|
private dateProvider;
|
|
37
39
|
private log;
|
|
@@ -40,16 +42,15 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
40
42
|
private metrics;
|
|
41
43
|
private previousProposal?;
|
|
42
44
|
private myAddresses;
|
|
43
|
-
private
|
|
45
|
+
private lastEpochForCommitteeUpdateLoop;
|
|
44
46
|
private epochCacheUpdateLoop;
|
|
45
47
|
private blockProposalValidator;
|
|
46
|
-
private txCollector;
|
|
47
48
|
private proposersOfInvalidBlocks;
|
|
48
|
-
constructor(blockBuilder: IFullNodeBlockBuilder, keyStore: ValidatorKeyStore, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, config: ValidatorClientConfig & Pick<SequencerConfig, 'txPublicSetupAllowList'> & Pick<SlasherConfig, 'slashInvalidBlockEnabled' | 'slashInvalidBlockPenalty' | 'slashInvalidBlockMaxPenalty'>, dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
|
|
49
|
+
protected constructor(blockBuilder: IFullNodeBlockBuilder, keyStore: ValidatorKeyStore, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: TxProvider, config: ValidatorClientConfig & Pick<SequencerConfig, 'txPublicSetupAllowList'> & Pick<SlasherConfig, 'slashInvalidBlockEnabled' | 'slashInvalidBlockPenalty' | 'slashInvalidBlockMaxPenalty'>, dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
|
|
49
50
|
private handleEpochCommitteeUpdate;
|
|
50
|
-
static new(config: ValidatorClientConfig & Pick<SlasherConfig, 'slashInvalidBlockEnabled' | 'slashInvalidBlockPenalty' | 'slashInvalidBlockMaxPenalty'>, blockBuilder: IFullNodeBlockBuilder, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, dateProvider?: DateProvider, telemetry?: TelemetryClient): ValidatorClient;
|
|
51
|
+
static new(config: ValidatorClientConfig & Pick<SlasherConfig, 'slashInvalidBlockEnabled' | 'slashInvalidBlockPenalty' | 'slashInvalidBlockMaxPenalty'>, blockBuilder: IFullNodeBlockBuilder, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: TxProvider, dateProvider?: DateProvider, telemetry?: TelemetryClient): ValidatorClient;
|
|
51
52
|
getValidatorAddresses(): EthAddress[];
|
|
52
|
-
signWithAddress(addr: EthAddress, msg:
|
|
53
|
+
signWithAddress(addr: EthAddress, msg: TypedDataDefinition): Promise<import("@aztec/stdlib/block").Signature>;
|
|
53
54
|
configureSlashing(config: Partial<Pick<SlasherConfig, 'slashInvalidBlockEnabled' | 'slashInvalidBlockPenalty' | 'slashInvalidBlockMaxPenalty'>>): void;
|
|
54
55
|
start(): Promise<void>;
|
|
55
56
|
stop(): Promise<void>;
|
|
@@ -77,8 +78,10 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
77
78
|
shouldSlash(args: WantToSlashArgs): Promise<boolean>;
|
|
78
79
|
createBlockProposal(blockNumber: number, header: ProposedBlockHeader, archive: Fr, stateReference: StateReference, txs: Tx[], proposerAddress: EthAddress | undefined, options: BlockProposalOptions): Promise<BlockProposal | undefined>;
|
|
79
80
|
broadcastBlockProposal(proposal: BlockProposal): Promise<void>;
|
|
81
|
+
collectOwnAttestations(proposal: BlockProposal): Promise<BlockAttestation[]>;
|
|
80
82
|
collectAttestations(proposal: BlockProposal, required: number, deadline: Date): Promise<BlockAttestation[]>;
|
|
81
83
|
private doAttestToProposal;
|
|
84
|
+
private handleAuthRequest;
|
|
82
85
|
}
|
|
83
86
|
export {};
|
|
84
87
|
//# sourceMappingURL=validator.d.ts.map
|
package/dest/validator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C,OAAO,EAAE,YAAY,EAAS,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAiD,UAAU,EAAE,MAAM,YAAY,CAAC;AAIvF,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE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