@aztec/aztec-node 1.0.0-staging.3 → 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.
@@ -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;IAU3B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAC;YAQrE,UAAU;IAKxB,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,sB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,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,gBAAgB;CAgBzB"}
@@ -67,15 +67,17 @@ export class SentinelStore {
67
67
  });
68
68
  }
69
69
  async pushValidatorStatusForSlot(who, slot, status) {
70
- const currentHistory = await this.getHistory(who) ?? [];
71
- const newHistory = [
72
- ...currentHistory,
73
- {
74
- slot,
75
- status
76
- }
77
- ].slice(-this.config.historyLength);
78
- await this.historyMap.set(who.toString(), this.serializeHistory(newHistory));
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",
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.3",
69
- "@aztec/bb-prover": "1.0.0-staging.3",
70
- "@aztec/blob-sink": "1.0.0-staging.3",
71
- "@aztec/constants": "1.0.0-staging.3",
72
- "@aztec/epoch-cache": "1.0.0-staging.3",
73
- "@aztec/ethereum": "1.0.0-staging.3",
74
- "@aztec/foundation": "1.0.0-staging.3",
75
- "@aztec/kv-store": "1.0.0-staging.3",
76
- "@aztec/l1-artifacts": "1.0.0-staging.3",
77
- "@aztec/merkle-tree": "1.0.0-staging.3",
78
- "@aztec/node-lib": "1.0.0-staging.3",
79
- "@aztec/noir-protocol-circuits-types": "1.0.0-staging.3",
80
- "@aztec/p2p": "1.0.0-staging.3",
81
- "@aztec/protocol-contracts": "1.0.0-staging.3",
82
- "@aztec/prover-client": "1.0.0-staging.3",
83
- "@aztec/sequencer-client": "1.0.0-staging.3",
84
- "@aztec/simulator": "1.0.0-staging.3",
85
- "@aztec/slasher": "1.0.0-staging.3",
86
- "@aztec/stdlib": "1.0.0-staging.3",
87
- "@aztec/telemetry-client": "1.0.0-staging.3",
88
- "@aztec/validator-client": "1.0.0-staging.3",
89
- "@aztec/world-state": "1.0.0-staging.3",
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",
@@ -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
- const currentHistory = (await this.getHistory(who)) ?? [];
90
- const newHistory = [...currentHistory, { slot, status }].slice(-this.config.historyLength);
91
- await this.historyMap.set(who.toString(), this.serializeHistory(newHistory));
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>> {