@aztec/aztec-node 2.0.0-rc.23 → 2.0.0-rc.25
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/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +10 -19
- package/package.json +24 -24
- package/src/aztec-node/config.ts +14 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/aztec-node/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAGzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,kBAAkB,EAA8C,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/aztec-node/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAGzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,kBAAkB,EAA8C,MAAM,0BAA0B,CAAC;AAE/G,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,EAIpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,KAAK,sBAAsB,EAA8B,MAAM,6BAA6B,CAAC;AACtG,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,qBAAqB,EAAiC,MAAM,gCAAgC,CAAC;AAC3G,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,2BAA2B,CAAC;AAI5F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,6BAA6B,EAAE,KAAK,qBAAqB,EAAE,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,GAC1C,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,gBAAgB,GAChB,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,oBAAoB,GAAG,YAAY,CAAC,GAClF,SAAS,GACT,eAAe,GACf,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,aAAa,GACb,aAAa,GAAG;IACd,6BAA6B;IAC7B,WAAW,EAAE,mBAAmB,CAAC;IACjC,sDAAsD;IACtD,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,CAuBvE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,eAAe,CAElD;AAoED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,cAAc,GAAG,qBAAqB,GAAG,gBAAgB,wBAM3G"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
2
|
import { genesisStateConfigMappings, l1ContractAddressesMapping } from '@aztec/ethereum';
|
|
3
3
|
import { booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
4
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
5
|
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
5
|
-
import { keyStoreConfigMappings } from '@aztec/node-keystore';
|
|
6
|
+
import { ethPrivateKeySchema, keyStoreConfigMappings } from '@aztec/node-keystore';
|
|
6
7
|
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
7
8
|
import { p2pConfigMappings } from '@aztec/p2p/config';
|
|
8
9
|
import { proverClientConfigMappings } from '@aztec/prover-client/config';
|
|
@@ -50,16 +51,12 @@ function createKeyStoreFromWeb3Signer(config) {
|
|
|
50
51
|
if (config.web3SignerUrl === undefined || config.web3SignerUrl.length === 0 || config.validatorAddresses === undefined || config.validatorAddresses.length === 0) {
|
|
51
52
|
return undefined;
|
|
52
53
|
}
|
|
53
|
-
const coinbase = config.coinbase ? config.coinbase.toString() : config.validatorAddresses[0].toString();
|
|
54
|
-
const feeRecipient = config.feeRecipient ? config.feeRecipient.toString() : AztecAddress.ZERO.toString();
|
|
55
|
-
const publisherAddresses = config.publisherAddresses && config.publisherAddresses.length > 0 ? config.publisherAddresses.map((k)=>k.toChecksumString()) : [];
|
|
56
|
-
const attestors = config.validatorAddresses.map((k)=>k.toChecksumString());
|
|
57
54
|
validatorKeyStores.push({
|
|
58
|
-
attester:
|
|
59
|
-
feeRecipient: feeRecipient,
|
|
60
|
-
coinbase: coinbase,
|
|
55
|
+
attester: config.validatorAddresses,
|
|
56
|
+
feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
|
|
57
|
+
coinbase: config.coinbase ?? config.validatorAddresses[0],
|
|
61
58
|
remoteSigner: config.web3SignerUrl,
|
|
62
|
-
publisher: publisherAddresses
|
|
59
|
+
publisher: config.publisherAddresses ?? []
|
|
63
60
|
});
|
|
64
61
|
const keyStore = {
|
|
65
62
|
schemaVersion: 1,
|
|
@@ -72,19 +69,13 @@ function createKeyStoreFromWeb3Signer(config) {
|
|
|
72
69
|
}
|
|
73
70
|
function createKeyStoreFromPrivateKeys(config) {
|
|
74
71
|
const validatorKeyStores = [];
|
|
75
|
-
const ethPrivateKeys = [];
|
|
76
|
-
const validatorKeys = config.validatorPrivateKeys ? config.validatorPrivateKeys.getValue() : [];
|
|
77
|
-
for(let i = 0; i < validatorKeys.length; i++){
|
|
78
|
-
const key = validatorKeys[i];
|
|
79
|
-
const ethPrivateKey = key;
|
|
80
|
-
ethPrivateKeys.push(ethPrivateKey);
|
|
81
|
-
}
|
|
72
|
+
const ethPrivateKeys = config.validatorPrivateKeys ? config.validatorPrivateKeys.getValue().map((x)=>ethPrivateKeySchema.parse(x)) : [];
|
|
82
73
|
if (!ethPrivateKeys.length) {
|
|
83
74
|
return undefined;
|
|
84
75
|
}
|
|
85
|
-
const coinbase = config.coinbase
|
|
86
|
-
const feeRecipient = config.feeRecipient
|
|
87
|
-
const publisherKeys = config.publisherPrivateKeys ? config.publisherPrivateKeys.map((k)=>k.getValue()) : [];
|
|
76
|
+
const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
|
|
77
|
+
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
78
|
+
const publisherKeys = config.publisherPrivateKeys ? config.publisherPrivateKeys.map((k)=>ethPrivateKeySchema.parse(k.getValue())) : [];
|
|
88
79
|
validatorKeyStores.push({
|
|
89
80
|
attester: ethPrivateKeys,
|
|
90
81
|
feeRecipient: feeRecipient,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.25",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -66,29 +66,29 @@
|
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/archiver": "2.0.0-rc.
|
|
70
|
-
"@aztec/bb-prover": "2.0.0-rc.
|
|
71
|
-
"@aztec/blob-sink": "2.0.0-rc.
|
|
72
|
-
"@aztec/constants": "2.0.0-rc.
|
|
73
|
-
"@aztec/epoch-cache": "2.0.0-rc.
|
|
74
|
-
"@aztec/ethereum": "2.0.0-rc.
|
|
75
|
-
"@aztec/foundation": "2.0.0-rc.
|
|
76
|
-
"@aztec/kv-store": "2.0.0-rc.
|
|
77
|
-
"@aztec/l1-artifacts": "2.0.0-rc.
|
|
78
|
-
"@aztec/merkle-tree": "2.0.0-rc.
|
|
79
|
-
"@aztec/node-keystore": "2.0.0-rc.
|
|
80
|
-
"@aztec/node-lib": "2.0.0-rc.
|
|
81
|
-
"@aztec/noir-protocol-circuits-types": "2.0.0-rc.
|
|
82
|
-
"@aztec/p2p": "2.0.0-rc.
|
|
83
|
-
"@aztec/protocol-contracts": "2.0.0-rc.
|
|
84
|
-
"@aztec/prover-client": "2.0.0-rc.
|
|
85
|
-
"@aztec/sequencer-client": "2.0.0-rc.
|
|
86
|
-
"@aztec/simulator": "2.0.0-rc.
|
|
87
|
-
"@aztec/slasher": "2.0.0-rc.
|
|
88
|
-
"@aztec/stdlib": "2.0.0-rc.
|
|
89
|
-
"@aztec/telemetry-client": "2.0.0-rc.
|
|
90
|
-
"@aztec/validator-client": "2.0.0-rc.
|
|
91
|
-
"@aztec/world-state": "2.0.0-rc.
|
|
69
|
+
"@aztec/archiver": "2.0.0-rc.25",
|
|
70
|
+
"@aztec/bb-prover": "2.0.0-rc.25",
|
|
71
|
+
"@aztec/blob-sink": "2.0.0-rc.25",
|
|
72
|
+
"@aztec/constants": "2.0.0-rc.25",
|
|
73
|
+
"@aztec/epoch-cache": "2.0.0-rc.25",
|
|
74
|
+
"@aztec/ethereum": "2.0.0-rc.25",
|
|
75
|
+
"@aztec/foundation": "2.0.0-rc.25",
|
|
76
|
+
"@aztec/kv-store": "2.0.0-rc.25",
|
|
77
|
+
"@aztec/l1-artifacts": "2.0.0-rc.25",
|
|
78
|
+
"@aztec/merkle-tree": "2.0.0-rc.25",
|
|
79
|
+
"@aztec/node-keystore": "2.0.0-rc.25",
|
|
80
|
+
"@aztec/node-lib": "2.0.0-rc.25",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "2.0.0-rc.25",
|
|
82
|
+
"@aztec/p2p": "2.0.0-rc.25",
|
|
83
|
+
"@aztec/protocol-contracts": "2.0.0-rc.25",
|
|
84
|
+
"@aztec/prover-client": "2.0.0-rc.25",
|
|
85
|
+
"@aztec/sequencer-client": "2.0.0-rc.25",
|
|
86
|
+
"@aztec/simulator": "2.0.0-rc.25",
|
|
87
|
+
"@aztec/slasher": "2.0.0-rc.25",
|
|
88
|
+
"@aztec/stdlib": "2.0.0-rc.25",
|
|
89
|
+
"@aztec/telemetry-client": "2.0.0-rc.25",
|
|
90
|
+
"@aztec/validator-client": "2.0.0-rc.25",
|
|
91
|
+
"@aztec/world-state": "2.0.0-rc.25",
|
|
92
92
|
"koa": "^2.16.1",
|
|
93
93
|
"koa-router": "^12.0.0",
|
|
94
94
|
"tslib": "^2.4.0",
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -6,16 +6,13 @@ import {
|
|
|
6
6
|
l1ContractAddressesMapping,
|
|
7
7
|
} from '@aztec/ethereum';
|
|
8
8
|
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
9
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
10
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
10
11
|
import {
|
|
11
|
-
type AztecAddressHex,
|
|
12
|
-
type EthAddressHex,
|
|
13
|
-
type EthPrivateKey,
|
|
14
|
-
type EthRemoteSignerAccount,
|
|
15
|
-
type Hex,
|
|
16
12
|
type KeyStore,
|
|
17
13
|
type KeyStoreConfig,
|
|
18
14
|
type ValidatorKeyStore,
|
|
15
|
+
ethPrivateKeySchema,
|
|
19
16
|
keyStoreConfigMappings,
|
|
20
17
|
} from '@aztec/node-keystore';
|
|
21
18
|
import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
@@ -108,22 +105,13 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore) {
|
|
|
108
105
|
) {
|
|
109
106
|
return undefined;
|
|
110
107
|
}
|
|
111
|
-
const coinbase = config.coinbase ? config.coinbase.toString() : config.validatorAddresses[0].toString();
|
|
112
|
-
const feeRecipient = config.feeRecipient ? config.feeRecipient.toString() : AztecAddress.ZERO.toString();
|
|
113
|
-
|
|
114
|
-
const publisherAddresses =
|
|
115
|
-
config.publisherAddresses && config.publisherAddresses.length > 0
|
|
116
|
-
? config.publisherAddresses.map(k => k.toChecksumString() as EthRemoteSignerAccount)
|
|
117
|
-
: [];
|
|
118
|
-
|
|
119
|
-
const attestors = config.validatorAddresses.map(k => k.toChecksumString() as EthRemoteSignerAccount);
|
|
120
108
|
|
|
121
109
|
validatorKeyStores.push({
|
|
122
|
-
attester:
|
|
123
|
-
feeRecipient: feeRecipient
|
|
124
|
-
coinbase: coinbase
|
|
110
|
+
attester: config.validatorAddresses,
|
|
111
|
+
feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
|
|
112
|
+
coinbase: config.coinbase ?? config.validatorAddresses[0],
|
|
125
113
|
remoteSigner: config.web3SignerUrl,
|
|
126
|
-
publisher: publisherAddresses,
|
|
114
|
+
publisher: config.publisherAddresses ?? [],
|
|
127
115
|
});
|
|
128
116
|
|
|
129
117
|
const keyStore: KeyStore = {
|
|
@@ -138,28 +126,24 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore) {
|
|
|
138
126
|
|
|
139
127
|
function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore) {
|
|
140
128
|
const validatorKeyStores: ValidatorKeyStore[] = [];
|
|
141
|
-
const ethPrivateKeys
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const key = validatorKeys[i];
|
|
145
|
-
const ethPrivateKey: EthPrivateKey = key as Hex<32>;
|
|
146
|
-
ethPrivateKeys.push(ethPrivateKey);
|
|
147
|
-
}
|
|
129
|
+
const ethPrivateKeys = config.validatorPrivateKeys
|
|
130
|
+
? config.validatorPrivateKeys.getValue().map(x => ethPrivateKeySchema.parse(x))
|
|
131
|
+
: [];
|
|
148
132
|
|
|
149
133
|
if (!ethPrivateKeys.length) {
|
|
150
134
|
return undefined;
|
|
151
135
|
}
|
|
152
|
-
const coinbase = config.coinbase
|
|
153
|
-
const feeRecipient = config.feeRecipient
|
|
136
|
+
const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
|
|
137
|
+
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
154
138
|
|
|
155
139
|
const publisherKeys = config.publisherPrivateKeys
|
|
156
|
-
? config.publisherPrivateKeys.map(k => k.getValue()
|
|
140
|
+
? config.publisherPrivateKeys.map(k => ethPrivateKeySchema.parse(k.getValue()))
|
|
157
141
|
: [];
|
|
158
142
|
|
|
159
143
|
validatorKeyStores.push({
|
|
160
144
|
attester: ethPrivateKeys,
|
|
161
|
-
feeRecipient: feeRecipient
|
|
162
|
-
coinbase: coinbase
|
|
145
|
+
feeRecipient: feeRecipient,
|
|
146
|
+
coinbase: coinbase,
|
|
163
147
|
remoteSigner: undefined,
|
|
164
148
|
publisher: publisherKeys,
|
|
165
149
|
});
|