@aztec/validator-client 2.1.0-rc.1 → 2.1.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/block_proposal_handler.js +1 -1
- package/dest/duties/validation_service.d.ts.map +1 -1
- package/dest/duties/validation_service.js +1 -2
- package/dest/key_store/interface.d.ts +1 -1
- package/dest/key_store/interface.d.ts.map +1 -1
- package/dest/key_store/local_key_store.d.ts +1 -1
- package/dest/key_store/local_key_store.d.ts.map +1 -1
- package/dest/key_store/local_key_store.js +1 -1
- package/dest/key_store/node_keystore_adapter.d.ts +1 -1
- package/dest/key_store/node_keystore_adapter.d.ts.map +1 -1
- package/dest/key_store/node_keystore_adapter.js +2 -2
- package/dest/key_store/web3signer_key_store.d.ts +1 -1
- package/dest/key_store/web3signer_key_store.d.ts.map +1 -1
- package/dest/validator.d.ts +1 -1
- package/dest/validator.d.ts.map +1 -1
- package/dest/validator.js +15 -3
- package/package.json +13 -13
- package/src/block_proposal_handler.ts +1 -1
- package/src/duties/validation_service.ts +1 -2
- package/src/key_store/interface.ts +1 -1
- package/src/key_store/local_key_store.ts +1 -1
- package/src/key_store/node_keystore_adapter.ts +3 -3
- package/src/key_store/web3signer_key_store.ts +1 -1
- package/src/validator.ts +19 -4
|
@@ -219,7 +219,7 @@ export class BlockProposalHandler {
|
|
|
219
219
|
deadline: this.getReexecutionDeadline(proposal, config)
|
|
220
220
|
});
|
|
221
221
|
const numFailedTxs = failedTxs.length;
|
|
222
|
-
const slot = proposal.slotNumber;
|
|
222
|
+
const slot = proposal.slotNumber.toBigInt();
|
|
223
223
|
this.log.verbose(`Transaction re-execution complete for slot ${slot}`, {
|
|
224
224
|
numFailedTxs,
|
|
225
225
|
numProposalTxs: txHashes.length,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation_service.d.ts","sourceRoot":"","sources":["../../src/duties/validation_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA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gB,EAChB,aAAa,EACb,KAAK,oBAAoB,EAG1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,iBAAiB;IAE/C;;;;;;;;;OASG;IACG,mBAAmB,CACvB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,EAAE,EACX,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,EAAE,EAAE,EACT,uBAAuB,EAAE,UAAU,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;IAU/F,0BAA0B,CAC9B,sBAAsB,EAAE,+BAA+B,EACvD,QAAQ,EAAE,UAAU,GAAG,SAAS,GAC/B,OAAO,CAAC,SAAS,CAAC;CAUtB"}
|
|
@@ -41,8 +41,7 @@ export class ValidationService {
|
|
|
41
41
|
*/ async attestToProposal(proposal, attestors) {
|
|
42
42
|
const buf = Buffer32.fromBuffer(keccak256(proposal.payload.getPayloadToSign(SignatureDomainSeparator.blockAttestation)));
|
|
43
43
|
const signatures = await Promise.all(attestors.map((attestor)=>this.keyStore.signMessageWithAddress(attestor, buf)));
|
|
44
|
-
|
|
45
|
-
return signatures.map((sig)=>new BlockAttestation(proposal.blockNumber, proposal.payload, sig));
|
|
44
|
+
return signatures.map((sig)=>new BlockAttestation(proposal.blockNumber, proposal.payload, sig, proposal.signature));
|
|
46
45
|
}
|
|
47
46
|
async signAttestationsAndSigners(attestationsAndSigners, proposer) {
|
|
48
47
|
if (proposer === undefined) {
|
|
@@ -3,7 +3,7 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
3
3
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
4
4
|
import type { EthRemoteSignerConfig } from '@aztec/node-keystore';
|
|
5
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import type { TypedDataDefinition } from 'viem';
|
|
6
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
7
7
|
/** Key Store
|
|
8
8
|
*
|
|
9
9
|
* A keystore interface that can be replaced with a local keystore / remote signer service
|
|
@@ -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;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
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;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;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;AAED;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE;;;OAGG;IACH,oBAAoB,IAAI,UAAU,EAAE,CAAC;IAErC;;;;;OAKG;IACH,kBAAkB,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,CAAC;IAE5D;;;;;OAKG;IACH,qBAAqB,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;IAEjE;;;;OAIG;IACH,eAAe,CAAC,eAAe,EAAE,UAAU,GAAG,YAAY,CAAC;IAE3D;;;;OAIG;IACH,qBAAqB,CAAC,eAAe,EAAE,UAAU,GAAG,qBAAqB,GAAG,SAAS,CAAC;CACvF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
+
import { type TypedDataDefinition } from '@spalladino/viem';
|
|
5
5
|
import type { ValidatorKeyStore } from './interface.js';
|
|
6
6
|
/**
|
|
7
7
|
* Local Key Store
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,kBAAkB,CAAC;AAE3E,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"}
|
|
@@ -4,7 +4,7 @@ import type { Signature } from '@aztec/foundation/eth-signature';
|
|
|
4
4
|
import { KeystoreManager } from '@aztec/node-keystore';
|
|
5
5
|
import type { EthRemoteSignerConfig } from '@aztec/node-keystore';
|
|
6
6
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import type { TypedDataDefinition } from 'viem';
|
|
7
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
8
8
|
import type { ExtendedValidatorKeyStore } from './interface.js';
|
|
9
9
|
export declare class NodeKeystoreAdapter implements ExtendedValidatorKeyStore {
|
|
10
10
|
private readonly keystoreManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node_keystore_adapter.d.ts","sourceRoot":"","sources":["../../src/key_store/node_keystore_adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"node_keystore_adapter.d.ts","sourceRoot":"","sources":["../../src/key_store/node_keystore_adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;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AG,UAAU;IAQrC;;OAEG;IACH,YAAY,IAAI,UAAU,EAAE;IAY5B;;;;OAIG;IACG,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAWzE;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAW1D;;;;;;;OAOG;IACG,wBAAwB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;IAkBvG;;;;;;;OAOG;IACG,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAiBxF;;OAEG;IACH,oBAAoB,IAAI,UAAU,EAAE;IAIpC;;;;OAIG;IACH,kBAAkB,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU;IAK3D;;;;OAIG;IACH,qBAAqB,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,EAAE;IAMhE,uBAAuB,CAAC,gBAAgB,EAAE,UAAU,GAAG,UAAU;IAajE;;;;OAIG;IACH,eAAe,CAAC,eAAe,EAAE,UAAU,GAAG,YAAY;IAK1D;;;;;;OAMG;IACH,qBAAqB,CAAC,eAAe,EAAE,UAAU,GAAG,qBAAqB,GAAG,SAAS;CAItF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeystoreManager, loadKeystoreFile } from '@aztec/node-keystore';
|
|
2
2
|
import { InvalidValidatorPrivateKeyError } from '@aztec/stdlib/validators';
|
|
3
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
import { privateKeyToAccount } from '@spalladino/viem/accounts';
|
|
4
4
|
export class NodeKeystoreAdapter {
|
|
5
5
|
keystoreManager;
|
|
6
6
|
// Per-validator cache (lazy)
|
|
@@ -272,7 +272,7 @@ export class NodeKeystoreAdapter {
|
|
|
272
272
|
* @returns Coinbase EthAddress
|
|
273
273
|
*/ getCoinbaseAddress(attesterAddress) {
|
|
274
274
|
const validatorIndex = this.findValidatorIndexForAttester(attesterAddress);
|
|
275
|
-
return this.keystoreManager.getCoinbaseAddress(validatorIndex);
|
|
275
|
+
return this.keystoreManager.getCoinbaseAddress(validatorIndex, attesterAddress);
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
278
|
* Get the publisher addresses for the validator that contains the given attester.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
-
import type { TypedDataDefinition } from 'viem';
|
|
4
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
5
5
|
import type { ValidatorKeyStore } from './interface.js';
|
|
6
6
|
/**
|
|
7
7
|
* Web3Signer Key Store
|
|
@@ -1 +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,
|
|
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,kBAAkB,CAAC;AAE5D,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"}
|
package/dest/validator.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
|
13
13
|
import type { BlockAttestation, BlockProposal, BlockProposalOptions } from '@aztec/stdlib/p2p';
|
|
14
14
|
import type { ProposedBlockHeader, StateReference, Tx } from '@aztec/stdlib/tx';
|
|
15
15
|
import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
16
|
-
import type { TypedDataDefinition } from 'viem';
|
|
16
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
17
17
|
import { BlockProposalHandler } from './block_proposal_handler.js';
|
|
18
18
|
import type { ValidatorClientConfig } from './config.js';
|
|
19
19
|
import { NodeKeystoreAdapter } from './key_store/node_keystore_adapter.js';
|
package/dest/validator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,+BAA+B,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAsB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AA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;CAsBhC"}
|
package/dest/validator.js
CHANGED
|
@@ -165,7 +165,7 @@ const SLASHABLE_BLOCK_PROPOSAL_VALIDATION_RESULT = [
|
|
|
165
165
|
...proposal.toBlockInfo(),
|
|
166
166
|
proposer: proposer.toString()
|
|
167
167
|
};
|
|
168
|
-
this.log.info(`Received proposal for slot ${slotNumber}`, {
|
|
168
|
+
this.log.info(`Received proposal for block ${proposal.blockNumber} at slot ${slotNumber}`, {
|
|
169
169
|
...proposalInfo,
|
|
170
170
|
txHashes: proposal.txHashes.map((t)=>t.toString())
|
|
171
171
|
});
|
|
@@ -190,7 +190,7 @@ const SLASHABLE_BLOCK_PROPOSAL_VALIDATION_RESULT = [
|
|
|
190
190
|
return undefined;
|
|
191
191
|
}
|
|
192
192
|
// Provided all of the above checks pass, we can attest to the proposal
|
|
193
|
-
this.log.info(`Attesting to proposal for slot ${slotNumber}`, proposalInfo);
|
|
193
|
+
this.log.info(`Attesting to proposal for block ${proposal.blockNumber} at slot ${slotNumber}`, proposalInfo);
|
|
194
194
|
this.metrics.incAttestations(inCommittee.length);
|
|
195
195
|
// If the above function does not throw an error, then we can attest to the proposal
|
|
196
196
|
return this.createBlockAttestationsFromProposal(proposal, inCommittee);
|
|
@@ -248,7 +248,19 @@ const SLASHABLE_BLOCK_PROPOSAL_VALIDATION_RESULT = [
|
|
|
248
248
|
const myAddresses = this.getValidatorAddresses();
|
|
249
249
|
let attestations = [];
|
|
250
250
|
while(true){
|
|
251
|
-
|
|
251
|
+
// Filter out attestations with a mismatching payload. This should NOT happen since we have verified
|
|
252
|
+
// the proposer signature (ie our own) before accepting the attestation into the pool via the p2p client.
|
|
253
|
+
const collectedAttestations = (await this.p2pClient.getAttestationsForSlot(slot, proposalId)).filter((attestation)=>{
|
|
254
|
+
if (!attestation.payload.equals(proposal.payload)) {
|
|
255
|
+
this.log.warn(`Received attestation for slot ${slot} with mismatched payload from ${attestation.getSender().toString()}`, {
|
|
256
|
+
attestationPayload: attestation.payload,
|
|
257
|
+
proposalPayload: proposal.payload
|
|
258
|
+
});
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
return true;
|
|
262
|
+
});
|
|
263
|
+
// Log new attestations we collected
|
|
252
264
|
const oldSenders = attestations.map((attestation)=>attestation.getSender());
|
|
253
265
|
for (const collected of collectedAttestations){
|
|
254
266
|
const collectedSender = collected.getSender();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/validator-client",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.11",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -64,20 +64,20 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@aztec/constants": "2.1.0-rc.
|
|
68
|
-
"@aztec/epoch-cache": "2.1.0-rc.
|
|
69
|
-
"@aztec/ethereum": "2.1.0-rc.
|
|
70
|
-
"@aztec/foundation": "2.1.0-rc.
|
|
71
|
-
"@aztec/node-keystore": "2.1.0-rc.
|
|
72
|
-
"@aztec/p2p": "2.1.0-rc.
|
|
73
|
-
"@aztec/prover-client": "2.1.0-rc.
|
|
74
|
-
"@aztec/slasher": "2.1.0-rc.
|
|
75
|
-
"@aztec/stdlib": "2.1.0-rc.
|
|
76
|
-
"@aztec/telemetry-client": "2.1.0-rc.
|
|
67
|
+
"@aztec/constants": "2.1.0-rc.11",
|
|
68
|
+
"@aztec/epoch-cache": "2.1.0-rc.11",
|
|
69
|
+
"@aztec/ethereum": "2.1.0-rc.11",
|
|
70
|
+
"@aztec/foundation": "2.1.0-rc.11",
|
|
71
|
+
"@aztec/node-keystore": "2.1.0-rc.11",
|
|
72
|
+
"@aztec/p2p": "2.1.0-rc.11",
|
|
73
|
+
"@aztec/prover-client": "2.1.0-rc.11",
|
|
74
|
+
"@aztec/slasher": "2.1.0-rc.11",
|
|
75
|
+
"@aztec/stdlib": "2.1.0-rc.11",
|
|
76
|
+
"@aztec/telemetry-client": "2.1.0-rc.11",
|
|
77
|
+
"@spalladino/viem": "2.38.2-eip7594.0",
|
|
77
78
|
"koa": "^2.16.1",
|
|
78
79
|
"koa-router": "^13.1.1",
|
|
79
|
-
"tslib": "^2.4.0"
|
|
80
|
-
"viem": "2.23.7"
|
|
80
|
+
"tslib": "^2.4.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@jest/globals": "^30.0.0",
|
|
@@ -265,7 +265,7 @@ export class BlockProposalHandler {
|
|
|
265
265
|
});
|
|
266
266
|
|
|
267
267
|
const numFailedTxs = failedTxs.length;
|
|
268
|
-
const slot = proposal.slotNumber;
|
|
268
|
+
const slot = proposal.slotNumber.toBigInt();
|
|
269
269
|
this.log.verbose(`Transaction re-execution complete for slot ${slot}`, {
|
|
270
270
|
numFailedTxs,
|
|
271
271
|
numProposalTxs: txHashes.length,
|
|
@@ -74,8 +74,7 @@ export class ValidationService {
|
|
|
74
74
|
const signatures = await Promise.all(
|
|
75
75
|
attestors.map(attestor => this.keyStore.signMessageWithAddress(attestor, buf)),
|
|
76
76
|
);
|
|
77
|
-
|
|
78
|
-
return signatures.map(sig => new BlockAttestation(proposal.blockNumber, proposal.payload, sig));
|
|
77
|
+
return signatures.map(sig => new BlockAttestation(proposal.blockNumber, proposal.payload, sig, proposal.signature));
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
async signAttestationsAndSigners(
|
|
@@ -4,7 +4,7 @@ import type { Signature } from '@aztec/foundation/eth-signature';
|
|
|
4
4
|
import type { EthRemoteSignerConfig } from '@aztec/node-keystore';
|
|
5
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
6
|
|
|
7
|
-
import type { TypedDataDefinition } from 'viem';
|
|
7
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
8
8
|
|
|
9
9
|
/** Key Store
|
|
10
10
|
*
|
|
@@ -3,7 +3,7 @@ import { Secp256k1Signer } from '@aztec/foundation/crypto';
|
|
|
3
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
5
5
|
|
|
6
|
-
import { type TypedDataDefinition, hashTypedData } from 'viem';
|
|
6
|
+
import { type TypedDataDefinition, hashTypedData } from '@spalladino/viem';
|
|
7
7
|
|
|
8
8
|
import type { ValidatorKeyStore } from './interface.js';
|
|
9
9
|
|
|
@@ -7,8 +7,8 @@ import type { EthRemoteSignerConfig } from '@aztec/node-keystore';
|
|
|
7
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
8
|
import { InvalidValidatorPrivateKeyError } from '@aztec/stdlib/validators';
|
|
9
9
|
|
|
10
|
-
import type { TypedDataDefinition } from 'viem';
|
|
11
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
10
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
11
|
+
import { privateKeyToAccount } from '@spalladino/viem/accounts';
|
|
12
12
|
|
|
13
13
|
import type { ExtendedValidatorKeyStore } from './interface.js';
|
|
14
14
|
|
|
@@ -324,7 +324,7 @@ export class NodeKeystoreAdapter implements ExtendedValidatorKeyStore {
|
|
|
324
324
|
*/
|
|
325
325
|
getCoinbaseAddress(attesterAddress: EthAddress): EthAddress {
|
|
326
326
|
const validatorIndex = this.findValidatorIndexForAttester(attesterAddress);
|
|
327
|
-
return this.keystoreManager.getCoinbaseAddress(validatorIndex);
|
|
327
|
+
return this.keystoreManager.getCoinbaseAddress(validatorIndex, attesterAddress);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/**
|
|
@@ -2,7 +2,7 @@ import type { Buffer32 } from '@aztec/foundation/buffer';
|
|
|
2
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
4
|
|
|
5
|
-
import type { TypedDataDefinition } from 'viem';
|
|
5
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
6
6
|
|
|
7
7
|
import type { ValidatorKeyStore } from './interface.js';
|
|
8
8
|
|
package/src/validator.ts
CHANGED
|
@@ -25,8 +25,8 @@ import type { ProposedBlockHeader, StateReference, Tx } from '@aztec/stdlib/tx';
|
|
|
25
25
|
import { AttestationTimeoutError } from '@aztec/stdlib/validators';
|
|
26
26
|
import { type TelemetryClient, type Tracer, getTelemetryClient } from '@aztec/telemetry-client';
|
|
27
27
|
|
|
28
|
+
import type { TypedDataDefinition } from '@spalladino/viem';
|
|
28
29
|
import { EventEmitter } from 'events';
|
|
29
|
-
import type { TypedDataDefinition } from 'viem';
|
|
30
30
|
|
|
31
31
|
import { BlockProposalHandler, type BlockProposalValidationFailureReason } from './block_proposal_handler.js';
|
|
32
32
|
import type { ValidatorClientConfig } from './config.js';
|
|
@@ -262,7 +262,7 @@ export class ValidatorClient extends (EventEmitter as new () => WatcherEmitter)
|
|
|
262
262
|
const incFailedAttestation = (reason: string) => this.metrics.incFailedAttestations(1, reason, partOfCommittee);
|
|
263
263
|
|
|
264
264
|
const proposalInfo = { ...proposal.toBlockInfo(), proposer: proposer.toString() };
|
|
265
|
-
this.log.info(`Received proposal for slot ${slotNumber}`, {
|
|
265
|
+
this.log.info(`Received proposal for block ${proposal.blockNumber} at slot ${slotNumber}`, {
|
|
266
266
|
...proposalInfo,
|
|
267
267
|
txHashes: proposal.txHashes.map(t => t.toString()),
|
|
268
268
|
});
|
|
@@ -304,7 +304,7 @@ export class ValidatorClient extends (EventEmitter as new () => WatcherEmitter)
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
// Provided all of the above checks pass, we can attest to the proposal
|
|
307
|
-
this.log.info(`Attesting to proposal for slot ${slotNumber}`, proposalInfo);
|
|
307
|
+
this.log.info(`Attesting to proposal for block ${proposal.blockNumber} at slot ${slotNumber}`, proposalInfo);
|
|
308
308
|
this.metrics.incAttestations(inCommittee.length);
|
|
309
309
|
|
|
310
310
|
// If the above function does not throw an error, then we can attest to the proposal
|
|
@@ -396,7 +396,22 @@ export class ValidatorClient extends (EventEmitter as new () => WatcherEmitter)
|
|
|
396
396
|
|
|
397
397
|
let attestations: BlockAttestation[] = [];
|
|
398
398
|
while (true) {
|
|
399
|
-
|
|
399
|
+
// Filter out attestations with a mismatching payload. This should NOT happen since we have verified
|
|
400
|
+
// the proposer signature (ie our own) before accepting the attestation into the pool via the p2p client.
|
|
401
|
+
const collectedAttestations = (await this.p2pClient.getAttestationsForSlot(slot, proposalId)).filter(
|
|
402
|
+
attestation => {
|
|
403
|
+
if (!attestation.payload.equals(proposal.payload)) {
|
|
404
|
+
this.log.warn(
|
|
405
|
+
`Received attestation for slot ${slot} with mismatched payload from ${attestation.getSender().toString()}`,
|
|
406
|
+
{ attestationPayload: attestation.payload, proposalPayload: proposal.payload },
|
|
407
|
+
);
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
return true;
|
|
411
|
+
},
|
|
412
|
+
);
|
|
413
|
+
|
|
414
|
+
// Log new attestations we collected
|
|
400
415
|
const oldSenders = attestations.map(attestation => attestation.getSender());
|
|
401
416
|
for (const collected of collectedAttestations) {
|
|
402
417
|
const collectedSender = collected.getSender();
|