@aztec/aztec-node 1.0.0-staging.2 → 1.0.0-staging.4
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/sentinel/store.d.ts.map +1 -1
- package/dest/sentinel/store.js +11 -9
- package/package.json +23 -23
- package/src/sentinel/store.ts +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/sentinel/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,qBAAa,aAAa;IAWtB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,MAAM;IAXhB,gBAAuB,cAAc,KAAK;IAG1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuC;IAIlE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuC;gBAGvD,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE;IAMpC,gBAAgB;IAIV,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B;IAQ9E,oBAAoB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;YAKjG,sCAAsC;IA6BvC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,qBAAqB,GAAG,SAAS,CAAC;YAUhG,0BAA0B;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","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export class SentinelStore {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
async pushValidatorStatusForSlot(who, slot, status) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
await this.store.transactionAsync(async ()=>{
|
|
71
|
+
const currentHistory = await this.getHistory(who) ?? [];
|
|
72
|
+
const newHistory = [
|
|
73
|
+
...currentHistory,
|
|
74
|
+
{
|
|
75
|
+
slot,
|
|
76
|
+
status
|
|
77
|
+
}
|
|
78
|
+
].slice(-this.config.historyLength);
|
|
79
|
+
await this.historyMap.set(who.toString(), this.serializeHistory(newHistory));
|
|
80
|
+
});
|
|
79
81
|
}
|
|
80
82
|
async getHistories() {
|
|
81
83
|
const histories = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "1.0.0-staging.
|
|
3
|
+
"version": "1.0.0-staging.4",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,28 +65,28 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/archiver": "1.0.0-staging.
|
|
69
|
-
"@aztec/bb-prover": "1.0.0-staging.
|
|
70
|
-
"@aztec/blob-sink": "1.0.0-staging.
|
|
71
|
-
"@aztec/constants": "1.0.0-staging.
|
|
72
|
-
"@aztec/epoch-cache": "1.0.0-staging.
|
|
73
|
-
"@aztec/ethereum": "1.0.0-staging.
|
|
74
|
-
"@aztec/foundation": "1.0.0-staging.
|
|
75
|
-
"@aztec/kv-store": "1.0.0-staging.
|
|
76
|
-
"@aztec/l1-artifacts": "1.0.0-staging.
|
|
77
|
-
"@aztec/merkle-tree": "1.0.0-staging.
|
|
78
|
-
"@aztec/node-lib": "1.0.0-staging.
|
|
79
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-staging.
|
|
80
|
-
"@aztec/p2p": "1.0.0-staging.
|
|
81
|
-
"@aztec/protocol-contracts": "1.0.0-staging.
|
|
82
|
-
"@aztec/prover-client": "1.0.0-staging.
|
|
83
|
-
"@aztec/sequencer-client": "1.0.0-staging.
|
|
84
|
-
"@aztec/simulator": "1.0.0-staging.
|
|
85
|
-
"@aztec/slasher": "1.0.0-staging.
|
|
86
|
-
"@aztec/stdlib": "1.0.0-staging.
|
|
87
|
-
"@aztec/telemetry-client": "1.0.0-staging.
|
|
88
|
-
"@aztec/validator-client": "1.0.0-staging.
|
|
89
|
-
"@aztec/world-state": "1.0.0-staging.
|
|
68
|
+
"@aztec/archiver": "1.0.0-staging.4",
|
|
69
|
+
"@aztec/bb-prover": "1.0.0-staging.4",
|
|
70
|
+
"@aztec/blob-sink": "1.0.0-staging.4",
|
|
71
|
+
"@aztec/constants": "1.0.0-staging.4",
|
|
72
|
+
"@aztec/epoch-cache": "1.0.0-staging.4",
|
|
73
|
+
"@aztec/ethereum": "1.0.0-staging.4",
|
|
74
|
+
"@aztec/foundation": "1.0.0-staging.4",
|
|
75
|
+
"@aztec/kv-store": "1.0.0-staging.4",
|
|
76
|
+
"@aztec/l1-artifacts": "1.0.0-staging.4",
|
|
77
|
+
"@aztec/merkle-tree": "1.0.0-staging.4",
|
|
78
|
+
"@aztec/node-lib": "1.0.0-staging.4",
|
|
79
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-staging.4",
|
|
80
|
+
"@aztec/p2p": "1.0.0-staging.4",
|
|
81
|
+
"@aztec/protocol-contracts": "1.0.0-staging.4",
|
|
82
|
+
"@aztec/prover-client": "1.0.0-staging.4",
|
|
83
|
+
"@aztec/sequencer-client": "1.0.0-staging.4",
|
|
84
|
+
"@aztec/simulator": "1.0.0-staging.4",
|
|
85
|
+
"@aztec/slasher": "1.0.0-staging.4",
|
|
86
|
+
"@aztec/stdlib": "1.0.0-staging.4",
|
|
87
|
+
"@aztec/telemetry-client": "1.0.0-staging.4",
|
|
88
|
+
"@aztec/validator-client": "1.0.0-staging.4",
|
|
89
|
+
"@aztec/world-state": "1.0.0-staging.4",
|
|
90
90
|
"koa": "^2.16.1",
|
|
91
91
|
"koa-router": "^12.0.0",
|
|
92
92
|
"tslib": "^2.4.0",
|
package/src/sentinel/store.ts
CHANGED
|
@@ -86,9 +86,11 @@ export class SentinelStore {
|
|
|
86
86
|
slot: bigint,
|
|
87
87
|
status: 'block-mined' | 'block-proposed' | 'block-missed' | 'attestation-sent' | 'attestation-missed',
|
|
88
88
|
) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
await this.store.transactionAsync(async () => {
|
|
90
|
+
const currentHistory = (await this.getHistory(who)) ?? [];
|
|
91
|
+
const newHistory = [...currentHistory, { slot, status }].slice(-this.config.historyLength);
|
|
92
|
+
await this.historyMap.set(who.toString(), this.serializeHistory(newHistory));
|
|
93
|
+
});
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
public async getHistories(): Promise<Record<`0x${string}`, ValidatorStatusHistory>> {
|